Merge branch 'doc-no-history'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 14 Feb 2012 20:30:56 +0000 (21:30 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 14 Feb 2012 20:30:56 +0000 (21:30 +0100)
* doc-no-history:
  docs: move chapter on automake history out of main manual

.gitattributes
lib/am/check.am
lib/am/header-vars.am
tests/depcomp.sh
tests/dist-formats.tap
tests/list-of-tests.mk
tests/parallel-tests-fd-redirect-exeext.test
tests/rst-formatting.test [new file with mode: 0755]
tests/tap-signal.tap
tests/test-driver-is-distributed.test

index b6c3614..5126add 100644 (file)
@@ -1,2 +1,2 @@
-ChangeLog merge=merge-changelog
+NEWS merge=union
 *.texi* diff=texinfo
index 777cb6f..bd9f5c2 100644 (file)
@@ -57,8 +57,8 @@ include inst-vars.am
 ## (among them, TAP).
 
 # Restructured Text title and section.
-am__rst_title = sed 's/.*/   &   /;h;s/./=/g;p;x;p;g;p;s/.*//'
-am__rst_section = sed 'p;s/./=/g;p;g'
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+am__rst_section = { sed 'p;s/./=/g;' && echo; }
 
 # Solaris 10 'make', and several other traditional 'make' implementations,
 # pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
index 1078a3d..97516ef 100644 (file)
@@ -32,12 +32,15 @@ VPATH = @srcdir@
 ## and are thus executed also with "make -n" -- either because they
 ## are declared as dependencies to '.MAKE' (NetBSD make), or because
 ## their recipes contain the "$(MAKE)" string (GNU and Solari make).
+
+## The case statement has [:] in order to not tickle makefile-deps.test
+## which greps for '^ *:'.
 am__make_dryrun = \
   { \
     am__dry=no; \
     for am__flg in : $(MAKEFLAGS); do \
       case $$am__flg in \
-        :) ;; \
+        [:]) ;; \
         *=*|--*) ;; \
         *n*) am__dry=yes; break;; \
       esac; \
index a53c0b5..d149280 100755 (executable)
@@ -150,7 +150,15 @@ case $depcomp_with_libtool in
   yes)
     po=Plo objext=lo a=la
     normalized_target=libfoo_la
-    LIBPRIMARY=LTLIBRARIES LINKADD=LIBADD
+    # On platforms requiring that no undefined symbols exist in order
+    # to build shared libraries (e.g. Windows DLLs), you have to
+    # explicitly declare that the libtool library you are building
+    # does not actually have any undefined symbols, for libtool to
+    # even try to build it as a shared library.  Without that
+    # explicit declaration, libtool falls back to a static library
+    # only, regardless of any --enable-shared flags etc.
+    LIBPRIMARY=LTLIBRARIES LINKADD=LIBADD NOUNDEF=-no-undefined
+    libbaz_ldflags="libbaz_${a}_LDFLAGS = $NOUNDEF"
     echo lib_LTLIBRARIES = libfoo.la >> Makefile.am
     make_ok ()
     {
@@ -167,7 +175,8 @@ case $depcomp_with_libtool in
   no)
     po=Po objext='$(OBJEXT)' a=a
     normalized_target=foo
-    LIBPRIMARY=LIBRARIES LINKADD=LDADD
+    LIBPRIMARY=LIBRARIES LINKADD=LDADD NOUNDEF=
+    libbaz_ldflags=
     echo bin_PROGRAMS = foo >> Makefile.am
     make_ok ()
     {
@@ -185,6 +194,7 @@ SUBDIRS = src
 # We include subfoo only to be sure that the munging in depcomp
 # doesn't remove too much from the object file name.
 ${normalized_target}_SOURCES = foo.c sub/subfoo.c foo.h sub/subfoo.h
+${normalized_target}_LDFLAGS = $NOUNDEF
 ${normalized_target}_${LINKADD} = src/libbaz.$a
 
 .PHONY: grep-test
@@ -207,6 +217,7 @@ noinst_${LIBPRIMARY} = libbaz.$a
 # We include sub2foo only to be sure that the munging in depcomp
 # doesn't remove too much from the object file name.
 libbaz_${a}_SOURCES = baz.c sub2/sub2foo.c baz.h sub2/sub2foo.h
+$libbaz_ldflags
 END
 
 cat > foo.c <<'END'
@@ -277,23 +288,28 @@ test -f build-aux/depcomp \
 
 case $depmode in
   auto)
-    plan_ 84
-    do_all_tests ()
-    {
-      do_test default
-      do_test noshared --disable-shared
-      do_test nostatic --disable-static
-    }
+    if test $depcomp_with_libtool = no; then
+      plan_ 28
+      do_all_tests () { do_test; }
+    else
+      plan_ 84
+      do_all_tests ()
+      {
+        do_test default
+        do_test noshared --disable-shared
+        do_test nostatic --disable-static
+      }
+    fi
     displayed_depmode='..*' # At least one character long.
     cfg_deptrack=--enable-dependency-tracking ;;
   disabled)
     plan_ 28
-    do_all_tests() { do_test; }
+    do_all_tests () { do_test; }
     displayed_depmode=none
     cfg_deptrack=--disable-dependency-tracking ;;
   *)
     plan_ 28
-    do_all_tests() { do_test; }
+    do_all_tests () { do_test; }
     displayed_depmode="(cached) $depmode"
     cfg_deptrack="$cachevar=$depmode"
     # Sanity check: ensure the cache variable we force is truly
index 80be9c9..612af54 100755 (executable)
@@ -80,7 +80,8 @@ missing_compressors=`
     case $c in
       # Assume gzip(1) is available on every reasonable portability target.
       gzip)
-        continue;;
+        continue
+        ;;
       # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
       # and is just a dummy script that is not able to actually compress
       # (it can only decompress).  So, check that the 'compress' program
@@ -92,9 +93,13 @@ missing_compressors=`
       compress)
         for x in 1 2 3 4 5 6 7 8; do
           echo aaaaaaaaaaaaaaa
-        done | $c -c >/dev/null && continue;;
+        done | $c -c >/dev/null && continue
+        : For shells with busted 'set -e'.
+        ;;
       *)
-        $c --version </dev/null >&2 && continue;;
+        $c --version </dev/null >&2 && continue
+        : For shells with busted 'set -e'.
+        ;;
     esac
     echo $c
   done | tr "$nl" ' '`
index d2ad678..c726bde 100644 (file)
@@ -880,6 +880,7 @@ req.test \
 reqd.test \
 reqd2.test \
 repeated-options.test \
+rst-formatting.test \
 rulepat.test \
 self-check-cleanup.tap \
 self-check-configure-help.test \
index 0f9d6da..4426604 100755 (executable)
@@ -34,7 +34,11 @@ AC_LINK_IFELSE(
     [AC_LANG_PROGRAM([[#include <unistd.h>]],
                      [[write (9, "foobar\n", 7); return 0;]])],
     [AM_RUN_LOG([./conftest$EXEEXT 9>&1]) \
-       && AM_RUN_LOG([(./conftest$EXEEXT 9>&1) | grep "^foobar"]) \
+dnl Leading ":;" required to avoid having two nested subshells starting
+dnl with '((' in the generated configure: that is unportable and could
+dnl confuse some shells (e.g., NetBSD 5.1 /bin/ksh) into thinking we are
+dnl trying to perform an arithmetic operation.
+       && AM_RUN_LOG([:; (./conftest$EXEEXT 9>&1) | grep "^foobar"]) \
        && am__ok=yes])
 test $am__ok = yes || AS_EXIT([63])
 AM_CONDITIONAL([real_EXEEXT], [test -n "$EXEEXT"])
diff --git a/tests/rst-formatting.test b/tests/rst-formatting.test
new file mode 100755 (executable)
index 0000000..ad80aff
--- /dev/null
@@ -0,0 +1,93 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Parallel testsuite harness: check APIs for the registering the
+# "global test result" in `*.trs' files, as documented in the automake
+# manual.
+
+am_create_testdir=empty
+. ./defs || Exit 1
+
+sed -n '/^am__rst_[a-z_][a-z_]* =/p' "$am_amdir"/check.am > Makefile \
+  || framework_failure_ "fetching definitions from check.am"
+
+cat >> Makefile << 'END'
+test:
+       printf '%s\n' "$$in" | $(am__rst_title) > title-got
+       printf '%s\n' "$$in" | $(am__rst_section) > section-got
+       cat title-exp
+       cat title-got
+       diff title-exp title-got
+       cat section-exp
+       cat section-got
+       diff section-exp section-got
+END
+
+# -------------------------------------------------------------------------
+
+cat > title-exp <<'END'
+==============
+   ab cd ef
+==============
+
+END
+
+cat > section-exp <<'END'
+ab cd ef
+========
+
+END
+
+env in='ab cd ef' $MAKE test
+
+# -------------------------------------------------------------------------
+
+cat > title-exp <<'END'
+============================================================================
+   0123456789012345678901234567890123456789012345678901234567890123456789
+============================================================================
+
+END
+
+cat > section-exp <<'END'
+0123456789012345678901234567890123456789012345678901234567890123456789
+======================================================================
+
+END
+
+in=0123456789012345678901234567890123456789012345678901234567890123456789
+env in=$in $MAKE test
+
+# -------------------------------------------------------------------------
+
+cat > title-exp <<'END'
+=======
+   x
+=======
+
+END
+
+cat > section-exp <<'END'
+x
+=
+
+END
+
+env in=x $MAKE test
+
+# -------------------------------------------------------------------------
+
+:
index f436bc8..b84993a 100755 (executable)
@@ -98,7 +98,16 @@ signal_caught ()
   esac
 }
 
-command_ok_ '"make check" fails' eval 'not $MAKE check >stdout'
+command_ok_ '"make check" fails' eval '
+  (
+    st=0; $MAKE check >stdout || st=$?
+    # Extra "echo" and silencing of xtraces required to avoid possible
+    # garbled output with NetBSD make, which would miss some final
+    # newlines in the expected places and thus mess up our TAP output.
+    set +x; echo
+    test $st -gt 0
+  )
+'
 cat stdout # For debugging.
 
 command_ok_ "count of test results" count_test_results \
index 054c6d9..ffe9d2a 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 #  - `test-driver' script not correctly distributed when TESTS is
 #    defined in a subdir Makefile
 
+am_create_testdir=empty
 am_parallel_tests=yes
 . ./defs || Exit 1
 
-cat >> configure.in << 'END'
-AC_CONFIG_FILES([tests/Makefile])
-AC_OUTPUT
+ocwd=`pwd` || fatal_ "getting current working directory"
+
+do_check ()
+{
+  whereopts=$1 auxdir=$2
+  case $#,$whereopts in
+    2,ac) ac_opts=parallel-tests am_code= ;;
+    2,am) am_opts=parallel-tests ac_code= ;;
+       *) fatal_ "do_check: bad usage";;
+  esac
+  mkdir $whereopts
+  cd $whereopts
+  mkdir tests
+  unindent > configure.in << END
+    AC_INIT([$me], [1.0])
+    AC_CONFIG_AUX_DIR([$auxdir])
+    AM_INIT_AUTOMAKE([$ac_opts])
+    AC_CONFIG_FILES([Makefile tests/Makefile])
+    AC_OUTPUT
 END
-
-rm -f depcomp # It's unneeded.
-
-mkdir tests
-
-cat > Makefile.am << 'END'
-SUBDIRS = tests
-check-local: test-top
-test-top: distdir
-       ls -l $(distdir) $(distdir)/* ;: For debugging.
-       test -f $(distdir)/test-driver
-.PHONY: test-top
+  if test $auxdir = .; then
+    test_driver=test-driver
+  else
+    mkdir $auxdir
+    test_driver=$auxdir/test-driver
+  fi
+  # No 'AUTOMAKE_OPTIONS' in here -- purposely.
+  unindent > Makefile.am << END
+    SUBDIRS = tests
+    check-local: test-top
+    test-top: distdir
+       ls -l \$(distdir) \$(distdir)/* ;: For debugging.
+       test -f \$(distdir)/$test_driver
+    .PHONY: test-top
 END
-
-cat > tests/Makefile.am << 'END'
-check-local: test-sub
-test-sub:
-       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]test-driver '
-TESTS = foo.test
-EXTRA_DIST = $(TESTS)
+  unindent > tests/Makefile.am << END
+    AUTOMAKE_OPTIONS = $am_opts
+    check-local: test-sub
+    test-sub:
+       echo ' ' \$(DIST_COMMON) ' ' | grep '[ /]$test_driver '
+    TESTS = foo.test
+    EXTRA_DIST = \$(TESTS)
 END
-
-cat > tests/foo.test << 'END'
-#!/bin/sh
-exit 0
+  unindent > tests/foo.test << 'END'
+    #!/bin/sh
+    exit 0
 END
-chmod a+x tests/foo.test
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
-./configure
-$MAKE test-top
-cd tests; $MAKE test-sub; cd ..;
-$MAKE distcheck
-
-# Try again, with a `config_auxdir' != `.' this time.
-
-$MAKE distclean
-
-mkdir build-aux
-mv missing install-sh test-driver build-aux
-
-for d in . tests; do
-  sed 's|test-driver|build-aux/test-driver|' $d/Makefile.am > $d/t
-  mv -f $d/t $d/Makefile.am
-  cat $d/Makefile.am # For debugging.
-done
-
-# Extra newline possibly required by OpenBSD 3.9 sed, see the autoconf
-# manual for details.
-sed '/^AC_INIT/i\
-AC_CONFIG_AUX_DIR([build-aux])
-' configure.in > t
-mv -f t configure.in
-cat configure.in # For debugging.
-
-touch aclocal.m4 # To avoid useless remakes.
-$AUTOCONF
-$AUTOMAKE
-./configure
-$MAKE test-top
-cd tests; $MAKE test-sub; cd ..;
-$MAKE distcheck
+  chmod a+x tests/foo.test
+  $ACLOCAL
+  $AUTOCONF
+  $AUTOMAKE -a
+  ./configure
+  $MAKE test-top
+  cd tests
+  $MAKE test-sub
+  cd ..
+  $MAKE distcheck
+  # Try code path without automatic installation of required files.
+  mv -f Makefile.in Makefile.sav
+  mv -f tests/Makefile.in tests/Makefile.sav
+  $AUTOMAKE
+  diff Makefile.in Makefile.sav
+  diff tests/Makefile.in tests/Makefile.sav
+  :
+}
+
+do_check ac .
+do_check am build-aux
 
 :