Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / nonrecursive.at
1 # nonrecursive.at -- test nonrecursive Automake Libltdl       -*- Autotest -*-
2 #
3 #   Copyright (C) 2005, 2008, 2009 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
26 AT_BANNER([Nonrecursive Automake Libltdl.])
27
28 # _LT_AT_LTDL_SETUP
29 # -----------------
30 m4_pushdef([_LT_AT_LTDL_SETUP],
31 [AT_DATA([configure.ac],
32 [[AC_INIT([subdirectory-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
33 LT_CONFIG_LTDL_DIR([ltdl])
34 AC_CONFIG_AUX_DIR([ltdl/config])
35 AC_CONFIG_MACRO_DIR([ltdl/m4])
36 AC_CONFIG_LIBOBJ_DIR([ltdl])
37 AC_CONFIG_HEADERS([config.h:config.hin])
38 AM_INIT_AUTOMAKE([foreign subdir-objects])
39 AC_PROG_CC
40 AM_PROG_CC_C_O
41 LT_INIT
42 LTDL_INIT([nonrecursive])
43 AC_CONFIG_FILES([Makefile])
44 AC_OUTPUT
45 ]])
46
47 AT_DATA([Makefile.am],
48 [[ACLOCAL_AMFLAGS = -I ltdl/m4
49 AUTOMAKE_OPTIONS        = 1.9.6
50 BUILT_SOURCES           =
51
52 AM_CPPFLAGS             =
53 AM_LDFLAGS              =
54
55 include_HEADERS         =
56 noinst_LTLIBRARIES      =
57 lib_LTLIBRARIES         = foo.la
58 EXTRA_LTLIBRARIES       =
59
60 EXTRA_DIST              =
61
62 CLEANFILES              =
63 MOSTLYCLEANFILES        =
64
65 include ltdl/Makefile.inc
66
67 foo_la_LDFLAGS          = -module -avoid-version -no-undefined
68 foo_la_SOURCES          = foo.c
69 ]])
70
71 echo 'int dummy = 0;' > foo.c
72 ])# _LT_AT_LTDL_SETUP
73
74 ## ------------------------ ##
75 ## Softlinked libltdl tree. ##
76 ## ------------------------ ##
77
78 AT_SETUP([compiling softlinked libltdl])
79
80 _LT_AT_LTDL_SETUP
81
82 LT_AT_LIBTOOLIZE([--ltdl])
83 AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
84
85 # Support vanilla autoconf-2.59 & automake-1.9.6
86 for file in argz.c lt__dirent.c lt__strl.c; do
87   cp ltdl/$file $file
88 done
89
90 LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [], [--add-missing --copy],
91         [], [], [all $tst_dist])
92
93 AT_CHECK([test -f ltdl/libltdlc.la])
94
95 AT_CLEANUP
96
97
98 ## -------------------- ##
99 ## Copied libltdl tree. ##
100 ## -------------------- ##
101
102 AT_SETUP([compiling copied libltdl])
103
104 _LT_AT_LTDL_SETUP
105
106 LT_AT_LIBTOOLIZE([--copy --ltdl])
107 AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
108
109 # Support vanilla autoconf-2.59 & automake-1.9.6
110 for file in argz.c lt__dirent.c lt__strl.c; do
111   cp ltdl/$file $file
112 done
113
114 LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [], [--add-missing --copy],
115         [], [], [all $tst_dist])
116
117 AT_CHECK([test -f ltdl/libltdlc.la])
118
119 AT_CLEANUP
120
121
122 ## ------------------------- ##
123 ## Installable libltdl tree. ##
124 ## ------------------------- ##
125
126 AT_SETUP([installable libltdl])
127
128 _LT_AT_LTDL_SETUP
129
130 prefix=`pwd`/_inst
131
132 LT_AT_LIBTOOLIZE([--copy --ltdl])
133 AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
134
135 # Support vanilla autoconf-2.59 & automake-1.9.6
136 for file in argz.c lt__dirent.c lt__strl.c; do
137   cp ltdl/$file $file
138 done
139
140 LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [], [--add-missing --copy],
141         [], [--enable-ltdl-install --prefix=$prefix], [all install $tst_dist])
142
143 AT_CHECK([test -f $prefix/lib/libltdl.la])
144 AT_CHECK([test -f $prefix/include/ltdl.h])
145
146 AT_CLEANUP
147
148 dnl Be careful not to let the definition leak into other tests
149 m4_popdef([_LT_AT_LTDL_SETUP])