Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / depcomp8b.test
1 #! /bin/sh
2 # Copyright (C) 2010, 2011 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
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.test', which checks the
20 # same thing for non-libtool objects.
21
22 required=libtoolize
23 . ./defs || Exit 1
24
25 set -e
26
27 cat >> configure.in << 'END'
28 AC_PROG_CC
29 #x AM_PROG_CC_C_O
30 AM_PROG_AR
31 AC_PROG_LIBTOOL
32 AC_OUTPUT
33 END
34
35 cat > Makefile.am << 'END'
36 lib_LTLIBRARIES = libzardoz.la
37 libzardoz_la_SOURCES = foo.c sub/bar.c
38 END
39
40 mkdir sub
41 echo 'extern int foo = 0;' > foo.c
42 echo 'extern int bar = 0;' > sub/bar.c
43
44 libtoolize
45
46 $ACLOCAL
47 $AUTOMAKE -a
48 grep include Makefile.in # for debugging
49 grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
50 grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
51 grep 'include.*/\./\$(DEPDIR)' Makefile.in && Exit 1
52
53 $AUTOCONF
54 # Don't reject slower dependency extractors, for better coverage.
55 ./configure --enable-dependency-tracking
56 $MAKE
57 DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
58
59 # Try again with subdir-objects option.
60
61 sed 's/#x //' configure.in >configure.int
62 mv -f configure.int configure.in
63 echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
64
65 $ACLOCAL
66 $AUTOMAKE -a
67 grep include Makefile.in # for debugging
68 grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
69 grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
70 $EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && Exit 1
71
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
77
78 :