diff options
Diffstat (limited to 't')
-rw-r--r-- | t/Makefile.inc | 1 | ||||
-rw-r--r-- | t/depcomp8a.sh | 13 | ||||
-rw-r--r-- | t/depcomp8b.sh | 8 | ||||
-rw-r--r-- | t/extra-sources.sh | 2 | ||||
-rw-r--r-- | t/lex-depend-cxx.sh | 6 | ||||
-rw-r--r-- | t/lex-depend-grep.sh | 2 | ||||
-rw-r--r-- | t/subobj-indir-pr13928.sh | 4 | ||||
-rw-r--r-- | t/subobj-pr13928-more-langs.sh | 138 | ||||
-rw-r--r-- | t/subobj-vpath-pr13928.sh | 89 |
9 files changed, 236 insertions, 27 deletions
diff --git a/t/Makefile.inc b/t/Makefile.inc index 15f0a523b..c3e72fc7e 100644 --- a/t/Makefile.inc +++ b/t/Makefile.inc @@ -96,7 +96,6 @@ XFAIL_TESTS = \ %D%/remake-timing-bug-pr8365.sh \ %D%/remake-am-pr10111.sh \ %D%/remake-m4-pr10111.sh \ - %D%/subobj-vpath-pr13928.sh \ %D%/var-undef-append.sh \ $(perl_fake_XFAIL_TESTS) diff --git a/t/depcomp8a.sh b/t/depcomp8a.sh index c9d49107f..2190800dc 100644 --- a/t/depcomp8a.sh +++ b/t/depcomp8a.sh @@ -48,14 +48,11 @@ int bar (void) END $ACLOCAL -# FIXME: stop disabling the warnings in the 'unsupported' category -# FIXME: once the 'subdir-objects' option has been mandatory. -$AUTOMAKE -a -Wno-unsupported -grep include Makefile.in # For debugging. -grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in - -LC_ALL=C grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in -$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1 +$AUTOMAKE -a +grep '\.P' Makefile.in # For debugging. +grep '\./\$(DEPDIR)/foo\.Po' Makefile.in +grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Po' Makefile.in +$EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1 $AUTOCONF # Don't reject slower dependency extractors, for better coverage. diff --git a/t/depcomp8b.sh b/t/depcomp8b.sh index 25a945ada..7395b5bc5 100644 --- a/t/depcomp8b.sh +++ b/t/depcomp8b.sh @@ -42,10 +42,10 @@ libtoolize $ACLOCAL $AUTOMAKE -a -grep include Makefile.in # For debugging. -LC_ALL=C grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in -LC_ALL=C grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in -$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1 +grep '\.P' Makefile.in # For debugging. +grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in +grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Plo' Makefile.in +$EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1 $AUTOCONF # Don't reject slower dependency extractors, for better coverage. diff --git a/t/extra-sources.sh b/t/extra-sources.sh index 2ff7f8b47..ffea3f5b6 100644 --- a/t/extra-sources.sh +++ b/t/extra-sources.sh @@ -21,7 +21,7 @@ echo AC_PROG_CC >> configure.ac -cat > Makefile.am << 'END' +cat > Makefile.am <<'END' bin_PROGRAMS = www www_SOURCES = www.c EXTRA_www_SOURCES = xtra.c diff --git a/t/lex-depend-cxx.sh b/t/lex-depend-cxx.sh index 5412e9c9f..3e2821f1d 100644 --- a/t/lex-depend-cxx.sh +++ b/t/lex-depend-cxx.sh @@ -83,6 +83,12 @@ $AUTOCONF ./configure --enable-dependency-tracking $MAKE + +# For debugging. +for f in $(find . -name '*.Po'); do + cat $f +done + $MAKE test-deps-exist $sleep diff --git a/t/lex-depend-grep.sh b/t/lex-depend-grep.sh index dedea2d31..70e5cb8d2 100644 --- a/t/lex-depend-grep.sh +++ b/t/lex-depend-grep.sh @@ -40,7 +40,7 @@ $AUTOMAKE -a $EGREP '([mj]oe|_[01234]|include|\.P)' Makefile.in # For debugging. for x in joe moe _0 _1 _2 _3 _4; do - grep "include.*$x\.Po" Makefile.in + $EGREP '\$\(DEPDIR\)/'"$x"'\.Po( |$)' Makefile.in done : diff --git a/t/subobj-indir-pr13928.sh b/t/subobj-indir-pr13928.sh index afad53b21..9a7116d35 100644 --- a/t/subobj-indir-pr13928.sh +++ b/t/subobj-indir-pr13928.sh @@ -38,7 +38,9 @@ END mkdir s echo 'int main(void) { return 0; }' > s/foo.c -$ACLOCAL && $AUTOCONF && $AUTOMAKE -a || fatal_ "autotools failed" +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a ./configure $MAKE diff --git a/t/subobj-pr13928-more-langs.sh b/t/subobj-pr13928-more-langs.sh new file mode 100644 index 000000000..323e24899 --- /dev/null +++ b/t/subobj-pr13928-more-langs.sh @@ -0,0 +1,138 @@ +#! /bin/sh +# Copyright (C) 2015 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/>. + +# Expose part of automake bug#13928, also for non-C languages: if the +# subdir-objects option is in use and a source file is listed in a +# _SOURCES variable with a leading $(srcdir) component, Automake will +# generate a Makefile that tries to create the corresponding object +# file in $(srcdir) as well. + +required='cc c++ fortran77 fortran' +. test-init.sh + +cat >> configure.ac <<'END' +AC_PROG_CC +AC_PROG_CXX +AC_PROG_F77 +AC_PROG_FC +AM_CONDITIONAL([OBVIOUS], [:]) +AC_CONFIG_FILES([sub/Makefile]) +AC_OUTPUT +END + +cat > Makefile.am <<'END' +AUTOMAKE_OPTIONS = subdir-objects +SUBDIRS = sub + +LESS = m/o/r/e + +noinst_PROGRAMS = test test2 +test_SOURCES = $(srcdir)/test.f90 + +test2_SOURCES = $(indir) + +indir = ${indir2} $(empty) +indir2 = +if OBVIOUS +indir2 += ${srcdir}/$(LESS)///test.f +else +endif + +test-objs: + ls -la @srcdir@ . + : + test ! -f @srcdir@/test.$(OBJEXT) + test -f test.$(OBJEXT) + test ! -f @srcdir@/m/o/r/e/test.$(OBJEXT) + test -f m/o/r/e/test.$(OBJEXT) + : + test ! -f @srcdir@/bar.$(OBJEXT) + test -f bar.$(OBJEXT) + test ! -f @srcdir@/baz.$(OBJEXT) + test -f baz.$(OBJEXT) + : + test ! -d @srcdir@/$(DEPDIR) + test ! -d @srcdir@/m/o/r/e/$(DEPDIR) + test -d $(DEPDIR) + test -d m/o/r/e/$(DEPDIR) + +check-local: test-objs +END + +mkdir sub +cat > sub/Makefile.am <<'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = foo +foo = baz +foo_SOURCES = foo.h \ + $(top_srcdir)/bar.cc \ + ${top_srcdir}/$(foo).c +END + + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +mkfiles='Makefile.in sub/Makefile.in' +$EGREP '(test|ba[rz])\.|DEPDIR|dirstamp|srcdir' $mkfiles # For debugging. +$EGREP '\$.(top_)?srcdir./(test|ba[rz]|\$.foo.)\.[o$]' $mkfiles && exit 1 +$FGREP '\$.(top_)?srcdir./.*$(am__dirstamp)' $mkfiles && exit 1 +$FGREP '\$.(top_)?srcdir./.*$(DEPDIR)' $mkfiles && exit 1 + +cat > test.f90 <<'EOF' + program foo + stop + end +EOF + +mkdir -p m/o/r/e +cp test.f90 m/o/r/e/test.f + +cat > sub/foo.h <<'END' +#ifdef __cplusplus +extern "C" +#endif +int foo (void); +END + +cat > bar.cc <<'END' +#include "foo.h" +#include <iostream> +int main (void) +{ + std::cout << "OK!" << "\n"; + return foo (); +} +END + +cat > baz.c <<'END' +#include "foo.h" +int foo (void) +{ + return 0; +} +END + +mkdir build +cd build +../configure + +$MAKE +$MAKE test-objs +$MAKE distcheck + +: diff --git a/t/subobj-vpath-pr13928.sh b/t/subobj-vpath-pr13928.sh index a10d65776..a7db9d8ad 100644 --- a/t/subobj-vpath-pr13928.sh +++ b/t/subobj-vpath-pr13928.sh @@ -22,39 +22,106 @@ required=cc . test-init.sh -cat >> configure.ac << 'END' +cat >> configure.ac <<'END' AC_PROG_CC AM_PROG_CC_C_O +AM_CONDITIONAL([OBVIOUS], [:]) +AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT END cat > Makefile.am <<'END' AUTOMAKE_OPTIONS = subdir-objects -noinst_PROGRAMS = test +SUBDIRS = sub + +LESS = more + +noinst_PROGRAMS = test test2 test_SOURCES = $(srcdir)/test.c + +test2_SOURCES = $(indir) + +indir = +if OBVIOUS +indir += ${srcdir}/$(LESS)/test.c +else +endif + test-objs: - test ! -f $(srcdir)/test.$(OBJEXT) + ls -la @srcdir@ . + : + test ! -f @srcdir@/test.$(OBJEXT) test -f test.$(OBJEXT) + test ! -f @srcdir@/more/test.$(OBJEXT) + test -f more/test.$(OBJEXT) + : + test ! -f @srcdir@/bar.$(OBJEXT) + test -f bar.$(OBJEXT) + test ! -f @srcdir@/baz.$(OBJEXT) + test -f baz.$(OBJEXT) + : + test ! -d @srcdir@/$(DEPDIR) + test ! -d @srcdir@/more/$(DEPDIR) + test -d $(DEPDIR) + test -d more/$(DEPDIR) + +check-local: test-objs +END + +mkdir sub +cat > sub/Makefile.am <<'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = foo +foo_SOURCES = foo.h \ + $(top_srcdir)/bar.c \ + ${top_srcdir}/baz.c +END + + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +mkfiles='Makefile.in sub/Makefile.in' +$EGREP '(test|ba[rz])\.|DEPDIR|dirstamp|srcdir' $mkfiles # For debugging. +$EGREP '\$.(top_)?srcdir./(test|ba[rz])\.[o$]' $mkfiles && exit 1 +$FGREP '\$.(top_)?srcdir./.*$(am__dirstamp)' $mkfiles && exit 1 +$FGREP '\$.(top_)?srcdir./.*$(DEPDIR)' $mkfiles && exit 1 + +cat > test.c <<'END' +int main (void) +{ + return 0; +} END -$ACLOCAL && $AUTOCONF && $AUTOMAKE -a || fatal_ "autotools failed" +mkdir more +cp test.c more/test.c -$EGREP 'test\.|DEPDIR|dirstamp|srcdir' Makefile.in || : # For debugging. -$EGREP '\$.srcdir./test\.[o$]' Makefile.in && exit 1 -$FGREP '$(srcdir)/$(am__dirstamp)' Makefile.in && exit 1 -$FGREP '$(srcdir)/$(DEPDIR)' && exit 1 +echo 'int foo (void);' > sub/foo.h -cat > test.c << 'END' +cat > bar.c <<'END' +#include "foo.h" int main (void) { + return foo (); +} +END + +cat > baz.c <<'END' +#include "foo.h" +int foo (void) +{ return 0; } END -mkdir build && cd build || fatal "preparation of build directory failed" -../configure || fatal_ "./configure failed" +mkdir build +cd build +../configure $MAKE $MAKE test-objs +$MAKE distcheck : |