]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
The SunOS' egrep fails to process properly the `egrep' invocations
authorAkim Demaille <akim@epita.fr>
Wed, 6 Dec 2000 14:05:46 +0000 (14:05 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 6 Dec 2000 14:05:46 +0000 (14:05 +0000)
of the test suite.
* tests/aclocal.m4 (AC_STATE_SAVE): If egrep fails, remove the
output file.
* tests/atspecific.m4 (_AT_CHECK_AC_MACRO): Don't check `state-*'
if the files are not present.
* m4sugar.m4 (m4_join): Rename as...
(m4_smash): this.
* tests/aclocal.m4 (join): Move as...
* m4sugar.m4 (m4_flatten): this.
* autoconf.sh (trace.m4): Rename m4_smash as m4_flatten.

ChangeLog
acgeneral.m4
autoconf.in
autoconf.sh
bin/autoconf.in
lib/autoconf/general.m4
lib/m4sugar/m4sugar.m4
m4sugar.m4
tests/aclocal.m4
tests/atspecific.m4

index a689e5f5eded1a5aa751b8f001d5eb6bd9a02570..89c3a4e8c54034f074a2df608d2584a96bb3b938 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2000-12-06  Akim Demaille  <akim@epita.fr>
+
+       The SunOS' egrep fails to process properly the `egrep' invocations
+       of the test suite.
+
+       * tests/aclocal.m4 (AC_STATE_SAVE): If egrep fails, remove the
+       output file.
+       * tests/atspecific.m4 (_AT_CHECK_AC_MACRO): Don't check `state-*'
+       if the files are not present.
+
+       * m4sugar.m4 (m4_join): Rename as...
+       (m4_smash): this.
+       * tests/aclocal.m4 (join): Move as...
+       * m4sugar.m4 (m4_flatten): this.
+       * autoconf.sh (trace.m4): Rename m4_smash as m4_flatten.
+
 2000-12-06  Akim Demaille  <akim@epita.fr>
 
        * autoconf.sh (task trace): s/m4/$M4/.
index 2db9dce2b322af456e7d1a8703cf0532413ce4bb..8bcf5d1f9eee0eb3bc2b087ff4344d7bc99d875d 100644 (file)
@@ -511,7 +511,7 @@ m4_define([AC_TR_SH],
 #    ive  ], [-Var-])end
 #    => -active--b--active-end
 m4_define([AC_FOREACH],
-[m4_foreach([$1], m4_split(m4_strip(m4_join([$2]))), [$3])])
+[m4_foreach([$1], m4_split(m4_strip(m4_flatten([$2]))), [$3])])
 
 
 
index e5817e713f6237311875c8cc8f20148e41147bb5..4f8606b1920dd022268cbcdaeebdd072b52f263e 100644 (file)
@@ -434,7 +434,7 @@ EOF
   # MODE can be:
   #  `at'       -- the elements are enclosed in brackets.
   #  `star'     -- the elements are listed as are.
-  #  `percent'  -- the elements are `smashed': spaces are singled out,
+  #  `percent'  -- the elements are `flattened': spaces are singled out,
   #                and no new line remains.
   define([_at_at],
          [at_ifelse([$#], [1], [],
@@ -442,15 +442,15 @@ EOF
                     [[[$2]][$1]$0([$1], at_shift(at_shift($@)))])])
   define([_at_percent],
          [at_ifelse([$#], [1], [],
-                    [$#], [2], [at_smash([$2])],
-                    [at_smash([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
+                    [$#], [2], [at_flatten([$2])],
+                    [at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
   define([_at_star],
          [at_ifelse([$#], [1], [],
                     [$#], [2], [[$2]],
                     [[$2][$1]$0([$1], at_shift(at_shift($@)))])])
 
-  # Smash quotes its result.
-  define([at_smash],
+  # FLATTEN quotes its result.
+  define([at_flatten],
          [at_patsubst(at_patsubst(at_patsubst([[[$1]]],
                                               [\\
   ]),
@@ -535,7 +535,7 @@ EOF
     # $*, list of unquoted effective arguments.
     if (arg == "*")
       return "]at_star([" (separator ? separator : ",") "], $@)["
-    # $%, list of smashed unquoted effective arguments.
+    # $%, list of flattened unquoted effective arguments.
     if (arg == "%")
       return "]at_percent([" (separator ? separator : ":") "], $@)["
   }
index e5817e713f6237311875c8cc8f20148e41147bb5..4f8606b1920dd022268cbcdaeebdd072b52f263e 100644 (file)
@@ -434,7 +434,7 @@ EOF
   # MODE can be:
   #  `at'       -- the elements are enclosed in brackets.
   #  `star'     -- the elements are listed as are.
-  #  `percent'  -- the elements are `smashed': spaces are singled out,
+  #  `percent'  -- the elements are `flattened': spaces are singled out,
   #                and no new line remains.
   define([_at_at],
          [at_ifelse([$#], [1], [],
@@ -442,15 +442,15 @@ EOF
                     [[[$2]][$1]$0([$1], at_shift(at_shift($@)))])])
   define([_at_percent],
          [at_ifelse([$#], [1], [],
-                    [$#], [2], [at_smash([$2])],
-                    [at_smash([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
+                    [$#], [2], [at_flatten([$2])],
+                    [at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
   define([_at_star],
          [at_ifelse([$#], [1], [],
                     [$#], [2], [[$2]],
                     [[$2][$1]$0([$1], at_shift(at_shift($@)))])])
 
-  # Smash quotes its result.
-  define([at_smash],
+  # FLATTEN quotes its result.
+  define([at_flatten],
          [at_patsubst(at_patsubst(at_patsubst([[[$1]]],
                                               [\\
   ]),
@@ -535,7 +535,7 @@ EOF
     # $*, list of unquoted effective arguments.
     if (arg == "*")
       return "]at_star([" (separator ? separator : ",") "], $@)["
-    # $%, list of smashed unquoted effective arguments.
+    # $%, list of flattened unquoted effective arguments.
     if (arg == "%")
       return "]at_percent([" (separator ? separator : ":") "], $@)["
   }
index e5817e713f6237311875c8cc8f20148e41147bb5..4f8606b1920dd022268cbcdaeebdd072b52f263e 100644 (file)
@@ -434,7 +434,7 @@ EOF
   # MODE can be:
   #  `at'       -- the elements are enclosed in brackets.
   #  `star'     -- the elements are listed as are.
-  #  `percent'  -- the elements are `smashed': spaces are singled out,
+  #  `percent'  -- the elements are `flattened': spaces are singled out,
   #                and no new line remains.
   define([_at_at],
          [at_ifelse([$#], [1], [],
@@ -442,15 +442,15 @@ EOF
                     [[[$2]][$1]$0([$1], at_shift(at_shift($@)))])])
   define([_at_percent],
          [at_ifelse([$#], [1], [],
-                    [$#], [2], [at_smash([$2])],
-                    [at_smash([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
+                    [$#], [2], [at_flatten([$2])],
+                    [at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])])
   define([_at_star],
          [at_ifelse([$#], [1], [],
                     [$#], [2], [[$2]],
                     [[$2][$1]$0([$1], at_shift(at_shift($@)))])])
 
-  # Smash quotes its result.
-  define([at_smash],
+  # FLATTEN quotes its result.
+  define([at_flatten],
          [at_patsubst(at_patsubst(at_patsubst([[[$1]]],
                                               [\\
   ]),
@@ -535,7 +535,7 @@ EOF
     # $*, list of unquoted effective arguments.
     if (arg == "*")
       return "]at_star([" (separator ? separator : ",") "], $@)["
-    # $%, list of smashed unquoted effective arguments.
+    # $%, list of flattened unquoted effective arguments.
     if (arg == "%")
       return "]at_percent([" (separator ? separator : ":") "], $@)["
   }
index 2db9dce2b322af456e7d1a8703cf0532413ce4bb..8bcf5d1f9eee0eb3bc2b087ff4344d7bc99d875d 100644 (file)
@@ -511,7 +511,7 @@ m4_define([AC_TR_SH],
 #    ive  ], [-Var-])end
 #    => -active--b--active-end
 m4_define([AC_FOREACH],
-[m4_foreach([$1], m4_split(m4_strip(m4_join([$2]))), [$3])])
+[m4_foreach([$1], m4_split(m4_strip(m4_flatten([$2]))), [$3])])
 
 
 
index 1622e3086ace82ef5e3f6d8874833b360fe1ebb9..4c65460adb30bd5f5cc9f3b9c09bc0443d8e2126 100644 (file)
@@ -1333,17 +1333,17 @@ m4_changequote([, ])
 
 
 
-# m4_join(STRING)
-# ---------------
+# m4_flatten(STRING)
+# ------------------
 # If STRING contains end of lines, replace them with spaces.  If there
 # are backslashed end of lines, remove them.  This macro is safe with
 # active symbols.
 #    m4_define(active, ACTIVE)
-#    m4_join([active
+#    m4_flatten([active
 #    act\
 #    ive])end
 #    => active activeend
-m4_define([m4_join],
+m4_define([m4_flatten],
 [m4_translit(m4_patsubst([[[$1]]], [\\
 ]), [
 ], [ ])])
@@ -1378,6 +1378,17 @@ m4_define([m4_strip],
 
 
 
+# m4_join(SEP, ARG1, ARG2...)
+# ---------------------------
+# Produce ARG1SEPARG2...SEPARGn.
+m4_defun([m4_join],
+[m4_case([$#],
+         [1], [],
+         [2], [[$2]],
+         [[$2][$1]m4_join([$1], m4_shift(m4_shift($@)))])])
+
+
+
 # m4_append(MACRO-NAME, STRING)
 # -----------------------------
 # Redefine MACRO-NAME to hold its former content plus STRING at the
@@ -1484,7 +1495,7 @@ m4_Prefix1[]dnl
 m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
       1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
 m4_Prefix])[]dnl
-m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_join([$1])))),
+m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_flatten([$1])))),
 [m4_define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl
 dnl New line if too long, else insert a space unless it is the first
 dnl of the words.
index 1622e3086ace82ef5e3f6d8874833b360fe1ebb9..4c65460adb30bd5f5cc9f3b9c09bc0443d8e2126 100644 (file)
@@ -1333,17 +1333,17 @@ m4_changequote([, ])
 
 
 
-# m4_join(STRING)
-# ---------------
+# m4_flatten(STRING)
+# ------------------
 # If STRING contains end of lines, replace them with spaces.  If there
 # are backslashed end of lines, remove them.  This macro is safe with
 # active symbols.
 #    m4_define(active, ACTIVE)
-#    m4_join([active
+#    m4_flatten([active
 #    act\
 #    ive])end
 #    => active activeend
-m4_define([m4_join],
+m4_define([m4_flatten],
 [m4_translit(m4_patsubst([[[$1]]], [\\
 ]), [
 ], [ ])])
@@ -1378,6 +1378,17 @@ m4_define([m4_strip],
 
 
 
+# m4_join(SEP, ARG1, ARG2...)
+# ---------------------------
+# Produce ARG1SEPARG2...SEPARGn.
+m4_defun([m4_join],
+[m4_case([$#],
+         [1], [],
+         [2], [[$2]],
+         [[$2][$1]m4_join([$1], m4_shift(m4_shift($@)))])])
+
+
+
 # m4_append(MACRO-NAME, STRING)
 # -----------------------------
 # Redefine MACRO-NAME to hold its former content plus STRING at the
@@ -1484,7 +1495,7 @@ m4_Prefix1[]dnl
 m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)),
       1, [m4_define([m4_Cursor], m4_len(m4_Prefix))
 m4_Prefix])[]dnl
-m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_join([$1])))),
+m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_flatten([$1])))),
 [m4_define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl
 dnl New line if too long, else insert a space unless it is the first
 dnl of the words.
index c4087ce85e22db86d0f7f2de24b7537d9f62a046..c27fcc7dc73d45cc04bd10c81709fbff3921d400 100644 (file)
@@ -1,16 +1,6 @@
 # actest.m4                                              -*- autoconf -*-
 # Additional Autoconf macros to ease testing.
 
-# join(SEP, ARG1, ARG2...)
-# ------------------------
-# Produce ARG1SEPARG2...SEPARGn.
-define([join],
-[m4_case([$#],
-         [1], [],
-         [2], [[$2]],
-         [[$2][$1]join([$1], m4_shift(m4_shift($@)))])])
-
-
 # AC_STATE_SAVE(FILE)
 # ------------------
 # Save the environment, but the variables we are allowed to touch.
@@ -28,10 +18,9 @@ define([join],
 #   Some variables some shells use and change
 # - POW_LIB
 #   From acfunctions.m4.
-AC_DEFUN([AC_STATE_SAVE],
+m4_defun([AC_STATE_SAVE],
 [(set) 2>&1 |
-  egrep -v -e \
-'join([|],
+  egrep -v -e 'm4_join([|],
       [^ac_],
       [^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=],
       [^(LIBS|LIBOBJS|LDFLAGS)=],
@@ -46,11 +35,14 @@ AC_DEFUN([AC_STATE_SAVE],
       [^(AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC)=],
       [^(_|@|.[*#?].|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS)=])' |
   # There maybe variables spread on several lines, eg IFS, remove the dead
-  # lines
+  # lines.
   fgrep = >state-env.$1
-  rm -f state-ls.$1
-  ls -1 | grep -v '^state' | sort > state-ls.$1
-])
+# Some `egrep' choke on such a big regex (e.g., SunOS 4.1.3).  In this
+# case just don't pay attention to the env.
+test $? = 0 || rm -f state-env.$1
+
+ls -1 | grep -v '^state' | sort >state-ls.$1
+])# AC_STATE_SAVE
 
 
 
@@ -58,7 +50,7 @@ AC_DEFUN([AC_STATE_SAVE],
 # ----------------
 # Related VALUE to NAME both with AC_SUBST and AC_DEFINE.  This is
 # used in the torture tests.
-AC_DEFUN([AC_DEFUBST],
+m4_defun([AC_DEFUBST],
 [AC_DUMMY_VAR($1)="AC_DEFUBST_VALUE"
 AC_DEFINE_UNQUOTED(AC_DUMMY_VAR($1),
                    "$AC_DUMMY_VAR($1)",
index ccba2dad685943538a3e0068b16518a77ce03563..d9545faf21b4ae6da3e88ba893daff9761fbe9c3 100644 (file)
@@ -72,9 +72,11 @@ AT_CHECK_CONFIGURE
 
 dnl Some tests might exit prematurely when they find a problem, in
 dnl which case `env-after' is probably missing.  Don't check it then.
-if test -f state-env.after; then
+if test -f state-env.before -a -f state-env.after; then
   mv -f state-env.before expout
   AT_CHECK([cat state-env.after], 0, expout)
+fi
+if test -f state-ls.before -a -f state-ls.after; then
   mv -f state-ls.before expout
   AT_CHECK([cat state-ls.after], 0, expout)
 fi