From: Stefano Lattarini Date: Thu, 3 Nov 2011 12:50:06 +0000 (+0100) Subject: Merge branch 'msvc' into master X-Git-Tag: ng-0.5a~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38e1b39d77ad4a22c85d5ad7b2fde4fd51bfd1b5;p=thirdparty%2Fautomake.git Merge branch 'msvc' into master Commits merged from msvc: - tests: few improvements to some `ar-lib' related tests - warnings: new 'extra-portability' category, for AM_PROG_AR - ar-lib: new 'AM_PROG_AR' macro, triggering the 'ar-lib' script Extra changes required by the testsuite: * 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. --- 38e1b39d77ad4a22c85d5ad7b2fde4fd51bfd1b5 diff --cc ChangeLog index 051e7fa5f,bd0a16521..b79cae064 --- a/ChangeLog +++ b/ChangeLog @@@ -1,3 -1,3 +1,127 @@@ ++2011-11-03 Stefano Lattarini ++ ++ 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 ++ ++ 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 ++ Ralf Wildenhues ++ Stefano Lattarini ++ ++ 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 (tiny change) Stefano Lattarini diff --cc NEWS index 3852abfab,c65ca1422..6c548d1f7 --- a/NEWS +++ b/NEWS @@@ -32,32 -27,9 +32,35 @@@ New in 1.11a - 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 diff --cc automake.in index cbbdd5308,edfa7e975..0b6d014f4 mode 100644,100755..100644 --- a/automake.in +++ b/automake.in diff --cc tests/Makefile.am index d900b41b9,8056f2d74..b5ad95a10 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@@ -162,13 -102,33 +162,24 @@@ amhello-binpkg.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 \ @@@ -465,8 -396,8 +476,10 @@@ extra9.test extra10.test \ extra11.test \ extra12.test \ +extradep.test \ +extradep2.test \ + extra-portability.test \ + extra-portability2.test \ f90only.test \ flavor.test \ flibs.test \ diff --cc tests/Makefile.in index e1f91d039,8e6eb4c3e..babba97f3 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@@ -438,13 -386,33 +438,24 @@@ amhello-binpkg.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 \ @@@ -741,8 -680,8 +752,10 @@@ extra9.test extra10.test \ extra11.test \ extra12.test \ +extradep.test \ +extradep2.test \ + extra-portability.test \ + extra-portability2.test \ f90only.test \ flavor.test \ flibs.test \ diff --cc tests/aclocal4.test index e18684b7c,eab8ca806..10b208034 --- a/tests/aclocal4.test +++ b/tests/aclocal4.test @@@ -21,8 -21,11 +21,9 @@@ required=GNUmake . ./defs || Exit 1 -set -e - cat >>configure.in <> configure.in << 'END' + AM_PROG_AR AC_SUBST([AR], ['echo it works']) AC_SUBST([ARFLAGS], ['>']) AC_SUBST([RANLIB], ['echo really works >>']) diff --cc tests/canon4.test index 733ea7027,d98636f32..c6b7296dd --- a/tests/canon4.test +++ b/tests/canon4.test @@@ -20,8 -18,11 +20,9 @@@ . ./defs || Exit 1 -set -e - cat >> configure.in << 'END' AC_PROG_CC + AM_PROG_AR AC_PROG_RANLIB END diff --cc tests/canon6.test index a24e2eb6f,9d6fd6e11..dd2e44ea0 --- a/tests/canon6.test +++ b/tests/canon6.test @@@ -15,27 -14,34 +15,29 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# 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 +: diff --cc tests/canon7.test index 4e700df1e,000000000..c399cd5ac mode 100755,000000..100755 --- a/tests/canon7.test +++ b/tests/canon7.test @@@ -1,90 -1,0 +1,91 @@@ +#! /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 . + +# 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 +int main(void) +{ + printf("Hello, FooBar!\n"); + return 0; +} +END + +cat > dummy.c << 'END' +#include +#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 + +: diff --cc tests/defs index ba4e9cc77,b8edd3b52..1c9dd908b --- a/tests/defs +++ b/tests/defs @@@ -403,16 -276,19 +403,24 @@@ d # 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. diff --cc tests/depcomp4.test index b995c0836,3c3602f58..80c9043d4 --- a/tests/depcomp4.test +++ b/tests/depcomp4.test @@@ -19,8 -19,11 +19,9 @@@ 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 diff --cc tests/depcomp8b.test index c67c3a85b,56514792d..1cd61a3cd --- a/tests/depcomp8b.test +++ b/tests/depcomp8b.test @@@ -22,8 -22,11 +22,9 @@@ required=libtoolize . ./defs || Exit 1 -set -e - cat >> configure.in << 'END' AC_PROG_CC + AM_PROG_AR AC_PROG_LIBTOOL AC_OUTPUT END diff --cc tests/extra-portability.test index 000000000,191dcb493..353141faa mode 000000,100755..100755 --- a/tests/extra-portability.test +++ b/tests/extra-portability.test @@@ -1,0 -1,69 +1,69 @@@ + #! /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 . + + # 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 <Makefile.am <. + + # Make sure that extra-portability warnings are not enabled by --gnits, + # --gnu and --foreign. + + . ./defs || Exit 1 + + set -e + -# Satisfy --gnits and --gnu. -: > INSTALL -: > NEWS -: > README -: > AUTHORS -: > ChangeLog -: > COPYING -: > THANKS ++# We want complete control over automake options. ++AUTOMAKE=$original_AUTOMAKE + + cat >>configure.in <Makefile.am <>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 diff --cc tests/extradep.test index 623d73a62,000000000..636d9b282 mode 100755,000000..100755 --- a/tests/extradep.test +++ b/tests/extradep.test @@@ -1,105 -1,0 +1,106 @@@ +#! /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 . + +# 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 + +: diff --cc tests/extradep2.test index 9a97de4ec,000000000..97f485d38 mode 100755,000000..100755 --- a/tests/extradep2.test +++ b/tests/extradep2.test @@@ -1,87 -1,0 +1,88 @@@ +#! /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 . + +# 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 + +: diff --cc tests/instdir-ltlib.test index 25f68dda3,f4003775a..d02359b79 --- a/tests/instdir-ltlib.test +++ b/tests/instdir-ltlib.test @@@ -24,8 -23,10 +24,9 @@@ required=libtooliz cat >>configure.in <<'END' AC_PROG_CC AM_PROG_CC_C_O + AM_PROG_AR AC_PROG_LIBTOOL +AM_PATH_PYTHON AC_OUTPUT END diff --cc tests/instdir-prog.test index 77fc2a04c,66a489227..0311613b6 --- a/tests/instdir-prog.test +++ b/tests/instdir-prog.test @@@ -23,8 -22,10 +23,9 @@@ cat >>configure.in <<'END' AC_PROG_CC AM_PROG_CC_C_O + AM_PROG_AR AC_PROG_RANLIB +AM_PATH_PYTHON AC_OUTPUT END diff --cc tests/instfail-libtool.test index b580c400e,2e5e312f6..d4ee994d0 --- a/tests/instfail-libtool.test +++ b/tests/instfail-libtool.test @@@ -22,7 -22,10 +22,8 @@@ required='libtool libtoolize' . ./defs || Exit 1 -set -e - cat >>configure.in <>configure.in <. + +# +# 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='' # back space +cr=' ' # carriage return +ff=' ' # 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 + +: diff --cc tests/ldflags.test index 96fb21302,c00f227d7..92fb42c08 --- a/tests/ldflags.test +++ b/tests/ldflags.test @@@ -23,9 -21,10 +23,10 @@@ required=libtoo 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 diff --cc tests/libobj-basic.test index 0fe0278c7,000000000..f87660ef6 mode 100755,000000..100755 --- a/tests/libobj-basic.test +++ b/tests/libobj-basic.test @@@ -1,108 -1,0 +1,112 @@@ +#! /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 . + +# 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 < 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 <> configure.in << 'END' AC_PROG_CC + AM_PROG_AR AC_PROG_RANLIB AC_LIBOBJ([foo]) AC_OUTPUT @@@ -29,22 -31,15 +30,24 @@@ EN 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 + +: diff --cc tests/libobj15a.test index 044e3db85,fc7f17372..1889d637f --- a/tests/libobj15a.test +++ b/tests/libobj15a.test @@@ -18,20 -18,24 +18,23 @@@ . ./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 + : > ar-lib -: > mountlist.c + -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +AUTOMAKE_fails +grep 'configure\.in:.*required file.*foobar\.c.*' stderr + +: diff --cc tests/libobj15b.test index 4548a2a2a,a40baa40d..03415c2fc --- a/tests/libobj15b.test +++ b/tests/libobj15b.test @@@ -20,21 -20,32 +20,24 @@@ 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 +# 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 +: diff --cc tests/libobj15c.test index c39ac996b,000000000..603e2ebe1 mode 100755,000000..100755 --- a/tests/libobj15c.test +++ b/tests/libobj15c.test @@@ -1,47 -1,0 +1,50 @@@ +#! /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 . + +# 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 +# +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 + +: diff --cc tests/libobj16a.test index 9946bc5b0,000000000..a1ae93b60 mode 100755,000000..100755 --- a/tests/libobj16a.test +++ b/tests/libobj16a.test @@@ -1,137 -1,0 +1,138 @@@ +#! /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 . + +# 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 ++$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 + +: diff --cc tests/libobj16b.test index 1039558e0,000000000..6adfce355 mode 100755,000000..100755 --- a/tests/libobj16b.test +++ b/tests/libobj16b.test @@@ -1,138 -1,0 +1,138 @@@ +#! /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 . + +# 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 ++$AUTOMAKE -Wno-extra-portability + +./configure MAUDE=yes +$MAKE +$MAKE check +$MAKE distcheck +$MAKE distclean + +./configure MAUDE=no +$MAKE +$MAKE check +$MAKE distcheck +$MAKE distclean + +: diff --cc tests/libobj17.test index 4f9db57f9,000000000..a570e1284 mode 100755,000000..100755 --- a/tests/libobj17.test +++ b/tests/libobj17.test @@@ -1,65 -1,0 +1,66 @@@ +#! /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 . + +# 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 ++$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 + +: diff --cc tests/libobj18.test index 5fba7804f,e14375361..66188c699 --- a/tests/libobj18.test +++ b/tests/libobj18.test @@@ -18,13 -19,16 +18,14 @@@ . ./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' diff --cc tests/libobj19.test index bc495b5b5,4fe685c3c..205bc48c0 --- a/tests/libobj19.test +++ b/tests/libobj19.test @@@ -14,47 -15,54 +14,51 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# 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 -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 : diff --cc tests/libobj2.test index 66ca0d04e,36c01b3ba..1359bd424 --- a/tests/libobj2.test +++ b/tests/libobj2.test @@@ -20,24 -20,14 +20,25 @@@ . ./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 @@@ -48,20 -38,10 +49,20 @@@ libtu_a_SOURCES 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 +: diff --cc tests/libobj20a.test index 2f90c843c,000000000..b2f70632a mode 100755,000000..100755 --- a/tests/libobj20a.test +++ b/tests/libobj20a.test @@@ -1,43 -1,0 +1,45 @@@ +#! /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 . + +# 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 + +: diff --cc tests/libobj20b.test index d130a8abe,000000000..374c8d932 mode 100755,000000..100755 --- a/tests/libobj20b.test +++ b/tests/libobj20b.test @@@ -1,54 -1,0 +1,57 @@@ +#! /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 . + +# 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 +# +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 + +: diff --cc tests/libobj20c.test index 1fb1f9d97,000000000..c4d9a12b4 mode 100755,000000..100755 --- a/tests/libobj20c.test +++ b/tests/libobj20c.test @@@ -1,51 -1,0 +1,54 @@@ +#! /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 . + +# 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 + +: diff --cc tests/libobj7.test index b7556b70b,1ff36c455..14b0571a8 --- a/tests/libobj7.test +++ b/tests/libobj7.test @@@ -19,53 -18,35 +19,54 @@@ . ./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 + +: diff --cc tests/library.test index e3a981397,8adc575c1..8ad40f1c4 --- a/tests/library.test +++ b/tests/library.test @@@ -31,7 -31,7 +32,8 @@@ lib_LIBRARIES = libfoo. libfoo_a_DEPENDENCIES = libzot.a END + : > ar-lib - -$ACLOCAL || Exit 1 +$ACLOCAL $AUTOMAKE + +: diff --cc tests/libtoo10.test index 72310bb72,44c072685..4f1a60e5b --- a/tests/libtoo10.test +++ b/tests/libtoo10.test @@@ -19,7 -19,10 +19,8 @@@ required=libtoolize . ./defs || Exit 1 -set -e - cat >> configure.in << 'END' + AM_PROG_AR AC_PROG_LIBTOOL AC_OUTPUT END diff --cc tests/libtool2.test index 6e268dd60,0120fa9e0..f2fe1af32 --- a/tests/libtool2.test +++ b/tests/libtool2.test @@@ -20,10 -19,18 +20,11 @@@ 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 diff --cc tests/libtool3.test index 3a6a40eab,1643f31eb..dd8a67b4b --- a/tests/libtool3.test +++ b/tests/libtool3.test @@@ -20,8 -20,11 +20,9 @@@ required='libtoolize gcc' . ./defs || Exit 1 -set -e - cat >> configure.in << 'END' AC_PROG_CC + AM_PROG_AR AM_PROG_LIBTOOL AC_OUTPUT END diff --cc tests/libtool7.test index 970062862,8ebce0a2d..9cba6d1a7 --- a/tests/libtool7.test +++ b/tests/libtool7.test @@@ -20,8 -20,11 +20,9 @@@ 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 diff --cc tests/listval.test index 677fe3f0a,d7cc884a0..6bd933df6 --- a/tests/listval.test +++ b/tests/listval.test @@@ -22,7 -20,8 +22,8 @@@ required=libtoo . ./defs || Exit 1 cat >> configure.in << 'END' -AC_SUBST(LTLIBOBJS) +AC_SUBST([LTLIBOBJS]) + AM_PROG_AR AC_PROG_LIBTOOL END diff --cc tests/location.test index 9013e31d9,609879638..7eb6549bd --- a/tests/location.test +++ b/tests/location.test @@@ -42,8 -45,10 +43,10 @@@ VAR = 1 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 diff --cc tests/ltcond2.test index d4bf0647b,898c97138..95b985ab7 --- a/tests/ltcond2.test +++ b/tests/ltcond2.test @@@ -19,8 -19,11 +19,9 @@@ 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) diff --cc tests/ltconv.test index 2ea2705eb,a130b9437..afd271699 --- a/tests/ltconv.test +++ b/tests/ltconv.test @@@ -20,8 -20,11 +20,9 @@@ 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 diff --cc tests/ltdeps.test index 3c41ec317,7ece4d493..8f4740200 --- a/tests/ltdeps.test +++ b/tests/ltdeps.test @@@ -19,7 -19,10 +19,8 @@@ 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) diff --cc tests/ltinit.test index 42c39138e,8b76bdf81..7b324308e --- a/tests/ltinit.test +++ b/tests/ltinit.test @@@ -21,8 -21,11 +21,9 @@@ 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])], diff --cc tests/ltinstloc.test index dd1c5d6fd,a4d715e52..506ae8ddd --- a/tests/ltinstloc.test +++ b/tests/ltinstloc.test @@@ -20,8 -20,11 +20,9 @@@ 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 @@@ -44,16 -47,16 +45,16 @@@ AUTOMAKE_fails --add-missin # 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 diff --cc tests/ltlibobjs.test index 9a3d830b5,2df001721..e430cdde9 --- a/tests/ltlibobjs.test +++ b/tests/ltlibobjs.test @@@ -21,7 -20,8 +21,8 @@@ required=libtoo . ./defs || Exit 1 cat >> configure.in << 'END' -AC_SUBST(LTLIBOBJS) +AC_SUBST([LTLIBOBJS]) + AM_PROG_AR AC_PROG_LIBTOOL END diff --cc tests/ltlibsrc.test index 78ac8e2f7,e8fa6f0c7..1cdf06a64 --- a/tests/ltlibsrc.test +++ b/tests/ltlibsrc.test @@@ -19,8 -19,11 +19,9 @@@ required='libtool gcc' . ./defs || Exit 1 -set -e - cat >> configure.in << 'END' AC_PROG_CC + AM_PROG_AR AC_PROG_LIBTOOL AC_OUTPUT END diff --cc tests/ltorder.test index c41134137,ef4a5f71c..d249596c8 --- a/tests/ltorder.test +++ b/tests/ltorder.test @@@ -19,8 -19,11 +19,9 @@@ required='libtoolize' . ./defs || Exit 1 -set -e - cat >>configure.in <<'END' AC_PROG_CC + AM_PROG_AR AC_PROG_LIBTOOL AC_OUTPUT END diff --cc tests/nobase-libtool.test index 15d1b4994,2a0cf68b3..3a5a71354 --- a/tests/nobase-libtool.test +++ b/tests/nobase-libtool.test @@@ -22,8 -22,11 +22,9 @@@ required='libtoolize gcc' . ./defs || Exit 1 -set -e - cat >> configure.in <<'EOF' AC_PROG_CC + AM_PROG_AR AC_PROG_LIBTOOL AC_OUTPUT EOF diff --cc tests/nobase.test index 2fa9a6059,cac875627..fd2fe2807 --- a/tests/nobase.test +++ b/tests/nobase.test @@@ -20,8 -20,11 +20,9 @@@ required='gcc' . ./defs || Exit 1 -set -e - cat >> configure.in <<'EOF' AC_PROG_CC + AM_PROG_AR AC_PROG_RANLIB AC_OUTPUT EOF diff --cc tests/noinstdir.test index 92f59ffd7,b04bb0d62..329990e1d --- a/tests/noinstdir.test +++ b/tests/noinstdir.test @@@ -37,8 -38,10 +38,10 @@@ AM_PROG_A AC_PROG_RANLIB END + : > ar-lib + -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE grep 'noinstdir' Makefile.in && Exit 1 grep 'checkdir' Makefile.in && Exit 1 diff --cc tests/posixsubst-ldadd.test index a418fc26e,000000000..e3aef7a7f mode 100755,000000..100755 --- a/tests/posixsubst-ldadd.test +++ b/tests/posixsubst-ldadd.test @@@ -1,76 -1,0 +1,77 @@@ +#! /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 . + +# 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 ++$AUTOMAKE -a + +./configure +$MAKE +test -f libquux1.c +$MAKE distcheck + +: diff --cc tests/posixsubst-libraries.test index 418d24175,000000000..a5719bfb8 mode 100755,000000..100755 --- a/tests/posixsubst-libraries.test +++ b/tests/posixsubst-libraries.test @@@ -1,63 -1,0 +1,64 @@@ +#! /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 . + +# 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 ++$AUTOMAKE -a + +cwd=`pwd` || Exit 1 +./configure --prefix="$cwd/_inst" +$MAKE +test -f libfoo2.c +$MAKE install +$MAKE installcheck +$MAKE distcheck + +: diff --cc tests/posixsubst-ltlibraries.test index e95023c94,000000000..e3b3d0307 mode 100755,000000..100755 --- a/tests/posixsubst-ltlibraries.test +++ b/tests/posixsubst-ltlibraries.test @@@ -1,65 -1,0 +1,66 @@@ +#! /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 . + +# 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 + +: diff --cc tests/python-virtualenv.test index 11055b0b3,000000000..87a0839b6 mode 100755,000000..100755 --- a/tests/python-virtualenv.test +++ b/tests/python-virtualenv.test @@@ -1,184 -1,0 +1,185 @@@ +#! /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 . + +# 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 + +: diff --cc tests/strip2.test index 01f66f186,bab0a38e0..ea4b3a603 --- a/tests/strip2.test +++ b/tests/strip2.test @@@ -20,8 -20,11 +20,9 @@@ required=strip . ./defs || Exit 1 -set -e - cat >> configure.in << 'END' AC_PROG_CC + AM_PROG_AR AC_PROG_RANLIB AC_OUTPUT END diff --cc tests/strip3.test index 5f6f163d3,34b02545f..31e04e8ea --- a/tests/strip3.test +++ b/tests/strip3.test @@@ -20,8 -20,11 +20,9 @@@ required='libtoolize strip' . ./defs || Exit 1 -set -e - cat >> configure.in << 'END' AC_PROG_CC + AM_PROG_AR AC_PROG_LIBTOOL AC_OUTPUT END diff --cc tests/subst3.test index c1b2dfc35,c7adc8c21..e64efdb94 --- a/tests/subst3.test +++ b/tests/subst3.test @@@ -20,8 -20,11 +20,9 @@@ 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]) diff --cc tests/suffix.test index bb8b82ec6,c790c66a4..3701b0c38 --- a/tests/suffix.test +++ b/tests/suffix.test @@@ -28,19 -26,14 +28,31 @@@ EN 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 : diff --cc tests/suffix2.test index b1212a8ac,f55d965c0..434077b58 --- a/tests/suffix2.test +++ b/tests/suffix2.test @@@ -22,8 -20,11 +22,9 @@@ required=libtooliz . ./defs || Exit 1 -set -e - cat >> configure.in << 'END' AC_PROG_CC + AM_PROG_AR AC_PROG_LIBTOOL END @@@ -40,14 -42,8 +41,14 @@@ EN : > 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 diff --cc tests/suffix5.test index 60417e46e,2cf0afa7c..48e905944 --- a/tests/suffix5.test +++ b/tests/suffix5.test @@@ -21,10 -21,11 +21,11 @@@ 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' @@@ -44,8 -37,9 +45,12 @@@ check-local: tes 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 diff --cc tests/suffix8.test index 99582d764,d2ba0d4ab..8a29b8b3f --- a/tests/suffix8.test +++ b/tests/suffix8.test @@@ -14,14 -14,16 +14,15 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# 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 diff --cc tests/vala.test index 3e1ef65aa,34b71d4a4..6954dbd4e --- a/tests/vala.test +++ b/tests/vala.test @@@ -24,8 -24,11 +24,9 @@@ 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 diff --cc tests/vala1.test index 5030f7232,b2c9e1606..7eb8d71d3 --- a/tests/vala1.test +++ b/tests/vala1.test @@@ -25,8 -25,11 +25,9 @@@ 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 diff --cc tests/vartypo2.test index f811bbcb4,000000000..624e86bfc mode 100755,000000..100755 --- a/tests/vartypo2.test +++ b/tests/vartypo2.test @@@ -1,69 -1,0 +1,70 @@@ +#! /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 . + +# 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 + +: diff --cc tests/vartypos.test index 03747ed87,000000000..cd8f71886 mode 100755,000000..100755 --- a/tests/vartypos.test +++ b/tests/vartypos.test @@@ -1,89 -1,0 +1,89 @@@ +#! /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 . + +# 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_fails ++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 ++$AUTOMAKE -Wno-extra-portability + +: