2 # Copyright (C) 2005, 2006 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
21 # Check support for AC_CONFIG_LIBOBJ_DIR vs LTLIBOBJS.
22 # (pr401.test and pr401c.test do the same for LIBOBJS and ALLOCA)
24 required
='gcc libtoolize'
31 cat >lib
/feep.c
<<'EOF'
39 cat >src
/main.c
<<'EOF'
45 main (int argc, char **argv)
52 cat >>configure.
in << 'EOF'
53 ## These lines are activated for later tests
54 #: AC_CONFIG_LIBOBJ_DIR([lib])
58 AC_LIBSOURCE
([feep.c
])
60 AC_CONFIG_FILES
([lib
/Makefile src
/Makefile
])
64 ## -------------------------------------------- ##
65 ## First a test of traditional LTLIBOBJS usage. ##
66 ## -------------------------------------------- ##
68 cat >Makefile.am
<<'EOF'
72 cat >lib
/Makefile.am
<<'EOF'
73 noinst_LTLIBRARIES = libfeep.la
75 libfeep_la_LIBADD = $(LTLIBOBJS)
78 cat >src
/Makefile.am
<<'EOF'
80 main_LDADD = ../lib/libfeep.la
93 ## ------------------------------------------ ##
94 ## Traditional LIBOBJS with LIBOBJDIR set. ##
95 ## ------------------------------------------ ##
97 # Invocation of AC_CONFIG_LIBOBJ_DIR may be necessary for reasons
98 # unrelated to Automake or Makefile.am layout.
100 sed 's/#: //' configure.
in >configure.int
101 mv -f configure.int configure.
in
111 ## ---------------------------------------------- ##
112 ## Test using LTLIBOBJS from a sibling directory. ##
113 ## ---------------------------------------------- ##
115 sed 's/#x //; s/lib\/Makefile //' configure.
in >configure.int
116 mv -f configure.int configure.
in
118 cat >Makefile.am
<<'EOF'
122 cat > src
/Makefile.am
<<'EOF'
123 AUTOMAKE_OPTIONS = subdir-objects
125 noinst_LTLIBRARIES = libfeep.la
127 libfeep_la_LIBADD = $(LTLIBOBJS)
129 check_PROGRAMS = main
130 main_LDADD = libfeep.la
137 $AUTOMAKE --add-missing
140 test ! -d 'src/$(top_builddir)'
146 ## ------------------------------------------- ##
147 ## Test using LTLIBOBJS from parent directory. ##
148 ## ------------------------------------------- ##
150 sed 's/^.*src\/Makefile.*$//' configure.
in >configure.int
151 mv -f configure.int configure.
in
153 cat >Makefile.am
<<'EOF'
154 AUTOMAKE_OPTIONS = subdir-objects
156 noinst_LTLIBRARIES = lib/libfeep.la
157 lib_libfeep_la_SOURCES =
158 lib_libfeep_la_LIBADD = $(LTLIBOBJS)
160 check_PROGRAMS = src/main
161 src_main_SOURCES = src/main.c
162 src_main_LDADD = lib/libfeep.la
167 test -f src/main.$(OBJEXT)
169 test ! -f src/$(DEPDIR)/feep.Po