This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

toplevel configure.in


Hi,
attached is a patch to the toplevel configure.in file, which fixes a problem
with trying to use --program-transform-name. I discovered that my suggested
workaround for this, (in http://egcs.cygnus.com/faq.html), doesn't work when
/bin/sh is really bash (as it is on my linux box). The problem is that
configure.in passes on the target arguments, but has stripped one level of
escapes off this. bash clearly has a subtly different stripping algorithm than
sh. Possibly, the faq's suggestion only works in shell because it leaves bad
escapes unchanged, whereas bash removes the \. What is really needed is to
re-escape and separately enclose each argument in ' marks, so that they're not
mangled by a shell on the way.

This patch adds an additional sed filter to those applied to targargs, so that
the right things happen. It works on both bash run as sh and Solaris sh. With
this patch, the escaping I suggested in the faq becomes much simpler! I'll
submit a patch for the faq if/when this one is installed.

Enjoy

nathan

-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
      You can up the bandwidth, but you can't up the speed of light      
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk
Mon Mar  8 13:49:17 GMT 1999  Nathan Sidwell  <nathan@acm.org>

	* configure.in (targargs): Reescape \ sequences.

Index: egcs/configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/configure.in,v
retrieving revision 1.33
diff -c -3 -p -r1.33 configure.in
*** configure.in	1999/02/09 21:01:13	1.33
--- configure.in	1999/03/02 09:32:29
*************** fi
*** 1050,1061 ****
  
  # Record target_configdirs and the configure arguments in Makefile.
  target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
! targargs=`echo "${arguments}" | \
  	sed -e 's/--no[^ 	]*//' \
  	    -e 's/--cache[a-z-]*=[^ 	]*//' \
  	    -e 's/--ho[a-z-]*=[^ 	]*//' \
  	    -e 's/--bu[a-z-]*=[^ 	]*//' \
! 	    -e 's/--ta[a-z-]*=[^ 	]*//'`
  
  # Passing a --with-cross-host argument lets the target libraries know
  # whether they are being built with a cross-compiler or being built
--- 1050,1063 ----
  
  # Record target_configdirs and the configure arguments in Makefile.
  target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
! targargs=\\\'`echo "${arguments}" | \
  	sed -e 's/--no[^ 	]*//' \
  	    -e 's/--cache[a-z-]*=[^ 	]*//' \
  	    -e 's/--ho[a-z-]*=[^ 	]*//' \
  	    -e 's/--bu[a-z-]*=[^ 	]*//' \
! 	    -e 's/--ta[a-z-]*=[^ 	]*//' \
! 	    -e 's/\\\\/\\\\\\\\/g' \
! 	    -e "s/[ 	][ 	]*/\\\\\\\' \\\\\\\'/g"`\\\'
  
  # Passing a --with-cross-host argument lets the target libraries know
  # whether they are being built with a cross-compiler or being built

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