maint: Update HACKING
[automake.git] / t / depcomp8b.sh
bloba4d5a77d64d4c23ece54f75879a491a85ca7a482
1 #! /bin/sh
2 # Copyright (C) 2010-2017 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Test for regressions in computation of names of .Plo files for
18 # automatic dependency tracking.
19 # Keep this in sync with sister test 'depcomp8a.sh', which checks the
20 # same thing for non-libtool objects.
22 required='cc libtoolize'
23 . test-init.sh
25 cat >> configure.ac << 'END'
26 AC_PROG_CC
27 #x AM_PROG_CC_C_O
28 AM_PROG_AR
29 AC_PROG_LIBTOOL
30 AC_OUTPUT
31 END
33 cat > Makefile.am << 'END'
34 ## FIXME: stop disabling the warnings in the 'unsupported' category
35 ## FIXME: once the 'subdir-objects' option has been mandatory.
36 AUTOMAKE_OPTIONS = -Wno-unsupported
37 lib_LTLIBRARIES = libzardoz.la
38 libzardoz_la_SOURCES = foo.c sub/bar.c
39 END
41 mkdir sub
42 echo 'int foo (void) { return 0; }' > foo.c
43 echo 'int bar (void) { return 0; }' > sub/bar.c
45 libtoolize
47 $ACLOCAL
48 # FIXME: stop disabling the warnings in the 'unsupported' category
49 # FIXME: once the 'subdir-objects' option has been mandatory.
50 $AUTOMAKE -a -Wno-unsupported
51 grep '\.P' Makefile.in # For debugging.
52 grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in
53 grep '\./\$(DEPDIR)/bar\.Plo' Makefile.in
54 grep '/\./\$(DEPDIR)' Makefile.in && exit 1
56 $AUTOCONF
57 # Don't reject slower dependency extractors, for better coverage.
58 ./configure --enable-dependency-tracking
59 $MAKE
60 DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
62 # Try again with subdir-objects option.
64 echo AUTOMAKE_OPTIONS += subdir-objects >> Makefile.am
66 $AUTOMAKE
67 grep '\.P' Makefile.in # For debugging.
68 grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in
69 grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Plo' Makefile.in
70 $EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
72 $AUTOCONF
73 # Don't reject slower dependency extractors, for better coverage.
74 ./configure --enable-dependency-tracking
75 $MAKE
76 DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck