1 # am-subdir.at -- libtool subdir-objects support -*- Autotest -*-
3 # Copyright (C) 2004, 2008 Free Software Foundation, Inc.
4 # Written by Gary V. Vaughan, 2004
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.
26 AT_BANNER([Libtool subdir-objects support.])
33 AT_SETUP([C subdir-objects])
35 AT_DATA([[configure.ac]],
36 [[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[)
41 AC_CONFIG_FILES([Makefile])
45 AT_DATA([[Makefile.am]],
46 [[ACLOCAL_AMFLAGS = -I m4
47 AUTOMAKE_OPTIONS = subdir-objects foreign 1.6
48 AM_CPPFLAGS = -I$(top_srcdir)/../..
50 lib_LTLIBRARIES = subdir/libsub.la
51 subdir_libsub_la_SOURCES= subdir/sub.c
53 bin_PROGRAMS = subdir/subdemo
54 subdir_subdemo_SOURCES = subdir/main.c
55 subdir_subdemo_LDADD = subdir/libsub.la
58 test -d subdir || { rm -f subdir && mkdir subdir; }
60 AT_DATA([[subdir/main.c]],
63 extern void sub (void);
67 printf ("Welcome to GNU Libtool subdir-objects test!\n");
73 AT_DATA([[subdir/sub.c]],
75 void sub (void) { printf ("** This is libsub **\n"); }
78 LT_AT_BOOTSTRAP([--copy], [-I m4], [ignore], [--add-missing])
80 LT_AT_EXEC_CHECK([subdir/subdemo], 0, stdout)
81 AT_CHECK([grep 'Welcome to GNU Libtool subdir-objects test' stdout],
83 AT_CHECK([grep 'This is libsub' stdout],
93 AT_SETUP([C++ subdir-objects])
96 AT_DATA([[configure.ac]],
97 [[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[)
107 AC_CONFIG_FILES([Makefile])
111 AT_DATA([[Makefile.am]],
112 [[ACLOCAL_AMFLAGS = -I m4
113 AUTOMAKE_OPTIONS = subdir-objects foreign 1.6
114 AM_CPPFLAGS = -I$(top_srcdir)/../..
116 lib_LTLIBRARIES = subdir/libsub.la
117 subdir_libsub_la_SOURCES= subdir/sub.cxx subdir/sub.hxx
119 bin_PROGRAMS = subdir/subdemo
120 subdir_subdemo_SOURCES = subdir/main.cxx
121 subdir_subdemo_LDADD = subdir/libsub.la
124 test -d subdir || { rm -f subdir && mkdir subdir; }
126 AT_DATA([[subdir/sub.hxx]],
127 [[class libsub { public: int sub (void); };
130 AT_DATA([[subdir/main.cxx]],
136 return SUB.sub() != 27;
140 AT_DATA([[subdir/sub.cxx]],
143 int libsub::sub (void) { return 27; }
146 LT_AT_BOOTSTRAP([--copy], [-I m4], [ignore], [--add-missing])
148 LT_AT_EXEC_CHECK([subdir/subdemo], 0)