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 # Make sure xxx_LINK is defined for each target that requires specific
23 # Quite similar to libtool7.test, using AM_LDFLAGS in addition to xxx_LDFLAGS.
25 required
='libtoolize gcc'
30 cat >> configure.
in << 'END'
38 cat > Makefile.am
<< 'END'
40 lib_LTLIBRARIES
= libmod1.la mod2.la
41 libmod1_la_SOURCES
= mod1.c
43 libmod1_la_LIBADD
= -dlopen mod2.la
44 mod2_la_SOURCES
= mod2.c
46 bin_PROGRAMS
= prg prg2
48 prg_LDADD
= -dlopen libmod1.la
-dlpreopen mod2.la
49 prg_CPPFLAGS
= -DXYZ=1
54 @
echo 1BEG
: $
(prg_DEPENDENCIES
) :END1
55 @
echo 2BEG
: $
(libmod1_la_DEPENDENCIES
) :END2
56 @
echo 3BEG
: $
(libmod1_la_LINK
) :END3
57 @
echo 4BEG
: $
(mod2_la_LINK
) :END4
58 @
echo 5BEG
: $
(prg_LINK
) :END5
59 @
echo 6BEG
: $
(prg2_LINK
) :END6
89 libtoolize
--force --copy
92 $AUTOMAKE --add-missing --copy
95 env LDFLAGS
=ldflags AM_LDFLAGS
=am_ldflags libmod1_la_LDFLAGS
=lm1_la_ldflags \
96 CFLAGS
=cflags AM_CFLAGS
=am_cflags prg2_CFLAGS
=prg2_cflags \
97 $MAKE -e print
>output
2>&1
99 grep '1BEG: libmod1.la mod2.la :END1' output
100 grep '2BEG: mod2.la :END2' output
101 grep '3BEG:.* am_cflags cflags .*lm1_la_ldflags ldflags.* :END3' output
102 grep '3BEG: .*am_ldflags.* :END3' output
&& exit 1
103 grep '4BEG: :END4' output
104 grep '5BEG: :END5' output
105 grep '6BEG:.* prg2_cflags cflags .*am_ldflags ldflags.* :END6' output
106 grep '6BEG: .*am_cflags.* :END6' output
&& exit 1