summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/depcomp8a.sh16
-rw-r--r--t/depcomp8b.sh16
-rw-r--r--t/depend-postproc.sh (renamed from t/postproc.sh)29
-rw-r--r--t/extra-sources.sh5
-rw-r--r--t/lex-depend-cxx.sh5
-rw-r--r--t/lex-depend-grep.sh2
-rw-r--r--t/list-of-tests.mk5
-rw-r--r--t/pr224.sh4
-rw-r--r--t/subobj-indir-pr13928.sh4
-rw-r--r--t/subobj-pr13928-more-langs.sh138
-rw-r--r--t/subobj-vpath-pr13928.sh89
-rw-r--r--t/subobj11b.sh10
-rw-r--r--t/subobj11c.sh2
13 files changed, 280 insertions, 45 deletions
diff --git a/t/depcomp8a.sh b/t/depcomp8a.sh
index 5f14ee09a..07bbfc1fd 100644
--- a/t/depcomp8a.sh
+++ b/t/depcomp8a.sh
@@ -51,10 +51,10 @@ $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
-grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
-grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Po' Makefile.in
+grep '\./\$(DEPDIR)/bar\.Po' Makefile.in
+grep '/\./\$(DEPDIR)' Makefile.in && exit 1
$AUTOCONF
# Don't reject slower dependency extractors, for better coverage.
@@ -68,10 +68,10 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
$AUTOMAKE
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-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\.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 8dd86a308..3f7f08244 100644
--- a/t/depcomp8b.sh
+++ b/t/depcomp8b.sh
@@ -48,10 +48,10 @@ $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
-grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
-grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in
+grep '\./\$(DEPDIR)/bar\.Plo' Makefile.in
+grep '/\./\$(DEPDIR)' Makefile.in && exit 1
$AUTOCONF
# Don't reject slower dependency extractors, for better coverage.
@@ -64,10 +64,10 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
echo AUTOMAKE_OPTIONS += subdir-objects >> Makefile.am
$AUTOMAKE
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-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/postproc.sh b/t/depend-postproc.sh
index 94909ce15..1411783e0 100644
--- a/t/postproc.sh
+++ b/t/depend-postproc.sh
@@ -15,20 +15,22 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Check to make sure we recognize a Makefile.in, even if post-processed
-# and renamed.
+# and renamed. The particularly tricky code for automatic dependency
+# tracking support used to have issues with that.
required=cc
. test-init.sh
-cat >configure.ac <<END
+cat > configure.ac <<END
AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_FILES([myMakefile])
+dnl: AC_CONFIG_LINKS([Makefile:Makefile])
AC_OUTPUT
END
-cat > myMakefile.am << 'END'
+cat > myMakefile.am <<'END'
bin_PROGRAMS = fred
fred_SOURCES = fred.c
END
@@ -45,4 +47,25 @@ cat myMakefile.old >> myMakefile.in
test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1
+$sleep
+
+cat > Makefile <<'END'
+include myMakefile
+END
+
+sed 's/^dnl: *//' configure.ac >t
+mv -f t configure.ac
+
+$MAKE myMakefile Makefile
+
+rm -rf .deps _deps
+./config.status
+
+test ! -e fred.c
+echo 'int main (void) { return 0; }' > fred.c
+
+$MAKE
+test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1
+$MAKE distcheck
+
:
diff --git a/t/extra-sources.sh b/t/extra-sources.sh
index cd276dbcc..cbffc9080 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
@@ -31,6 +31,7 @@ END
$ACLOCAL
$AUTOMAKE
-grep '@am__include@ .*/xtra\.P' Makefile.in
+grep '@am__include@ .*/xtra\.Po' Makefile.in
+grep '^am__depfiles_remade =.*/xtra.Po' Makefile.in
:
diff --git a/t/lex-depend-cxx.sh b/t/lex-depend-cxx.sh
index fc89c8aa5..79a2f3b77 100644
--- a/t/lex-depend-cxx.sh
+++ b/t/lex-depend-cxx.sh
@@ -82,6 +82,11 @@ $AUTOCONF
# using slow dependency extractors.
./configure --enable-dependency-tracking
+# For debugging.
+for f in $(find . -name '*.Po'); do
+ cat $f
+done
+
$MAKE test-deps-exist
$MAKE
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/list-of-tests.mk b/t/list-of-tests.mk
index 01c1a53ae..80d0f0864 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -41,8 +41,6 @@ t/java-nobase.sh \
t/objext-pr10128.sh \
t/remake-timing-bug-pr8365.sh \
t/lex-subobj-nodep.sh \
-t/subobj-indir-pr13928.sh \
-t/subobj-vpath-pr13928.sh \
t/remake-am-pr10111.sh \
t/remake-m4-pr10111.sh \
$(perl_fake_XFAIL_TESTS)
@@ -391,6 +389,7 @@ t/depend3.sh \
t/depend4.sh \
t/depend5.sh \
t/depend6.sh \
+t/depend-postproc.sh \
t/deprecated-acinit.sh \
t/destdir.sh \
t/dir-named-obj-is-bad.sh \
@@ -866,7 +865,6 @@ t/posixsubst-programs.sh \
t/posixsubst-scripts.sh \
t/posixsubst-sources.sh \
t/posixsubst-tests.sh \
-t/postproc.sh \
t/ppf77.sh \
t/pr2.sh \
t/pr9.sh \
@@ -1064,6 +1062,7 @@ t/subobj-clean-pr10697.sh \
t/subobj-clean-lt-pr10697.sh \
t/subobj-indir-pr13928.sh \
t/subobj-vpath-pr13928.sh \
+t/subobj-pr13928-more-langs.sh \
t/subpkg.sh \
t/subpkg2.sh \
t/subpkg3.sh \
diff --git a/t/pr224.sh b/t/pr224.sh
index 7d907441c..bca1d3037 100644
--- a/t/pr224.sh
+++ b/t/pr224.sh
@@ -56,8 +56,8 @@ cd build
../configure
$MAKE
-test -d foo/.deps
+test -f foo/.deps/main.Po
$MAKE distclean
-test -d foo/.deps && exit 1
+test ! -e foo/.deps/main.Po
:
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
:
diff --git a/t/subobj11b.sh b/t/subobj11b.sh
index db29e5e58..12e2216d2 100644
--- a/t/subobj11b.sh
+++ b/t/subobj11b.sh
@@ -56,9 +56,9 @@ END
$ACLOCAL
$AUTOMAKE -a
-# Be lax in the regexp, to account for automake conditionals, the
-# use of @am__include@, and similar stuff.
-grep 'include.*//.*foobar' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+
+grep '//.*foobar\.P' Makefile.in && exit 1
# These checks depend on automake internals, but presently this is
# the only way to test the code path we are interested in.
@@ -71,12 +71,12 @@ for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do
esac
# Be a little lax in the regexp, to account for automake conditionals,
# quoting, and similar stuff.
- grep "^[^/]*am__include[^/]*//server/$d\\\$(DEPDIR)/$b\\.[^/]*$" Makefile.in
+ grep "[ ]//server/$d\\\$(DEPDIR)/$b\\.Po" Makefile.in
done
# Sanity checks.
for i in 0 1 2 3 4 5 6 7 8 9; do
- grep "am__include.*/foobar$i\\." Makefile.in
+ grep "\$(DEPDIR)/foobar$i\\.Po" Makefile.in
done
:
diff --git a/t/subobj11c.sh b/t/subobj11c.sh
index 652a31d56..79abef96c 100644
--- a/t/subobj11c.sh
+++ b/t/subobj11c.sh
@@ -43,6 +43,6 @@ $AUTOMAKE -a
#
# FIXME: Are we sure this is the most sensible output in our situation?
#
-grep '^[^/]*am__include[^/]*//\$(DEPDIR)/zardoz\.[^/]*$' Makefile.in
+grep 'am__depfiles_remade =.* //\$(DEPDIR)/zardoz\.Po' Makefile.in
: