Peculiar configure behavior

Randy Chung aoshi at OCF.Berkeley.EDU
Sat Aug 7 18:21:04 CEST 2004

First, a disclaimer: my familiarity with the autoconf chaintool is near nil.

Now then, I'll first show an example of how things are wrong.  A few 
choice snippets from the autogenerated Makefile in xfce-utils/xfrun, 
where the environment variables during the build process were as follows:

LDFLAGS="-L/usr/local/xfce4/lib -R/usr/local/xfce4/lib"

But, curiously, here are the two important lines from the autogenerated 

LDFLAGS = -L/usr/local/xfce4/lib -R/usr/local/xfce4/lib

xfrun4_LDADD = \
   -Wl,--export-dynamic -L/usr/X11R6/lib -L/usr/local/xfce4/lib 
-lxfcegui4 -lgtk-x11-2.0 -lxfce4util -lgdk-x11-2.0 -latk-1.0 
-lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 
-lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0              \
   -Wl,-R/usr/lib -ldbh -lm

What we can see from line 1 is that LDFLAGS is being read properly. 

What we can see from line two, particularly the part that reads 
"-R/usr/lib" is that the -R flag passed in LDFLAGS is not being 
respected.  However, the -L flag (what libraries to use during 
compilation) IS respected ("-L/usr/local/xfce4/lib" in line 2).  This 
lets xfrun build without a hitch, and for all we can tell life is good. 
  But upon trying to run it, the -R flag (what libraries to use when 
actually running the binary) kicks in, and reads the version in /usr/lib 
and dies a horrible, painful death akin to Braveheart (but worse, 
because there's no fast forward button).

To fix, simple swap -R/usr/lib for -R/usr/local/xfce4/lib (in the 
Makefile) and everything compiles and runs happily.  So the question is, 
why is (some autoconf tool) not respecting the -R portion of the LDFLAGS 
environment variable?

Once we can answer that question, all will unfold and life will be 
peachy again.  Alternatively, we could simply require all users to 
change the autogen'ed Makefiles by hand :) (or only use CVS)

Again, more time will be commited to this once I get on my plane. 
Little by little, it seems edscott and I are making progress on this, so 
hopefully there'll be a fix soon!



edscott wrote:
> When all else fails, read the instructions:
> "If you ever happen to want to link against installed libraries
> in a given directory, LIBDIR, you must either use libtool, and
> specify the full pathname of the library, or [don't use libtool]"
> The automated make process uses libtool, so if we follow instructions,
> do some cut and paste and replace -lxfcegui4 with
> -l${prefix}/lib/, everything is marvelous:
> /bin/sh ../libtool --mode=link gcc  -g -O2   -o xfrun4  xfrun4-xfrun.o
> -Wl,-R/var/xfce/lib -L/var/xfce/lib -lxfce4util -lglib-2.0
> -Wl,-R/var/xfce/lib -Wl,--export-dynamic -L/usr/X11R6/lib
> -L/var/xfce/lib -Wl,--rpath -Wl,/var/xfce/lib
> /var/xfce/lib/ -lgtk-x11-2.0  -lgdk-x11-2.0 -latk-1.0
> -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0
> -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -Wl,-R/usr/lib -ldbh -lm  
> which produces --> 
> gcc -g -O2 -o xfrun4 xfrun4-xfrun.o -Wl,-R/var/xfce/lib
> -Wl,-R/var/xfce/lib -Wl,--export-dynamic -Wl,--rpath -Wl,/var/xfce/lib
> /var/xfce/lib/ -Wl,-R/usr/lib  -L/var/xfce/lib
> /var/xfce/lib/ -L/usr/X11R6/lib
> /usr/lib/ /usr/lib/
> /usr/lib/ /usr/lib/
> /usr/lib/ /usr/lib/
> /usr/lib/ /usr/lib/
> /usr/lib/ -ldl /usr/lib/
> /usr/lib/ -lm -Wl,--rpath -Wl,/var/xfce/lib -Wl,--rpath
> -Wl,/var/xfce/lib
> So unless I am mistaken, there is no fix possible (Benny knows more
> about this than I do), except updating libxfce4util to the latest
> version. 
> Why does this only happen to xfcalendar, xfrun4 and xffm? That's a good
> question to ask libtool.
> regards,
> Edscott  

More information about the Xfce4-dev mailing list