Fix quoting of program-transform-name in toplevel configure

Andreas Tobler toa@pop.agri.ch
Thu Aug 21 04:44:00 GMT 2003


Geoffrey Keating wrote:

> I wanted to do
> 
> .../configure --program-transform-name=/^[cg][^.-]*$/s/$/-3.4/
> 
> so that 'gcc' would be renamed 'gcc-3.4' but
> 'powerpc-apple-darwin-gcc-3.4' wouldn't be renamed.  I quickly
> developed a severe case of Leaning Toothpick Syndrome.  This is a
> regression from 3.3, which Just Worked.
> 
> Tested with a bootstrap on powerpc-darwin, and lots of manual
> inspection of Makefiles.
> 
+# Export original configure arguments for use by sub-configures.  These
+# will be expanded once by make, and once by the shell, so they need to
+# have '$' quoted for make, and then each argument quoted for the shell.
+# What's more, the 'echo' below might expand backslashes.
+cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+tmp="'$progname'"
+for ac_arg ; do    <--------------------------------
+  tmp="$tmp '"`echo "$ac_arg" | sed -fconftestsed`
+done
+rm -f conftestsed
+TOPLEVEL_CONFIGURE_ARGUMENTS="$tmp"
  AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)


Solaris native complains about unexpected ; at line 805.

Andreas



More information about the Gcc-patches mailing list