This is the mail archive of the
autoconf-patches@gnu.org
mailing list for the autoconf project.
119-changequote-busters
- To: APatche <autoconf-patches at gnu dot org>
- Subject: 119-changequote-busters
- From: Akim Demaille <akim at epita dot fr>
- Date: 08 Feb 2000 13:56:12 +0100
Index: 0.148/ChangeLog
--- 0.148/ChangeLog Sat, 05 Feb 2000 14:59:02 +0100 akim (ace/34_ChangeLog 1.139 666)
+++ 0.148(w)/ChangeLog Sat, 05 Feb 2000 15:54:08 +0100 akim (ace/34_ChangeLog 1.139 666)
@@ -1,5 +1,16 @@
2000-02-05 Akim Demaille <akim@epita.fr>
+ Changequote-busters!
+ From Dan Ackroyd.
+
+ * acgeneral.m4 (AC_INIT_PARSE_ARGS, AC_INIT_PREPARE,
+ AC_CACHE_SAVE, AC_PREFIX_PROGRAM, AC_OUTPUT,
+ _AC_OUTPUT_CONFIG_STATUS, AC_OUTPUT_MAKE_DEFS, AC_OUTPUT_FILES,
+ _AC_OUTPUT_HEADERS, AC_OUTPUT_LINKS, AC_OUTPUT_SUBDIRS): Quit
+ playing with changequotes, @BKL@ and Co.! Just quote properly.
+
+2000-02-05 Akim Demaille <akim@epita.fr>
+
Honor properly the `#define' config.h.in templates.
Test it.
Index: 0.148/acgeneral.m4
--- 0.148/acgeneral.m4 Sat, 05 Feb 2000 14:59:02 +0100 akim (ace/27_acgeneral. 1.99 644)
+++ 0.148(w)/acgeneral.m4 Sat, 05 Feb 2000 15:37:13 +0100 akim (ace/27_acgeneral. 1.99 644)
@@ -752,11 +752,11 @@
[[ test -n "$ac_arg_enable_help" && echo "
Optional features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE@BKL@=ARG@BKR@ include FEATURE @BKL@ARG=yes@BKR@\
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]\
$ac_arg_enable_help"
test -n "$ac_arg_with_help" && echo "
Optional packages:
- --with-PACKAGE@BKL@=ARG@BKR@ use PACKAGE @BKL@ARG=yes@BKR@
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)\
$ac_arg_with_help"
test -n "$ac_arg_var_help" && echo "
@@ -1109,9 +1109,7 @@
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
ac_prog=[$]0
-changequote(, )dnl
- ac_confdir=`echo "$ac_prog"|sed 's%/[^/][^/]*$%%'`
-changequote([, ])dnl
+ ac_confdir=`echo "$ac_prog" | sed 's%/[[^/][^/]]*$%%'`
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
@@ -1129,9 +1127,7 @@
fi
dnl Double slashes in pathnames in object file debugging info
dnl mess up M-x gdb in Emacs.
-changequote(, )dnl
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-changequote([, ])dnl
+srcdir=`echo "$srcdir" | sed 's%\([[^/]]\)/*$%\1%'`
dnl Let the site file select an alternate cache file if it wants to.
AC_SITE_LOAD
@@ -1574,8 +1570,10 @@
# AC_CACHE_SAVE
# -------------
+# Save the cache.
+# Allow a site initialization script to override cache values.
define(AC_CACHE_SAVE,
-[cat >confcache <<\EOF
+[[cat >confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs. It is not useful on other systems.
@@ -1591,13 +1589,11 @@
# --recheck option to rerun configure.
#
EOF
-dnl Allow a site initialization script to override cache values.
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-changequote(, )dnl
(set) 2>&1 |
case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
@@ -1612,7 +1608,6 @@
sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
;;
esac >>confcache
-changequote([, ])dnl
if cmp -s $cache_file confcache; then :; else
if test -w $cache_file; then
echo "updating cache $cache_file"
@@ -1622,7 +1617,7 @@
fi
fi
rm -f confcache
-])
+]])
# AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
# ------------------------------------------
@@ -2222,10 +2217,8 @@
dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
echo $ac_n "checking for prefix by $ac_c" 1>&AC_FD_MSG
AC_PATH_PROG(AC_Prog, $1)
-changequote(<<, >>)dnl
- if test -n "$ac_cv_path_<<>>AC_Prog"; then
- prefix=`echo $ac_cv_path_<<>>AC_Prog|sed 's%/[^/][^/]*//*[^/][^/]*$%%'`
-changequote([, ])dnl
+ if test -n "$ac_cv_path_[]AC_Prog"; then
+ prefix=`echo $ac_cv_path_[]AC_Prog | [sed 's%/[^/][^/]*//*[^/][^/]*$%%']`
fi
fi
popdef([AC_Prog])dnl
@@ -3345,9 +3338,7 @@
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
-changequote(, )dnl
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-changequote([, ])dnl
+ ac_vpsub=['/^[ ]*VPATH[ ]*=[^:]*$/d']
fi
ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
@@ -3426,19 +3417,19 @@
\\\`$CONFIG_STATUS' instantiates files from templates according to the
current configuration.
-Usage: $CONFIG_STATUS @BKL@OPTIONS@BKR@ FILE...
+Usage: $CONFIG_STATUS [[OPTIONS]] FILE...
--recheck Update $CONFIG_STATUS by reconfiguring in the same conditions
--version Print the version of Autoconf and exit
--help Display this help and exit
ifset([AC_LIST_FILES],
-[ --file=FILE@BKL@:TEMPLATE@BKR@
+[[ --file=FILE[:TEMPLATE]
Instantiate the configuration file FILE
-])dnl
+]])dnl
ifset([AC_LIST_HEADERS],
-[ --header=FILE@BKL@:TEMPLATE@BKR@
+[[ --header=FILE[:TEMPLATE]
Instantiate the configuration header FILE
-])dnl
+]])dnl
ifset([AC_LIST_FILES],
[Configuration files:
@@ -3485,7 +3476,7 @@
case "[\$]1" in
--*=*)
ac_option=\`echo "[\$]1" | sed -e 's/=.*//'\`
- ac_optarg=\`echo "[\$]1" | sed -e 's/@BKL@^=@BKR@*=//'\`
+ ac_optarg=\`echo "[\$]1" | sed -e ['s/[^=]*=//']\`
shift
set dummy "[\$]ac_option" "[\$]ac_optarg" [\$]{1+"[\$]@"}
shift
@@ -3631,16 +3622,14 @@
# take arguments), then we branch to the cleanup section. Otherwise,
# look for a macro that doesn't take arguments.
cat >$ac_cs_root.defs <<\EOF
-changequote(<<, >>)dnl
-s%^[ ]*<<#>>[ ]*<<define>>[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g
+[s%^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)%-D\1=\2%g
t cleanup
-s%^[ ]*<<#>>[ ]*<<define>>[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)%-D\1=\2%g
+s%^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)%-D\1=\2%g
: cleanup
-s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
s%\[%\\&%g
s%\]%\\&%g
-s%\$%$$%g
-changequote([, ])dnl
+s%\$%$$%g]
EOF
# We use echo to avoid assuming a particular line-breaking character.
# The extra dot is to prevent the shell from consuming trailing
@@ -3675,10 +3664,8 @@
dnl Please, pay attention that this sed code depends a lot on the shape
dnl of the sed commands issued by AC_SUBST. So if you change one, change
dnl the other too.
-changequote(, )dnl
- sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' >\$ac_cs_root.subs <<\\CEOF
-changequote([, ])dnl
+[ sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' >\$ac_cs_root.subs <<\\CEOF]
dnl These here document variables are unquoted when configure runs
dnl but quoted when config.status runs, so variables are expanded once.
dnl Insert the sed substitutions of variables.
@@ -3712,8 +3699,8 @@
# speed up the sed processing (if there are no `@' at all, there
# is no need to browse any of the substitutions).
# These are the two extra sed commands mentioned above.
- (echo ':t
- /@@BKL@a-zA-Z_@BKR@@BKL@a-zA-Z_0-9@BKR@*@/!b' && cat $ac_cs_root.sfrag) >$ac_cs_root.s$ac_sed_frag
+ (echo [':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b'] && cat $ac_cs_root.sfrag) >$ac_cs_root.s$ac_sed_frag
if test -z "$ac_sed_cmds"; then
ac_sed_cmds="sed -f $ac_cs_root.s$ac_sed_frag"
else
@@ -3732,19 +3719,17 @@
EOF
cat >>$CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-changequote(, )dnl
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *:*) ac_file_in=`echo "$ac_file" | sed 's%[[^:]]*:%%'`
+ ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
# Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
-changequote([, ])dnl
+ ac_dir=`echo "$ac_file" | sed 's%/[[^/][^/]]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
dnl FIXME: should actually be mkinstalldirs (parents may have
@@ -3752,9 +3737,7 @@
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dir_suffix.
-changequote(, )dnl
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
-changequote([, ])dnl
+ ac_dots=`echo "$ac_dir_suffix" | sed 's%/[[^/]]*%../%g'`
else
ac_dir_suffix= ac_dots=
fi
@@ -3781,16 +3764,14 @@
configure_input="Generated automatically from `echo $ac_file_in |
sed 's%.*/%%'` by configure."
case "$ac_file" in
-changequote(, )dnl
- *[Mm]akefile*) ac_comsub="1i\\
-changequote([, ])dnl
+ *[[Mm]]akefile*) ac_comsub="1i\\
# $configure_input" ;;
*) ac_comsub= ;;
esac
# Don't redirect the output to AC_FILE directly: use `mv' so that updating
# is atomic, and doesn't need trapping.
- ac_file_inputs=`echo $ac_file_in |
+ ac_file_inputs=`echo "$ac_file_in" |
sed -e "s%^%$ac_given_srcdir/%;s%:% $ac_given_srcdir/%g"`
for ac_file_input in $ac_file_inputs;
do
@@ -3808,7 +3789,7 @@
EOF
cat >>$CONFIG_STATUS <<\EOF
:t
-/@@BKL@a-zA-Z_@BKR@@BKL@a-zA-Z_0-9@BKR@*@/!b
+[/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
s%@configure_input@%$configure_input%;t t
s%@srcdir@%$srcdir%;t t
s%@top_srcdir@%$top_srcdir%;t t
@@ -3905,19 +3886,17 @@
ac_uD='%;t']
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
-changequote(, )dnl
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *:*) ac_file_in=`echo "$ac_file" | sed 's%[[^:]]*:%%'`
+ ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
*) ac_file_in="${ac_file}.in" ;;
esac
-changequote([, ])dnl
echo creating $ac_file
rm -f $ac_cs_root.frag $ac_cs_root.in $ac_cs_root.out
- ac_file_inputs=`echo $ac_file_in |
+ ac_file_inputs=`echo "$ac_file_in" |
sed -e "s%^%$ac_given_srcdir/%;s%:% $ac_given_srcdir/%g"`
for ac_file_input in $ac_file_inputs;
do
@@ -3925,7 +3904,7 @@
AC_MSG_ERROR(cannot find input file `$ac_file_input')
done
# Remove the trailing spaces.
- sed -e 's/@BKL@ @BKR@*$//' $ac_file_inputs >$ac_cs_root.in
+ sed -e 's/[[ ]]*$//' $ac_file_inputs >$ac_cs_root.in
EOF
@@ -3954,16 +3933,15 @@
dnl Additionally, this works around a bug of IRIX' sed which does not
dnl clear the `t' flag between two cycles.
cat >$ac_cs_root.hdr <<\EOF
-changequote(<<, >>)dnl
-s/[\\&%]/\\&/g
+dnl Double quote for `[ ]' and `define'.
+[s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
t clear
: clear
-s%^[ ]*<<#>>[ ]*<<define>>[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${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
-changequote([, ])dnl
+s%^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+: cleanup]
EOF
# If some macros were called several times there might be several times
# the same #defines, which is useless. Nevertheless, we may not want to
@@ -3976,15 +3954,13 @@
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >>conftest.undefs <<\EOF
-changequote(, )dnl
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-changequote([, ])dnl
+[s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%]
EOF
# Break up conftest.defines because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo ' if egrep "^@BKL@ @BKR@*#@BKL@ @BKR@*define" $ac_cs_root.in >/dev/null; then' >>$CONFIG_STATUS
+echo ' if egrep ["^[ ]*#[ ]*define"] $ac_cs_root.in >/dev/null; then' >>$CONFIG_STATUS
echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
echo ' :' >>$CONFIG_STATUS
rm -f conftest.tail
@@ -3993,7 +3969,7 @@
# Write a limited-size here document to $ac_cs_root.frag.
echo ' cat >$ac_cs_root.frag <<CEOF' >>$CONFIG_STATUS
dnl Speed up: don't consider the non `#define' lines.
- echo '/^@BKL@ @BKR@*#@BKL@ @BKR@*define/!b' >>$CONFIG_STATUS
+ echo ['/^[ ]*#[ ]*define/!b'] >>$CONFIG_STATUS
sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
echo 'CEOF
sed -f $ac_cs_root.frag $ac_cs_root.in >$ac_cs_root.out
@@ -4017,7 +3993,7 @@
# Write a limited-size here document to $ac_cs_root.frag.
echo ' cat >$ac_cs_root.frag <<CEOF' >>$CONFIG_STATUS
dnl Speed up: don't consider the non `#undef'
- echo '/^@BKL@ @BKR@*#@BKL@ @BKR@*undef/!b' >>$CONFIG_STATUS
+ echo ['/^[ ]*#[ ]*undef/!b'] >>$CONFIG_STATUS
sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
echo 'CEOF
sed -f $ac_cs_root.frag $ac_cs_root.in >$ac_cs_root.out
@@ -4041,9 +4017,7 @@
rm -f $ac_cs_root.h
else
# Remove last slash and all that follows it. Not all systems have dirname.
- changequote(, )dnl
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- changequote([, ])dnl
+ ac_dir=`echo "$ac_file" | sed 's%/[[^/][^/]]*$%%'`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
dnl FIXME: should actually be mkinstalldirs (parents may have
@@ -4082,8 +4056,8 @@
dnl with empty parameters (as in gettext.m4), then we obtain here
dnl `:', which we want to skip. So let's keep a single exception: `:'.
for ac_file in : $CONFIG_LINKS; do if test "x$ac_file" != x:; then
- ac_dest=`echo "$ac_file"|sed 's%:.*%%'`
- ac_source=`echo "$ac_file"|sed 's%@BKL@^:@BKR@*:%%'`
+ ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
+ ac_source=`echo "$ac_file" | sed 's%[[^:]]*:%%'`
echo "linking $srcdir/$ac_source to $ac_dest"
@@ -4094,9 +4068,7 @@
# Make relative symlinks.
# Remove last slash and all that follows it. Not all systems have dirname.
-changequote(, )dnl
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
-changequote([, ])dnl
+ ac_dest_dir=`echo $ac_dest | sed 's%/[[^/][^/]]*$%%'`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
# The dest file is in a subdirectory.
dnl FIXME: should actually be mkinstalldirs (parents may have
@@ -4104,17 +4076,13 @@
test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
# A "../" for each directory in $ac_dest_dir_suffix.
-changequote(, )dnl
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
-changequote([, ])dnl
+ ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[[^/]]*%../%g'`
else
ac_dest_dir_suffix= ac_dots=
fi
case "$srcdir" in
-changequote(, )dnl
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
-changequote([, ])dnl
+ [[/$]]*) ac_rel_source="$srcdir/$ac_source" ;;
*) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
esac
@@ -4153,7 +4121,7 @@
#
for ac_file in .. $CONFIG_COMMANDS; do if test "x$ac_file" != x..; then
ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
- ac_source=`echo "$ac_file" | sed 's%@BKL@^:@BKR@*:%%'`
+ ac_source=`echo "$ac_file" | sed 's%[[^:]]*:%%'`
dnl FIXME: Until Automake uses the new features of config.status, we
dnl should keep this silent. Otherwise, because Automake runs this in
@@ -4229,10 +4197,9 @@
ac_popdir=`pwd`
cd $ac_config_dir
-changequote(, )dnl
# A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
-changequote([, ])dnl
+ ac_dots=`echo $ac_config_dir |
+ sed -e 's%^\./%%;s%[[^/]]$%&/%;s%[[^/]]*/%../%g'`
case "$srcdir" in
.) # No --srcdir option. We are building in place.