libtool fails if user has environment variable D defined
From:
Sebastian Jester
Subject:
libtool fails if user has environment variable D defined
Date:
Wed, 8 Aug 2007 11:16:32 -1000
Hi,
Bug summary: compilation with libtool fails if user has an environment variable D (and probably for S, too).
Description: while compiling a package that uses libtool, I ran into a strange problem where paths to libraries like
/disk1/jester/IPP/bla/bla got turned into /IPP/bla/bla and since that directory does not exist, much less contain the required library, compilation fails in the libtool call.
It turns out that the failure is caused by one or more of these snippets from
ltmain.sh:
# We do not want portage's install root ($D) present. Check only for # this if the .la is being installed. if test "$installed" = yes && test "$D"; then
eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` else mynewdependency_lib="$libdir/$name" fi ...
# We do not want portage's install root ($D) present. my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` if test -n "$my_little_ninja_foo_2" && test "$S"; then
mynewdependency_lib="" elif test -n "$my_little_ninja_foo_3" && test "$D"; then eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
else mynewdependency_lib="$deplib" fi ... # Do not add duplicates if test "$installed" = yes && test "$D"; then install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
fi
together with the fact that I use an environment variable D = /disk1/jester (in this case) on every machine I have an account on that points to my non-home-area data disk. Compilation works as
expected if I unset D.
I don't understand how libtool works and don't know what portage is, so I can't offer a fix. Clearly, global environment variable names like D and S are very very bad programming style for a
maximum-portability tool such as libtool (sorry to be so blunt) so probably the straightforward fix is to rename them into PORTAGE_INSTALL_ROOT_D or something like that (MY_LITTLE_NINJA_FOO_D is very descriptive, too ;-)