1 # subproject.at -- test subproject Libltdl builds -*- Autotest -*-
3 # Copyright (C) 2005, 2008 Free Software Foundation, Inc.
4 # Written by Gary V. Vaughan, 2005
6 # This file is part of GNU Libtool.
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.
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.
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.
25 AT_BANNER([Subproject Libltdl.])
29 m4_pushdef([_LT_AT_LTDL_SETUP],
30 [AT_DATA([configure.ac],
31 [[AC_INIT([subproject-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
32 LT_CONFIG_LTDL_DIR([sub/ltdl])
33 AC_CONFIG_AUX_DIR([sub/ltdl/config])
34 AC_CONFIG_MACRO_DIR([sub/ltdl/m4])
35 AM_INIT_AUTOMAKE([foreign])
38 AC_CONFIG_FILES([Makefile])
42 AT_DATA([Makefile.am],
43 [[ACLOCAL_AMFLAGS = -I sub/ltdl/m4
44 AUTOMAKE_OPTIONS = 1.9
46 lib_LTLIBRARIES = foo.la
47 foo_la_LDFLAGS = -module -avoid-version -no-undefined
50 echo 'int dummy = 0;' > foo.c
53 ## ------------------------ ##
54 ## Softlinked libltdl tree. ##
55 ## ------------------------ ##
57 AT_SETUP([compiling softlinked libltdl])
61 LT_AT_BOOTSTRAP([--ltdl], [-I sub/ltdl/m4], [ignore], [--add-missing --copy],
62 [], [], [all $tst_dist])
64 AT_CHECK([test -f sub/ltdl/libltdlc.la])
69 ## -------------------- ##
70 ## Copied libltdl tree. ##
71 ## -------------------- ##
73 AT_SETUP([compiling copied libltdl])
77 LT_AT_BOOTSTRAP([--copy --ltdl], [-I sub/ltdl/m4], [ignore],
78 [--add-missing --copy], [], [], [all $tst_dist])
80 AT_CHECK([test -f sub/ltdl/libltdlc.la])
85 ## ------------------------- ##
86 ## Installable libltdl tree. ##
87 ## ------------------------- ##
89 AT_SETUP([installable libltdl])
95 LT_AT_BOOTSTRAP([--copy --ltdl], [-I sub/ltdl/m4], [ignore],
96 [--add-missing --copy], [], [--enable-ltdl-install --prefix=$prefix],
97 [all install $tst_dist])
99 AT_CHECK([test -f $prefix/lib/libltdl.la])
100 AT_CHECK([test -f $prefix/include/ltdl.h])
105 ## ----------------------------------------------- ##
106 ## libltdl is usable without Autoconf or Automake. ##
107 ## ----------------------------------------------- ##
109 AT_SETUP([linking libltdl without autotools])
111 _LTDL_PROJECT_FILES([sub/ltdl])
112 LT_AT_LIBTOOLIZE([--copy --ltdl=sub/ltdl])
113 LT_AT_MAKE([], [CC="$CC" LIBTOOLFLAGS="$LIBTOOLFLAGS" CPPFLAGS="$CPPFLAGS" ]dnl
114 [CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" SHELL="$SHELL" MAKE="${MAKE-make}" ]dnl
115 [CONFIGURE_OPTIONS="$configure_options"])
117 LT_AT_EXEC_CHECK([./ltdldemo], 0, [ignore])
121 dnl Be careful not to let the definition leak into other tests
122 m4_popdef([_LT_AT_LTDL_SETUP])