2004-10-16 22:43:48 +08:00
|
|
|
# Hand crafted tests for GNU Libtool. -*- Autotest -*-
|
|
|
|
# Copyright 2004 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
2005-04-22 18:10:31 +08:00
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
# 02110-1301, USA.
|
2004-10-16 22:43:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
AT_BANNER([Libtool's subdir-objects support.])
|
|
|
|
|
|
|
|
|
|
|
|
## ----------- ##
|
|
|
|
## C Language. ##
|
|
|
|
## ----------- ##
|
|
|
|
|
|
|
|
AT_SETUP([C subdir-objects])
|
|
|
|
|
|
|
|
AT_DATA([[configure.ac]],
|
|
|
|
[[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[)
|
Testsuite portability update round.
* tests/inherited_flags: skip when shared libs are disabled.
* tests/deplibs-ident.at [ aix ]: No unexpected failure here.
* tests/libtoolize.at: Fix for distcheck (readonly sources).
* tests/nonrecursive.at, tests/recursive.at, tests/subproject.at
(foo.c): Actually export a symbol, for AIX.
* tests/old-m4-iface.at: Use AC_LIBTOOL_DLOPEN, for AIX.
* tests/nonrecursive.at: Set foo_la_SOURCES, for automake-1.7.
* tests/subproject.at: Require automake-1.9, we use indirect
subdirs.
* tests/am-subdir.at: Move AT_KEYWORDS settings..
* tests/testsuite.at: ..here, in respective macros.
(LT_AT_AUTOMAKE): Skip if we detect failure due to old version.
(PREPARE_TESTS): Set autotool variables to `no' if not present.
(LT_AT_ACLOCAL, LT_AT_AUTOCONF, LT_AT_AUTOMAKE)
(LT_AT_AUTOHEADER, LT_AT_AUTORECONF): Use to XFAIL tests.
Reported by Tim Rice <tim@multitalents.net>.
(LT_AT_MAKE): Do not use `make -e'.
(_LTDL_PROJECT_FILES): Adjust sub-make call. Work around `make'
which does not set `MAKE' or `SHELL'. Fix for user-set
`CONFIG_SHELL'.
Reported by Charles Wilson <cygwin@cwilson.fastmail.fm>.
2005-11-15 06:19:40 +08:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects foreign 1.5])
|
2004-10-16 22:43:48 +08:00
|
|
|
LT_INIT([win32-dll])
|
2005-11-10 22:57:50 +08:00
|
|
|
AC_PROG_CC
|
2004-10-16 22:43:48 +08:00
|
|
|
AM_PROG_CC_C_O
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([[Makefile.am]],
|
2004-11-29 21:50:54 +08:00
|
|
|
[[ACLOCAL_AMFLAGS = -I m4
|
2004-10-16 22:43:48 +08:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/../..
|
|
|
|
|
|
|
|
lib_LTLIBRARIES = subdir/libsub.la
|
|
|
|
subdir_libsub_la_SOURCES= subdir/sub.c
|
|
|
|
|
|
|
|
bin_PROGRAMS = subdir/subdemo
|
|
|
|
subdir_subdemo_SOURCES = subdir/main.c
|
|
|
|
subdir_subdemo_LDADD = subdir/libsub.la
|
|
|
|
]])
|
|
|
|
|
|
|
|
test -d subdir || { rm -f subdir && mkdir subdir; }
|
|
|
|
|
|
|
|
AT_DATA([[subdir/main.c]],
|
|
|
|
[[#include <stdio.h>
|
|
|
|
|
|
|
|
extern void sub (void);
|
|
|
|
|
|
|
|
int main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
printf ("Welcome to GNU Libtool subdir-objects test!\n");
|
|
|
|
sub();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([[subdir/sub.c]],
|
|
|
|
[[#include <stdio.h>
|
|
|
|
void sub (void) { printf ("** This is libsub **\n"); }
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA(expout,
|
|
|
|
[[Welcome to GNU Libtool subdir-objects test!
|
|
|
|
** This is libsub **
|
|
|
|
]])
|
|
|
|
|
2005-11-10 23:31:32 +08:00
|
|
|
LT_AT_BOOTSTRAP([--copy], [-I m4], [ignore], [--add-missing])
|
2005-11-10 22:57:50 +08:00
|
|
|
|
* tests/convenience.at: New. Test convenience archives.
* Makefile.am, tests/testsuite.at: Adjust.
* tests/testsuite.at: Reorder tests. Suspend AT_TESTED.
(PREPARE_TESTS): Define EGREP, host, build, LIBTOOL.
(LT_AT_BOOTSTRAP): Fail if autoreconf fails.
(LT_AT_EXEC_CHECK): New macro for execution of $build binaries.
(LT_AT_TAG): New macro to test tag availability or skip test.
* tests/am-subdir.at, tests/duplicate_members.at, tests/inherited_flags.at,
tests/link-order.at, tests/stresstest.at, tests/template.at:
Adjust. Use LT_AT_TAG, LT_AT_EXEC_CHECK, AT_KEYWORDS.
Use compiler/linker flags consistently.
* tests/link-order.at: Fix use of AT_DATA, bogus redirection
inside AT_CHECK.
* tests/stresstest.at: Do not use wildcards/regex in symbol files,
they are not portable. Use -no-undefined on win32. Fix to ignore
compile/link warnings.
2005-04-28 02:18:10 +08:00
|
|
|
LT_AT_EXEC_CHECK([subdir/subdemo], 0, expout)
|
2004-10-16 22:43:48 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ------------- ##
|
|
|
|
## C++ Language. ##
|
|
|
|
## ------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([C++ subdir-objects])
|
* tests/convenience.at: New. Test convenience archives.
* Makefile.am, tests/testsuite.at: Adjust.
* tests/testsuite.at: Reorder tests. Suspend AT_TESTED.
(PREPARE_TESTS): Define EGREP, host, build, LIBTOOL.
(LT_AT_BOOTSTRAP): Fail if autoreconf fails.
(LT_AT_EXEC_CHECK): New macro for execution of $build binaries.
(LT_AT_TAG): New macro to test tag availability or skip test.
* tests/am-subdir.at, tests/duplicate_members.at, tests/inherited_flags.at,
tests/link-order.at, tests/stresstest.at, tests/template.at:
Adjust. Use LT_AT_TAG, LT_AT_EXEC_CHECK, AT_KEYWORDS.
Use compiler/linker flags consistently.
* tests/link-order.at: Fix use of AT_DATA, bogus redirection
inside AT_CHECK.
* tests/stresstest.at: Do not use wildcards/regex in symbol files,
they are not portable. Use -no-undefined on win32. Fix to ignore
compile/link warnings.
2005-04-28 02:18:10 +08:00
|
|
|
LT_AT_TAG([CXX])
|
2004-10-16 22:43:48 +08:00
|
|
|
|
|
|
|
AT_DATA([[configure.ac]],
|
|
|
|
[[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[)
|
Testsuite portability update round.
* tests/inherited_flags: skip when shared libs are disabled.
* tests/deplibs-ident.at [ aix ]: No unexpected failure here.
* tests/libtoolize.at: Fix for distcheck (readonly sources).
* tests/nonrecursive.at, tests/recursive.at, tests/subproject.at
(foo.c): Actually export a symbol, for AIX.
* tests/old-m4-iface.at: Use AC_LIBTOOL_DLOPEN, for AIX.
* tests/nonrecursive.at: Set foo_la_SOURCES, for automake-1.7.
* tests/subproject.at: Require automake-1.9, we use indirect
subdirs.
* tests/am-subdir.at: Move AT_KEYWORDS settings..
* tests/testsuite.at: ..here, in respective macros.
(LT_AT_AUTOMAKE): Skip if we detect failure due to old version.
(PREPARE_TESTS): Set autotool variables to `no' if not present.
(LT_AT_ACLOCAL, LT_AT_AUTOCONF, LT_AT_AUTOMAKE)
(LT_AT_AUTOHEADER, LT_AT_AUTORECONF): Use to XFAIL tests.
Reported by Tim Rice <tim@multitalents.net>.
(LT_AT_MAKE): Do not use `make -e'.
(_LTDL_PROJECT_FILES): Adjust sub-make call. Work around `make'
which does not set `MAKE' or `SHELL'. Fix for user-set
`CONFIG_SHELL'.
Reported by Charles Wilson <cygwin@cwilson.fastmail.fm>.
2005-11-15 06:19:40 +08:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects foreign 1.5])
|
2005-11-10 22:57:50 +08:00
|
|
|
AC_PROG_CC
|
2004-10-16 22:43:48 +08:00
|
|
|
AM_PROG_CC_C_O
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_CXXCPP
|
|
|
|
|
|
|
|
# As of the writing of this demo, GNU Autoconf's AC_OBJEXT and
|
|
|
|
# AC_EXEEXT macros only works for C compilers!
|
|
|
|
# Libtool's setup macro calls AC_OBJEXT and AC_EXEEXT without setting
|
|
|
|
# the test language to C. We do it before any libtool setup macros are
|
|
|
|
# called so that the proper values are cached beforehand. We also do
|
|
|
|
# it before any linker flags (LDFLAGS) are set so that C++ specific
|
|
|
|
# ones don't break the tests.
|
|
|
|
AC_LANG_PUSH([C])
|
|
|
|
AC_OBJEXT
|
|
|
|
AC_EXEEXT
|
|
|
|
AC_LANG_POP
|
|
|
|
|
|
|
|
AC_LANG([C++])
|
|
|
|
LT_INIT([win32-dll])
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([[Makefile.am]],
|
2004-11-29 21:50:54 +08:00
|
|
|
[[ACLOCAL_AMFLAGS = -I m4
|
2004-10-16 22:43:48 +08:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/../..
|
|
|
|
|
|
|
|
lib_LTLIBRARIES = subdir/libsub.la
|
|
|
|
subdir_libsub_la_SOURCES= subdir/sub.cxx subdir/sub.hxx
|
|
|
|
|
|
|
|
bin_PROGRAMS = subdir/subdemo
|
|
|
|
subdir_subdemo_SOURCES = subdir/main.cxx
|
|
|
|
subdir_subdemo_LDADD = subdir/libsub.la
|
|
|
|
]])
|
|
|
|
|
|
|
|
test -d subdir || { rm -f subdir && mkdir subdir; }
|
|
|
|
|
|
|
|
AT_DATA([[subdir/sub.hxx]],
|
2005-09-13 00:24:38 +08:00
|
|
|
[[class libsub { public: int sub (void); };
|
2004-10-16 22:43:48 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([[subdir/main.cxx]],
|
2005-09-13 00:24:38 +08:00
|
|
|
[[#include "sub.hxx"
|
2004-10-16 22:43:48 +08:00
|
|
|
|
|
|
|
int main (int, char *[])
|
|
|
|
{
|
|
|
|
libsub SUB;
|
2005-09-13 00:24:38 +08:00
|
|
|
return SUB.sub() != 27;
|
2004-10-16 22:43:48 +08:00
|
|
|
}
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([[subdir/sub.cxx]],
|
2005-09-13 00:24:38 +08:00
|
|
|
[[#include "sub.hxx"
|
2004-10-16 22:43:48 +08:00
|
|
|
|
2005-09-13 00:24:38 +08:00
|
|
|
int libsub::sub (void) { return 27; }
|
2004-10-16 22:43:48 +08:00
|
|
|
]])
|
|
|
|
|
2005-11-10 23:31:32 +08:00
|
|
|
LT_AT_BOOTSTRAP([--copy], [-I m4], [ignore], [--add-missing])
|
2005-11-10 22:57:50 +08:00
|
|
|
|
2005-09-13 00:24:38 +08:00
|
|
|
LT_AT_EXEC_CHECK([subdir/subdemo], 0)
|
2004-10-16 22:43:48 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|