libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Path funkiness in executable shell wrapper scripts


From: Albert Chin
Subject: Path funkiness in executable shell wrapper scripts
Date: Wed, 23 Feb 2005 22:57:57 -0600
User-agent: Mutt/1.5.6i

Just build ImageMagick-6.1.9 which uses a single Makefile for
subdirectory builds (rather than a Makefile per directory). Some of
the tests fail because the wrapper script created by libtool doesn't
set LD_LIBRARY_PATH to the correct path to find shared libraries. As
an example, the $(top_builddir)/Magick++/tests/exceptions script looks
like this:
  ...
  if test -f "$progdir/$program"; then
    # Add our own library path to LD_LIBRARY_PATH
    LD_LIBRARY_PATH="$thisdir/Magick++/lib/.libs:/opt/build/ImageMagick-6.1.9/wa
nd/.libs:/opt/build/ImageMagick-6.1.9/magick/.libs:/opt/TWWfsw/liblcms11/lib:/op
t/TWWfsw/jpeg/lib:/opt/TWWfsw/bzip2/lib:/opt/TWWfsw/libttf21/lib:/opt/TWWfsw/zli
b11/lib:$LD_LIBRARY_PATH"
  ...

thisdir will be the directory
$(top_builddir)/Magick++/tests/exceptions resides in, namely
"$(top_builddir)/Magick++/tests". Because the Magick++ libs are in
$(top_builddir)/Magick++/lib, the wrapper cannot find them as the
first path component of LD_LIBRARY_PATH is
$(top_builddir)/Magick++/tests, not $(top_builddir)/Magick++/lib. I
understand why $thisdir is used (so you can call the wrapper from any
directory using an asbolute or relative path).

When building with subdirectory Makefile's, this wouldn't be a
problem. However, because of the single Makefile in $(top_builddir),
the first path component is incorrectly generated.

Any ideas on how to fix? The command used to link
Magick++/tests/exceptions is:
  /bin/bash ./libtool --mode=link CC  -xO2 -xtarget=generic -xarch=v8
  -D_REENTRANT  -L/opt/TWWfsw/xpm/lib -L/opt/TWWfsw/jpeg/lib
  -L/opt/TWWfsw/liblcms11/lib -L/opt/TWWfsw/libtiff35/lib
  -L/opt/TWWfsw/libpng12/lib -L/opt/TWWfsw/zlib11/lib
  -L/opt/TWWfsw/bzip2/lib -L/opt/TWWfsw/libttf21/lib
  -L/opt/TWWfsw/libwmf02/lib -L/opt/TWWfsw/libxml26/lib
  
-R/opt/TWWfsw/xpm/lib:/opt/TWWfsw/jpeg/lib:/opt/TWWfsw/liblcms11/lib:/opt/TWWfsw/libtiff35/lib:/opt/TWWfsw/libpng12/lib:/opt/TWWfsw/zlib11/lib:/opt/TWWfsw/bzip2/lib:/opt/TWWfsw/libttf21/lib:/opt/TWWfsw/libwmf02/lib:/opt/TWWfsw/libxml26/lib:/opt/TWWfsw/libiconv19/lib
  -L/usr/openwin/lib -R/usr/openwin/lib -L/opt/TWWfsw/libttf21/lib
  -R/opt/TWWfsw/libttf21/lib:/opt/TWWfsw/zlib11/lib -lfreetype
  -L/opt/TWWfsw/zlib11/lib -lz -L/opt/TWWfsw/libxml26/lib -o
  Magick++/tests/exceptions  Magick++/tests/exceptions.o
  Magick++/lib/libMagick++.la

-- 
albert chin (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]