diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-01-09 23:16:53 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-01-11 19:56:41 +0100 |
commit | 34001a987a6defdb70f6f3c17cce9d9c665fe6e8 (patch) | |
tree | 9d9dd5720fe8e4fd773d2e22378e10db90103058 | |
parent | 1ab8fb6d0e8497c0b86a1453b901dda29ba9d9f6 (diff) | |
download | automake-34001a987a6defdb70f6f3c17cce9d9c665fe6e8.tar.gz |
compile: use 'compile' script when "-c -o" is used with losing compilers
Do so seen when only source files in the "current" directory are present.
This commit is part of a series of related changes addressing automake
bug#13378 (see also the plan 'PLANS/subdir-objects.txt').
Before this change, Automake-generated C compilation rules mistakenly
passed the "-c -o" options combination unconditionally (even to losing
compiler) when the 'subdir-objects' was used but sources were only
present in the top-level directory. Issue spotted by Nick Bowler:
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#35>
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#44>
We fix this by having Automake redefine AC_PROG_CC to take over the role
of AM_PROG_CC_C_O and to require the 'compile' script unconditionally
(albeit that will continue to be invoked only when inferior compilers
are detected).
Among other things, this means AM_PROG_CC_C_O explicitly is no longer
required; that macro is still supported for backward-compatibility, but
calling it is basically a no-op now.
This change has some pros and some cons (obviously, we believe the former
outweighs the latter). Here are the most relevant ones:
+ Pros 1:
Some logic in the Automake script has been simplified.
+ Pros 2:
That simplification has automatically fixed an actual bug (see
Nick's mails referenced above; admittedly, that was present only in
corner-case situations, but still); the test 't/ccnoco4.sh', which
demonstrated the bug and has been failing so far, now passes.
+ Pros 3:
Things works more "automagically" now (no need to manually add the
AM_PROG_CC_C_O macro to configure.ac anymore).
* Cons 1:
The 'compile' script will be required in all projects using C
compilation; this will only be a problem for packages not using
'--add-missing'. However, such packages are definitely more rare
than the ones using '--add-missing', and adjusting them will be
trivial -- just copy the compile script over from the new Automake
installation.
* Cons 2:
The copy & paste of autoconf internals hack this change has introduced
in our "rewrite" of AC_PROG_CC is really an egregious abomination. It
can only be justified with the fact that we expect future versions of
autoconf to implement the semantics we need directly in AC_PROG_CC, so
that we'll be able to leverage that (since Automake 1.14 will require
the latest Autoconf version released).
Now, the detailed list of file-by-file changes ...
* automake.in ($seen_cc_c_o): Remove this global variable.
(scan_autoconf_traces): Don't set it, and do not trace the
'AM_PROG_CC_C_O' m4 macro.
(lang_c_rewrite): Remove, no longer needed.
* doc/automake.texi: Adjust expected "autoreconf --install" output
in the amhello example. Remove statements about the need for the
AM_PROG_CC_C_O macro. Report it is obsolete now.
* m4/init.m4: Re-write AC_PROG_CC to append checks about whether the
C compiler supports "-c -o" together. These checks have basically
been ripped out (with adaptations) from the 'AC_PROG_CC_C_O' macro
of Autoconf and ...
* m4/minuso.m4 (AM_PROG_CC_C_O): ... this macro of ours, which has
thus basically become a no-op.
* t/ax/am-test-lib.sh (am_setup_testdir): Also copy the 'compile'
script in the test directory; if we don't do so, every test using
AC_PROG_CC should call automake with the "--add-missing" option, or
copy the 'compile' script itself.
* t/cond11.sh: No need to create a dummy 'compile' script: that is
already brought in by 'am_setup_testdir()', that is automatically
invoked when 'test-lib.sh' is sourced.
* t/add-missing.tap: Adjust: we expect the 'compile' script to be
required by a mere AC_PROG_CC call now.
* t/dist-auxdir-many-subdirs.sh: Likewise.
* t/specflg6.sh: Likewise.
* t/subobj4.sh: Likewise.
* t/cxx-lt-demo.sh: Likewise, and update comments to match.
* t/distcom2.sh: Enhance a little.
* t/dollarvar2.sh: Adjust.
* t/extra-portability.sh: Likewise.
* t/libobj19.sh: Likewise.
* t/per-target-flags.sh: Likewise.
* t/repeated-options.sh: Likewise.
* t/subobj.sh: Likewise, and enhance a little.
* t/ccnoco2.sh: Remove as obsolete.
* t/list-of-tests.mk (handwritten_TESTS): Adjust.
(XFAIL_TESTS): Remove 't/ccnoco4.sh'.
* NEWS: Update.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | NEWS | 26 | ||||
-rw-r--r-- | automake.in | 47 | ||||
-rw-r--r-- | doc/automake.texi | 22 | ||||
-rw-r--r-- | m4/init.m4 | 45 | ||||
-rw-r--r-- | m4/minuso.m4 | 27 | ||||
-rwxr-xr-x | t/add-missing.tap | 9 | ||||
-rw-r--r-- | t/ax/am-test-lib.sh | 2 | ||||
-rwxr-xr-x | t/ccnoco2.sh | 55 | ||||
-rwxr-xr-x | t/cond11.sh | 1 | ||||
-rwxr-xr-x | t/cxx-lt-demo.sh | 6 | ||||
-rwxr-xr-x | t/dist-auxdir-many-subdirs.sh | 1 | ||||
-rwxr-xr-x | t/distcom2.sh | 2 | ||||
-rwxr-xr-x | t/dollarvar2.sh | 11 | ||||
-rwxr-xr-x | t/extra-portability.sh | 13 | ||||
-rwxr-xr-x | t/libobj19.sh | 1 | ||||
-rw-r--r-- | t/list-of-tests.mk | 2 | ||||
-rwxr-xr-x | t/per-target-flags.sh | 7 | ||||
-rwxr-xr-x | t/repeated-options.sh | 2 | ||||
-rwxr-xr-x | t/specflg6.sh | 2 | ||||
-rwxr-xr-x | t/subobj.sh | 5 | ||||
-rwxr-xr-x | t/subobj4.sh | 1 |
22 files changed, 122 insertions, 166 deletions
diff --git a/.gitignore b/.gitignore index dd55add5f..4b509d70e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ /doc/amhello/config.h.in~ /doc/amhello/configure /doc/amhello/depcomp +/doc/amhello/compile /doc/amhello/install-sh /doc/amhello/missing /doc/web-manual @@ -49,6 +49,32 @@ New in 1.13.2: should take precedence over the same-named automake-provided macro (defined in '/usr/local/share/aclocal-1.14/vala.m4'). +* C compilation, and the AC_PROG_CC and AM_PROG_CC_C_O macros: + + - The 'compile' script is now unconditionally required for all + packages that perform C compilation (note that if you are using + the '--add-missing' option, automake will fetch that script for + you, so you shouldn't need any explicit adjustment). + This new behaviour is needed to avoid obscure errors when the + 'subdir-objects' option is used, and the compiler is an inferior + one that doesn't grasp the combined use of both the "-c -o" + options; see discussion about automake bug#13378 for more details: + <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#35> + <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13378#44> + + - Automake will automatically enhance the AC_PROG_CC autoconf macro + to make it check, at configure time, that the C compiler supports + the combined use of both the "-c -o" options. This "rewrite" of + AC_PROG_CC is only meant to be temporary, since future Autoconf + versions should provide all the features Automake needs. + + - The AM_PROG_CC_C_O is no longer useful, and its use is a no-op + now. Future Automake versions might start warning that this + macro is obsolete. For better backward-compatibility, this macro + still sets a proper 'ac_cv_prog_cc_*_c_o' cache variable, and + define the 'NO_MINUS_C_MINUS_O' C preprocessor symbol, but you + should really stop relying on that. + * Obsolescent features: - Use of suffix-less info files (that can be specified through the diff --git a/automake.in b/automake.in index e8ba73f94..990b60d60 100644 --- a/automake.in +++ b/automake.in @@ -387,9 +387,6 @@ my $package_version_location; # TRUE if we've seen AM_PROG_AR my $seen_ar = 0; -# TRUE if we've seen AM_PROG_CC_C_O -my $seen_cc_c_o = 0; - # Location of AC_REQUIRE_AUX_FILE calls, indexed by their argument. my %required_aux_file = (); @@ -5179,7 +5176,6 @@ sub scan_autoconf_traces ($) AM_INIT_AUTOMAKE => 0, AM_MAINTAINER_MODE => 0, AM_PROG_AR => 0, - AM_PROG_CC_C_O => 0, _AM_SUBST_NOTMAKE => 1, _AM_COND_IF => 1, _AM_COND_ELSE => 1, @@ -5383,10 +5379,6 @@ EOF { $seen_ar = $where; } - elsif ($macro eq 'AM_PROG_CC_C_O') - { - $seen_cc_c_o = $where; - } elsif ($macro eq '_AM_COND_IF') { cond_stack_if ('', $args[1], $where); @@ -5607,45 +5599,6 @@ sub lang_sub_obj return option 'subdir-objects' ? LANG_SUBDIR : LANG_PROCESS; } -# Rewrite a single C source file. -sub lang_c_rewrite -{ - my ($directory, $base, $ext, $obj, $have_per_exec_flags, $var) = @_; - - my $r = LANG_PROCESS; - if (option 'subdir-objects') - { - $r = LANG_SUBDIR; - if ($directory && $directory ne '.') - { - $base = $directory . '/' . $base; - - # libtool is always able to put the object at the proper place, - # so we do not have to require AM_PROG_CC_C_O when building .lo files. - msg_var ('portability', $var, - "compiling '$base.c' in subdir requires " - . "'AM_PROG_CC_C_O' in '$configure_ac'", - uniq_scope => US_GLOBAL, - uniq_part => 'AM_PROG_CC_C_O subdir') - unless $seen_cc_c_o || $obj eq '.lo'; - } - } - - if (! $seen_cc_c_o - && $have_per_exec_flags - && ! option 'subdir-objects' - && $obj ne '.lo') - { - msg_var ('portability', - $var, "compiling '$base.c' with per-target flags requires " - . "'AM_PROG_CC_C_O' in '$configure_ac'", - uniq_scope => US_GLOBAL, - uniq_part => 'AM_PROG_CC_C_O per-target') - } - - return $r; -} - # Rewrite a single header file. sub lang_header_rewrite { diff --git a/doc/automake.texi b/doc/automake.texi index 8ace5e5e0..a333a1c33 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -1496,6 +1496,7 @@ command as follows: ~/amhello % @kbd{autoreconf --install} configure.ac: installing './install-sh' configure.ac: installing './missing' +configure.ac: installing './compile' src/Makefile.am: installing './depcomp' @end example @@ -3994,10 +3995,9 @@ choose the assembler for you (by default the C compiler) and set @item AM_PROG_CC_C_O @acindex AM_PROG_CC_C_O @acindex AC_PROG_CC_C_O -This is like @code{AC_PROG_CC_C_O}, but it generates its results in -the manner required by Automake. You must use this instead of -@code{AC_PROG_CC_C_O} when you need this functionality, that is, when -using per-target flags or subdir-objects with C sources. +This is an @emph{obsolete wrapper} around @code{AC_PROG_CC_C_O}. +New code needs not use this macro. It might be deprecated and +@emph{retired in future Automake versions}. @item AM_PROG_LEX @acindex AM_PROG_LEX @@ -4068,6 +4068,13 @@ Invocation, , Using @command{autoupdate} to Modernize @table @code +@item AM_PROG_CC_C_O +@acindex AM_PROG_CC_C_O +@acindex AC_PROG_CC_C_O +This is an @emph{obsolete wrapper} around @code{AC_PROG_CC_C_O}. New +code needs not to use this macro. It will be deprecated, and then +removed, in future Automake versions. + @item AM_PROG_MKDIR_P @acindex AM_PROG_MKDIR_P @cindex @code{mkdir -p}, macro check @@ -5810,9 +5817,7 @@ different name for the intermediate object files. Ordinarily a file like @file{sample.c} will be compiled to produce @file{sample.o}. However, if the program's @code{_CFLAGS} variable is set, then the object file will be named, for instance, @file{maude-sample.o}. (See -also @ref{Renamed Objects}.) The use of per-target compilation flags -with C sources requires that the macro @code{AM_PROG_CC_C_O} be called -from @file{configure.ac}. +also @ref{Renamed Objects}). In compilations with per-target flags, the ordinary @samp{AM_} form of the flags variable is @emph{not} automatically included in the @@ -10245,9 +10250,6 @@ the source file. For instance, if the source file is @file{subdir/file.cxx}, then the output file would be @file{subdir/file.o}. -In order to use this option with C sources, you should add -@code{AM_PROG_CC_C_O} to @file{configure.ac}. - @anchor{tar-formats} @item @option{tar-v7} @itemx @option{tar-ustar} diff --git a/m4/init.m4 b/m4/init.m4 index 44b24819a..c5af65cce 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -125,6 +125,51 @@ dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) +dnl We have to redefine AC_PROG_CC to allow our compile rules to use +dnl "-c -o" together also with losing compilers. +dnl FIXME: Add references to the original discussion and bug report. +dnl FIXME: Shameless copy & paste from Autoconf internals, since trying to +dnl play smart among tangles of AC_REQUIRE, m4_defn, m4_provide and +dnl other tricks was proving too difficult, and in the end, likely +dnl more brittle too. And this should anyway be just a temporary +dnl band-aid, until Autoconf provides the semantics and/or hooks we +dnl need (hint hint, nudge nudge) ... +AC_DEFUN([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +dnl FIXME The following abomination is expected to disappear in +dnl Automake 1.14. +AC_MSG_CHECKING([whether $CC understands -c and -o together]) +set dummy $CC; am__cc=`AS_ECHO(["$[2]"]) | \ + sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'` +AC_CACHE_VAL([am_cv_prog_cc_${am__cc}_c_o], +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&AS_MESSAGE_LOG_FD' +rm -f conftest2.* +if _AC_DO_VAR(ac_try) && test -f conftest2.$ac_objext +then + eval am_cv_prog_cc_${am__cc}_c_o=yes +else + eval am_cv_prog_cc_${am__cc}_c_o=no +fi +rm -f core conftest* +])dnl +if eval test \"\$am_cv_prog_cc_${am__cc}_c_o\" = yes; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) + # Losing compiler, so wrap it with the 'compile' script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header diff --git a/m4/minuso.m4 b/m4/minuso.m4 index 984427cfc..17fa8c92a 100644 --- a/m4/minuso.m4 +++ b/m4/minuso.m4 @@ -7,26 +7,19 @@ # AM_PROG_CC_C_O # -------------- -# Like AC_PROG_CC_C_O, but changed for automake. +# Basically a no-op now, completely superseded by the AC_PROG_CC +# adjusted by Automake. Kept for backward-compatibility. AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi +[AC_REQUIRE([AC_PROG_CC])dnl dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +# For better backward-compatibility. Users are advised to stop +# relying on this cache variable and C preprocessor symbol ASAP. +eval ac_cv_prog_cc_${am__cc}_c_o=\$am_cv_prog_cc_${am__cc}_c_o +if eval test \"\$ac_cv_prog_cc_${am__cc}_c_o\" != yes; then + AC_DEFINE([NO_MINUS_C_MINUS_O], [1], + [Define to 1 if your C compiler doesn't accept -c and -o together.]) +fi ]) diff --git a/t/add-missing.tap b/t/add-missing.tap index f74c2fd93..9c4b774b3 100755 --- a/t/add-missing.tap +++ b/t/add-missing.tap @@ -247,6 +247,7 @@ check_ <<'END' depcomp/C == Files == depcomp +compile == configure.ac == AC_PROG_CC == Makefile.am == @@ -271,9 +272,9 @@ compile == Files == compile == configure.ac == -# Using AM_PROG_CC_C_O in configure.ac should be enough. No need to -# use AC_PROG_CC too, nor to define xxx_PROGRAMS in Makefile.am. -AM_PROG_CC_C_O +# Using AC_PROG_CC in configure.ac should be enough. No +# need to also define, say, xxx_PROGRAMS in Makefile.am. +AC_PROG_CC END # For config.guess and config.sub. @@ -294,6 +295,7 @@ check_ <<'END' == Name == ylwrap/Lex == Files == +compile ylwrap == configure.ac == AC_PROG_CC @@ -308,6 +310,7 @@ check_ <<'END' == Name == ylwrap/Yacc == Files == +compile ylwrap == configure.ac == AC_PROG_CC diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh index f3fcacca5..0ceb4d09c 100644 --- a/t/ax/am-test-lib.sh +++ b/t/ax/am-test-lib.sh @@ -820,7 +820,7 @@ am_setup_testdir () || framework_failure_ "cannot chdir into test subdirectory" if test x"$am_create_testdir" != x"empty"; then cp "$am_scriptdir"/install-sh "$am_scriptdir"/missing \ - "$am_scriptdir"/depcomp . \ + "$am_scriptdir"/compile "$am_scriptdir"/depcomp . \ || framework_failure_ "fetching common files from $am_scriptdir" # Build appropriate environment in test directory. E.g., create # configure.ac, touch all necessary files, etc. Don't use AC_OUTPUT, diff --git a/t/ccnoco2.sh b/t/ccnoco2.sh deleted file mode 100755 index a835fa668..000000000 --- a/t/ccnoco2.sh +++ /dev/null @@ -1,55 +0,0 @@ -#! /bin/sh -# Copyright (C) 2006-2013 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 Automake requires AM_PROG_CC_C_O when either per-targets -# flags or subdir-objects are used. - -. test-init.sh - -cat >>configure.ac <<EOF -AC_PROG_CC -AC_OUTPUT -EOF - -cat >Makefile.am <<EOF -bin_PROGRAMS = wish -wish_SOURCES = a.c -wish_CPPFLAGS = -DWHATEVER -EOF - -touch a.c - -$ACLOCAL -$AUTOCONF -AUTOMAKE_fails --copy --add-missing -grep '^Makefile\.am:2:.*per-target.*AM_PROG_CC_C_O' stderr - - -cat >Makefile.am <<EOF -bin_PROGRAMS = wish -wish_SOURCES = sub/a.c -EOF - -mkdir sub -mv a.c sub - -$AUTOMAKE --copy --add-missing - -echo 'AUTOMAKE_OPTIONS = subdir-objects' >> Makefile.am -AUTOMAKE_fails --copy --add-missing -grep '^Makefile\.am:2:.*subdir.*AM_PROG_CC_C_O' stderr - -: diff --git a/t/cond11.sh b/t/cond11.sh index 03c4077ad..7d729d8f1 100755 --- a/t/cond11.sh +++ b/t/cond11.sh @@ -47,7 +47,6 @@ END : > config.guess : > config.sub -: > compile $ACLOCAL $AUTOCONF diff --git a/t/cxx-lt-demo.sh b/t/cxx-lt-demo.sh index 8afc974aa..3a87cfdfc 100755 --- a/t/cxx-lt-demo.sh +++ b/t/cxx-lt-demo.sh @@ -94,10 +94,12 @@ $AUTOCONF $AUTOMAKE --add-missing --copy ls -l . ax # For debugging. -for f in ltmain.sh depcomp config.guess config.sub; do +# Ideally, the 'compile' script should not be required by C++ compilers. +# But alas, LT_INIT seems to invoke AC_PROG_CC anyway, and that brings in +# that script. +for f in ltmain.sh depcomp compile config.guess config.sub; do test -f ax/$f && test ! -h ax/$f || exit 1 done -test ! -e ax/compile # Not required by C++ compilers. cat > src/main.cc << 'END' #include "libfoo.h++" diff --git a/t/dist-auxdir-many-subdirs.sh b/t/dist-auxdir-many-subdirs.sh index d49372a1f..ec1a9641f 100755 --- a/t/dist-auxdir-many-subdirs.sh +++ b/t/dist-auxdir-many-subdirs.sh @@ -63,6 +63,7 @@ END required_files=' install-sh missing + compile depcomp py-compile test-driver diff --git a/t/distcom2.sh b/t/distcom2.sh index 57154d97c..dc0cb4d29 100755 --- a/t/distcom2.sh +++ b/t/distcom2.sh @@ -44,6 +44,8 @@ $ACLOCAL for opt in '' --no-force; do + rm -f compile depcomp + $AUTOMAKE $opt --add-missing test -f compile diff --git a/t/dollarvar2.sh b/t/dollarvar2.sh index 718374370..ef2dd06af 100755 --- a/t/dollarvar2.sh +++ b/t/dollarvar2.sh @@ -65,27 +65,22 @@ grep 'recursive variable expansion' stderr cat >Makefile.am <<'EOF' x = 1 bla = $(foo$(x)) -noinst_PROGRAMS = foo -foo_CPPFLAGS = -Dwhatever +oops = $(var-with-dash) EOF -echo AC_PROG_CC >> configure.ac - -$ACLOCAL --force - # Can disable both 'portability' and 'portability-recursive' warnings. $AUTOMAKE -Wno-portability # Disabling 'portability-recursive' warnings should not disable # 'portability' warnings. AUTOMAKE_fails -Wportability -Wno-portability-recursive -grep AM_PROG_CC_C_O stderr +grep 'var-with-dash' stderr grep 'recursive variable expansion' stderr && exit 1 # Enabling 'portability-recursive' warnings should not enable # all the 'portability' warning. AUTOMAKE_fails -Wno-portability -Wportability-recursive -grep AM_PROG_CC_C_O stderr && exit 1 +grep 'var-with-dash' stderr && exit 1 grep 'recursive variable expansion' stderr : diff --git a/t/extra-portability.sh b/t/extra-portability.sh index 94dd799e2..1ea23ad75 100755 --- a/t/extra-portability.sh +++ b/t/extra-portability.sh @@ -62,30 +62,29 @@ $AUTOMAKE -Wall -Wno-portability # Now, a setup where also a "simple" portability warning is present. # -# Per-target flags require the use of AM_PROG_CC_C_O in configure.ac. -echo libfoo_a_CPPFLAGS = -Dwhatever >> Makefile.am +echo 'var = $(foo--bar)' >> Makefile.am # Enabling extra-portability enables portability as well ... AUTOMAKE_fails -Wextra-portability -grep 'requires.*AM_PROG_CC_C_O' stderr +grep 'foo--bar' stderr grep 'requires.*AM_PROG_AR' stderr # ... even if it had been previously disabled. AUTOMAKE_fails -Wno-portability -Wextra-portability -grep 'requires.*AM_PROG_CC_C_O' stderr +grep 'foo--bar' stderr grep 'requires.*AM_PROG_AR' stderr # Disabling extra-portability leaves portability intact (1). AUTOMAKE_fails -Wportability -Wno-extra-portability -grep 'requires.*AM_PROG_CC_C_O' stderr +grep 'foo--bar' stderr grep 'requires.*AM_PROG_AR' stderr && exit 1 # Disabling extra-portability leaves portability intact (2). AUTOMAKE_fails -Wall -Wno-extra-portability -grep 'requires.*AM_PROG_CC_C_O' stderr +grep 'foo--bar' stderr grep 'requires.*AM_PROG_AR' stderr && exit 1 # Enabling portability does not enable extra-portability. AUTOMAKE_fails -Wportability -grep 'requires.*AM_PROG_CC_C_O' stderr +grep 'foo--bar' stderr grep 'requires.*AM_PROG_AR' stderr && exit 1 # Disabling portability disables extra-portability. diff --git a/t/libobj19.sh b/t/libobj19.sh index fdca575b5..65172fb21 100755 --- a/t/libobj19.sh +++ b/t/libobj19.sh @@ -55,7 +55,6 @@ extern int dummy; END cp "$am_scriptdir/ar-lib" . || fatal_ "fetching auxiliary script 'ar-lib'" -cp "$am_scriptdir/compile" . || fatal_ "fetching auxiliary script 'compile'" $ACLOCAL $AUTOCONF diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 2052bd8ee..baccdca6d 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -30,7 +30,6 @@ t/pm/Version3.pl XFAIL_TESTS = \ t/all.sh \ -t/ccnoco4.sh \ t/cond17.sh \ t/gcj6.sh \ t/override-conditional-2.sh \ @@ -208,7 +207,6 @@ t/canon7.sh \ t/canon8.sh \ t/canon-name.sh \ t/ccnoco.sh \ -t/ccnoco2.sh \ t/ccnoco3.sh \ t/ccnoco4.sh \ t/check.sh \ diff --git a/t/per-target-flags.sh b/t/per-target-flags.sh index ef19e6925..333242f9d 100755 --- a/t/per-target-flags.sh +++ b/t/per-target-flags.sh @@ -55,15 +55,8 @@ cat - libMakefile.am > libMakefile2.am << 'END' AUTOMAKE_OPTIONS = no-dependencies END -# Make sure 'compile' is required. -for m in $makefiles; do - AUTOMAKE_fails $m - $EGREP " required file.* '(compile|\./compile)'" stderr -done - makefiles=$(for mkf in $makefiles; do echo $mkf.in; done) -: > compile $AUTOMAKE # Sanity check. diff --git a/t/repeated-options.sh b/t/repeated-options.sh index af1897bcb..d3fe96207 100755 --- a/t/repeated-options.sh +++ b/t/repeated-options.sh @@ -58,7 +58,7 @@ int main (void) } END -cp "$am_scriptdir"/compile "$am_scriptdir"/test-driver . +cp "$am_scriptdir"/test-driver . $ACLOCAL $AUTOMAKE --foreign --foreign -Wall 2>stderr || { cat stderr >&2; exit 1; } diff --git a/t/specflg6.sh b/t/specflg6.sh index 77d837a53..bbc83343f 100755 --- a/t/specflg6.sh +++ b/t/specflg6.sh @@ -36,8 +36,6 @@ foo_CFLAGS = -DFOO foo_SOURCES = foo.c END -: > compile - $ACLOCAL $AUTOMAKE diff --git a/t/subobj.sh b/t/subobj.sh index 2431184b6..6e5fd9800 100755 --- a/t/subobj.sh +++ b/t/subobj.sh @@ -20,6 +20,8 @@ cat >> configure.ac << 'END' AC_PROG_CC +dnl This should be a no-op now, but still be supported +dnl without causing warnings. AM_PROG_CC_C_O END @@ -30,10 +32,11 @@ wish_SOURCES = generic/a.c generic/b.c END $ACLOCAL +rm -f compile $AUTOMAKE --add-missing 2>stderr || { cat stderr >&2; exit 1; } cat stderr >&2 # Make sure compile is installed, and that Automake says so. -grep 'install.*compile' stderr +grep '^configure\.ac:4:.*install.*compile' stderr test -f compile grep '^generic/a\.\$(OBJEXT):' Makefile.in diff --git a/t/subobj4.sh b/t/subobj4.sh index b1b577d6a..45d9666ab 100755 --- a/t/subobj4.sh +++ b/t/subobj4.sh @@ -41,7 +41,6 @@ END cat > d2/Makefile.am << 'END' END -: > compile : > d2/z.c $ACLOCAL |