bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

do not grep config.status internals


From: Ralf Wildenhues
Subject: do not grep config.status internals
Date: Sat, 16 Dec 2006 16:35:38 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

[ Cc:ing the autoconf list FYI ]

The literal contents of config.status are an internal detail of Autoconf
and subject to change.  If you want to know the value of a certain
substituted variable, then what you do is you add a config file or turn
one of your files into one, and @substitute@ it in there, and use the
substituted file, just like is already done in hundred other places in a
typical package that uses Autoconf.

YOU DON'T grep config.status!  That NEVER worked reliably, and that was
NEVER documented.  (You wouldn't have guessed that putting a variable
value inside a sed script's "s" command needed escaping of at least
special characters like the backslash or the command delimiter, right?)

Autoconf 2.60 "broke" that in one way (that happened to not affect
gettext).  Autoconf 2.62 _will_ "break" it again in a different way if
you do not obey this rule.  And it's really really simple to play by the
rule in the first place, in a way portable to Autoconf 1.0 from 14 years
ago, and to 2.62 and all intermediates and future versions, just how the
Autoconf manual documents.

Here's an example from the gettext package.  Hope that helps.
Sorry for the screaming, that was not intended for the gettext audience.

gettext-tools/ChangeLog:
2006-12-16  Ralf Wildenhues  <address@hidden>

        * configure.ac: New config file tests/defs.

gettext-tools/tests/ChangeLog:
2006-12-16  Ralf Wildenhues  <address@hidden>

        * defs.in: New file.
        * gettext-3: Source it to learn about $GLIBC2.  Fixes false SKIP
        of the test on glibc systems with Autoconf > 2.61.
        * gettext-5: Likewise.
        * gettext-6: Likewise.
        * gettext-7: Likewise.

--- /dev/null   2006-12-12 01:34:08.640403500 +0100
+++ gettext-tools/tests/defs.in 2006-12-16 16:30:50.000000000 +0100
@@ -0,0 +1 @@
address@hidden@
Index: gettext-tools/configure.ac
===================================================================
RCS file: /cvsroot/gettext/gettext/gettext-tools/configure.ac,v
retrieving revision 1.87
diff -u -r1.87 configure.ac
--- gettext-tools/configure.ac  12 Dec 2006 14:12:18 -0000      1.87
+++ gettext-tools/configure.ac  16 Dec 2006 15:32:32 -0000
@@ -371,5 +371,6 @@
 
 AC_CONFIG_FILES([tests/Makefile],
                 [FIX_MAKEFILE_COMPILE])
+AC_CONFIG_FILES([tests/defs])
 
 AC_OUTPUT
Index: gettext-tools/tests/gettext-3
===================================================================
RCS file: /cvsroot/gettext/gettext/gettext-tools/tests/gettext-3,v
retrieving revision 1.2
diff -u -r1.2 gettext-3
--- gettext-tools/tests/gettext-3       9 Jun 2006 20:22:17 -0000       1.2
+++ gettext-tools/tests/gettext-3       16 Dec 2006 15:32:39 -0000
@@ -6,8 +6,10 @@
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
+. ./defs
+
 # This test works only on glibc systems.
-grep '@address@hidden' ../config.status >/dev/null || {
+test "$GLIBC2" = yes || {
   echo "Skipping test: not a glibc system"
   exit 77
 }
Index: gettext-tools/tests/gettext-5
===================================================================
RCS file: /cvsroot/gettext/gettext/gettext-tools/tests/gettext-5,v
retrieving revision 1.2
diff -u -r1.2 gettext-5
--- gettext-tools/tests/gettext-5       9 Jun 2006 20:22:17 -0000       1.2
+++ gettext-tools/tests/gettext-5       16 Dec 2006 15:32:39 -0000
@@ -6,8 +6,10 @@
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
+. ./defs
+
 # This test works only on glibc systems.
-grep '@address@hidden' ../config.status >/dev/null || {
+test "$GLIBC2" = yes || {
   echo "Skipping test: not a glibc system"
   exit 77
 }
Index: gettext-tools/tests/gettext-6
===================================================================
RCS file: /cvsroot/gettext/gettext/gettext-tools/tests/gettext-6,v
retrieving revision 1.3
diff -u -r1.3 gettext-6
--- gettext-tools/tests/gettext-6       21 Jul 2006 12:23:33 -0000      1.3
+++ gettext-tools/tests/gettext-6       16 Dec 2006 15:32:39 -0000
@@ -7,8 +7,10 @@
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
+. ./defs
+
 # This test works only on glibc systems.
-grep '@address@hidden' ../config.status >/dev/null || {
+test "$GLIBC2" = yes || {
   echo "Skipping test: not a glibc system"
   exit 77
 }
Index: gettext-tools/tests/gettext-7
===================================================================
RCS file: /cvsroot/gettext/gettext/gettext-tools/tests/gettext-7,v
retrieving revision 1.3
diff -u -r1.3 gettext-7
--- gettext-tools/tests/gettext-7       21 Jul 2006 12:23:33 -0000      1.3
+++ gettext-tools/tests/gettext-7       16 Dec 2006 15:32:39 -0000
@@ -7,8 +7,10 @@
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
+. ./defs
+
 # This test works only on glibc systems.
-grep '@address@hidden' ../config.status >/dev/null || {
+test "$GLIBC2" = yes || {
   echo "Skipping test: not a glibc system"
   exit 77
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]