2 # Copyright (C) 2005 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 LIBOBJS.
22 # (pr401b.test and pr401c.test do the same for LTLIBOBJS and ALLOCA)
31 cat >lib
/feep.c
<<'EOF'
39 cat >src
/feep.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 LIBOBJS usage. ##
66 ## ------------------------------------------ ##
68 cat >Makefile.am
<<'EOF'
72 cat >lib
/Makefile.am
<<'EOF'
73 noinst_LIBRARIES = libfeep.a
75 libfeep_a_LIBADD = $(LIBOBJS)
78 cat >src
/Makefile.am
<<'EOF'
80 feep_LDADD = ../lib/libfeep.a
92 ## -------------------------------------------- ##
93 ## Test using LIBOBJS from a sibling directory. ##
94 ## -------------------------------------------- ##
96 $PERL -pi -e 's/#: //' configure.
in
97 $PERL -pi -e 's/lib\/Makefile //' configure.
in
99 cat >Makefile.am
<<'EOF'
103 cat > src
/Makefile.am
<<'EOF'
104 AUTOMAKE_OPTIONS = subdir-objects
106 noinst_LIBRARIES = libfeep.a
108 libfeep_a_LIBADD = $(LIBOBJS)
110 check_PROGRAMS = feep
111 feep_LDADD = libfeep.a
118 $AUTOMAKE --add-missing
125 ## ----------------------------------------- ##
126 ## Test using LIBOBJS from parent directory. ##
127 ## ----------------------------------------- ##
129 $PERL -pi -e 's/^.*src\/Makefile.*$//' configure.
in
131 cat >Makefile.am
<<'EOF'
132 AUTOMAKE_OPTIONS = subdir-objects
134 noinst_LIBRARIES = lib/libfeep.a
135 lib_libfeep_a_SOURCES =
136 lib_libfeep_a_LIBADD = $(LIBOBJS)
138 check_PROGRAMS = src/feep
139 src_feep_SOURCES = src/feep.c
140 src_feep_LDADD = lib/libfeep.a
145 test -f src/feep.$(OBJEXT)