libtool-patches
[Top][All Lists]
Advanced

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

Re: PATCH: Work around libtool for `$' in filenames


From: Alexandre Oliva
Subject: Re: PATCH: Work around libtool for `$' in filenames
Date: 27 Nov 2002 00:44:03 -0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

[Cc:ing libtool-patches, to make sure libtool maintainers are aware of
 the problem and don't end up rewriting this patch by mistake]

On Nov 26, 2002, "H. J. Lu" <address@hidden> wrote:

> Libtool couldn't deal with `$' in filenames, which is used in libjava
> test. This patch seems to work for me.

Sorry, this one can't go in.  For one, it would break the libtool
testsuite for disregarding $run, which would break libtool -n.

This is probably a symptom of places where arguments to libtool should
be quoted but aren't, or cases in which we expand a command line with
eval too many times.  Simply quoting `$' may fix this particular
problem, without fixing the more general problem that should be fixed,
e.g., other shell meta-characters would remain broken.

Also, by policy, GCC doesn't accept patches that didn't make it to the
libtool CVS tree, and this one doesn't seem to have made it.
Fortunately, otherwise it would have to be reverted :-)

> 2002-11-23  H.J. Lu <address@hidden>

>       * ltmain.sh: Handle `$' in filenames.

> --- ltmain.sh.dollar  Fri Nov 22 12:33:19 2002
> +++ ltmain.sh Sat Nov 23 10:04:22 2002
> @@ -655,9 +655,11 @@ EOF
 
>        $run $rm "$lobj" "$output_obj"
 
> +      command=`echo $command | sed -e "s/[$]/\\\\$/g"`
>        $show "$command"
> -      if $run eval "$command"; then :
> -      else
> +      $SHELL -c "$command"
> +      status=$?
> +      if test $status -ne 0; then
>       test -n "$output_obj" && $run $rm $removelist
>       exit 1
>        fi
> @@ -723,11 +725,12 @@ EOF
>        fi
 
>        # Suppress compiler output if we already did a PIC compilation.
> -      command="$command$suppress_output"
>        $run $rm "$obj" "$output_obj"
> +      command=`echo $command | sed -e "s/[$]/\\\\$/g"`
>        $show "$command"
> -      if $run eval "$command"; then :
> -      else
> +      $SHELL -c "$command"
> +      status=$?
> +      if test $status -ne 0; then
>       $run $rm $removelist
>       exit 1
>        fi

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 address@hidden, gcc.gnu.org}
CS PhD student at IC-Unicamp        address@hidden, gnu.org}
Free Software Evangelist                Professional serial bug killer




reply via email to

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