2 # Copyright (C) 2002-2012 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)
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 <http://www.gnu.org/licenses/>.
20 # When using non-recursive make to build a libtoolize-library from
21 # sources in a subdirectory, 'make distcheck' fails because of incomplete
22 # cleanup. "make clean" tries to remove '*.o' and '.../<file>.lo' but
23 # forgets '.../<file>.o'.
25 required='c++ libtoolize'
28 cat > configure.ac << END
30 AM_INIT_AUTOMAKE([subdir-objects])
34 AC_CONFIG_FILES([Makefile])
38 cat > Makefile.am << 'END'
39 noinst_LTLIBRARIES = libfoo.la
40 libfoo_la_SOURCES = src/foo.cc .//src/bar.cc # The './/' is meant.
43 @echo BEG1: "$(LTCXXCOMPILE)" :1END
44 @echo BEG2: "$(CXXLINK)" :2END
48 cat > src/foo.cc << 'END'
56 cat > src/bar.cc << 'END'
71 # Ensure './libtool --help' will use the right tool versions.
72 export AUTOCONF AUTOMAKE
74 # Opportunistically check that --tag=CXX is used when supported.
75 if ./libtool --help | grep tag=TAG; then
76 $MAKE print >stdout || { cat stdout; exit 1; }
78 grep 'BEG1: .*--tag=CXX.*--mode=compile.* :1END' stdout
79 grep 'BEG2: .*--tag=CXX.*--mode=link.* :2END' stdout
83 $MAKE distcheck >output 2>&1 || { cat output; exit 1; }
85 # GNU Make used to complain that the Makefile contained two rules
86 # for 'src/.dirstamp' and './/src/.dirstamp'.
87 grep 'overriding commands' output && exit 1