[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
char-ranges.patch
From: |
Akim Demaille |
Subject: |
char-ranges.patch |
Date: |
23 Oct 2000 21:55:33 +0200 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
There are still some character ranges left, but that's a start. My
distcheck is running, and up to test 150, everything is OK :)
Akim
Index: ChangeLog
from Akim Demaille <address@hidden>
Start avoiding dependence upon character ranges.
* acgeneral.m4 (_AC_INIT_DEFAULTS): Introduce `ac_cr_AZ',
`ac_cr_az', `ac_cr_09', `ac_cr_alnum' and `ac_hostname'.
Spread their use.
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.586
diff -u -r1.586 acgeneral.m4
--- acgeneral.m4 2000/10/23 19:13:37 1.586
+++ acgeneral.m4 2000/10/23 19:46:55
@@ -1270,13 +1270,26 @@
subdirs=
MFLAGS= MAKEFLAGS=
AC_SUBST(SHELL, ${CONFIG_SHELL-/bin/sh})dnl
+
# Maximum number of lines to put in a shell here document.
# This variable seems obsolete. It should probably be removed, and
# only ac_max_sed_lines should be used.
: ${ac_max_here_lines=38}
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too. Use two double quotes for font-lock.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+# Avoid depending upon Character Ranges.
+ac_cr_az='abcdefghijklmnopqrstuvwxyz'
+ac_cr_AZ='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ac_cr_09='0123456789'
+ac_cr_alnum=$ac_cr_az$ac_cr_AZ$ac_cr_09
+
# Sed expression to map a string onto a valid sh and CPP variable names.
-ac_tr_sh='sed y%*+%pp%;s%[[^a-zA-Z0-9_]]%_%g'
-ac_tr_cpp='sed
y%*abcdefghijklmnopqrstuvwxyz%PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[[^A-Z0-9_]]%_%g'
+ac_tr_sh="sed y%*+%pp%;s%[[^_$ac_cr_alnum]]%_%g"
+ac_tr_cpp="sed y%*$ac_cr_az%P$ac_cr_AZ%;s%[[^_$ac_cr_alnum]]%_%g"
# By default always use an empty string as the executable extension.
# Only change it if the script calls AC_EXEEXT.
@@ -1453,7 +1466,7 @@
-disable-* | --disable-*)
ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : "[.*[^-a-zA-Z0-9_]]" >/dev/null &&
+ expr "x$ac_feature" : "[.*[^-_$ac_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid feature name: $ac_feature])
ac_feature=`echo $ac_feature | sed 's/-/_/g'`
eval "enable_$ac_feature=no" ;;
@@ -1461,7 +1474,7 @@
-enable-* | --enable-*)
ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : "[.*[^-a-zA-Z0-9_]]" >/dev/null &&
+ expr "x$ac_feature" : "[.*[^-_$ac_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid feature name: $ac_feature])
ac_feature=`echo $ac_feature | sed 's/-/_/g'`
case $ac_option in
@@ -1642,7 +1655,7 @@
-with-* | --with-*)
ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : "[.*[^-a-zA-Z0-9_]]" >/dev/null &&
+ expr "x$ac_package" : "[.*[^-_$ac_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid package name: $ac_package])
ac_package=`echo $ac_package| sed 's/-/_/g'`
case $ac_option in
@@ -1654,7 +1667,7 @@
-without-* | --without-*)
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : "[.*[^-a-zA-Z0-9_]]" >/dev/null &&
+ expr "x$ac_package" : "[.*[^-_$ac_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid package name: $ac_package])
ac_package=`echo $ac_package | sed 's/-/_/g'`
eval "with_$ac_package=no" ;;
@@ -1684,7 +1697,7 @@
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
# Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : "[.*[^a-zA-Z0-9_]]" >/dev/null &&
+ expr "x$ac_envvar" : "[.*[^_$ac_cr_alnum]]" >/dev/null &&
AC_MSG_ERROR([invalid variable name: $ac_envvar])
ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
eval "$ac_envvar='$ac_optarg'"
@@ -1693,7 +1706,7 @@
*)
# FIXME: should be removed in autoconf 3.0.
AC_MSG_WARN([you should use --build, --host, --target])
- expr "x$ac_option" : "[.*[^a-zA-Z0-9.]]" >/dev/null &&
+ expr "x$ac_option" : "[.*[^.$ac_cr_alnum]]" >/dev/null &&
AC_MSG_WARN([invalid host type: $ac_option])
: ${build_alias=$ac_option} ${host_alias=$ac_option}
${target_alias=$ac_option}
;;
@@ -2518,15 +2531,16 @@
(set) 2>&1 |
case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
substitution
- # turns \\\\ into \\, and sed turns \\ into \).
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
- -e "s/'/'\\\\''/g" \
- -e ["s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1='\\2'/p"]
+ ["s/'/'\\\\''/g \
+ s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"]
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n '[s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\2/p]'
+ sed -n \
+ ["s/^\\([_$ac_cr_alnum]*_cv_[_$ac_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"]
;;
esac;
}dnl
@@ -3241,11 +3255,11 @@
# No big loss, I think, since most configures don't use this macro anyway.
AC_DEFUN([AC_PREFIX_PROGRAM],
[dnl Get an upper case version of $[1].
-pushdef(AC_Prog, translit($1, a-z, A-Z))dnl
+pushdef([AC_Prog], translit([$1], [a-z], [A-Z]))dnl
if test "x$prefix" = xNONE; then
dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
echo $ECHO_N "checking for prefix by $ECHO_C" >&AC_FD_MSG
-AC_PATH_PROG(AC_Prog, $1)
+AC_PATH_PROG(AC_Prog, [$1])
if test -n "$ac_cv_path_[]AC_Prog"; then
prefix=`echo $ac_cv_path_[]AC_Prog | [sed 's,/[^/][^/]*//*[^/][^/]*$,,']`
fi
@@ -4557,12 +4571,10 @@
Report bugs to <address@hidden>."
EOF
-dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-dnl so uname gets run too. Use two double quotes for font-lock.
cat >>$CONFIG_STATUS <<EOF
ac_cs_version="\\
$CONFIG_STATUS generated by autoconf version AC_ACVERSION.
-Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by
+Configured on host $ac_hostname by
`echo "[$]0 $ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`"
ac_given_srcdir=$srcdir