libtool
[Top][All Lists]
Advanced

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

Re: [ 100058 ] 1.4 - $buildir-path may not contain "~"


From: Pavel Roskin
Subject: Re: [ 100058 ] 1.4 - $buildir-path may not contain "~"
Date: Sun, 17 Jun 2001 02:50:49 -0400 (EDT)

Hello, Bruce!

> > In the mean while, I think the only workaround is to not use '~' in 
> > pathnames.

Let's not hide the problems. Libtool it misusing IFS. Several macros in
libtool.m4 set IFS to whatever they want and then run a loop including
Autoconf macros assuming that the later can work with and IFS.

I'm sorry to disappoint you. Autoconf provides protection to the configure
script as a whole, but there is no protection for every single macro
against the code setting IFS in aclocal.m4 and configure.in.

By the way, _LT_AC_TAGCONFIG doesn't restore IFS at all! This causes
errors with Autoconf 2.50 that uses ":" instead of true. If ":" is in IFS,
it doesn't work.

Autoconf restores IFS inside the loop. Maybe it's not good for speed, but
it's good for reliability. ltmain.in already uses this trick.

This patch fixes the problem with Autoconf 2.50 and the problem with "~"
in the directory names.

ChangeLog:
        * libtool.m4: If IFS is set before loop restore it in the
        beginning of the loop.
        (_LT_AC_TAGCONFIG): Restore IFS at the end of the loop.
        (_LT_AC_PROG_ECHO_BACKSLASH): s/save_ifs/ac_save_ifs/.
____________________________________________
--- libtool.m4
+++ libtool.m4
@@ -297,8 +297,9 @@
   #
   # So, first we look for a working echo in the user's PATH.

-  IFS="${IFS=  }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
   for dir in $PATH /usr/ucb; do
+    IFS="$ac_save_ifs"
     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
@@ -307,7 +308,7 @@
       break
     fi
   done
-  IFS="$save_ifs"
+  IFS="$ac_save_ifs"

   if test "X$echo" = Xecho; then
     # We didn't find a better echo, so look for alternatives.
@@ -3025,6 +3026,7 @@

   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   for tagname in $tagnames; do
+    IFS="$ac_save_ifs"
     # Check whether tagname contains only valid characters
     [case `$echo "X$tagname" | $Xsed -e 
's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in]
     "") ;;
@@ -3053,6 +3055,7 @@
       available_tags="$available_tags $tagname"
     fi
   done
+  IFS="$ac_save_ifs"

   # Now substitute the updated list of available tags.
   if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' 
\"$ofile\" > \"${ofile}T\""; then
@@ -3182,6 +3185,7 @@
   # Look at the argument we got.  We use all the common list separators.
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   for pkg in $enableval; do
+    IFS="$ac_save_ifs"
     if test "X$pkg" = "X$p"; then
       enable_shared=yes
     fi
@@ -3221,6 +3225,7 @@
   # Look at the argument we got.  We use all the common list separators.
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   for pkg in $enableval; do
+    IFS="$ac_save_ifs"
     if test "X$pkg" = "X$p"; then
       enable_static=yes
     fi
@@ -3260,6 +3265,7 @@
   # Look at the argument we got.  We use all the common list separators.
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
   for pkg in $enableval; do
+    IFS="$ac_save_ifs"
     if test "X$pkg" = "X$p"; then
       enable_fast_install=yes
     fi
@@ -3311,6 +3317,7 @@
 dnl not every word.  This closes a longstanding sh security hole.
   ac_dummy="ifelse([$2], , $PATH, [$2])"
   for ac_dir in $ac_dummy; do
+    IFS="$ac_save_ifs"
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$1; then
       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
@@ -3420,6 +3427,7 @@
 [if test -z "$LD"; then
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   for ac_dir in $PATH; do
+    IFS="$ac_save_ifs"
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
       lt_cv_path_LD="$ac_dir/$ac_prog"
@@ -3665,6 +3673,7 @@
 else
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$ac_save_ifs"
     test -z "$ac_dir" && ac_dir=.
     tmp_nm=$ac_dir/${ac_tool_prefix}nm
     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
____________________________________________


Regards,
Pavel Roskin




reply via email to

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