From: Matthew D. Langston Date: Wed, 2 Jun 1999 12:46:59 +0000 (+0000) Subject: {f77-name-mangling} (AC_OUTPUT_MAKE_DEFS): Change sed regexps to X-Git-Tag: exp-1999-06-18~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bb5f4cfcc856f35b419286e3627d9f2c9ac38fe;p=thirdparty%2Fautoconf.git {f77-name-mangling} (AC_OUTPUT_MAKE_DEFS): Change sed regexps to recognize CPP macros that take arguments. Reported, and based on a patch, by Steven G. Johnson . (AC_OUTPUT_HEADER): Likewise. --- diff --git a/acgeneral.m4 b/acgeneral.m4 index 4e0eaedb..abeeb539 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -2147,9 +2147,16 @@ define(AC_OUTPUT_MAKE_DEFS, dnl Using a here document instead of a string reduces the quoting nightmare. # 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 cleanup section. Otherwise, +# look for a macro that doesn't take arguments. cat > conftest.defs <<\EOF changequote(<<, >>)dnl -s%<<#define>> \([^ ][^ ]*\) *\(.*\)%-D\1=\2%g +s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g +t cleanup +s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)%-D\2=\3%g +: cleanup s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g @@ -2359,7 +2366,10 @@ cat > conftest.hdr <<\EOF changequote(<<, >>)dnl s/[\\&%]/\\&/g s%[\\$`]%\\&%g -s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%^[ ]*<<#>>[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*$\)%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp +t cleanup +s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*$\)% ${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +: cleanup s%ac_d%ac_u%gp s%ac_u%ac_e%gp changequote([, ])dnl diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 4e0eaedb..abeeb539 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -2147,9 +2147,16 @@ define(AC_OUTPUT_MAKE_DEFS, dnl Using a here document instead of a string reduces the quoting nightmare. # 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 cleanup section. Otherwise, +# look for a macro that doesn't take arguments. cat > conftest.defs <<\EOF changequote(<<, >>)dnl -s%<<#define>> \([^ ][^ ]*\) *\(.*\)%-D\1=\2%g +s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g +t cleanup +s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)%-D\2=\3%g +: cleanup s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g @@ -2359,7 +2366,10 @@ cat > conftest.hdr <<\EOF changequote(<<, >>)dnl s/[\\&%]/\\&/g s%[\\$`]%\\&%g -s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%^[ ]*<<#>>[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*$\)%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp +t cleanup +s%^[ ]*<<#>>[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*$\)% ${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +: cleanup s%ac_d%ac_u%gp s%ac_u%ac_e%gp changequote([, ])dnl