ltmain.in: Use func_warning for all warnings
[libtool.git] / tests / subproject.at
blob45e9b8ffdb83f15aeee26569cdea8d5bcb9f4d8b
1 # subproject.at -- test subproject Libltdl builds             -*- Autotest -*-
3 #   Copyright (C) 2005, 2008, 2011-2019, 2021-2024 Free Software
4 #   Foundation, Inc.
5 #   Written by Gary V. Vaughan, 2005
7 #   This file is part of GNU Libtool.
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING.  If not, a copy
21 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 ####
26 AT_BANNER([Subproject Libltdl.])
28 # _LT_AT_LTDL_SETUP
29 # -----------------
30 m4_pushdef([_LT_AT_LTDL_SETUP],
31 [AT_DATA([configure.ac],
32 [[AC_INIT([subproject-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
33 LT_CONFIG_LTDL_DIR([sub/ltdl])
34 AC_CONFIG_AUX_DIR([sub/ltdl/config])
35 AC_CONFIG_MACRO_DIRS([sub/ltdl/m4])
36 AM_INIT_AUTOMAKE([foreign])
37 LT_INIT
38 LT_WITH_LTDL
39 AC_CONFIG_FILES([Makefile])
40 AC_OUTPUT
41 ]])
43 AT_DATA([Makefile.am],
44 [[ACLOCAL_AMFLAGS = -I sub/ltdl/m4
45 AUTOMAKE_OPTIONS = 1.9
46 SUBDIRS = sub/ltdl
47 lib_LTLIBRARIES = foo.la
48 foo_la_LDFLAGS = -module -avoid-version -no-undefined
49 ]])
51 echo 'int dummy = 0;' > foo.c
52 ])# _LT_AT_LTDL_SETUP
54 ## ------------------------ ##
55 ## Softlinked libltdl tree. ##
56 ## ------------------------ ##
58 AT_SETUP([compiling softlinked libltdl])
60 _LT_AT_LTDL_SETUP
62 LT_AT_BOOTSTRAP([--ltdl], [-I sub/ltdl/m4], [ignore], [--add-missing --copy],
63         [], [], [all $tst_dist])
65 AT_CHECK([test -f sub/ltdl/libltdlc.la])
67 AT_CLEANUP
70 ## -------------------- ##
71 ## Copied libltdl tree. ##
72 ## -------------------- ##
74 AT_SETUP([compiling copied libltdl])
76 _LT_AT_LTDL_SETUP
78 LT_AT_BOOTSTRAP([--copy --ltdl], [-I sub/ltdl/m4], [ignore],
79         [--add-missing --copy], [], [], [all $tst_dist])
81 AT_CHECK([test -f sub/ltdl/libltdlc.la])
83 AT_CLEANUP
86 ## ------------------------- ##
87 ## Installable libltdl tree. ##
88 ## ------------------------- ##
90 AT_SETUP([installable libltdl])
92 prefix=`pwd`/_inst
94 _LT_AT_LTDL_SETUP
96 LT_AT_BOOTSTRAP([--copy --ltdl], [-I sub/ltdl/m4], [ignore],
97         [--add-missing --copy], [], [--enable-ltdl-install --prefix=$prefix],
98         [all install $tst_dist])
100 AT_CHECK([test -f "$prefix/lib/libltdl.la"])
101 AT_CHECK([test -f "$prefix/include/ltdl.h"])
103 AT_CLEANUP
106 ## ----------------------------------------------- ##
107 ## libltdl is usable without Autoconf or Automake. ##
108 ## ----------------------------------------------- ##
110 AT_SETUP([linking libltdl without autotools])
112 _LTDL_PROJECT_FILES([sub/ltdl])
113 LT_AT_LIBTOOLIZE([--copy --ltdl=sub/ltdl])
114 LT_AT_MAKE([], [CC="$CC" LIBTOOLFLAGS="$LIBTOOLFLAGS" CPPFLAGS="$CPPFLAGS" ]dnl
115      [CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" SHELL="$SHELL" MAKE="${MAKE-make}" ]dnl
116      [CONFIGURE_OPTIONS="$configure_options"])
118 LT_AT_EXEC_CHECK([./ltdldemo], 0, [ignore])
120 AT_CLEANUP
122 dnl Be careful not to let the definition leak into other tests
123 m4_popdef([_LT_AT_LTDL_SETUP])