Peculiar configure behavior

Brian J. Tarricone bjt23 at cornell.edu
Sat Aug 7 19:23:04 CEST 2004


what is the -R option?  according to the gcc manpage, it doesn't exist.  
ditto for libtool.  perhaps you're thinking of the -rpath option (which 
is actually a linker option, and needs to be passed to gcc using -Wl).

	-brian

On Sun, 8 Aug 2004, Randy Chung wrote:

> 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:
> 
> PKG_CONFIG_PATH=/usr/local/xfce4/lib/pkgconfig
> LDFLAGS="-L/usr/local/xfce4/lib -R/usr/local/xfce4/lib"
> 
> But, curiously, here are the two important lines from the autogenerated 
> Makefile:
> 
> 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. 
> Excellent.
> 
> 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!
> 
> --
> 
> Randy
> 
> 
> 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/libxfcegui4.so, 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/libxfcegui4.so -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/libxfcegui4.so -Wl,-R/usr/lib  -L/var/xfce/lib
> > /var/xfce/lib/libxfce4util.so -L/usr/X11R6/lib
> > /usr/lib/libgtk-x11-2.0.so /usr/lib/libgdk-x11-2.0.so
> > /usr/lib/libatk-1.0.so /usr/lib/libgdk_pixbuf-2.0.so
> > /usr/lib/libpangoxft-1.0.so /usr/lib/libpangox-1.0.so
> > /usr/lib/libpango-1.0.so /usr/lib/libgobject-2.0.so
> > /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libglib-2.0.so
> > /usr/lib/libdbh.so -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  
> > 
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://lunar-linux.org/mailman/listinfo/xfce4-dev
> 
> 




More information about the Xfce4-dev mailing list