]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
bug fixes for quoting and locales
authorDavid MacKenzie <djm@djmnet.org>
Wed, 20 Nov 1996 19:13:42 +0000 (19:13 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Wed, 20 Nov 1996 19:13:42 +0000 (19:13 +0000)
ChangeLog
TODO
acgeneral.m4
autoconf.in
autoconf.sh
autoheader.in
autoheader.sh
bin/autoconf.in
bin/autoheader.in
configure
lib/autoconf/general.m4

index 0127449a85afd2db6860132dec2fad8b9cc3e293..a732e5b62308eea7d91fc0ea7ca00ad8c769cca4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Wed Nov 20 13:00:21 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
+
+       * acgeneral.m4 (AC_TRY_LIB): Remove an erroneous dnl.
+       (AC_TRY_COMPILE): Make the final newline consistent with the
+       other AC_TRY_* macros.
+       
+       * acgeneral.m4 (AC_CACHE_SAVE): Handle cache variable values
+       correctly even if they contain single quote, or are quoted by
+       the shell.  From Paul Eggert <eggert@twinsun.com>.
+       (AC_INIT_PREPARE): Set LC_MESSAGES to C if set.
+       From Hans Olsson <Hans.Olsson@dna.lth.se>.
+       Set LC_CTYPE to C if set.
+       From tom@vlsivie.tuwien.ac.AT (Thomas Winder).
+       * autoconf.sh, autoheader.sh: Likewise set LC_MESSAGES and LC_CTYPE.
+
 Tue Nov 19 10:29:06 1996  David J MacKenzie  <djm@catapult.va.pubnix.com>
 
        * testsuite/autoconf.g/sizeof.exp: Use the v2 macro name.
diff --git a/TODO b/TODO
index 01f29b795e25e18c9575329c2297d92ea672f71d..4a15fdd13c6e87a7d76eacb957601294aa6ef429 100644 (file)
--- a/TODO
+++ b/TODO
@@ -291,17 +291,6 @@ Make easy macros for checking for X functions and libraries, such as Motif.
 
 ------------------------------------------------------------------------------
 
-Testing for ANSI header files (AC_HEADER_STDC) fails under linux when
-using the latest libraries (libc-4.6.30, at least libc-4.6.27 works
-ok) when LC_CTYPE is set to ISO-8859-1. The islower/toupper test
-reports errors.
-Anyway, adding a line like 
-if test "${LC_CTYPE+set}"   = set; then LC_CTYPE=C;   export LC_CTYPE;   fi
-to the configure script can solve the problem.
-From: tom@vlsivie.tuwien.ac.AT (Thomas Winder)
-
-------------------------------------------------------------------------------
-
 * Test suite: more things to test:
 ** That the shell scripts produce correct output on some simple data.
 ** Configuration header files.  That autoheader does the right thing,
@@ -537,18 +526,6 @@ Merge the two lex macros, AC_PROG_LEX and AC_DECL_YYTEXT?
 
 ------------------------------------------------------------------------------
 
-Modify the meaning of autoheader --localdir to add an additional
-directory to look for acconfig.h instead of replacing the directory
-containing configure.in.  Also, autoreconf recurses on all
-subdirectories containing a configure.in, not just those given by an
-AC_CONFIG_SUBDIRS directive, so you can't have both directories that
-are parts of a large package, and directories that are independent
-packages.
-
-Marc Horowitz <marc@MIT.EDU>
-
-------------------------------------------------------------------------------
-
 in order to use the AC_CANONICAL_SYSTEM macro, I have to
 have install-sh somewhere nearby --- why is this?  I have no real
 reason to distribute install-sh, other than that its absence breaks
@@ -571,3 +548,32 @@ die if the compiler seemed to succeed--in which case it's not usable
 with autoconf scripts.
 
 ------------------------------------------------------------------------------
+
+there is absolutely no guarantee that 'a' to 'z' are
+contiguous, and the ISLOWER macro is not guaranteed to correctly
+reproduce the result of islower. In all variants of ASCII however, it
+will work correctly in the C locale.
+
+There is also no guarantee that toupper(i) - i is the same constant if
+non-zero. TOUPPER, hence, is not correct either. But, in all variants
+of ASCII in the C locale, it works.
+
+Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov>
+
+------------------------------------------------------------------------------
+
+Modify the meaning of autoheader --localdir to add an additional
+directory to look for acconfig.h instead of replacing the directory
+containing configure.in.  You can't have both directories that are
+parts of a large package, and directories that are independent
+packages.  (Also, autoreconf recurses on all subdirectories containing
+a configure.in, not just those given by an AC_CONFIG_SUBDIRS
+directive.)
+
+Marc Horowitz <marc@MIT.EDU>
+
+------------------------------------------------------------------------------
+
+Rewrite AC_OUTPUT_COMMANDS to use diversions.
+
+------------------------------------------------------------------------------
index e9db16ff2e446c5c53255ebc563212bd59bffce8..4fd7d8ce1d9db689589948cd185bfe05abe82d67 100644 (file)
@@ -633,11 +633,14 @@ changequote([, ])dnl
 done
 
 # NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -rf conftest* confdefs.h
@@ -1049,14 +1052,27 @@ define(AC_CACHE_SAVE,
 # --recheck option to rerun configure.
 #
 EOF
-changequote(, )dnl
 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.
-# HP-UX 10.01 sh prints single quotes around any value that contains spaces.
+changequote(, )dnl
 (set) 2>&1 |
-sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)='*\([^']*\)'*/\1=\${\1='\2'}/p"\
-  >> confcache
+  case `(ac_space=' '; set) 2>&1` in
+  *ac_space=\ *)
+    # `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=\${\1='\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    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
   :
@@ -1476,7 +1492,7 @@ char $2();
 ]),
            [$2()],
            eval "ac_cv_lib_$ac_lib_var=yes",
-           eval "ac_cv_lib_$ac_lib_var=no")dnl
+           eval "ac_cv_lib_$ac_lib_var=no")
 LIBS="$ac_save_LIBS"
 ])dnl
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
@@ -1618,8 +1634,7 @@ ifelse([$4], , , [  rm -rf conftest*
   $4
 ])dnl
 fi
-rm -f conftest*]
-)
+rm -f conftest*])
 
 
 dnl ### Examining libraries
index ee64ca5d1e7c742cc0408f814b2f6a185d2c4552..4e667b93cc20c9d9286f624d5dd80d89e7215367 100644 (file)
@@ -26,11 +26,14 @@ Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
        [-l dir] [--localdir=dir] [--version] [template-file]"
 
 # NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 : ${AC_MACRODIR=@datadir@}
 : ${M4=@M4@}
index ee64ca5d1e7c742cc0408f814b2f6a185d2c4552..4e667b93cc20c9d9286f624d5dd80d89e7215367 100644 (file)
@@ -26,11 +26,14 @@ Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
        [-l dir] [--localdir=dir] [--version] [template-file]"
 
 # NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 : ${AC_MACRODIR=@datadir@}
 : ${M4=@M4@}
index 707195dd87649c31d2f2d0d434a329abd2d34b3d..92f9d63c853ef06937a86633407c629bd34ea1bd 100644 (file)
@@ -28,11 +28,14 @@ Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir]
        [-l dir] [--localdir=dir] [--version] [template-file]"
 
 # NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
 test -z "${M4}" && M4=@M4@
index 707195dd87649c31d2f2d0d434a329abd2d34b3d..92f9d63c853ef06937a86633407c629bd34ea1bd 100644 (file)
@@ -28,11 +28,14 @@ Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir]
        [-l dir] [--localdir=dir] [--version] [template-file]"
 
 # NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
 test -z "${M4}" && M4=@M4@
index ee64ca5d1e7c742cc0408f814b2f6a185d2c4552..4e667b93cc20c9d9286f624d5dd80d89e7215367 100644 (file)
@@ -26,11 +26,14 @@ Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
        [-l dir] [--localdir=dir] [--version] [template-file]"
 
 # NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 : ${AC_MACRODIR=@datadir@}
 : ${M4=@M4@}
index 707195dd87649c31d2f2d0d434a329abd2d34b3d..92f9d63c853ef06937a86633407c629bd34ea1bd 100644 (file)
@@ -28,11 +28,14 @@ Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir]
        [-l dir] [--localdir=dir] [--version] [template-file]"
 
 # NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
 test -z "${M4}" && M4=@M4@
index 79ef1dd90ae3a691bd4fb2c9ad79d86a731d0ecf..a3f877babf21a12f93076ada77ab04deb63917c4 100755 (executable)
--- a/configure
+++ b/configure
@@ -434,11 +434,14 @@ do
 done
 
 # NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -rf conftest* confdefs.h
@@ -747,12 +750,25 @@ cat > confcache <<\EOF
 # --recheck option to rerun configure.
 #
 EOF
+# 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.
-# HP-UX 10.01 sh prints single quotes around any value that contains spaces.
 (set) 2>&1 |
-sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)='*\([^']*\)'*/\1=\${\1='\2'}/p"\
-  >> confcache
+  case `(ac_space=' '; set) 2>&1` in
+  *ac_space=\ *)
+    # `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=\${\1='\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1=\2}/p'
+    ;;
+  esac >> confcache
 if cmp -s $cache_file confcache; then
   :
 else
index e9db16ff2e446c5c53255ebc563212bd59bffce8..4fd7d8ce1d9db689589948cd185bfe05abe82d67 100644 (file)
@@ -633,11 +633,14 @@ changequote([, ])dnl
 done
 
 # NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -rf conftest* confdefs.h
@@ -1049,14 +1052,27 @@ define(AC_CACHE_SAVE,
 # --recheck option to rerun configure.
 #
 EOF
-changequote(, )dnl
 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.
-# HP-UX 10.01 sh prints single quotes around any value that contains spaces.
+changequote(, )dnl
 (set) 2>&1 |
-sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)='*\([^']*\)'*/\1=\${\1='\2'}/p"\
-  >> confcache
+  case `(ac_space=' '; set) 2>&1` in
+  *ac_space=\ *)
+    # `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=\${\1='\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    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
   :
@@ -1476,7 +1492,7 @@ char $2();
 ]),
            [$2()],
            eval "ac_cv_lib_$ac_lib_var=yes",
-           eval "ac_cv_lib_$ac_lib_var=no")dnl
+           eval "ac_cv_lib_$ac_lib_var=no")
 LIBS="$ac_save_LIBS"
 ])dnl
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
@@ -1618,8 +1634,7 @@ ifelse([$4], , , [  rm -rf conftest*
   $4
 ])dnl
 fi
-rm -f conftest*]
-)
+rm -f conftest*])
 
 
 dnl ### Examining libraries