This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[toplevel] Pass --program-transform-name to subconfigures


As I suggested earlier, this patch causes --program-transform-name to be
computed at the top level and passed to subconfigures.  This guarantees that
no matter what versions of autoconf may live in subdirectories, they'll all
agree about what installed programs are named.  If we flip over to match the
new autoconf defaults (I'm undecided), then we can do it all at once; if we
don't, we can override autoconf in just one place.

This patch replaces the previous version, submitted last week.  It depends
on the quoting fix for gcc/12201, which I just posted.

Known caveat: if you use --program-suffix='$' or some other shell
metacharacter, this will get confused.  Programs may end up with two dollar
signs at the end instead of one.  Fixing that was extremely complicated, so
I didn't bother.

I've successfully tested this with:
 no command line options to configure
 --program-suffix=-3.4
 --program-transform-name='s,\(as\),\1-\1,'

Just for kicks I tried:
 --program-transform-name=s,\$,\',
which doesn't work but may after the top level is converted to autoconf
2.5x.  config.status ends up with unmatched quotes.

Is this OK?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-09-14  Daniel Jacobowitz  <drow@mvista.com>

	* configure.in: Pass a computed --program-transform-name
	to subconfigures.

--- configure.infoo	2003-09-14 10:57:36.000000000 -0400
+++ configure.in	2003-09-14 11:57:22.000000000 -0400
@@ -1760,7 +1760,14 @@
 
 # Base args.  Strip norecursion, cache-file, srcdir, host, build,
 # target and nonopt.  These are the ones we might not want to pass
-# down to subconfigures.  These will be expanded by make, so quote '$'.
+# down to subconfigures.  Also strip program-prefix, program-suffix,
+# and program-transform-name, so that we can pass down a consistent
+# program-transform-name.  If autoconf has put single quotes around
+# any of these arguments (because they contain shell metacharacters)
+# then this will fail; in practice this only happens for
+# --program-transform-name, so be sure to override --program-transform-name
+# at the end of the argument list.
+# These will be expanded by make, so quote '$'.
 cat <<\EOF_SED > conftestsed
 s/ --no[[^ ]]* / /
 s/ --c[[a-z-]]*[[= ]][[^ ]]* / /
@@ -1768,11 +1775,15 @@
 s/ --ho[[a-z-]]*[[= ]][[^ ]]* / /
 s/ --bu[[a-z-]]*[[= ]][[^ ]]* / /
 s/ --t[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / /
 s/ -cache-file[[= ]][[^ ]]* / /
 s/ -srcdir[[= ]][[^ ]]* / /
 s/ -host[[= ]][[^ ]]* / /
 s/ -build[[= ]][[^ ]]* / /
 s/ -target[[= ]][[^ ]]* / /
+s/ -program-prefix[[= ]][[^ ]]* / /
+s/ -program-suffix[[= ]][[^ ]]* / /
+s/ -program-transform-name[[= ]][[^ ]]* / /
 s/ [[^' -][^ ]*] / /
 s/^ *//;s/ *$//
 s,\$,$$,g
@@ -1783,6 +1794,20 @@
 baseargs=`cat conftestsed.out`
 rm -f conftestsed conftestsed.out
 
+# Add in --program-transform-name, after --program-prefix and
+# --program-suffix have been applied to it.  Autoconf has already
+# doubled dollar signs and backslashes in program_transform_name; we want
+# the backslashes un-doubled, and then the entire thing wrapped in single
+# quotes, because this will be expanded first by make and then by the shell. 
+# Also, because we want to override the logic in subdir configure scripts to
+# choose program_transform_name, replace any s,x,x, with s,y,y,.
+sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
+${program_transform_name}
+EOF_SED
+gcc_transform_name=`cat conftestsed.out`
+rm -f conftestsed.out
+baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
+
 # For the build-side libraries, we just need to pretend we're native,
 # and not use the same cache file.  Multilibs are neither needed nor
 # desired.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]