]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Multiple `-e' to egrep are not portable. On IRIX 6.5 and Solaris
authorAkim Demaille <akim@epita.fr>
Fri, 10 Mar 2000 15:22:13 +0000 (15:22 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 10 Mar 2000 15:22:13 +0000 (15:22 +0000)
2.5.1 only the last one is honored:
  > echo "foonbar" | egrep -e 'foo' -e 'bar'
  bar
  > echo "foonbar" | egrep -e 'bar' -e 'foo'
  foo
Reported by Nicolas Joly.
An alternative would have to use `sed', unfortunately alternation
is not portable.

* tests/actest.m4 (join): New macro.
(AC_ENV_SAVE): Join the egrep patterns into a single big one.
* tests/Makefile.am (EGREP_EXCLUDE): Rename as FILTER_MACROS.
Join the egrep patterns into a single big one.

ChangeLog
m4/Makefile.in
man/Makefile.in
tests/Makefile.am
tests/Makefile.in
tests/actest.m4

index 68a01f77bc058295ed48eda5f47302335b30be9c..5b7c844b727c9e70ee40253aba765ac7d5301f15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2000-03-10  Akim Demaille  <akim@epita.fr>
+
+       Multiple `-e' to egrep are not portable.  On IRIX 6.5 and Solaris
+       2.5.1 only the last one is honored:
+         > echo "foo\nbar" | egrep -e 'foo' -e 'bar'
+         bar
+         > echo "foo\nbar" | egrep -e 'bar' -e 'foo'
+         foo
+       Reported by Nicolas Joly.
+       An alternative would have to use `sed', unfortunately alternation
+       is not portable.
+
+       * tests/actest.m4 (join): New macro.
+       (AC_ENV_SAVE): Join the egrep patterns into a single big one.
+       * tests/Makefile.am (EGREP_EXCLUDE): Rename as FILTER_MACROS.
+       Join the egrep patterns into a single big one.
+
 2000-03-10  Jim Meyering  <meyering@lucent.com>
 
        * acgeneral.m4 (_AC_CHECK_TOOL_PREFIX): Correct typos in definition:
index c7758a1c22fc199955440d977ca1fa6f4ac4b050..6f1d1215965b355ebce86a434f5a4d84810da7fd 100644 (file)
@@ -57,15 +57,11 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-AT_TESTPATH = @AT_TESTPATH@
 AWK = @AWK@
 HELP2MAN = @HELP2MAN@
 M4 = @M4@
-MAKEINFO = @MAKEINFO@
-PACKAGE = @PACKAGE@
 PERL = @PERL@
 PERLSCRIPTS = @PERLSCRIPTS@
-VERSION = @VERSION@
 standards_texi = @standards_texi@
 
 EXTRA_DIST = init.m4 missing.m4 sanity.m4 atconfig.m4
@@ -74,6 +70,9 @@ CONFIG_CLEAN_FILES =
 DIST_COMMON =  Makefile.am Makefile.in
 
 
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
 TAR = tar
index cf08485c750c991bf17d71f9cd6a6b86aee16456..f15168deb0f95301c40014f6f8cf1af503c0422c 100644 (file)
@@ -57,15 +57,11 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-AT_TESTPATH = @AT_TESTPATH@
 AWK = @AWK@
 HELP2MAN = @HELP2MAN@
 M4 = @M4@
-MAKEINFO = @MAKEINFO@
-PACKAGE = @PACKAGE@
 PERL = @PERL@
 PERLSCRIPTS = @PERLSCRIPTS@
-VERSION = @VERSION@
 standards_texi = @standards_texi@
 
 man_MANS = autoconf.1 autoreconf.1 autoheader.1 autoupdate.1 ifnames.1 autoscan.1
@@ -87,6 +83,9 @@ NROFF = nroff
 DIST_COMMON =  Makefile.am Makefile.in
 
 
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
 TAR = tar
index 6392fc707d80f28bd49c8a87c4d543295e6a2e0e..7646950eadf1f760ce3b8410ea1a43b7738e43be 100644 (file)
@@ -40,7 +40,7 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 macros.m4 $(SUITE)
 
 
 
-# EGREP_EXCLUDE
+# FILTER_MACROS
 # -------------
 # The test `syntax.m4' tries to run all the macros of Autoconf to check
 # for syntax problems, etc.  Not all the macros can be run without argument,
@@ -63,25 +63,28 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 macros.m4 $(SUITE)
 #   Used in many places.
 # - _AC_
 #   Internal macros are used elsewhere.
-EGREP_EXCLUDE = egrep -v \
-  -e '^AC_ARG_VAR$$' \
-  -e '^AC_CHECK_(DECL|FILE|FUNC|HEADER|MEMBER|PROG|SIZEOF|TYPE)S?$$' \
-  -e '^AC_CONFIG' \
-  -e '^AC_INIT' \
-  -e '^AC_LINKER_OPTION$$' \
-  -e '^AC_LINK_FILES$$' \
-  -e '^AC_LIST_MEMBER_OF$$' \
-  -e '^AC_PATH_(TOOL|PROG)S?$$' \
-  -e '^AC_PROG_(CC|CXX|F77)_(GNU|WORKS)$$' \
-  -e '^AC_REPLACE_FUNCS$$' \
-  -e '^AC_SEARCH_LIBS$$' \
-  -e '^AC_TRY' \
-  -e '_AC_'
+#
+# Multiple `-e' to egrep are not portable, so join all the patterns together.
+# We use the fact that automake will replace all the `\\\n' with ` '.
+FILTER_MACROS = egrep -v -e \
+`echo '^AC_ARG_VAR$$\
+^AC_CHECK_(DECL|FILE|FUNC|HEADER|MEMBER|PROG|SIZEOF|TYPE)S?$$\
+^AC_CONFIG\
+^AC_INIT\
+^AC_LINKER_OPTION$$\
+^AC_LINK_FILES$$\
+^AC_LIST_MEMBER_OF$$\
+^AC_PATH_(TOOL|PROG)S?$$\
+^AC_PROG_(CC|CXX|F77)_(GNU|WORKS)$$\
+^AC_REPLACE_FUNCS$$\
+^AC_SEARCH_LIBS$$\
+^AC_TRY\
+_AC_' | tr ' ' '|'`
 
 macros.m4: $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 $(srcdir)/Makefile.am
        cat $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 | \
          sed -ne 's/^A[CU]_DEFUN(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \
-         sort | uniq | $(EGREP_EXCLUDE) >defuns
+         sort | uniq | $(FILTER_MACROS) >defuns
 # Get the list of macros that are required: there is little interest
 # in testing them since they will be run but the guy who requires
 # them.
index 484b919f655e36461a01858d87f1cfec5a9f4a30..eea52fd7c81eea0299dc2bac3d948e75d3361dad 100644 (file)
@@ -73,7 +73,7 @@ EXTRA_DIST = atgeneral.m4 atspecific.m4 suite.m4 macros.m4 actest.m4 $(SUITE)
 
 PERL = perl
 
-# EGREP_EXCLUDE
+# FILTER_MACROS
 # -------------
 # The test `syntax.m4' tries to run all the macros of Autoconf to check
 # for syntax problems, etc.  Not all the macros can be run without argument,
@@ -96,7 +96,10 @@ PERL = perl
 #   Used in many places.
 # - _AC_
 #   Internal macros are used elsewhere.
-EGREP_EXCLUDE = egrep -v   -e '^AC_ARG_VAR$$'   -e '^AC_CHECK_(DECL|FILE|FUNC|HEADER|MEMBER|PROG|SIZEOF|TYPE)S?$$'   -e '^AC_CONFIG'   -e '^AC_INIT'   -e '^AC_LINKER_OPTION$$'   -e '^AC_LINK_FILES$$'   -e '^AC_LIST_MEMBER_OF$$'   -e '^AC_PATH_(TOOL|PROG)S?$$'   -e '^AC_PROG_(CC|CXX|F77)_(GNU|WORKS)$$'   -e '^AC_REPLACE_FUNCS$$'   -e '^AC_SEARCH_LIBS$$'   -e '^AC_TRY'   -e '_AC_'
+#
+# Multiple `-e' to egrep are not portable, so join all the patterns together.
+# We use the fact that automake will replace all the `\\\n' with ` '.
+FILTER_MACROS = egrep -v -e `echo '^AC_ARG_VAR$$ ^AC_CHECK_(DECL|FILE|FUNC|HEADER|MEMBER|PROG|SIZEOF|TYPE)S?$$ ^AC_CONFIG ^AC_INIT ^AC_LINKER_OPTION$$ ^AC_LINK_FILES$$ ^AC_LIST_MEMBER_OF$$ ^AC_PATH_(TOOL|PROG)S?$$ ^AC_PROG_(CC|CXX|F77)_(GNU|WORKS)$$ ^AC_REPLACE_FUNCS$$ ^AC_SEARCH_LIBS$$ ^AC_TRY _AC_' | tr ' ' '|'`
 
 
 CLEANFILES = debug-*.sh macro configure configure.in config.status config.cache config.log config.h.in config.h
@@ -104,7 +107,8 @@ CLEANFILES = debug-*.sh macro configure configure.in config.status config.cache
 DISTCLEANFILES = atconfig testsuite
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_CLEAN_FILES =  atconfig
-DIST_COMMON =  Makefile.am Makefile.in atconfig.in
+DIST_COMMON =  Makefile.am Makefile.in atconfig.in configure \
+configure.in
 
 
 PACKAGE = @PACKAGE@
@@ -226,7 +230,7 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 macros.m4 $(SUITE)
 macros.m4: $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 $(srcdir)/Makefile.am
        cat $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 | \
          sed -ne 's/^A[CU]_DEFUN(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \
-         sort | uniq | $(EGREP_EXCLUDE) >defuns
+         sort | uniq | $(FILTER_MACROS) >defuns
 # Get the list of macros that are required: there is little interest
 # in testing them since they will be run but the guy who requires
 # them.
index 6e1a03a967046864cd0a197e899165caa168707e..c8f4eb6bb70efd1e52fa1df8cdbe3df69b67effe 100644 (file)
@@ -1,6 +1,14 @@
 dnl actest.m4                                              -*- autoconf -*-
 dnl Additional Autoconf macros to ease testing.
 
+# join(SEP, ARG1, ARG2...)
+# ------------------------
+# Produce ARG1SEPARG2...SEPARGn.
+define(join,
+[ifelse([$#], [1], [],
+        [$#], [2], [[$2]],
+        [[$2][$1]join([$1], m4_shift(m4_shift($@)))])])
+
 
 # AC_ENV_SAVE(FILE)
 # ------------------
@@ -20,20 +28,21 @@ dnl Additional Autoconf macros to ease testing.
 
 AC_DEFUN(AC_ENV_SAVE,
 [(set) 2>&1 |
-  egrep -v \
-  -e '^ac_' \
-  -e '^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=' \
-  -e '^(LIBS|LIBOBJS|LDFLAGS)=' \
-  -e '^INSTALL(_(DATA|PROGRAM|SCRIPT))?=' \
-  -e '^(CYGWIN|ISC|MINGW32|MINIX|EMXOS2|EXEEXT|OBJEXT)=' \
-  -e '^(X_(CFLAGS|(EXTRA_|PRE_)?LIBS)|x_(includes|libraries)|have_x)=' \
-  -e '^(host|build|target)(_(alias|cpu|vendor|os))?=' \
-  -e '^(cross_compiling)=' \
-  -e '^(interpval)=' \
-  -e '^(f77_(case|underscore))=' \
-  -e '^(ALLOCA|NEED_SETGID|KMEM_GROUP)=' \
-  -e '^(AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC)=' \
-  -e '^(_|OLDPWD|PIPESTATUS|SECONDS)=' |
+  egrep -v -e \
+'join([|],
+      [^ac_],
+      [^(CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77)=],
+      [^(LIBS|LIBOBJS|LDFLAGS)=],
+      [^INSTALL(_(DATA|PROGRAM|SCRIPT))?=],
+      [^(CYGWIN|ISC|MINGW32|MINIX|EMXOS2|EXEEXT|OBJEXT)=],
+      [^(X_(CFLAGS|(EXTRA_|PRE_)?LIBS)|x_(includes|libraries)|have_x)=],
+      [^(host|build|target)(_(alias|cpu|vendor|os))?=],
+      [^(cross_compiling)=],
+      [^(interpval)=],
+      [^(f77_(case|underscore))=],
+      [^(ALLOCA|NEED_SETGID|KMEM_GROUP)=],
+      [^(AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|RANLIB|SET_MAKE|YACC)=],
+      [^(_|OLDPWD|PIPESTATUS|SECONDS)=])' |
   # There maybe variables spread on several lines, eg IFS, remove the dead
   # lines
   fgrep = >$1