]> sourceware.org Git - automake.git/commitdiff
* Makefile.am (maintainer-check): Check for egrep and fgrep.
authorAlexandre Duret-Lutz <adl@gnu.org>
Fri, 31 May 2002 18:05:04 +0000 (18:05 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Fri, 31 May 2002 18:05:04 +0000 (18:05 +0000)
* test/cond22.test: Set SHELL when calling $MAKE -e.

ChangeLog
Makefile.am
Makefile.in
tests/cond22.test

index 0166369e45e4c874dd2795c014a17878494461e1..bcb47a42d8e05530e8c7aa105173e8ef9d489ecd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-31  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * Makefile.am (maintainer-check): Check for egrep and fgrep.
+
+       * test/cond22.test: Set SHELL when calling $MAKE -e.
+
 2002-05-31  Richard Boulton <richard@tartarus.org>
 
        Fix PR automake/326:
index f0d8d26704b12a0447b647bb38d48d1a41d8d844..1b47d27238394d3ded37c17beb1807b812b25e03 100644 (file)
@@ -202,6 +202,15 @@ maintainer-check: automake aclocal
          echo 'Do not use "sleep 1" in the above tests.  Use "sleep 2" instead.' 1>&2; \
          exit 1; \
        fi
+## fgrep and egrep are not required by POSIX.
+       @if grep -E '\b[ef]grep\b' $(srcdir)/tests/*.test ; then \
+         echo 'Do not use egrep or fgrep in test cases.  Use $FGREP or $EGREP.' 1>&2; \
+         exit 1; \
+       fi
+       @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
+         echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
+         exit 1; \
+       fi
 
 
 # Tag before making distribution.  Also, don't make a distribution if
index 767f84b0fa45d7b6f30c08aff884738b3f25a1a9..d2bc8951699ed6f53fbf16ec44b79bfb7f5bed0a 100644 (file)
@@ -213,7 +213,7 @@ DVIPS = dvips
 uninstall-info-am:
        $(PRE_UNINSTALL)
        @if (install-info --version && \
-            install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \
+            install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
          list='$(INFO_DEPS)'; \
          for file in $$list; do \
            echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \
@@ -401,7 +401,7 @@ distdir: $(DISTFILES)
          fi; \
        done
        $(MAKE) $(AM_MAKEFLAGS) \
-         top_distdir="${top_distdir}" distdir="$(distdir)" \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-info
        -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
          ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
@@ -432,8 +432,9 @@ distcheck: dist
        mkdir $(distdir)/=inst
        chmod a-w $(distdir)
        dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
          && cd $(distdir)/=build \
-         && ../configure --srcdir=.. --prefix=$$dc_install_base \
+         && ../configure --srcdir=.. --prefix="$$dc_install_base" \
            $(DISTCHECK_CONFIGURE_FLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -441,10 +442,19 @@ distcheck: dist
          && $(MAKE) $(AM_MAKEFLAGS) install \
          && $(MAKE) $(AM_MAKEFLAGS) installcheck \
          && $(MAKE) $(AM_MAKEFLAGS) uninstall \
-         && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+         && (test `find "$$dc_install_base" -type f -print | wc -l` -le 1 \
              || { echo "ERROR: files left after uninstall:" ; \
                   find $$dc_install_base -type f -print ; \
                   exit 1; } >&2 ) \
+         && chmod -R a-w "$$dc_install_base" \
+         && ({   $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+              && (test `find "$$dc_destdir" -type f -print | wc -l` -le 1 \
+                  || { echo "ERROR: files left after uninstall (check DESTDIR support):" ; \
+                       find "$$dc_destdir" -type f -print ; \
+                       exit 1; } >&2 ) \
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \
+         && rm -rf "$$dc_destdir" \
          && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
          && rm -f $(distdir).tar.gz \
          && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
@@ -531,7 +541,7 @@ install-info-am: $(INFO_DEPS)
        done
        @$(POST_INSTALL)
        @if (install-info --version && \
-            install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \
+            install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
          list='$(INFO_DEPS)'; \
          for file in $$list; do \
            echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
@@ -605,28 +615,28 @@ maintainer-check: automake aclocal
        fi
        perllibdir=$(srcdir)/lib $(PERL) -c -w automake
        perllibdir=$(srcdir)/lib $(PERL) -c -w aclocal
-       @if fgrep '\$${' $(srcdir)/lib/am/[a-z]*.am | \
-              fgrep -v '$$$$'; then \
+       @if grep -F '$${' $(srcdir)/lib/am/[a-z]*.am | \
+              grep -F -v '$$$$'; then \
          echo "Found too many uses of '\$${' in the lines above." 1>&2; \
          exit 1;                               \
        else :; fi
-       @if egrep '\<rm ([^-]|\-[^f ]*\>)' \
+       @if grep -E '\<rm ([^-]|\-[^f ]*\>)' \
                  $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
-             fgrep -v '##'; then \
+             grep -v '##'; then \
          echo "Suspicious 'rm' invocation." 1>&2; \
          exit 1;                               \
        else :; fi
-       @if fgrep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
-             fgrep -v '$$(mkinstalldirs)'; then \
+       @if grep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
+             grep -F -v '$$(mkinstalldirs)'; then \
          echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
          exit 1; \
        else :; fi
        @if grep -n -w 'undef ' $(srcdir)/automake.in | \
-             fgrep -v 'undef $$/'; then \
+             grep -F -v 'undef $$/'; then \
          echo "Found undef in automake.in; use delete instead" 1>&2; \
          exit 1; \
        fi
-       @if fgrep -n 'split (/ /' $(srcdir)/automake.in; then \
+       @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
          echo "Found bad split in the lines above." 1>&2; \
          exit 1; \
        fi
@@ -662,27 +672,27 @@ maintainer-check: automake aclocal
          echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
          exit 1; \
        fi
-       @if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[     ]*make'; then \
+       @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*make'; then \
          echo 'Do not run "make" in the above tests.  Use "$$MAKE" instead.' 1>&2; \
          exit 1; \
        fi
-       @if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[     ]*autoconf'; then \
+       @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*autoconf'; then \
          echo 'Do not run "autoconf" in the above tests.  Use "$$AUTOCONF" instead.' 1>&2; \
          exit 1; \
        fi
-       @if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[     ]*automake'; then \
+       @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*automake'; then \
          echo 'Do not run "automake" in the above tests.  Use "$$AUTOMAKE" instead.' 1>&2;  \
          exit 1; \
        fi
-       @if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[     ]*aclocal'; then \
+       @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*aclocal'; then \
          echo 'Do not run "aclocal" in the above tests.  Use "$$ACLOCAL" instead.' 1>&2;  \
          exit 1; \
        fi
-       @if grep -v '^#' $(srcdir)/tests/*.test | egrep ':[     ]*perl'; then \
+       @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*perl'; then \
          echo 'Do not run "perl" in the above tests.  Use "$$PERL" instead.' 1>&2; \
          exit 1; \
        fi
-       @if egrep '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
+       @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
          echo 'Rewrite "$$MAKE foo=bar SHELL=/bin/sh" as "foo=bar $$MAKE -e SHELL=/bin/sh"' 1>&2; \
          echo ' in the above lines, it is more portable.' 1>&2; \
          exit 1; \
@@ -697,15 +707,23 @@ maintainer-check: automake aclocal
          echo 'Use "$$MAKE -e SHELL=/bin/sh" in the above lines.' 1>&2; \
          exit 1; \
        fi
-       @if egrep 'SHELL=.*\$$MAKE' $(srcdir)/tests/*.test; then \
+       @if grep 'SHELL=.*\$$MAKE' $(srcdir)/tests/*.test; then \
          echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=/bin/sh" in' 1>&2; \
          echo 'the above lines.' 1>&2; \
          exit 1; \
        fi
-       @if egrep '\bsleep +1\b' $(srcdir)/tests/*.test; then \
+       @if grep -E '\bsleep +1\b' $(srcdir)/tests/*.test; then \
          echo 'Do not use "sleep 1" in the above tests.  Use "sleep 2" instead.' 1>&2; \
          exit 1; \
        fi
+       @if grep -E '\b[ef]grep\b' $(srcdir)/tests/*.test ; then \
+         echo 'Do not use egrep or fgrep in test cases.  Use $FGREP or $EGREP.' 1>&2; \
+         exit 1; \
+       fi
+       @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
+         echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
+         exit 1; \
+       fi
 
 # Tag before making distribution.  Also, don't make a distribution if
 # checks fail.  Also, make sure the NEWS file is up-to-date.
index ce89aee44e0dc923010bf11844f6ca3b7dfd98ab..564a7f31e78a0b8466890979ff2edae68b38128c 100755 (executable)
@@ -50,6 +50,6 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure
-OBJEXT=oo $MAKE -e echo > output
+OBJEXT=oo $MAKE -e SHELL=/bin/sh echo > output
 cat output
 $FGREP 'BEG: one.oo two.oo three.oo three2.oo :END' output
This page took 0.039763 seconds and 5 git commands to generate.