]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/status.m4 (AC_OUTPUT_MAKE_DEFS): Rewrite to avoid
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 May 2006 05:47:40 +0000 (05:47 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 May 2006 05:47:40 +0000 (05:47 +0000)
the use of 'tr', since this is our only use of 'tr'.

ChangeLog
lib/autoconf/status.m4

index c61dbd1e2aab7f4fd1c66db5436c620c5ce1ef59..fc9f98d8a7af516be42e8fce28384e98d605ebe9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/autoconf/status.m4 (AC_OUTPUT_MAKE_DEFS): Rewrite to avoid
+       the use of 'tr', since this is our only use of 'tr'.
+
 2006-05-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
        and Paul Eggert  <eggert@cs.ucla.edu>
 
index 3e1e711e65de3ecd7b2acb892dbaa9b586f1a0d9..44516697f7d0c82eef8f06907ed3d35745c79465 100644 (file)
@@ -1491,37 +1491,35 @@ done # for ac_tag
 # Set the DEFS variable to the -D options determined earlier.
 # This is a subroutine of AC_OUTPUT.
 # It is called inside configure, outside of config.status.
-# Using a here document instead of a string reduces the quoting nightmare.
 m4_define([AC_OUTPUT_MAKE_DEFS],
 [[# Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
 #
 # If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section.  Otherwise,
+# take arguments), then branch to the quote section.  Otherwise,
 # look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
+ac_script='
 t clear
 :clear
 s/^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\)/-D\1=\2/g
 t quote
 s/^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)/-D\1=\2/g
 t quote
-d
+b any
 :quote
-s/[     `~#$^&*(){}\\|;'"<>?]/\\&/g
+s/[     `~#$^&*(){}\\|;'\''"<>?]/\\&/g
 s/\[/\\&/g
 s/\]/\\&/g
 s/\$/$$/g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output.  A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
+H
+:any
+${
+       g
+       s/^\n//
+       s/\n/ /g
+       p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
 ]])# AC_OUTPUT_MAKE_DEFS