From: Paul Eggert Date: Tue, 30 May 2006 05:47:40 +0000 (+0000) Subject: * lib/autoconf/status.m4 (AC_OUTPUT_MAKE_DEFS): Rewrite to avoid X-Git-Tag: AUTOCONF-2.59d~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d1f0479606fce135a755500a223f99758554b21;p=thirdparty%2Fautoconf.git * lib/autoconf/status.m4 (AC_OUTPUT_MAKE_DEFS): Rewrite to avoid the use of 'tr', since this is our only use of 'tr'. --- diff --git a/ChangeLog b/ChangeLog index c61dbd1e2..fc9f98d8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-29 Paul Eggert + + * 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 and Paul Eggert diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index 3e1e711e6..44516697f 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -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