Very cool -- Thank you!

--Stefan

-----

Mark Wright wrote:
> Hello,
> 
> I asked libtool at gnu.org, the answer is that yes libtool 2.2.4
> will by default place the LDFLAGS options before the libraries
> in the build directories when doing "libtool -relink" during
> "make install".  So the default behaviour is that libtool could
> find some old, incompatible libraries in the directories
> listed in the -L options in LDFLAGS, which could then result
> in "Undefined symbol" errors.
> 
> The workaround for the libtool -relink problem is simple though,
> I manually added a -L option for the pkgbuild directory at the
> front of LDFLAGS before the configure and build, so that the
> make install finds the just installed libraries before the
> libtool -relink, like:
> 
> goanna% svn diff Dude/TAGLIB/1.5.0/Solaris/configure.sh 
> Index: Dude/TAGLIB/1.5.0/Solaris/configure.sh
> ===================================================================
> --- Dude/TAGLIB/1.5.0/Solaris/configure.sh    (revision 2093)
> +++ Dude/TAGLIB/1.5.0/Solaris/configure.sh    (working copy)
> @@ -1,5 +1,13 @@
>  #!/bin/bash
>  
> +# libtool 2.2.4 relink looks for libs first in LDFLAGS.  Placing
> +# -L${DESTDIR}${_foss_lib} at the front of LDFLAGS is necessary
> +# to avoid libtool relink during make install linking against
> +# JDS gnome 2.22.2 /usr/lib/libtag.so instead of
> +# ${DESTDIR}${_foss_lib}/libtag.so that has just been installed.
> +export CFLAGS=`echo $CFLAGS | $KBE_PREFIX/bin/sed -e 
> "s%-L${_foss_lib}%-L${DESTDIR}${_foss_lib} -L${_foss_lib}%g"`
> +export CXXFLAGS=`echo $CXXFLAGS | $KBE_PREFIX/bin/sed -e 
> "s%-L${_foss_lib}%-L${DESTDIR}${_foss_lib} -L${_foss_lib}%g"`
> +export LDFLAGS="-L${DESTDIR}${_foss_lib} ${LDFLAGS}" 
>  ./configure --prefix=${PREFIX} \
>       --bindir=${_bindir} \
>       --sbindir=${_sbindir} \
> goanna% 
> 
> Then it links fine, and the rpath is OK:
> 
> goanna% dump -Lv /opt/foss/lib/libtag_c.so | grep RUNPATH
> [13]  RUNPATH         
> /opt/foss/lib:/opt/foss/lib:/usr/lib:/opt/SunStudio12/SUNWspro/lib/rw7:/opt/SunStudio12/SUNWspro/lib/sse2:/opt/SunStudio12/SUNWspro/lib:/opt/SUNWspro/lib/sse2:/opt/SUNWspro/lib:/usr/ccs/lib:/lib:/usr/lib
> goanna% 
> 
> Thanks, Mark
> 

-- 
Stefan Teleman
Sun Microsystems, Inc.
Stefan.Teleman at Sun.COM


Reply via email to