Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / recursive.at
1 # recursive.at -- test recursive Automake libltdl build       -*- Autotest -*-
2 #
3 #   Copyright (C) 2005, 2008 Free Software Foundation, Inc.
4 #   Written by Gary V. Vaughan, 2005
5 #
6 #   This file is part of GNU Libtool.
7 #
8 # GNU Libtool is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
12 #
13 # GNU Libtool is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Libtool; see the file COPYING.  If not, a copy
20 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
21 # or obtained by writing to the Free Software Foundation, Inc.,
22 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ####
24
25 AT_BANNER([Recursive Automake Libltdl.])
26
27 # _LT_AT_LTDL_SETUP
28 # -----------------
29 m4_pushdef([_LT_AT_LTDL_SETUP],
30 [AT_DATA([configure.ac],
31 [[AC_INIT([subdirectory-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
32 LT_CONFIG_LTDL_DIR([ltdl])
33 AC_CONFIG_AUX_DIR([ltdl/config])
34 AC_CONFIG_MACRO_DIR([ltdl/m4])
35 AC_CONFIG_LIBOBJ_DIR([ltdl])
36 AC_CONFIG_HEADERS([config.h:config.hin])
37 AM_INIT_AUTOMAKE([foreign])
38 LT_INIT
39 LTDL_INIT([recursive])
40 AC_CONFIG_FILES([Makefile ltdl/Makefile])
41 AC_OUTPUT
42 ]])
43
44 AT_DATA([Makefile.am],
45 [[ACLOCAL_AMFLAGS = -I ltdl/m4
46 AUTOMAKE_OPTIONS = 1.7
47 SUBDIRS = ltdl
48 lib_LTLIBRARIES = foo.la
49 foo_la_LDFLAGS = -module -avoid-version -no-undefined
50 foo_la_SOURCES = foo.c
51 ]])
52
53 echo 'int dummy = 0;' > foo.c
54 ])# _LT_AT_LTDL_SETUP
55
56 ## ------------------------ ##
57 ## Softlinked libltdl tree. ##
58 ## ------------------------ ##
59
60 AT_SETUP([compiling softlinked libltdl])
61
62 _LT_AT_LTDL_SETUP
63
64 LT_AT_LIBTOOLIZE([--ltdl])
65 AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
66
67 LT_AT_AUTORECONF([--force --verbose --install])
68 LT_AT_CONFIGURE
69 LT_AT_MAKE([all $tst_dist])
70
71 AT_CHECK([test -f ltdl/libltdlc.la])
72
73 AT_CLEANUP
74
75
76 ## -------------------- ##
77 ## Copied libltdl tree. ##
78 ## -------------------- ##
79
80 AT_SETUP([compiling copied libltdl])
81
82 _LT_AT_LTDL_SETUP
83
84 LT_AT_LIBTOOLIZE([--copy --ltdl])
85 AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
86
87 LT_AT_AUTORECONF([--force --verbose --install])
88 LT_AT_CONFIGURE
89 LT_AT_MAKE([all $tst_dist])
90
91 AT_CHECK([test -f ltdl/libltdlc.la])
92
93 AT_CLEANUP
94
95
96 ## ------------------------- ##
97 ## Installable libltdl tree. ##
98 ## ------------------------- ##
99
100 AT_SETUP([installable libltdl])
101
102 _LT_AT_LTDL_SETUP
103
104 prefix=`pwd`/_inst
105
106 LT_AT_LIBTOOLIZE([--copy --ltdl])
107 AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
108
109 LT_AT_AUTORECONF([--force --verbose --install])
110 LT_AT_CONFIGURE([--enable-ltdl-install --prefix=$prefix])
111 LT_AT_MAKE([all install $tst_dist])
112
113 AT_CHECK([test -f $prefix/lib/libltdl.la])
114 AT_CHECK([test -f $prefix/include/ltdl.h])
115
116 AT_CLEANUP
117
118 dnl Be careful not to let the definition leak into other tests
119 m4_popdef([_LT_AT_LTDL_SETUP])