Finding the Motif libs

24 views
Skip to first unread message

Tony Mechelynck

unread,
Apr 9, 2023, 11:31:05 AM4/9/23
to Bram Moolenaar, vim_dev
Recently (but I'm not sure when) my supposedly Motif gvim started
getting compiled without GUI. Examination of the config log showed the
following lines:

checking --enable-gui argument... Motif GUI support
checking for pkg-config... /usr/bin/pkg-config
checking for location of Motif GUI includes... in default path
checking --with-motif-lib argument... no
checking for location of Motif GUI libs... <not found>

After some trial and error, I found out that by changing just one line
in my environment settings, as follows:

from: export CONF_OPT_GUI='--enable-gui=motif'
to: export CONF_OPT_GUI='--enable-gui=motif --with-motif-lib=-lXm'

(and doing no other changes), then sourcing the configure script again
in the same shell to overwrite the environment values set by the
previous version of the same script, and running "make reconfig", its
--version output told me this time "Tiny version with X11-Motif GUI".
The relevant lines in the config log are now

checking --enable-gui argument... Motif GUI support
checking for pkg-config... /usr/bin/pkg-config
checking for location of Motif GUI includes... in default path
checking --with-motif-lib argument... -lXm

Is this expected? If just specifying that the Motif lib is named libXm
(without mentioning a directory) makes configure find it, I would have
expected it to already know that. Or is that name nonstandard?

N.B. Here is the full (new) configuration script for that shell (I
compile each differently configured version in a separate shadowdir
and a separate konsole tab and shell, with a soft link, not a copy, to
the src/Makefile, and configure arguments set only via environment
variables):

# Vim without evaluation but with Motif
export CONF_OPT_GUI='--enable-gui=motif --with-motif-lib=-lXm'
export CONF_OPT_FEAT='--with-features=small'
export CONF_ARGS2='--with-vim-name=vim-small'
export CONF_OPT_COMPBY='"--with-compiledby=antoine.m...@gmail.com"'


Best regards,
Tony.

Bram Moolenaar

unread,
Apr 9, 2023, 5:02:48 PM4/9/23
to vim...@googlegroups.com, Tony Mechelynck
It's not about the lib name, it's about finding the library to link
with. A sequence of directories are checked for:
libXm.a
libXm.dll.a
libXm.so*
libXm.sl
libXm.dylib

Perhaps the name of the library changed? On my system I can find
/usr/lib/x86_64-linux-gnu/libXm.a

The check hasn't changed for a long time. It can be found in
src/configure.ac around line 2960.

--
There can't be a crisis today, my schedule is already full.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Tony Mechelynck

unread,
Apr 10, 2023, 3:30:06 AM4/10/23
to Bram Moolenaar, vim...@googlegroups.com
According to the YaST installer, openSUSE Tumbleweed package libXm4
titled "Motif runtime library" installs (only) files
/usr/lib64/libXm.so.4 and /usr/lib64/libXm.so.4.0.4

so I did

pushd /usr/lib64
ls -l libXm*

which answered

lrwxrwxrwx 1 root root 14 Mar 19 23:38 libXm.so -> libXm.so.4.0.4
lrwxrwxrwx 1 root root 14 Mar 19 23:38 libXm.so.4 -> libXm.so.4.0.4
-rwxr-xr-x 1 root root 3021784 Mar 19 23:38 libXm.so.4.0.4
lrwxrwxrwx 1 root root 15 Mar 19 23:28 libXmu.so -> libXmu.so.6.2.0
lrwxrwxrwx 1 root root 15 Mar 19 23:28 libXmu.so.6 -> libXmu.so.6.2.0
-rwxr-xr-x 1 root root 113936 Mar 19 23:28 libXmu.so.6.2.0
lrwxrwxrwx 1 root root 16 Mar 19 23:28 libXmuu.so -> libXmuu.so.1.0.0
lrwxrwxrwx 1 root root 16 Mar 19 23:28 libXmuu.so.1 -> libXmuu.so.1.0.0
-rwxr-xr-x 1 root root 22568 Mar 19 23:28 libXmuu.so.1.0.0

I think only the first three lines in this list are relevant. IOW on
my system there are three files answering to /usr/lib64/libXm.so* in
your list, two of which are soft links to the third one. IIUC by
giving configure the argument --with-motif-lib=-lXm it doesn't search
for the lib but just passes -lXm to the linker, which finds
/usr/lib64/libXm.so -> libXm.so.4.0.4 and happily uses that (as it
should) to find the Motif entry points.

Best regards,
Tony.

Bram Moolenaar

unread,
Apr 10, 2023, 3:07:32 PM4/10/23
to vim...@googlegroups.com, Tony Mechelynck
So perhaps it's because configure doesn't check /usr/lib64, and the
library was moved there recently? You can try by editing
src/auto/configure and around line 10221; add "/usr/lib64" before
"/usr/lib/i386-linux-gnu" in the assignment to "gui_libs".

--
Q: What do you call a fish without an eye?
A: fsh!
Q: What do you call a deer with no eyes?
A: no eye deer.
Q: What do you call a deer with no eyes and no legs?
A: still no eye deer.

James McCoy

unread,
Apr 10, 2023, 4:11:59 PM4/10/23
to vim...@googlegroups.com
Most shared library packages on Linux are split into the runtime package
(which contains only the SONAME-versioned library names) and the
development package (which includes the header files and the unversioned
library name -- libXm.so -- which is used when building). It sounds
like you only have the runtime package installed.

Cheers,
--
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB

Bram Moolenaar

unread,
Apr 10, 2023, 5:25:58 PM4/10/23
to vim...@googlegroups.com, James McCoy
However, that it works by adding "--with-motif-lib=-lXm" suggests that
the development packages can be found by the compiler. It's the
configure script that can't find them and assumes Motif wasn't
installed.

--
Q: What's orange and sounds like a parrot?
A: A carrot

Tony Mechelynck

unread,
Apr 10, 2023, 7:28:22 PM4/10/23
to vim...@googlegroups.com
When I search for "Motif" packages, YaST tells me (in alphabetical
order) that the following are installed:
• libGLwM1 : Motif OpenGL drawing area widget library
• libMrm4 : Motif Resource Manager library
• libUil4 : Motif User Interface Language library
• libXm4 : Motif runtime library
• motif : Motif Runtime Programs
• motif-devel : Motif Include Files and Libraries Mandatory for Development
Not installed are:
• motif-debuginfo : Debug information for package motif
• motif-debugsource : Debug sources for package motif
• motif-devel-debuginfo : Debug information for package motif-devel

If motif-devel were not installed, configure would not find, as it
does even without my help, the Motif include files; and the existence
of the unversioned /usr/lib64/libXm.so as a soft link pointing where
it should, is mentioned in one of my ealier messages.

Best regards,
Tony.

Tony Mechelynck

unread,
Apr 10, 2023, 8:03:10 PM4/10/23
to Bram Moolenaar, vim...@googlegroups.com
AFAIK on openSUSE /usr/lib has always been the 32-bit library (here
with interfaces for 32-bit executables running on this 64-bit system)
and /usr/lib64 the "purely" 64-bit library.

IIUC the relevant lines are the following (src/auto/configure lines
10220-10235):

$as_echo_n "checking for location of Motif GUI libs... " >&6; }
gui_libs="`echo $x_libraries|sed 's%/^/^/*$%%'` `echo "$gui_XXX" |
sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu
`echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC"
GUI_LIB_LOC=
for try in $gui_libs; do
for libtry in "$try"/libXm.a "$try"/libXm.dll.a "$try"/libXm.so*
"$try"/libXm.sl "$try"/libXm.dylib; do
if test -f "$libtry"; then
GUI_LIB_LOC=$try
fi
done
done
if test -n "$GUI_LIB_LOC"; then
if test "$GUI_LIB_LOC" = /usr/lib \
-o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \
-o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; then
GUI_LIB_LOC=
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: in default path" >&5

Indeed /usr/lib and a couple of others are looked for but /usr/lib64 isn't.

As I'm loath to meddle with distributed files unless it is absolutely
necessary, and I've found a temporary solution without altering them,
I'll leave it as-is for the time being so if and when you decide to
change the relevant line(s) in the master repository the change will
be taken up in my clone with no patching conflicts.

Best regards,
Tony.

Bram Moolenaar

unread,
Apr 12, 2023, 12:09:48 PM4/12/23
to vim...@googlegroups.com, Tony Mechelynck
Please try with patch 9.0.1445. Hopefully it works without any special
arguments now.


--
Save the plankton - eat a whale.

Tony Mechelynck

unread,
Apr 12, 2023, 5:35:27 PM4/12/23
to Bram Moolenaar, vim...@googlegroups.com
As I come back to the computer, the source is at patchlevel 9.0.1447
and the Motif libs are found even with no --with-motif-lib= argument
(and a "make reconfig").

Problem solved.

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages