mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-03-07 15:37:05 +08:00
tests: migrate legacy tests/cdemo tests to Autotest.
* tests/cdemo.at: New Autotest groups, based on... * tests/cdemo-conf.test, tests/cdemo-exec.test, tests/cdemo-make.test, tests/cdemo-shared-exec.test, tests/cdemo-shared-make.test, tests/cdemo-shared.test, tests/cdemo-static-exec.test, tests/cdemo-static-make.test, tests/cdemo-static.test, tests/cdemo-undef-exec.test, tests/cdemo-undef-make.test, tests/cdemo-undef.test: ...these legacy test cases, now removed. tests/cdemo/Makefile.am, tests/cdemo/README, tests/cdemo/configure.ac, tests/cdemo/foo.c, tests/cdemo/foo.h, tests/cdemo/main.c: Remove. * configure.ac (CONF_SUBDIRS): Remove tests/cdemo. * Makefile.am: Adjust. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
This commit is contained in:
parent
848524eac7
commit
bcc0740c8b
29
Makefile.am
29
Makefile.am
@ -626,13 +626,14 @@ TESTSUITE = tests/testsuite
|
||||
TESTSUITE_AT = tests/testsuite.at \
|
||||
tests/getopt-m4sh.at \
|
||||
tests/libtoolize.at \
|
||||
tests/cdemo.at \
|
||||
tests/convenience.at \
|
||||
tests/help.at \
|
||||
tests/duplicate_members.at \
|
||||
tests/duplicate_conv.at \
|
||||
tests/duplicate_deps.at \
|
||||
tests/flags.at \
|
||||
tests/inherited_flags.at \
|
||||
tests/convenience.at \
|
||||
tests/link-order.at \
|
||||
tests/link-order2.at \
|
||||
tests/fail.at \
|
||||
@ -872,9 +873,6 @@ COMMON_TESTS = \
|
||||
tests/quote.test \
|
||||
tests/suffix.test \
|
||||
tests/tagtrace.test \
|
||||
tests/cdemo-static.test \
|
||||
tests/cdemo-static-make.test \
|
||||
tests/cdemo-static-exec.test \
|
||||
tests/demo-static.test \
|
||||
tests/demo-static-make.test \
|
||||
tests/demo-static-exec.test \
|
||||
@ -890,9 +888,6 @@ COMMON_TESTS = \
|
||||
tests/mdemo-static-exec.test \
|
||||
tests/mdemo-static-inst.test \
|
||||
tests/mdemo-static-unst.test \
|
||||
tests/cdemo-conf.test \
|
||||
tests/cdemo-make.test \
|
||||
tests/cdemo-exec.test \
|
||||
tests/demo-conf.test \
|
||||
tests/demo-make.test \
|
||||
tests/demo-exec.test \
|
||||
@ -933,17 +928,11 @@ COMMON_TESTS = \
|
||||
tests/demo-nopic.test \
|
||||
tests/demo-nopic-make.test \
|
||||
tests/demo-nopic-exec.test \
|
||||
tests/cdemo-shared.test \
|
||||
tests/cdemo-shared-make.test \
|
||||
tests/cdemo-shared-exec.test \
|
||||
tests/mdemo-shared.test \
|
||||
tests/mdemo-shared-make.test \
|
||||
tests/mdemo-shared-exec.test \
|
||||
tests/mdemo-shared-inst.test \
|
||||
tests/mdemo-shared-unst.test \
|
||||
tests/cdemo-undef.test \
|
||||
tests/cdemo-undef-make.test \
|
||||
tests/cdemo-undef-exec.test
|
||||
tests/mdemo-shared-unst.test
|
||||
|
||||
# Actually, only demo-relink and depdemo-relink require interaction,
|
||||
# but they depend on the other tests being run beforehand.
|
||||
@ -963,18 +952,6 @@ INTERACTIVE_TESTS = \
|
||||
tests/depdemo-relink.test \
|
||||
tests/depdemo-shared-unst.test
|
||||
|
||||
tests/cdemo-undef-exec.log: tests/cdemo-undef-make.log
|
||||
tests/cdemo-undef-make.log: tests/cdemo-undef.log
|
||||
tests/cdemo-undef.log: $(ORDER) tests/cdemo-shared-exec.log
|
||||
tests/cdemo-shared-exec.log: tests/cdemo-shared-make.log
|
||||
tests/cdemo-shared-make.log: tests/cdemo-shared.log
|
||||
tests/cdemo-shared.log: $(ORDER) tests/cdemo-exec.log
|
||||
tests/cdemo-exec.log: tests/cdemo-make.log
|
||||
tests/cdemo-make.log: tests/cdemo-conf.log
|
||||
tests/cdemo-conf.log: $(ORDER) tests/cdemo-static-exec.log
|
||||
tests/cdemo-static-exec.log: tests/cdemo-static-make.log
|
||||
tests/cdemo-static-make.log: tests/cdemo-static.log
|
||||
|
||||
tests/demo-shared-unst.log: tests/demo-noinst-link.log
|
||||
tests/demo-noinst-link.log: tests/demo-relink.log
|
||||
tests/demo-relink.log: tests/demo-hardcode.log
|
||||
|
@ -126,7 +126,7 @@ AC_SUBST([pkgaux_scripts])
|
||||
|
||||
# All subdirectories that are configured on demand, but that must be
|
||||
# included in the distribution.
|
||||
CONF_SUBDIRS="tests/cdemo tests/demo tests/depdemo tests/f77demo tests/fcdemo \
|
||||
CONF_SUBDIRS="tests/demo tests/depdemo tests/f77demo tests/fcdemo \
|
||||
tests/mdemo tests/mdemo2 tests/pdemo tests/tagdemo"
|
||||
AC_SUBST([CONF_SUBDIRS])
|
||||
|
||||
|
@ -1,34 +0,0 @@
|
||||
#! /bin/sh
|
||||
# cdemo-conf.test - try configuring the cdemo subdirectory
|
||||
#
|
||||
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2003
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
# or obtained by writing to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
####
|
||||
|
||||
. tests/defs || exit 1
|
||||
|
||||
func_mkprefixdir
|
||||
func_cd "tests/cdemo"
|
||||
func_make_distclean
|
||||
func_configure
|
||||
func_check_static_shared "yes" "yes"
|
||||
|
||||
exit 0
|
@ -1,34 +0,0 @@
|
||||
#! /bin/sh
|
||||
# cdemo-exec.test - check that programs in the cdemo subdirectory are viable
|
||||
#
|
||||
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2003
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
# or obtained by writing to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
####
|
||||
|
||||
. tests/defs || exit 1
|
||||
|
||||
func_require "cdemo-make" "tests/cdemo/cdemo$EXEEXT"
|
||||
|
||||
func_rmprefixdir
|
||||
func_exec_init "uninstalled"
|
||||
func_exec "tests/cdemo/cdemo$EXEEXT"
|
||||
|
||||
exit $exec_status
|
@ -1,34 +0,0 @@
|
||||
#! /bin/sh
|
||||
# cdemo-make.test - try building in the cdemo subdirectory
|
||||
#
|
||||
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2003
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
# or obtained by writing to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
####
|
||||
|
||||
. tests/defs || exit 1
|
||||
|
||||
func_require "cdemo-conf" "tests/cdemo/Makefile"
|
||||
|
||||
func_rmprefixdir
|
||||
func_cd "tests/cdemo"
|
||||
func_make
|
||||
|
||||
exit 0
|
@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
. tests/defs || exit 1
|
||||
. $abs_srcdir/tests/cdemo-exec.test
|
@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
. tests/defs || exit 1
|
||||
. $abs_srcdir/tests/cdemo-make.test
|
@ -1,34 +0,0 @@
|
||||
#! /bin/sh
|
||||
# cdemo-shared.test - try configuring the cdemo subdirectory for shared libs
|
||||
#
|
||||
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2003
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
# or obtained by writing to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
####
|
||||
|
||||
. tests/defs || exit 1
|
||||
|
||||
func_mkprefixdir
|
||||
func_cd "tests/cdemo"
|
||||
func_make_distclean
|
||||
func_configure "--disable-static"
|
||||
func_check_static_shared "no" "yes"
|
||||
|
||||
exit 0
|
@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
. tests/defs || exit 1
|
||||
. $abs_srcdir/tests/cdemo-exec.test
|
@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
. tests/defs || exit 1
|
||||
. $abs_srcdir/tests/cdemo-make.test
|
@ -1,34 +0,0 @@
|
||||
#! /bin/sh
|
||||
# cdemo-static.test - try configuring the cdemo subdirectory for static libs
|
||||
#
|
||||
# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2003
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
# or obtained by writing to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
####
|
||||
|
||||
. tests/defs || exit 1
|
||||
|
||||
func_mkprefixdir
|
||||
func_cd "tests/cdemo"
|
||||
func_make_distclean
|
||||
func_configure "--disable-shared"
|
||||
func_check_static_shared "yes" "no"
|
||||
|
||||
exit 0
|
@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
. tests/defs || exit 1
|
||||
. $abs_srcdir/tests/cdemo-exec.test
|
@ -1,3 +0,0 @@
|
||||
#! /bin/sh
|
||||
. tests/defs || exit 1
|
||||
. $abs_srcdir/tests/cdemo-make.test
|
@ -1,49 +0,0 @@
|
||||
#! /bin/sh
|
||||
# cdemo-undef - test generating shared libraries with undefined symbols
|
||||
#
|
||||
# Copyright (C) 2003, 2004, 2008 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2003
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
# or obtained by writing to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
####
|
||||
|
||||
. tests/defs || exit 1
|
||||
|
||||
func_mkprefixdir
|
||||
func_cd "tests/cdemo"
|
||||
func_make_distclean
|
||||
func_configure "--disable-static"
|
||||
|
||||
grep '^allow_undefined_flag=.\{0,1\}unsupported.\{0,1\}$' ./libtool >/dev/null 2>&1 \
|
||||
&& func_skip "$host doesn't support undefined symbols in shared libs"
|
||||
|
||||
if test -f ./libtool; then
|
||||
$SED 's|allow_undefined=no|allow_undefined=yes|g' ./libtool > ltnew
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -f ./ltnew; then
|
||||
rm -f libtool
|
||||
mv ltnew libtool
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
193
tests/cdemo.at
Normal file
193
tests/cdemo.at
Normal file
@ -0,0 +1,193 @@
|
||||
# cdemo.at -- Using Automake to build a program and library -*- Autotest -*-
|
||||
#
|
||||
# Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2003
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
# or obtained by writing to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
####
|
||||
|
||||
|
||||
AT_BANNER([Convenience libraries.])
|
||||
|
||||
|
||||
# _LT_SETUP
|
||||
# ---------
|
||||
m4_define([_LT_SETUP],
|
||||
[AT_DATA([configure.ac],
|
||||
[[AC_INIT([cdemo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_PROG_CC
|
||||
LT_INIT
|
||||
AC_SUBST([LIBTOOL_DEPS])
|
||||
LT_LIB_M
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_HEADERS([config.h:config.in.h])
|
||||
AC_OUTPUT
|
||||
]])
|
||||
|
||||
AT_DATA([Makefile.am],
|
||||
[[AUTOMAKE_OPTIONS = no-dependencies foreign
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
noinst_LTLIBRARIES = libfoo.la
|
||||
libfoo_la_SOURCES = foo.c
|
||||
libfoo_la_LIBADD = $(LIBM)
|
||||
libfoo_la_LDFLAGS = -no-undefined
|
||||
noinst_HEADERS = foo.h
|
||||
|
||||
bin_PROGRAMS = cdemo
|
||||
cdemo_SOURCES = main.c
|
||||
cdemo_LDADD = libfoo.la
|
||||
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
||||
]])
|
||||
|
||||
AT_DATA([foo.h],
|
||||
[[#ifndef FOO_H
|
||||
#define FOO_H 1
|
||||
|
||||
/* Silly constants that the functions return. */
|
||||
#define HELLO_RET 0xe110
|
||||
#define FOO_RET 0xf00
|
||||
|
||||
extern int foo();
|
||||
|
||||
extern int hello();
|
||||
|
||||
#endif
|
||||
]])
|
||||
|
||||
AT_DATA([foo.c],
|
||||
[[#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "foo.h"
|
||||
|
||||
int foo() {
|
||||
printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
|
||||
return FOO_RET;
|
||||
}
|
||||
|
||||
int hello() {
|
||||
printf ("** This is libfoo **\n");
|
||||
return HELLO_RET;
|
||||
}
|
||||
]])
|
||||
|
||||
AT_DATA([main.c],
|
||||
[[#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include "foo.h"
|
||||
|
||||
int main ()
|
||||
{
|
||||
int value;
|
||||
|
||||
printf ("Welcome to GNU libtool cdemo!\n");
|
||||
|
||||
value = hello();
|
||||
printf ("hello returned: %i\n", value);
|
||||
if (value == HELLO_RET)
|
||||
printf("hello is ok!\n");
|
||||
|
||||
if (foo () == FOO_RET)
|
||||
printf("foo is ok!\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
]])
|
||||
|
||||
AT_DATA([expout],
|
||||
[[Welcome to GNU libtool cdemo!
|
||||
** This is libfoo **
|
||||
hello returned: 57616
|
||||
hello is ok!
|
||||
cos (0.0) = 1
|
||||
foo is ok!
|
||||
]])
|
||||
]) # _LT_SETUP
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Cdemo static. ##
|
||||
## ------------- ##
|
||||
|
||||
AT_SETUP([build and link against a static library])
|
||||
|
||||
_LT_SETUP
|
||||
|
||||
LT_AT_CHECK_CONFIG([--disable-shared],
|
||||
[^build_old_libs=yes], [^build_libtool_libs=no])
|
||||
LT_AT_CHECK_EXECUTE([], [./cdemo])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ------------- ##
|
||||
## Cdemo shared. ##
|
||||
## ------------- ##
|
||||
|
||||
AT_SETUP([build and link against a dynamic library])
|
||||
|
||||
_LT_SETUP
|
||||
|
||||
LT_AT_CHECK_CONFIG([--disable-static],
|
||||
[^build_old_libs=no], [^build_libtool_libs=yes])
|
||||
LT_AT_CHECK_EXECUTE([], [./cdemo])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Cdemo conf. ##
|
||||
## ----------- ##
|
||||
|
||||
AT_SETUP([build both static and dynamic])
|
||||
|
||||
_LT_SETUP
|
||||
|
||||
LT_AT_CHECK_CONFIG([],
|
||||
[^build_old_libs=yes], [^build_libtool_libs=yes])
|
||||
LT_AT_CHECK_EXECUTE([], [./cdemo])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ------------ ##
|
||||
## Cdemo undef. ##
|
||||
## ------------ ##
|
||||
|
||||
AT_SETUP([allow_undefined_flag])
|
||||
|
||||
_LT_SETUP
|
||||
|
||||
LT_AT_CHECK_CONFIG([--disable-static])
|
||||
|
||||
AT_CHECK([$EGREP "^allow_undefined_flag=.\{0,1\}unsupported.\{0,1\}$" libtool && (exit 77)],
|
||||
1, [ignore])
|
||||
|
||||
sed 's|allow_undefined=no|allow_undefined=yes|g' libtool > ltnew && mv -f ltnew libtool
|
||||
|
||||
LT_AT_CHECK_EXECUTE([], [./cdemo])
|
||||
|
||||
AT_CLEANUP
|
1
tests/cdemo/.gitignore
vendored
1
tests/cdemo/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/cdemo
|
@ -1,53 +0,0 @@
|
||||
## Makefile.am -- Process this file with automake to produce Makefile.in
|
||||
##
|
||||
## Copyright (C) 2003, 2004, 2005 Free Software Foundation
|
||||
## Written by Gary V. Vaughan, 2003
|
||||
##
|
||||
## This file is part of GNU Libtool.
|
||||
##
|
||||
## GNU Libtool 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 of
|
||||
## the License, or (at your option) any later version.
|
||||
##
|
||||
## GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
## can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
## or obtained by writing to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#####
|
||||
|
||||
AUTOMAKE_OPTIONS = no-dependencies foreign
|
||||
ACLOCAL_AMFLAGS = -I ../../m4
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/../..
|
||||
|
||||
noinst_LTLIBRARIES = libfoo.la
|
||||
|
||||
libfoo_la_SOURCES = foo.c
|
||||
libfoo_la_LIBADD = $(LIBM)
|
||||
libfoo_la_LDFLAGS = -no-undefined
|
||||
|
||||
noinst_HEADERS = foo.h
|
||||
|
||||
bin_PROGRAMS = cdemo
|
||||
|
||||
cdemo_SOURCES = main.c
|
||||
cdemo_LDADD = libfoo.la
|
||||
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
# Workaround a bug in Autoconf-2.61 and earlier that don't clean up
|
||||
# file droppings left by many compilers:
|
||||
distclean-local:
|
||||
ac_files="a.out.* a.exe.* a_out.exe.* b.out.* conftest.*"; \
|
||||
for ac_file in $$ac_files; do \
|
||||
case $$ac_file in \
|
||||
*.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) rm -rf $$ac_file ;; \
|
||||
esac; \
|
||||
done
|
@ -1,4 +0,0 @@
|
||||
This is cdemo, an example package that uses GNU libtool with an
|
||||
Automake-generated environment to build two simple libraries and programs.
|
||||
|
||||
It demonstrates how to build convenience libraries
|
@ -1,63 +0,0 @@
|
||||
# Process this file with autoconf to create configure. -*- autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU Libtool.
|
||||
#
|
||||
# GNU Libtool 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 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
# or obtained by writing to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
####
|
||||
|
||||
AC_PREREQ(2.54)
|
||||
|
||||
## ------------------------ ##
|
||||
## Autoconf initialisation. ##
|
||||
## ------------------------ ##
|
||||
AC_INIT([cdemo], [1.0], [bug-libtool@gnu.org])
|
||||
AC_CONFIG_SRCDIR([main.c])
|
||||
AC_CONFIG_AUX_DIR([../../build-aux])
|
||||
|
||||
|
||||
## ------------------------ ##
|
||||
## Automake Initialisation. ##
|
||||
## ------------------------ ##
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## C compiler checks. ##
|
||||
## ------------------ ##
|
||||
AC_PROG_CC
|
||||
|
||||
|
||||
## ----------------------- ##
|
||||
## Libtool initialisation. ##
|
||||
## ----------------------- ##
|
||||
LT_INIT
|
||||
AC_SUBST([LIBTOOL_DEPS])
|
||||
|
||||
|
||||
## ---------------------------- ##
|
||||
## Libraries required by cdemo. ##
|
||||
## ---------------------------- ##
|
||||
LT_LIB_M
|
||||
|
||||
|
||||
## -------- ##
|
||||
## Outputs. ##
|
||||
## -------- ##
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
@ -1,42 +0,0 @@
|
||||
/* foo.c -- trivial test library
|
||||
|
||||
Copyright (C) 1998-1999, 2007 Free Software Foundation, Inc.
|
||||
Written by Thomas Tanner, 1998
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
GNU Libtool 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 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
or obtained by writing to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "foo.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
int
|
||||
foo()
|
||||
{
|
||||
printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
|
||||
return FOO_RET;
|
||||
}
|
||||
|
||||
int
|
||||
hello()
|
||||
{
|
||||
printf ("** This is libfoo **\n");
|
||||
return HELLO_RET;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/* foo.h -- interface to the libfoo* libraries
|
||||
|
||||
Copyright (C) 1998-1999 Free Software Foundation, Inc.
|
||||
Written by Thomas Tanner, 1998
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
GNU Libtool 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 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
or obtained by writing to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* Only include this header file once. */
|
||||
#ifndef _FOO_H_
|
||||
#define _FOO_H_ 1
|
||||
|
||||
/* Silly constants that the functions return. */
|
||||
#define HELLO_RET 0xe110
|
||||
#define FOO_RET 0xf00
|
||||
|
||||
extern int foo();
|
||||
|
||||
extern int hello();
|
||||
|
||||
#endif /* !_FOO_H_ */
|
@ -1,45 +0,0 @@
|
||||
/* main.c -- cdemo test program
|
||||
|
||||
Copyright (C) 1998-1999, 2006 Free Software Foundation, Inc.
|
||||
Written by Thomas Tanner, 1998
|
||||
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
GNU Libtool 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 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
||||
can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
||||
or obtained by writing to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "foo.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int value;
|
||||
|
||||
printf ("Welcome to GNU libtool cdemo!\n");
|
||||
|
||||
value = hello();
|
||||
printf ("hello returned: %i\n", value);
|
||||
if (value == HELLO_RET)
|
||||
printf("hello is ok!\n");
|
||||
|
||||
if (foo () == FOO_RET)
|
||||
printf("foo is ok!\n");
|
||||
|
||||
return 0;
|
||||
}
|
@ -208,6 +208,22 @@ m4_define([LT_AT_CHECK],
|
||||
[echo "LT_ESCAPE([$1])"; AT_CHECK($@)])
|
||||
|
||||
|
||||
# LT_AT_CHECK_CONFIG (CONFIGURE-ARGS, [GREP-EXPRESSION], ...)
|
||||
# -----------------------------------------------------------
|
||||
# Bootstrap and configure the project, and check each GREP-EXPRESSION
|
||||
# works on the resulting libtool script.
|
||||
m4_define([LT_AT_CHECK_CONFIG],
|
||||
[LT_AT_BOOTSTRAP([], [-I m4], [], [--add-missing], [],
|
||||
[--prefix="$prefixdir" $1], [ignore])
|
||||
m4_if([$#], 0, [],
|
||||
[$#], 1, [], [$0_(m4_shift($@))])
|
||||
])
|
||||
m4_define([LT_AT_CHECK_CONFIG_],
|
||||
[AT_CHECK([$EGREP '$1' libtool], 0, [ignore])
|
||||
m4_if([$#], 1, [], [$0(m4_shift($@))])
|
||||
])
|
||||
|
||||
|
||||
# LT_AT_HOST_DATA(FILE, CONTENTS)
|
||||
# -------------------------------
|
||||
# Ensure correct line ending for expected output of host executables.
|
||||
|
Loading…
Reference in New Issue
Block a user