++2011-11-03 Stefano Lattarini <stefano.lattarini@gmail.com>
++
++ Merge branch 'msvc' into master
++
++ * tests/instspc-tests.sh: Adjust to new portability requirements
++ due to the new AM_PROG_AR macro.
++ * tests/libobj-basic.test: Likewise.
++ * tests/libobj2.test: Likewise.
++ * tests/libobj15a.test: Likewise.
++ * tests/libobj15b.test: Likewise.
++ * tests/libobj15c.test: Likewise.
++ * tests/libobj16a.test: Likewise.
++ * tests/libobj16b.test: Likewise.
++ * tests/libobj17.test: Likewise.
++ * tests/libobj18.test: Likewise.
++ * tests/libobj19.test: Likewise.
++ * tests/libobj20a.test: Likewise.
++ * tests/libobj20b.test: Likewise.
++ * tests/libobj20c.test: Likewise.
++ * tests/canon6.test: Likewise.
++ * tests/canon6.test: Likewise.
++ * tests/canon7.tests: Likewise.
++ * tests/extra9.test: Likewise.
++ * tests/extradep.test: Likewise.
++ * tests/extradep2.test: Likewise.
++ * tests/posixsubst-ldadd.test: Likewise.
++ * tests/posixsubst-libraries.test: Likewise.
++ * tests/posixsubst-ltlibraries.test: Likewise.
++ * tests/python-virtualenv.test: Likewise.
++ * tests/vartypos.test: Likewise.
++ * tests/vartypo2.test: Likewise.
++ * tests/suffix.test: Update to take into account previous
++ master-only changes.
++ * tests/suffix2.test: Likewise.
++ * tests/libobj7.test: Call automake with the `--add-missing'
++ option, instead of creating a dummy `ar-lib' file, since this
++ test now also runs "./configure" and "make".
++ * tests/suffix5.test: Copy the real `ar-lib' script file,
++ instead of creating a dummy one, since this test now also
++ runs "./configure" and "make".
++ * tests/extra-portability2.test: Fix this test not to rely
++ on the older, faulty semantics of "strictness specification
++ always reset warning level", which has been fixed in commit
++ v1.11-623-g1609491 (see also automake bug#7669 a.k.a. PR/547).
++ Since we are at it, throw inf few other minor unrelated
++ improvements.
++ * tests/extra-portability.test: Explicitly pass `-Wall' to
++ automake calls, for clarity.
++
++2011-10-21 Peter Rosin <peda@lysator.liu.se>
++
++ warnings: new 'extra-portability' category, for AM_PROG_AR
++ * lib/Automake/ChannelDefs.pm: Register new extra-portability
++ warning channel.
++ (switch_warning): Turn off extra-portability if portability is
++ turned off, and turn on portability if extra-portability is
++ turned on.
++ (set_strictness): Silence extra-portability for --gnits, --gnu
++ and --foreign.
++ * tests/extra-portability2.test: New test, checking that the
++ extra-portability channel is silenced by --gnits, --gnu and
++ --foreign.
++ * doc/automake.texi (Invoking Automake): Document the new warning
++ category and its interaction with the portability category.
++ * tests/extra-portability.test: New test, checking the interaction
++ between the portability and extra-portability warning categories.
++ * automake.in (handle_libraries, handle_ltlibraries): Move the
++ AM_PROG_AR warnings to the new extra-portability channel.
++ * tests/ar2.test: Adjust to the new warning channel.
++ * tests/pr300-lib.test: Likewise.
++ * tests/pr300-ltlib.test: Likewise.
++ * tests/pr307.test: Likewise.
++ * tests/pr401.test: Likewise.
++ * tests/pr401b.test: Likewise.
++ * tests/pr401c.test: Likewise.
++ * tests/pr72.test: Likewise.
++ * NEWS: Likewise.
++ * tests/Makefile.am (TESTS): Update.
++
++2011-10-21 Peter Rosin <peda@lysator.liu.se>
++ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
++ Stefano Lattarini <stefano.lattarini@gmail.com>
++
++ Add new 'AM_PROG_AR' macro, triggering the 'ar-lib' script.
++ * m4/ar-lib.m4: New macro AM_PROG_AR, which locates an
++ archiver and triggers the auxiliary 'ar-lib' script if needed.
++ * m4/Makefile.am (dist_m4data_DATA): Update.
++ * automake.in ($seen_ar): New variable.
++ (scan_autoconf_traces): Set it.
++ (handle_libraries, handle_ltlibraries): Require AM_PROG_AR for
++ portability.
++ * doc/automake.texi (Public Macros): Mention the new
++ 'AM_PROG_AR' macro.
++ (Subpackages): Add AM_PROG_AR to the example.
++ (A Library): Adjust recommendations for AR given the new
++ AM_PROG_AR macro.
++ * All relevant tests: Adjust to new portability requirements due
++ to the new AM_PROG_AR macro.
++ * tests/ar-lib2.test: New test, checking that AM_PROG_AR triggers
++ install of ar-lib.
++ * tests/ar-lib3.test: New test, checking that lib_LIBRARIES
++ requires AM_PROG_AR.
++ * tests/ar-lib4.test: New test, checking that lib_LTLIBRARIES
++ requires AM_PROG_AR.
++ * tests/ar-lib5a.test: New test, checking that AM_PROG_AR triggers
++ use of ar-lib when the archiver is Microsoft lib.
++ * tests/ar-lib5b.test: New test, checking that AM_PROG_AR triggers
++ use of ar-lib when the archiver is a faked lib.
++ * tests/ar-lib6a.test: New test, checking the ordering of
++ AM_PROG_AR and LT_INIT.
++ * tests/ar-lib6b.test: New test, checking the ordering of
++ AM_PROG_AR and AC_PROG_LIBTOOL.
++ * tests/ar-lib7.test: New test, checking that automake warns
++ if ar-lib is missing.
++ * tests/ar3.test: New test, checking that AR and ARFLAGS may
++ be overridden by the user even if AM_PROG_AR is used.
++ * tests/ar4.test: New test, checking that AM_PROG_AR bails out
++ if it cannot determine the archiver interface.
++ * tests/ar5.test: New test, checking that AM_PROG_AR runs its
++ optional argument if it cannot determine the archiver interface.
++ * tests/defs.in: New required entry 'lib'.
++ * tests/Makefile.am (TESTS): Update.
++ * NEWS: Update.
++
2011-11-03 Zack Weinberg <zackw@panix.com> (tiny change)
Stefano Lattarini <stefano.lattarini@gmail.com>
- The `lzma' compression scheme and associated automake option `dist-lzma'
is obsoleted by `xz' and `dist-xz' due to upstream changes.
+ - "make dist" can now create lzip-compressed tarballs.
+
+ - You may adjust the compression options used in dist-xz and dist-bzip2.
+ The default is still -9 for each, but you may specify a different
+ level via the XZ_OPT and BZIP2 envvars respectively. E.g.,
+ "make dist-xz XZ_OPT=-7" or "make dist-xz BZIP2=-5"
+
+ - Messages of types warning or error from `automake' and `aclocal' are now
+ prefixed with the respective type, and presence of -Werror is noted.
+
+ - The `compile' script now converts some options for MSVC for a better
+ user experience. Similarly, the new `ar-lib' script wraps Microsoft lib.
+
+ - Automake's early configure-time sanity check now tries to avoid sleeping
+ for a second, which slowed down cached configure runs noticeably. In that
+ case, it will check back at the end of the configure script to ensure that
+ at least one second has passed, to avoid time stamp issues with makefile
+ rules rerunning autotools programs.
+
+ - For programs and libraries, automake now detects EXTRA_foo_DEPENDENCIES and
+ adds them to the normal list of dependencies, but without overwriting the
+ foo_DEPENDENCIES variable, which is normally computed by automake.
+
+ - C source and header files derived from non-distributed Yacc sources are
+ now removed by "make clean", not only by "make maintainer-clean".
+
+ - The `compile' script now converts some options for MSVC for a better
+ user experience. Similarly, the new `ar-lib' script wraps Microsoft lib.
+
- The py-compile script now accepts empty arguments passed to the options
`--destdir' and `--basedir', and complains about unrecognized options.
Moreover, a non-option argument or a special `--' argument terminates
amassign.test \
ammissing.test \
amopt.test \
+amopts-location.test \
+amopts-variable-expansion.test \
amsubst.test \
-ansi2knr-deprecation.test \
-ansi.test \
-ansi2.test \
-ansi3.test \
-ansi3b.test \
-ansi4.test \
-ansi5.test \
-ansi6.test \
-ansi7.test \
-ansi8.test \
-ansi9.test \
-ansi10.test \
+ansi2knr-no-more.test \
ar-lib.test \
+ ar-lib2.test \
+ ar-lib3.test \
+ ar-lib4.test \
+ ar-lib5a.test \
+ ar-lib5b.test \
+ ar-lib6a.test \
+ ar-lib6b.test \
+ ar-lib7.test \
ar.test \
ar2.test \
+ ar3.test \
+ ar4.test \
+ ar5.test \
asm.test \
asm2.test \
asm3.test \
extra10.test \
extra11.test \
extra12.test \
+extradep.test \
+extradep2.test \
+ extra-portability.test \
+ extra-portability2.test \
f90only.test \
flavor.test \
flibs.test \
amassign.test \
ammissing.test \
amopt.test \
+amopts-location.test \
+amopts-variable-expansion.test \
amsubst.test \
-ansi2knr-deprecation.test \
-ansi.test \
-ansi2.test \
-ansi3.test \
-ansi3b.test \
-ansi4.test \
-ansi5.test \
-ansi6.test \
-ansi7.test \
-ansi8.test \
-ansi9.test \
-ansi10.test \
+ansi2knr-no-more.test \
ar-lib.test \
+ ar-lib2.test \
+ ar-lib3.test \
+ ar-lib4.test \
+ ar-lib5a.test \
+ ar-lib5b.test \
+ ar-lib6a.test \
+ ar-lib6b.test \
+ ar-lib7.test \
ar.test \
ar2.test \
+ ar3.test \
+ ar4.test \
+ ar5.test \
asm.test \
asm2.test \
asm3.test \
extra10.test \
extra11.test \
extra12.test \
+extradep.test \
+extradep2.test \
+ extra-portability.test \
+ extra-portability2.test \
f90only.test \
flavor.test \
flibs.test \
required=GNUmake
. ./defs || Exit 1
-set -e
-
cat >>configure.in <<EOF
AC_PROG_RANLIB
+ AM_PROG_AR
AC_PROG_CC
MY_MACRO
AC_CONFIG_FILES([lib/Makefile])
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
+ AM_PROG_AR
AC_SUBST([AR], ['echo it works'])
AC_SUBST([ARFLAGS], ['>'])
AC_SUBST([RANLIB], ['echo really works >>'])
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
END
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure ansi2knr doesn't use `$U' for C++.
-# Report from Robert Boehne.
+# Test to make sure name canonicalization happens for libtool libraries.
+# Keep this in sync with sister test `canon4.test'.
+required='libtoolize'
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
-AC_PROG_CXX
-AM_C_PROTOTYPES
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_LIBTOOL
END
cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = ansi2knr
-sbin_PROGRAMS = anonymous
-anonymous_SOURCES = doe.c jane.C
+noinst_LTLIBRARIES = libx-y.la
+libx_y_la_SOURCES = xy.c
END
-: > ansi2knr.c
-: > ansi2knr.1
-
-: > doe.C
-: > jane.C
+: > ltmain.sh
++: > ar-lib
$ACLOCAL
-$AUTOMAKE -Wno-obsolete
+$AUTOMAKE -a
-$FGREP 'jane$U' Makefile.in && Exit 1
-$FGREP 'doe$U' Makefile.in
+grep '^ *libx-y.*=' Makefile.in && Exit 1
-Exit 0
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Stress test on canonicalization.
+
+required='libtool libtoolize'
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_RANLIB dnl: for static libraries
+AC_PROG_LIBTOOL dnl: for libtool libraries
+AC_OUTPUT
+END
+
+touch ,foo-bar libb.az+baz lib~zardoz,, || Exit 77
+rm -f ,foo-bar libb.az+baz lib~zardoz,,
+
+cat > Makefile.am << 'END'
+noinst_PROGRAMS = dummy_static dummy_dynamic ,foo-bar
+noinst_LIBRARIES = libb.az+baz.a
+noinst_LTLIBRARIES = lib~zardoz,,.la
+
+dummy_static_SOURCES = dummy.c lib.h
+dummy_dynamic_SOURCES = $(dummy_static_SOURCES)
+
+dummy_static_LDADD = $(noinst_LIBRARIES)
+dummy_dynamic_LDADD = $(noinst_LTLIBRARIES)
+
+_foo_bar_SOURCES = foobar.c
+libb_az_baz_a_SOURCES = libs.c
+lib_zardoz___la_SOURCES = libd.c
+
+check-local:
+ ls -l
+ ./,foo-bar
+ ./dummy_static
+ ./dummy_dynamic
+ ./,foo-bar | grep 'Hello, FooBar!'
+ ./dummy_static | grep 'Hello from Static!'
+ ./dummy_dynamic | grep 'Hello from Dynamic!'
+END
+
+cat > foobar.c << 'END'
+#include <stdio.h>
+int main(void)
+{
+ printf("Hello, FooBar!\n");
+ return 0;
+}
+END
+
+cat > dummy.c << 'END'
+#include <stdio.h>
+#include "lib.h"
+int main(void)
+{
+ printf("Hello from %s!\n", dummy_func());
+ return 0;
+}
+END
+
+echo 'const char *dummy_func(void);' > lib.h
+echo 'const char *dummy_func(void) { return "Dynamic"; }' > libd.c
+echo 'const char *dummy_func(void) { return "Static"; }' > libs.c
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
# telling that source files are missing. Adding also the `-help'
# option seems to solve the problem.
echo "$me: running javac -version -help"
- javac -version -help || exit 77
+ javac -version -help || skip_ "java compiler not found"
+ ;;
+ java)
+ # See the comments above about `javac' for why we use also `-help'.
+ echo "$me: running java -version -help"
+ java -version -help || skip_ "java interpreter not found"
;;
+ lib)
+ AR=lib
+ export AR
+ # Attempting to create an empty archive will actually not
+ # create the archive, but lib will output its version.
+ echo "$me: running $AR -out:defstest.lib"
+ $AR -out:defstest.lib || skip_ "Microsoft \`lib' utility not available"
+ ;;
makedepend)
echo "$me: running makedepend -f-"
- ( makedepend -f- ) || exit 77
+ makedepend -f- || exit 77
;;
makeinfo-html)
# Make sure makeinfo understands --html.
required='libtoolize gcc makedepend'
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
required=libtoolize
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
--- /dev/null
-AUTOMAKE_fails -Wno-extra-portability
+ #! /bin/sh
+ # Copyright (C) 2011 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/>.
+
+ # Check interactions between the `portability' and `extra-portability'
+ # warning categories:
+ # 1. `-Wextra-portability' must imply `-Wportability'.
+ # 2. `-Wno-portability' must imply `-Wno-extra-portability'.
+
+ . ./defs || Exit 1
+
+ set -e
+
+ cat >>configure.in <<END
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_OUTPUT
+ END
+
+ cat >Makefile.am <<END
+ EXTRA_LIBRARIES = libfoo.a
+ libfoo_a_SOURCES = sub/foo.c
+ libfoo_a_CPPFLAGS = -Dwhatever
+ END
+
+ $ACLOCAL
+
+ # Enabling extra-portability enables portability.
+ AUTOMAKE_fails -Wnone -Wextra-portability
+ # The expected diagnostic is
+ # Makefile.am:2: compiling `foo.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.in'
+ # .../lib/am/library.am: `libfoo.a': linking libraries using a non-POSIX
+ # .../lib/am/library.am: archiver requires `AM_PROG_AR' in `configure.in'
+ # Makefile.am:1: while processing library `libfoo.a'
+ grep 'requires.*AM_PROG_CC_C_O' stderr
+ grep 'requires.*AM_PROG_AR' stderr
+
+ # Disabling extra-portability leaves portability intact.
-$AUTOMAKE -Wno-portability
++AUTOMAKE_fails -Wall -Wno-extra-portability
+ # The expected diagnostic is
+ # Makefile.am:2: compiling `foo.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.in'
+ # Makefile.am:1: while processing library `libfoo.a'
+ grep 'requires.*AM_PROG_CC_C_O' stderr
+ grep 'requires.*AM_PROG_AR' stderr && Exit 1
+
+ # Enabling portability does not enable extra-portability.
+ AUTOMAKE_fails -Wnone -Wportability
+ # The expected diagnostic is
+ # Makefile.am:2: compiling `foo.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.in'
+ # Makefile.am:1: while processing library `libfoo.a'
+ grep 'requires.*AM_PROG_CC_C_O' stderr
+ grep 'requires.*AM_PROG_AR' stderr && Exit 1
+
+ # Disabling portability disables extra-portability.
++$AUTOMAKE -Wall -Wno-portability
+
+ :
--- /dev/null
-# Satisfy --gnits and --gnu.
-: > INSTALL
-: > NEWS
-: > README
-: > AUTHORS
-: > ChangeLog
-: > COPYING
-: > THANKS
+ #! /bin/sh
+ # Copyright (C) 2011 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/>.
+
+ # Make sure that extra-portability warnings are not enabled by --gnits,
+ # --gnu and --foreign.
+
+ . ./defs || Exit 1
+
+ set -e
+
-AUTOMAKE_fails
++# We want complete control over automake options.
++AUTOMAKE=$original_AUTOMAKE
+
+ cat >>configure.in <<END
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_OUTPUT
+ END
+
+ cat >Makefile.am <<END
+ EXTRA_LIBRARIES = libfoo.a
+ libfoo_a_SOURCES = foo.c
+ END
+
+ $ACLOCAL
+
+ # Make sure the test is useful.
++AUTOMAKE_fails -Wextra-portability \
++ || fatal_ "setup doesn't trigger \`extra-portability' warnings"
+
+ $AUTOMAKE --foreign
++
++touch INSTALL NEWS README AUTHORS ChangeLog COPYING # Satisfy --gnu.
+ $AUTOMAKE --gnu
++
++touch THANKS # Satisfy also --gnits.
+ $AUTOMAKE --gnits
+
+ :
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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 3 of the License, or
+# (at your option) any later version.
+#
+# GNU Automake 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 Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Ensure we warn about substitutions in bin_PROGRAMS if EXTRA_PROGRAMS
+# are missing; but only if the former is not AC_SUBSTed itself
+# (lib_LIBRARIES is in the same boat here).
+
+. ./defs || Exit 1
+
+cat >>configure.in <<'END'
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_RANLIB
+AC_SUBST([lib_LIBRARIES])
+AC_SUBST([bins])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+bin_PROGRAMS = @bins@
+END
+
++: > ar-lib
++
+$ACLOCAL
+AUTOMAKE_fails
+grep 'bin_PROGRAMS.*contains configure substitution' stderr
+grep 'lib_LIBRARIES.*contains configure substitution' stderr && Exit 1
+
+Exit 0
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Test EXTRA_*_DEPENDENCIES. See extradep2 for libtool variant.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_RANLIB
+AC_SUBST([deps], [bardep])
+AM_CONDITIONAL([COND], [test -n "$cond"])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libfoo.a
+EXTRA_libfoo_a_DEPENDENCIES = libfoodep
+libfoodep:
+ @echo making $@
+ @: > $@
+CLEANFILES = libfoodep
+
+bin_PROGRAMS = foo bar
+EXTRA_foo_DEPENDENCIES = foodep
+if COND
+EXTRA_foo_DEPENDENCIES += foodep2
+endif
+bar_LDADD = libfoo.a
+EXTRA_bar_DEPENDENCIES = $(deps)
+
+EXTRA_DIST = foodep bardep
+
+.PHONY: bar-has-been-updated
+bar-has-been-updated:
+ stat older bar$(EXEEXT) libfoo.a || : For debugging.
+ test `ls -t bar$(EXEEXT) older | sed q` = bar$(EXEEXT)
+END
+
+cat >libfoo.c <<'END'
+int libfoo () { return 0; }
+END
+
+cat >foo.c <<'END'
+int main () { return 0; }
+END
+
+cat >bar.c <<'END'
+extern int libfoo ();
+int main () { return libfoo (); }
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure cond=yes
+
+# hypotheses:
+# EXTRA_*_DEPENDENCIES are honored.
+# conditionals and substitutions are honored.
+# *_DEPENDENCIES are not overwritten by their EXTRA_* counterparts.
+
+: >foodep
+: >foodep2
+: >bardep
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'making libfoodep' stdout
+
+rm -f foodep
+$MAKE && Exit 1
+: >foodep
+
+rm -f foodep2
+$MAKE && Exit 1
+: >foodep2
+
+rm -f bardep
+$MAKE && Exit 1
+: >bardep
+
+$MAKE
+: > older
+$sleep
+touch libfoo.a
+$MAKE
+$MAKE bar-has-been-updated
+
+$MAKE distcheck
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Test EXTRA_*_DEPENDENCIES, libtool version; see extradep.test.
+
+required=libtoolize
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_LIBTOOL
+AC_SUBST([deps], [bardep])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LTLIBRARIES = libfoo.la
+EXTRA_libfoo_la_DEPENDENCIES = libfoodep
+libfoodep:
+ @echo making $@
+ @: > $@
+CLEANFILES = libfoodep
+
+bin_PROGRAMS = bar
+bar_LDADD = libfoo.la
+EXTRA_bar_DEPENDENCIES = $(deps)
+
+EXTRA_DIST = bardep
+
+.PHONY: bar-has-been-updated
+bar-has-been-updated:
+ stat older bar$(EXEEXT) libfoo.la || : For debugging.
+ test `ls -t bar$(EXEEXT) older | sed q` = bar$(EXEEXT)
+END
+
+cat >libfoo.c <<'END'
+int libfoo () { return 0; }
+END
+
+cat >bar.c <<'END'
+extern int libfoo ();
+int main () { return libfoo (); }
+END
+
+libtoolize
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+
+# hypothesis: EXTRA_*_DEPENDENCIES are honored.
+
+: >foodep
+: >foodep2
+: >bardep
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'making libfoodep' stdout
+
+rm -f bardep
+$MAKE && Exit 1
+: >bardep
+
+$MAKE
+: > older
+$sleep
+touch libfoo.la
+$MAKE
+$MAKE bar-has-been-updated
+
+$MAKE distcheck
+
+:
cat >>configure.in <<'END'
AC_PROG_CC
AM_PROG_CC_C_O
+ AM_PROG_AR
AC_PROG_LIBTOOL
+AM_PATH_PYTHON
AC_OUTPUT
END
cat >>configure.in <<'END'
AC_PROG_CC
AM_PROG_CC_C_O
+ AM_PROG_AR
AC_PROG_RANLIB
+AM_PATH_PYTHON
AC_OUTPUT
END
required='libtool libtoolize'
. ./defs || Exit 1
-set -e
-
cat >>configure.in <<END
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
. ./defs || Exit 1
-set -e
-
cat >>configure.in <<END
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
AM_PATH_LISPDIR
AC_OUTPUT
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+#
+# Driver script to generate and run tests checking that building from,
+# or installing to, directories with shell metacharacters succeed.
+#
+# Original report from James Amundson about file names with spaces.
+# Other characters added by Paul Eggert.
+#
+# This script fulfills a threefold role:
+# 1. It generates a Makefile.am snippet, containing the definition
+# of proper lists of tests.
+# 2. It sets up a directory containing some common data files and
+# autotools-generated files used by said generated tests (this
+# is done for speed reasons only).
+# 3. It is sourced by said generated tests with proper parameters
+# pre-set, to run the "meat" of the checks.
+# This setup might seem a tricky and over-engineered abuse, but past
+# (painful) experiences showed that it is indeed required, because
+# the test generation code and test execution code tend to be
+# inextricably coupled and intertwined.
+#
+
+# Be more Bourne compatible (snippet copied from `tests/defs').
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+
+set -e
+
+# Sanity and usage checks.
+if test x"$instspc_action" = x; then
+ if test "$#,$1" = "1,--generate-makefile"; then
+ instspc_action=generate-makefile
+ else
+ echo "$0: empty action and no proper command line" >&2
+ exit 99
+ fi
+elif test $# -gt 0; then
+ echo "$0: action specified and command line arguments used" >&2
+ exit 99
+fi
+
+case $instspc_action in
+ generate-makefile|generate-data)
+ ;;
+ test-build|test-install)
+ if test x"$instspc_test_name" = x; then
+ echo "$0: test name undefined for action '$instspc_action'" >&2
+ exit 99
+ fi
+ ;;
+ *)
+ echo "$0: invalid action: '$instspc_action'"
+ exit 99
+ ;;
+esac
+
+# Helper subroutine for test data definition.
+# Usage: define_problematic_string NAME STRING
+define_problematic_string ()
+{
+ tst=$1
+ shift
+ eval "instspc__$tst=\$1" || exit 99
+ shift
+ instspc_names_list="$instspc_names_list $tst"
+ # Some of the "problematic" characters cannot be used in the name of
+ # a build or install directory on a POSIX host. These lists should
+ # be empty, but are not due to limitations in Autoconf, Automake, Make,
+ # M4, or the shell.
+ case " $* " in *' fail-build '*|*' build-fail '*)
+ instspc_xfail_builds_list="$instspc_xfail_builds_list $tst";;
+ esac
+ case " $* " in *' fail-install '*|*' install-fail '*)
+ instspc_xfail_installs_list="$instspc_xfail_installs_list $tst";;
+ esac
+}
+
+# Helper subroutines for creation of input data files.
+
+create_input_data ()
+{
+ mkdir sub
+
+ unindent > configure.in << 'EOF'
+ AC_INIT([instspc], [1.0])
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_FILES([Makefile])
+ AC_PROG_CC
+ AC_PROG_RANLIB
++ AM_PROG_AR
+ AC_OUTPUT
+EOF
+
+ : > sub/base.h
+ : > sub/nobase.h
+ : > sub/base.dat
+ : > sub/nobase.dat
+ : > sub/base.sh
+ : > sub/nobase.sh
+
+ unindent > source.c << 'EOF'
+ int
+ main (int argc, char **argv)
+ {
+ return 0;
+ }
+EOF
+
+ unindent > Makefile.am << 'EOF'
+ foodir = $(prefix)/foo
+ fooexecdir = $(prefix)/foo
+
+ foo_HEADERS = sub/base.h
+ nobase_foo_HEADERS = sub/nobase.h
+
+ dist_foo_DATA = sub/base.dat
+ nobase_dist_foo_DATA = sub/nobase.dat
+
+ dist_fooexec_SCRIPTS = sub/base.sh
+ nobase_dist_fooexec_SCRIPTS = sub/nobase.sh
+
+ fooexec_PROGRAMS = sub/base
+ nobase_fooexec_PROGRAMS = sub/nobase
+ sub_base_SOURCES = source.c
+ sub_nobase_SOURCES = source.c
+
+ fooexec_LIBRARIES = sub/libbase.a
+ nobase_fooexec_LIBRARIES = sub/libnobase.a
+ sub_libbase_a_SOURCES = source.c
+ sub_libnobase_a_SOURCES = source.c
+
+ .PHONY: test-install-sep
+ test-install-sep: install
+ test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.h'
+ test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.h'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/base.h'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.dat'
+ test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.dat'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/base.dat'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase.sh'
+ test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase.sh'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/base.sh'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/sub/nobase$(EXEEXT)'
+ test ! -f '$(DESTDIR)/$(file)-prefix/foo/nobase$(EXEEXT)'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/base$(EXEEXT)'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/sub/libnobase.a'
+ test ! -f '$(DESTDIR)/$(file)-prefix/foo/libnobase.a'
+ test -f '$(DESTDIR)/$(file)-prefix/foo/libbase.a'
+EOF
+
+ $ACLOCAL
+ $AUTOCONF
+ $AUTOMAKE -a
+
+ : > success
+}
+
+# Be sure to avoid interferences from the environment.
+instspc_names_list=''
+instspc_xfail_builds_list=''
+instspc_xfail_installs_list=''
+
+
+# ================= #
+# Test data begin #
+# ----------------- #
+
+# Some control characters that are white space.
+bs='\b' # back space
+cr='\r' # carriage return
+ff='\f' # form feed
+ht=' ' # horizontal tab
+lf='
+' # line feed (aka newline)
+
+# Hack to save typing and make code visually clearer.
+def=define_problematic_string
+
+$def squote \' fail-build fail-install
+$def dquote '"' fail-build fail-install
+$def bquote '`' fail-build fail-install
+$def sharp '#' fail-build fail-install
+$def dollar '$' fail-build fail-install
+$def bang '!'
+$def bslash '\' fail-build
+$def ampersand '&' fail-build
+$def percent '%'
+$def leftpar '('
+$def rightpar ')'
+$def pipe '|'
+$def caret '^'
+$def tilde '~'
+$def qmark '?'
+$def star '*'
+$def plus '+'
+$def minus '-'
+$def comma ','
+$def colon ':'
+$def semicol ';'
+$def equal '='
+$def less '<'
+$def more '>'
+$def at '@'
+$def lqbrack '['
+$def rqbrack ']'
+$def lcbrack '{'
+$def rcbrack '}'
+$def space ' '
+$def tab "$ht"
+$def linefeed "$lf" fail-build fail-install
+$def backspace "$bs"
+$def formfeed "$ff"
+$def carriageret "$cr"
+$def quadrigraph0 '@&t@' fail-build
+$def quadrigraph1 '@<:@'
+$def quadrigraph2 '@:>@'
+$def quadrigraph3 '@S|@'
+$def quadrigraph4 '@%:@'
+$def a_b 'a b'
+$def a__b 'a b'
+$def a_lf_b "a${lf}b" fail-build fail-install
+$def dotdotdot '...'
+$def dosdrive 'a:'
+$def miscglob1 '?[a-z]*'
+$def miscglob2 '.*?[0-9]'
+
+unset def
+
+# --------------- #
+# Test data end #
+# =============== #
+
+
+if test x"$instspc_action" = x"generate-makefile"; then
+ # We must generate a makefile fragment on stdout. It must refer
+ # to all tests at once, hence the loop below.
+ echo '## Generated by instspc-tests.sh. DO NOT EDIT!'
+ echo 'instspc_tests ='
+ echo 'instspc_xfail_tests ='
+ for test_name in $instspc_names_list; do
+ echo "instspc_tests += instspc-$test_name-build.test"
+ echo "instspc_tests += instspc-$test_name-install.test"
+ done
+ for test_name in $instspc_xfail_builds_list; do
+ echo "instspc_xfail_tests += instspc-$test_name-build.test"
+ done
+ for test_name in $instspc_xfail_installs_list; do
+ echo "instspc_xfail_tests += instspc-$test_name-install.test"
+ done
+ exit 0
+fi
+
+# We'll need the full setup provided by `tests/defs'. Temporarily disable
+# the errexit flag, since the setup code might not be prepared to deal
+# with it.
+set +e
+. ./defs || Exit 99
+set -e
+
+# The directory set up by the `generate-data' action should contain all
+# the files we need. So remove the other files created by ./defs. And
+# check we really are in a temporary `*.dir' directory in the build tree,
+# since the last thing we want is to remove some random user files!
+test -f ../defs-static && test -f ../defs || Exit 99
+case `pwd` in *.dir);; *) Exit 99;; esac
+rm -f *
+
+if test x"$instspc_action" = x"generate-data"; then
+ # We must *not* remove the test directory, since its contents must be
+ # used by following dependent tests.
+ keep_testdirs=yes
+ create_input_data
+ Exit 0
+fi
+
+### If we are still here, we have to run a test ...
+
+eval "instspc_test_string=\${instspc__$instspc_test_name}" || Exit 99
+if test x"$instspc_test_string" = x; then
+ echo "$me: invalid test name: '$instspc_test_name'" >&2
+ Exit 99
+fi
+
+test -f ../instspc-data.dir/success || {
+ echo "$me: setup by instspc-data.test failed" >&2
+ Exit 99
+}
+
+# Skip if this system doesn't support these characters in file names.
+mkdir "./$instspc_test_string" || Exit 77
+
+case $instspc_action in
+ test-build)
+ dest=`pwd`/_dest
+ relbuilddir=../..
+ cd "./$instspc_test_string"
+ ;;
+ test-install)
+ dest=`pwd`/$instspc_test_string
+ relbuilddir=..
+ ;;
+ *)
+ echo "$me: internal error: invalid action '$instspc_action'"
+ Exit 99
+ ;;
+esac
+
+$relbuilddir/instspc-data.dir/configure \
+ --prefix "/$instspc_test_string-prefix"
+$MAKE
+# Some make implementations eliminate leading and trailing whitespace
+# from macros passed on the command line, and some eliminate leading
+# whitespace from macros set from environment variables, so prepend
+# './' and use the latter here.
+# Tru64 sh -e needs '|| Exit' in order to work correctly.
+DESTDIR="$dest" file="./$instspc_test_string" $MAKE -e test-install-sep \
+ || Exit 1
+
+:
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_SUBST([LTLIBOBJS], [q.o])
-AM_CONDITIONAL(USE_SWIG, :)
+AM_CONDITIONAL([USE_SWIG], [:])
AC_OUTPUT
END
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Make sure AC_LIBSOURCE and AC_LIBSOURCES work.
+
+. ./defs || Exit 1
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES = foo.c
+libtu_a_LIBADD = $(LIBOBJS)
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+ ls -l $(srcdir) $(builddir) $(distdir)
+ $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+ grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+ grep dummy_maude $(distdir)/maude.c
+liver-src:
+ grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+ grep dummy_liver $(distdir)/liver.c
+liver-not-dist:
+ test -d $(distdir)
+ test ! -r $(distdir)/liver.c
+maude-not-dist:
+ test -d $(distdir)
+ test ! -r $(distdir)/maude.c
+END
+
+cat > foo.c << 'END'
+extern int dummy_foo;
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+# AC_LIBSOURCE should work also if called after AC_OUTPUT.
+cat configure.proto - > configure.in <<END
+AC_LIBSOURCE([maude.c])
+END
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-not-dist
+END
+
++# FIXME: improve support for "installcheck" here.
++cp "$top_testsrcdir/lib/ar-lib" . || Exit 99
++
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+$MAKE distclean
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+END
+
+# AC_LIBSOURCES should work also if called after AC_OUTPUT.
+cat configure.proto - > configure.in <<END
+AC_LIBSOURCES([maude.c, liver.c])
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
AC_LIBOBJ([foo])
AC_OUTPUT
cat > Makefile.am << 'END'
noinst_LIBRARIES = libfoo.a
-libfoo_a_LIBADD = @LIBOBJS@
+libfoo_a_SOURCES =
+libfoo_a_LIBADD = $(LIBOBJS)
+BUILT_SOURCES = foo.c
+CLEANFILES = foo.c
+foo.c:
+ echo 'extern int dummy;' > $@
END
+ : > ar-lib
+
$ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:2:.*foo\.c' stderr
+$AUTOCONF
+$AUTOMAKE
-echo 'BUILT_SOURCES = foo.c' >> Makefile.am
+./configure
-$AUTOMAKE
+$MAKE
+ar t libfoo.a # for debugging
+$MAKE distcheck
+
+:
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
-AC_LIBOBJ([mountlist])
-AC_OUTPUT(Makefile)
+AC_LIBOBJ([foobar])
END
cat > Makefile.am << 'END'
noinst_LIBRARIES = libtu.a
libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+libtu_a_LIBADD = $(LIBOBJS)
END
-: > mountlist.c
+ : > ar-lib
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
+
+:
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
+AC_LIBSOURCE([foobar.c])
+# NOTE: this call to AC_OUTPUT is really needed; see Automake bug #7635
+# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7635>
AC_OUTPUT
END
cat > Makefile.am << 'END'
noinst_LIBRARIES = libtu.a
libtu_a_SOURCES =
-libtu_a_LIBADD = @LIBOBJS@
+libtu_a_LIBADD = $(LIBOBJS)
END
-: > maude.c
-: > liver.c
+ : > ar-lib
+
$ACLOCAL
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
-set -e
-
-cp configure.in X
-echo 'AC_LIBSOURCE(maude.c)' >> configure.in
-$AUTOMAKE
-
-# Avoid timestamp-related differences.
-rm -rf autom4te.cache
-
-cp X configure.in
-echo 'AC_LIBSOURCES([maude.c, liver.c])' >> configure.in
-$AUTOMAKE
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Nonexistent sources for AC_LIBSOURCES should cause Automake to fail.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBSOURCES([foobar.c, bazquux.c])
+# NOTE: this call to AC_OUTPUT is really needed; see Automake bug #7635
+# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7635>
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
++# Don't trip on errors due to missing `AM_PROG_AR'.
++AUTOMAKE="$AUTOMAKE -Wno-extra-portability"
++
+$ACLOCAL
+
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*foobar\.c.*' stderr
+grep 'configure\.in:.*required file.*bazquux\.c.*' stderr
+
+: > foobar.c
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*bazquux\.c.*' stderr
+grep 'foobar\.c' stderr && Exit 1
+
+:
--- /dev/null
- $AUTOMAKE
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Make sure AC_LIBOBJ and friends work.
+# Please keep this in sync with sister test `libobj16b.test'.
+
+. ./defs || Exit 1
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_RANLIB
+%LIBOBJ-STUFF% # will be activated later
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+ ls -l $(srcdir) $(builddir) $(distdir)
+ $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+ grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+ grep dummy_maude $(distdir)/maude.c
+liver-src:
+ grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+ grep dummy_liver $(distdir)/liver.c
+liver-not-dist: distdir
+ test ! -r $(distdir)/liver.c
+maude-not-dist: distdir
+ test ! -r $(distdir)/maude.c
+maude-lib:
+ $(AR) t libtu.a | grep maude
+maude-not-lib:
+ $(AR) t libtu.a | grep maude && exit 1; exit 0
+liver-lib:
+ $(AR) t libtu.a | grep liver
+liver-not-lib:
+ $(AR) t libtu.a | grep liver && exit 1; exit 0
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AC_LIBOBJ([maude])
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist maude-lib liver-not-dist
+END
+
+$ACLOCAL
+$AUTOCONF
++$AUTOMAKE --add-missing
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+if MAUDE_COND
+extra_checks += maude-lib liver-not-lib
+else
+extra_checks += maude-not-lib liver-lib
+endif
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
+if test x"$MAUDE" = x"yes"; then\
+ AC_LIBOBJ([maude])\
+else\
+ AC_LIBOBJ([liver])\
+fi\
+AC_LIBSOURCES([maude.c, liver.c])
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure MAUDE=yes
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+./configure MAUDE=no
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+:
--- /dev/null
- $AUTOMAKE
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Make sure AC_LIBOBJ and friends work.
+# Please keep this in sync with sister test `libobj16b.test'.
+
+. ./defs || Exit 1
+
+mv configure.in configure.proto
+cat >> configure.proto << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
+%LIBOBJ-STUFF% # will be activated later
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = @LIBOBJS@
+
+include extra-checks.am
+.PHONY: $(extra_checks) pre-test
+
+pre-test: distdir
+ ls -l $(srcdir) $(builddir) $(distdir)
+ $(AR) tv libtu.a
+$(extra_checks): pre-test
+check-local: $(extra_checks)
+
+maude-src:
+ grep dummy_maude $(srcdir)/maude.c
+maude-dist:
+ grep dummy_maude $(distdir)/maude.c
+liver-src:
+ grep dummy_liver $(srcdir)/liver.c
+liver-dist:
+ grep dummy_liver $(distdir)/liver.c
+liver-not-dist: distdir
+ test ! -r $(distdir)/liver.c
+maude-not-dist: distdir
+ test ! -r $(distdir)/maude.c
+maude-lib:
+ $(AR) t libtu.a | grep maude
+maude-not-lib:
+ $(AR) t libtu.a | grep maude && exit 1; exit 0
+liver-lib:
+ $(AR) t libtu.a | grep liver
+liver-not-lib:
+ $(AR) t libtu.a | grep liver && exit 1; exit 0
+END
+
+cat > maude.c << 'END'
+extern int dummy_maude;
+END
+
+cat > liver.c << 'END'
+extern int dummy_liver;
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AC_LIBOBJ(maude) dnl: do not quote this!
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist maude-lib liver-not-dist
+END
+
+$ACLOCAL
+$AUTOCONF
- $AUTOMAKE
++$AUTOMAKE -Wno-extra-portability
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+# Avoid timestamp-related differences.
+rm -rf autom4te*.cache
+
+cat > extra-checks.am << 'END'
+extra_checks = maude-src maude-dist liver-src liver-dist
+if MAUDE_COND
+extra_checks += maude-lib liver-not-lib
+else
+extra_checks += maude-not-lib liver-lib
+endif
+END
+
+sed '/%LIBOBJ-STUFF%/{
+s/.*//
+i\
+AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
+if test x"$MAUDE" = x"yes"; then\
+ AC_LIBOBJ(maude) dnl: do not quote this!\
+else\
+ AC_LIBOBJ(liver) dnl: do not quote this!\
+fi\
+AC_LIBSOURCE(maude.c) dnl: do not quote this!\
+AC_LIBSOURCE(liver.c) dnl: do not quote this!
+}' configure.proto > configure.in
+cat configure.in # for debugging
+
+$ACLOCAL
+$AUTOCONF
++$AUTOMAKE -Wno-extra-portability
+
+./configure MAUDE=yes
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+./configure MAUDE=no
+$MAKE
+$MAKE check
+$MAKE distcheck
+$MAKE distclean
+
+:
--- /dev/null
- $AUTOMAKE
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Make sure AC_LIBOBJ accept non-literal arguments.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
++AM_PROG_AR
+foo=${FOO-oops}
+AC_LIBSOURCES([quux.c, zardoz.c])
+AC_LIBOBJ([$foo])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+cat > quux.c <<'END'
+extern int dummy;
+END
+
+cat > zardoz.c <<'END'
+extern int dummy;
+END
+
+# These might print warnings, but should not error out.
+$ACLOCAL
++$AUTOMAKE -a
+$AUTOCONF
+
+./configure FOO=quux
+$MAKE
+ls -l # for debugging
+test -f libtu.a
+ar t libtu.a | $FGREP quux
+ar t libtu.a | $FGREP zardoz && Exit 1
+
+$MAKE distclean
+
+./configure FOO=zardoz
+$MAKE
+ls -l # for debugging
+test -f libtu.a
+ar t libtu.a | $FGREP zardoz
+ar t libtu.a | $FGREP quux && Exit 1
+
+:
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
AC_PROG_CC
-AC_PROG_CC_STDC
+ AM_PROG_AR
AC_PROG_RANLIB
-AC_REPLACE_FUNCS(basename dirname strsignal)
-AM_C_PROTOTYPES
-AC_OUTPUT(Makefile)
+foo=dummy bar=dummy baz=dummy
+AC_LIBSOURCE([$foo.c])
+AC_LIBSOURCES([$bar.c, $baz.c])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test of subdir objects with C++.
+# Test support for AC_CONFIG_LIBOBJ_DIR.
-required=gcc
. ./defs || Exit 1
-set -e
-
-cat > configure.in << END
-AC_INIT([$me], [1.0])
-dnl Prevent automake from looking in .. and ../..
-AC_CONFIG_AUX_DIR([.])
-AM_INIT_AUTOMAKE
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
AC_PROG_CC
-AC_PROG_CC_STDC
-AM_PROG_CC_C_O
-AM_C_PROTOTYPES
-AC_CONFIG_FILES([Makefile])
++AM_PROG_AR
+AC_PROG_RANLIB
+AC_LIBOBJ([foobar])
AC_OUTPUT
END
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = subdir-objects
-bin_PROGRAMS = hello
-hello_SOURCES = sub/hello.c
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+check-local: distdir
+ ls -l $(srcdir)/* $(builddir)/* $(distdir)/*
+ test -f libtu.a
+ test ! -r $(srcdir)/foobar.c
+ test -f $(srcdir)/libobj-dir/foobar.c
+ test ! -r $(distdir)/foobar.c
+ test -f $(distdir)/libobj-dir/foobar.c
+ $(AR) t libtu.a
+ $(AR) t libtu.a | grep foobar
END
-mkdir sub
-cat > sub/hello.c << 'END'
-#include <stdio.h>
-int
-main (int argc, char *argv[])
-{
- printf ("yeah, yeah\n");
- return 0;
-}
+mkdir libobj-dir
+cat > libobj-dir/foobar.c << 'END'
+extern int dummy;
END
-# Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
++# FIXME: improve support for "installcheck" here.
++cp "$top_testsrcdir/lib/ar-lib" . || Exit 99
+
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
$ACLOCAL
$AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE
+
./configure
-ANSI2KNR=./ansi2knr U=_ $MAKE -e
-./hello
+
+$MAKE
+$MAKE check
+$MAKE distcheck
:
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([subdir/Makefile])
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
+AC_CHECK_TOOLS([AR], [ar])
AC_LIBOBJ([fsusage])
-AC_OUTPUT(subdir/Makefile)
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = subdir
+check-local: distdir
+ ls -l $(srcdir) $(srcdir)/subdir
+ ls -l $(distdir) $(distdir)/subdir
+ ls -l $(builddir) $(builddir)/subdir
+ test -f $(srcdir)/subdir/fsusage.c
+ test -f $(distdir)/subdir/fsusage.c
+ $(AR) tv $(builddir)/subdir/libtu.a
END
mkdir subdir
libtu_a_LIBADD = @LIBOBJS@
END
-: > ar-lib
-: > subdir/fsusage.c
+cat > subdir/fsusage.c << 'END'
+extern int dummy;
+END
+
+$ACLOCAL
+$AUTOCONF
- $AUTOMAKE
++$AUTOMAKE -a
+
+# Older grepping check, kept "just to be sure".
+$FGREP 'fsusage.c' subdir/Makefile.in
+
+./configure
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$MAKE check
+$MAKE distcheck
-grep 'fsusage\.c' subdir/Makefile.in
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20b.test' and `libobj20c.test' .
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_RANLIB
+AC_LIBOBJ([foo])
+END
+
+cat > Makefile.am << 'END'
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+mkdir libobj-dir
+: > libobj-dir/foo.c
++: > ar-lib
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'LIBOBJS.*used outside.*libobj-dir' stderr
+grep 'subdir-objects.*not set' stderr
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20a.test' and `libobj20c.test' .
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_RANLIB
+AC_LIBSOURCE([foobar.c])
+# NOTE: this call to AC_OUTPUT is really needed; see Automake bug #7635
+# <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7635>
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
++: > ar-lib
++
+$ACLOCAL
+
+AUTOMAKE_fails
+grep 'configure\.in:.*required directory.*libobj-dir' stderr
+
+mkdir libobj-dir
+: > foobar.c # oops, it should be in libobj-dir...
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*libobj-dir/foobar.c.*' stderr
+
+rm -f foobar.c
+
+: > libobj-dir/foobar.c
+$AUTOMAKE # now we should succeed
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Test error reporting for AC_CONFIG_LIBOBJ_DIR.
+# See also sister tests `libobj20a.test' and `libobj20b.test' .
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_CONFIG_LIBOBJ_DIR([libobj-dir])
+AC_PROG_CC
+AC_PROG_RANLIB
+AC_LIBOBJ([foobar])
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = subdir-objects
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = $(LIBOBJS)
+END
+
+$ACLOCAL
+
++# Don't trip on errors due to missing `AM_PROG_AR'.
++AUTOMAKE="$AUTOMAKE -Wno-extra-portability"
++
+AUTOMAKE_fails
+grep 'configure\.in:.*required directory.*\./libobj-dir' stderr
+
+mkdir libobj-dir
+: > foobar.c # oops, it should be in libobj-dir!
+AUTOMAKE_fails
+grep 'configure\.in:.*required file.*libobj-dir/foobar.c.*' stderr
+
+rm -f foobar.c
+
+: > libobj-dir/foobar.c
+$AUTOMAKE # now we should succeed
+
+:
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
-AC_REPLACE_FUNCS(basename dirname strsignal)
-AC_OUTPUT(Makefile)
+# `am__dummy_function' is there to ensure that at least one function is
+# replaced, to avoid creating an empty archive which can cause problems
+# with e.g. Solaris ar.
+AC_REPLACE_FUNCS([basename dirname am__dummy_function])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
noinst_LIBRARIES = libtu.a
libtu_a_SOURCES =
libtu_a_LIBADD = @LIBOBJS@
+check-local: test1 test2 test3
+.PHONY: test1 test2 test3
+test1: all
+ $(AR) tv libtu.a
+test2:
+ @echo DIST_COMMON = $(DIST_COMMON)
+ echo ' ' $(DIST_COMMON) ' ' | grep '[ /]basename\.c '
+ echo ' ' $(DIST_COMMON) ' ' | grep '[ /]dirname\.c '
+ echo ' ' $(DIST_COMMON) ' ' | grep '[ /]am__dummy_function\.c '
+test3: distdir
+ test -f $(distdir)/basename.c
+ test -f $(distdir)/dirname.c
+ test -f $(distdir)/am__dummy_function.c
END
-: > ar-lib
-: > basename.c
-: > dirname.c
-: > strsignal.c
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-
-sed -n -e ': again
- /^DIST_COMMON.*[^\]$/ p
- /^DIST_COMMON/ {
- s/^DIST_COMMON//p
- n
- s/^/DIST_COMMON/
- b again
- }' < Makefile.in | $FGREP dirname.c
+cat > basename.c <<'END'
+extern int dummy1;
+END
+cat > dirname.c <<'END'
+extern int dummy2;
+END
+cat > am__dummy_function.c <<'END'
+extern int dummy3;
+END
+
+$ACLOCAL
+$AUTOCONF
- $AUTOMAKE
++$AUTOMAKE --add-missing
+
+./configure
+
+$MAKE
+$MAKE check
+$MAKE distcheck
+
+:
libfoo_a_DEPENDENCIES = libzot.a
END
-
-$ACLOCAL || Exit 1
+ : > ar-lib
+$ACLOCAL
$AUTOMAKE
+
+:
required=libtoolize
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
required=libtoolize
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(mypackage,0.1)
-
+cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
-
-AC_CONFIG_FILES([
- sub/Makefile
- Makefile
-])
+AC_CONFIG_FILES([sub/Makefile])
AC_OUTPUT
END
required='libtoolize gcc'
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AM_PROG_LIBTOOL
AC_OUTPUT
END
required='libtoolize gcc'
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
AC_OUTPUT
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS])
+ AM_PROG_AR
AC_PROG_LIBTOOL
END
3
END
+ : > ar-lib
+
$ACLOCAL
-AUTOMAKE_fails
+AUTOMAKE_fails -Wno-error
# Smash the useless difference of lib file locations.
sed 's,^.*lib/am/\([a-z]*\.am\),\1,' stderr >observed
required='libtoolize gcc'
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_SUBST([HELLO_SYSTEM], [hello-generic.lo])
AM_CONDITIONAL([LINUX], true)
required='libtoolize gcc'
. ./defs || Exit 1
-set -e
-
cat >>configure.in <<'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_CONFIG_FILES(sub1/Makefile
sub2/Makefile
required=libtool
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_PROG_CXX
AM_CONDITIONAL(HACKING_COMPACT_BUILD, whatever)
required='libtoolize'
. ./defs || Exit 1
-set -e
-
cat >>configure.in <<'END'
AC_PROG_CC
+ AM_PROG_AR
dnl Older libtool versions don't define LT_PREREQ :-(
m4_ifdef([LT_PREREQ],
[LT_PREREQ([2.0])],
required='libtoolize'
. ./defs || Exit 1
-set -e
-
cat >>configure.in <<'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AM_CONDITIONAL([COND], [:])
AC_OUTPUT
# libtoolize might have installed config.guess and config.sub already,
# and autom4te might warn about bugs in Libtool macro files, so filter
# out warnings about Makefile.am only. We don't care in this test
- # whether automake installs config.guess and config.sub.
+ # whether automake installs config.guess, config.sub and ar-lib.
cat >expected <<'END'
-Makefile.am:5: sub/liba2.la multiply defined in condition COND
+Makefile.am:5: error: sub/liba2.la multiply defined in condition COND
Makefile.am:5: `sub/liba2.la' should be installed below `lib' in condition COND ...
Makefile.am:2: ... and should also be installed in `lib' in condition COND.
-Makefile.am:4: liba1.la multiply defined in condition COND
+Makefile.am:4: error: liba1.la multiply defined in condition COND
Makefile.am:4: `liba1.la' should be installed in `pkglib' in condition COND ...
Makefile.am:2: ... and should also be installed in `lib' in condition COND.
-Makefile.am:2: Libtool libraries can be built for only one destination.
+Makefile.am:2: Libtool libraries can be built for only one destination
END
grep '^Makefile.am' stderr | diff - expected
. ./defs || Exit 1
cat >> configure.in << 'END'
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS])
+ AM_PROG_AR
AC_PROG_LIBTOOL
END
required='libtool gcc'
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
required='libtoolize'
. ./defs || Exit 1
-set -e
-
cat >>configure.in <<'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
required='libtoolize gcc'
. ./defs || Exit 1
-set -e
-
cat >> configure.in <<'EOF'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
EOF
required='gcc'
. ./defs || Exit 1
-set -e
-
cat >> configure.in <<'EOF'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
AC_OUTPUT
EOF
AC_PROG_RANLIB
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+ : > ar-lib
+
+$ACLOCAL
+$AUTOMAKE
grep 'noinstdir' Makefile.in && Exit 1
grep 'checkdir' Makefile.in && Exit 1
--- /dev/null
- $AUTOMAKE
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works
+# in when used in LDADD.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
++AM_PROG_AR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+u = libquux1.lib libquux2.lib
+v = libquux1
+w = none
+
+zardozdir = $(prefix)/zardoz
+zardoz_PROGRAMS = foo bar
+
+noinst_LIBRARIES = libquux1.a libquux2.a libquux3.a
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+LDADD = $(u:.lib=.a)
+bar_LDADD = $(v:=.a) libquux2.a $(w:none=libquux3.a)
+
+libquux1.c:
+ echo 'int quux1(void) { return 0; }' > $@
+CLEANFILES = libquux1.c # for FreeBSD make
+END
+
+cat > foo.c <<'END'
+int main(void)
+{
+ int quux1(void), quux2(void);
+ return quux1() + quux2();
+}
+END
+
+cat > bar.c <<'END'
+int main(void)
+{
+ int quux1(void), quux2(void), quux3(void);
+ return quux1() + quux2() + quux3();
+}
+END
+
+echo 'int quux2(void) { return 0; }' > libquux2.c
+echo 'int quux3(void) { return 0; }' > libquux3.c
+
+$ACLOCAL
+$AUTOCONF
++$AUTOMAKE -a
+
+./configure
+$MAKE
+test -f libquux1.c
+$MAKE distcheck
+
+:
--- /dev/null
- $AUTOMAKE
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# with the LIBRARIES primary in a "simple" way.
+# Keep this in sync with sister test `posixsubst-ltlibraries.test'.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_PROG_RANLIB
++AM_PROG_AR
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+foolibs = libfoo1 libfoo2
+barlibs = libbaz
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+lib_LIBRARIES = $(foolibs:=.a) $(barlibs:z=r.a)
+
+libbar.c:
+ echo 'int bar(void) { return 0; }' > $@
+CLEANFILES = libbar.c # for FreeBSD make
+
+installcheck-local:
+ ls -l $(prefix)/lib
+ test -f $(prefix)/lib/libfoo1.a
+ test -f $(prefix)/lib/libfoo2.a
+ test -f $(prefix)/lib/libbar.a
+END
+
+echo 'int bar1(void) { return 0; }' > libfoo1.c
+echo 'int bar2(void) { return 0; }' > libfoo2.c
+
+$ACLOCAL
+$AUTOCONF
++$AUTOMAKE -a
+
+cwd=`pwd` || Exit 1
+./configure --prefix="$cwd/_inst"
+$MAKE
+test -f libfoo2.c
+$MAKE install
+$MAKE installcheck
+$MAKE distcheck
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Test that POSIX variable expansion `$(var:str=rpl)' works when used
+# with the LTLIBRARIES primary in a "simple" way.
+# Keep this in sync with sister test `posixsubst-libraries.test'.
+
+required='libtool libtoolize'
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+foolibs = libfoo1 libfoo2
+barlibs = libbaz
+
+# Also try an empty match suffix, to ensure that the `:=' in there is
+# not confused by the parser with an unportable assignment operator.
+lib_LTLIBRARIES = $(foolibs:=.la) $(barlibs:z=r.la)
+
+libbar.c:
+ echo 'int bar(void) { return 0; }' > $@
+CLEANFILES = libbar.c # for FreeBSD make
+
+installcheck-local:
+ ls -l $(prefix)/lib
+ test -f $(prefix)/lib/libfoo1.la
+ test -f $(prefix)/lib/libfoo2.la
+ test -f $(prefix)/lib/libbar.la
+END
+
+echo 'int bar1(void) { return 0; }' > libfoo1.c
+echo 'int bar2(void) { return 0; }' > libfoo2.c
+
+libtoolize
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+cwd=`pwd` || Exit 1
+./configure --prefix="$cwd/_inst"
+$MAKE
+test -f libfoo2.c
+$MAKE install
+$MAKE installcheck
+$MAKE distcheck
+
+:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Check that python support can work well with virtualenvs.
+# This test also works as a mild stress-test on the python support.
+
+required='python virtualenv'
+. ./defs || Exit 1
+
+# In case the user's config.site defines pythondir or pyexecdir.
+CONFIG_SITE=/dev/null; export CONFIG_SITE
+
+# Skip the test if a proper virtualenv cannot be created.
+virtualenv --verbose virtenv || Exit 77
+test -f virtenv/bin/activate || Exit 77
+
+# Activate the virtualenv.
+. ./virtenv/bin/activate
+# Sanity check.
+test -n "$VIRTUAL_ENV" || Exit 99
+
+cwd=`pwd`
+py_version=`python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))'`
+py_site=$VIRTUAL_ENV/lib/python$py_version/site-packages
+
+# We need control over the package name.
+cat > configure.in << END
+AC_INIT([am_virtenv], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_SUBST([MY_VIRTENV], ['$cwd/virtenv'])
+AC_PROG_CC
++AM_PROG_AR
+AC_PROG_RANLIB
+AM_PATH_PYTHON
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+python_PYTHON = am_foo.py
+pkgpython_PYTHON = __init__.py
+pyexec_LIBRARIES = libquux.a
+libquux_a_SOURCES = foo.c
+pkgpyexec_LIBRARIES = libzardoz.a
+libzardoz_a_SOURCES = foo.c
+
+py_site = $(MY_VIRTENV)/lib/python$(PYTHON_VERSION)/site-packages
+
+.PYTHON: debug test-run test-install test-uninstall
+debug:
+ @echo PYTHON: $(PYTHON)
+ @echo PYTHON_VERSION: $(PYTHON_VERSION)
+ @echo prefix: $(prefix)
+ @echo pythondir: $(pythondir)
+ @echo pkgpythondir: $(pkgpythondir)
+ @echo pyexecdir: $(pyexecdir)
+ @echo pkgpyexecdir: $(pkgpyexecdir)
+test-run:
+ ## In a virtualenv, the default python must be the custom
+ ## virtualenv python.
+ @: \
+ && py1=`python -c 'import sys; print(sys.executable)'` \
+ && py2=`$(PYTHON) -c 'import sys; print(sys.executable)'` \
+ && echo "py1: $$py1" \
+ && echo "py2: $$py2" \
+ && test -n "$$py1" \
+ && test -n "$$py2" \
+ && test x"$$py1" = x"$$py2"
+ ## Check that modules installed in the virtualenv are readily
+ ## available.
+ python -c 'from am_foo import foo_func; assert (foo_func () == 12345)'
+ python -c 'from am_virtenv import old_am; assert (old_am () == "AutoMake")'
+test-install:
+ test -f $(py_site)/am_foo.py
+ test -f $(py_site)/am_foo.pyc
+ test -f $(py_site)/am_foo.pyo
+ test -f $(py_site)/am_virtenv/__init__.py
+ test -f $(py_site)/am_virtenv/__init__.pyc
+ test -f $(py_site)/am_virtenv/__init__.pyo
+ test -f $(py_site)/libquux.a
+ test -f $(py_site)/am_virtenv/libzardoz.a
+test-uninstall:
+ test ! -f $(py_site)/am_foo.py
+ test ! -f $(py_site)/am_foo.pyc
+ test ! -f $(py_site)/am_foo.pyo
+ test ! -f $(py_site)/am_virtenv/__init__.py
+ test ! -f $(py_site)/am_virtenv/__init__.pyc
+ test ! -f $(py_site)/am_virtenv/__init__.pyo
+ test ! -f $(py_site)/libquux.a
+ test ! -f $(py_site)/am_virtenv/libzardoz.a
+all-local: debug
+END
+
+cat > am_foo.py << 'END'
+def foo_func ():
+ return 12345
+END
+
+cat > __init__.py << 'END'
+def old_am ():
+ return 'AutoMake'
+END
+
+cat > foo.c << 'END'
+int foo (void)
+{
+ return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+# Try a VPATH build.
+mkdir build
+cd build
+../configure --prefix="$VIRTUAL_ENV"
+$MAKE install
+$MAKE test-install
+$MAKE test-run
+$MAKE uninstall
+$MAKE test-uninstall
+cd ..
+
+# Try an in-tree build.
+./configure --prefix="$VIRTUAL_ENV"
+$MAKE install
+$MAKE test-install
+$MAKE test-run
+$MAKE uninstall
+$MAKE test-uninstall
+
+$MAKE distclean
+
+# Overriding pythondir and pyexecdir with cache variables should work.
+./configure am_cv_python_pythondir="$py_site" \
+ am_cv_python_pyexecdir="$py_site"
+$MAKE install
+$MAKE test-install
+$MAKE test-run
+$MAKE uninstall
+$MAKE test-uninstall
+
+$MAKE distclean
+
+# Overriding pythondir and pyexecdir at make time should be enough.
+./configure --prefix="$cwd/bad-prefix"
+pythondir=$py_site pyexecdir=$py_site
+export pythondir pyexecdir
+$MAKE -e install
+test ! -d bad-prefix
+$MAKE -e test-install
+$MAKE test-run
+$MAKE -e uninstall
+$MAKE -e test-uninstall
+unset pythondir pyexecdir
+
+# Also check that the distribution is self-contained, for completeness.
+$MAKE distcheck
+
+# Finally, check that if we disable the virtualenv, we shouldn't be
+# able to access to the installed modules anymore.
+cd build
+$MAKE install
+python -c 'import am_foo; print(am_foo.__file__)'
+python -c 'import am_virtenv; print(am_virtenv.__file__)'
+deactivate "nondestructive"
+python -c 'import am_foo' && Exit 1
+python -c 'import am_virtenv' && Exit 1
+
+:
required=strip
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
AC_OUTPUT
END
required='libtoolize strip'
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AC_OUTPUT
END
required='gcc'
. ./defs || Exit 1
-set -e
-
cat >> configure.in <<'EOF'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_RANLIB
if test -n "$doit"; then
AC_SUBST([basehdr], [sub/base.h])
cat > Makefile.am << 'END'
noinst_PROGRAMS = foo
+noinst_LIBRARIES = libbar.a
END
--$ACLOCAL
++for use_arlib in false :; do
+
- $AUTOMAKE -i
- grep '^ *\.c' Makefile.in # for debugging
- test `grep -c '^\.c\.o:' Makefile.in` -eq 1
- test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
++ if $use_arlib; then
++ am_warns=
++ echo AM_PROG_AR >> configure.in
++ : > ar-lib
++ else
++ am_warns=-Wno-extra-portability
++ fi
+
- $AUTOMAKE
- grep '^ *\.c' Makefile.in # for debugging
- test `grep -c '^\.c\.o:' Makefile.in` -eq 1
- test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
++ $ACLOCAL --force
++
++ $AUTOMAKE $am_warns -i
++ grep '^ *\.c' Makefile.in # for debugging
++ test `grep -c '^\.c\.o:' Makefile.in` -eq 1
++ test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+
-$AUTOMAKE -i
-grep '^\.c\.o' Makefile.in
++ $AUTOMAKE $am_warns
++ grep '^ *\.c' Makefile.in # for debugging
++ test `grep -c '^\.c\.o:' Makefile.in` -eq 1
++ test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+
-$AUTOMAKE
-grep '^\.c\.o' Makefile.in
++done
:
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
END
: > config.sub
$ACLOCAL
- $AUTOMAKE -i
+
+ $AUTOMAKE -a
+grep '^ *\.c' Makefile.in # for debugging
+test `grep -c '^\.c\.o:' Makefile.in` -eq 1
+test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
- $AUTOMAKE
++$AUTOMAKE -i
+grep '^ *\.c' Makefile.in # for debugging
test `grep -c '^\.c\.o:' Makefile.in` -eq 1
test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
required=libtool
. ./defs || Exit 1
-set -e
-
cat >> configure.in << 'END'
+AC_SUBST([LINK], [:])
+ AM_PROG_AR
AC_PROG_LIBTOOL
+AC_OUTPUT
END
cat > Makefile.am << 'END'
END
: > ltmain.sh
-: > config.guess
-: > config.sub
-: > ar-lib
+
- cp "$testsrcdir/../lib/config.guess" "$testsrcdir/../lib/config.sub" .
++# FIXME: better support for installcheck.
++for auxscript in ar-lib config.guess config.sub; do
++ cp "$top_testsrcdir/lib/$auxscript" . \
++ || fatal_ "fetching auxiliary script \`$auxscript'"
++done
$ACLOCAL
$AUTOMAKE
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure Automake supports multiple derivations for the same suffix.
-# PR/37
+# Test to make sure Automake supports multiple derivations for the
+# same suffix.
+# From PR/37.
-required='gcc libtoolize'
+required=libtoolize
. ./defs || Exit 1
-set -e
-
cat >>configure.in <<'END'
+ AM_PROG_AR
AM_PROG_LIBTOOL
AC_OUTPUT
END
required="libtool"
. ./defs || Exit 1
-set -e
-
cat >> 'configure.in' << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AM_PROG_VALAC
AC_OUTPUT
required="libtool"
. ./defs || Exit 1
-set -e
-
cat >> 'configure.in' << 'END'
AC_PROG_CC
+ AM_PROG_AR
AC_PROG_LIBTOOL
AM_PROG_VALAC
AC_OUTPUT
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Make sure we warn about possible variable typos when we should,
+# Libtool variant.
+
+required=libtoolize
+. ./defs || Exit 1
+
+cat >>configure.in <<'END'
++AM_PROG_AR
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+libfoo_la_SOURCES = unused
+nodist_libfoo_la_SOURCES = unused
+EXTRA_libfoo_la_SOURCES = unused
+libfoo_la_LIBADD = unused
+libfoo_la_DEPENDENCIES = unused
+EXTRA_libfoo_la_DEPENDENCIES = unused
+END
+
+libtoolize
+$ACLOCAL
+AUTOMAKE_fails --add-missing
+# The expected diagnostic is:
+# automake: warnings are treated as errors
+# Makefile.am:3: warning: variable `EXTRA_libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:3: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:1: warning: variable `libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:1: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:2: warning: variable `nodist_libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:2: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:4: warning: variable `libfoo_la_LIBADD' is defined but no program or
+# Makefile.am:4: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:6: warning: variable `EXTRA_libfoo_la_DEPENDENCIES' is defined but no program or
+# Makefile.am:6: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:5: warning: variable `libfoo_la_DEPENDENCIES' is defined but no program or
+# Makefile.am:5: library has `libfoo_la' as canonical name (possible typo)
+
+
+grep 'as canonical' stderr | grep -v ' .libfoo_la. ' && Exit 1
+test `grep 'variable.*is defined but' stderr | wc -l` = 6
+
+# If we add a global -Wnone, all warnings should disappear.
+$AUTOMAKE -Wnone
+
+# Likewise, if matching programs or libraries are defined.
+cat >>Makefile.am <<'END'
+lib_LTLIBRARIES = libfoo.la
+END
+
+$AUTOMAKE
+
+:
--- /dev/null
- AUTOMAKE_fails
+#! /bin/sh
+# Copyright (C) 2010, 2011 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/>.
+
+# Make sure we warn about possible variable typos when we should.
+
+. ./defs || Exit 1
+
+cat >>configure.in <<'END'
+AC_PROG_RANLIB
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+foo_SOURCES = unused
+nodist_foo_SOURCES = unused
+EXTRA_foo_SOURCES = unused
+foo_LDADD = unused
+foo_LDFLAGS = unused
+foo_DEPENDENCIES = unused
+EXTRA_foo_DEPENDENCIES = unused
+
+libfoo_a_SOURCES = unused
+nodist_libfoo_a_SOURCES = unused
+EXTRA_libfoo_a_SOURCES = unused
+libfoo_a_LIBADD = unused
+libfoo_a_DEPENDENCIES = unused
+EXTRA_libfoo_a_DEPENDENCIES = unused
+END
+
+$ACLOCAL
- $AUTOMAKE
++AUTOMAKE_fails -Wno-extra-portability
+# The expected diagnostic is:
+# automake: warnings are treated as errors
+# Makefile.am:2: warning: variable `nodist_foo_SOURCES' is defined but no program or
+# Makefile.am:2: library has `foo' as canonical name (possible typo)
+# Makefile.am:1: warning: variable `foo_SOURCES' is defined but no program or
+# Makefile.am:1: library has `foo' as canonical name (possible typo)
+# Makefile.am:9: warning: variable `libfoo_a_SOURCES' is defined but no program or
+# Makefile.am:9: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:10: warning: variable `nodist_libfoo_a_SOURCES' is defined but no program or
+# Makefile.am:10: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:11: warning: variable `EXTRA_libfoo_a_SOURCES' is defined but no program or
+# Makefile.am:11: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:3: warning: variable `EXTRA_foo_SOURCES' is defined but no program or
+# Makefile.am:3: library has `foo' as canonical name (possible typo)
+# Makefile.am:12: warning: variable `libfoo_a_LIBADD' is defined but no program or
+# Makefile.am:12: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:4: warning: variable `foo_LDADD' is defined but no program or
+# Makefile.am:4: library has `foo' as canonical name (possible typo)
+# Makefile.am:5: warning: variable `foo_LDFLAGS' is defined but no program or
+# Makefile.am:5: library has `foo' as canonical name (possible typo)
+# Makefile.am:14: warning: variable `EXTRA_libfoo_a_DEPENDENCIES' is defined but no program or
+# Makefile.am:14: library has `libfoo_a' as canonical name (possible typo)
+# Makefile.am:7: warning: variable `EXTRA_foo_DEPENDENCIES' is defined but no program or
+# Makefile.am:7: library has `foo' as canonical name (possible typo)
+# Makefile.am:6: warning: variable `foo_DEPENDENCIES' is defined but no program or
+# Makefile.am:6: library has `foo' as canonical name (possible typo)
+# Makefile.am:13: warning: variable `libfoo_a_DEPENDENCIES' is defined but no program or
+# Makefile.am:13: library has `libfoo_a' as canonical name (possible typo)
+
+grep 'as canonical' stderr | grep -v ' .foo. ' | grep -v ' .libfoo_a. ' \
+ && Exit 1
+test `grep 'variable.*is defined but' stderr | wc -l` = 13
+
+# If we add a global -Wnone, all warnings should disappear.
+$AUTOMAKE -Wnone
+
+# Likewise, if matching programs or libraries are defined.
+cat >>Makefile.am <<'END'
+bin_PROGRAMS = foo
+lib_LIBRARIES = libfoo.a
+END
+
++$AUTOMAKE -Wno-extra-portability
+
+: