tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
# demo.at -- Dynamic ltdl runtime loading -*- Autotest -*-
|
|
|
|
#
|
2024-01-12 14:35:32 +08:00
|
|
|
# Copyright (C) 1998, 2002-2004, 2011-2019, 2021-2024 Free Software
|
2021-11-15 12:37:22 +08:00
|
|
|
# Foundation, Inc.
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
# Written by Thomas Tanner, 1998
|
|
|
|
# Written by Greg Eisenhauer, 2002
|
|
|
|
# Rewritten 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
|
libtool: FSF office address replaced by URL
* AUTHORS, HACKING, Makefile.am, bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/no-bogus-m4-defines, cfg.mk, configure.ac, libltdl/configure.ac,
libltdl/libltdl/lt__alloc.h, libltdl/libltdl/lt__argz_.h,
libltdl/libltdl/lt__dirent.h, libltdl/libltdl/lt__glibc.h,
libltdl/libltdl/lt__private.h, libltdl/libltdl/lt__strl.h,
libltdl/libltdl/lt_dlloader.h, libltdl/libltdl/lt_error.h,
libltdl/libltdl/lt_system.h, libltdl/libltdl/slist.h,
libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c, libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c, libltdl/lt__alloc.c, libltdl/lt__argz.c,
libltdl/lt__dirent.c, libltdl/lt__strl.c, libltdl/lt_dlloader.c,
libltdl/lt_error.c, libltdl/ltdl.c, libltdl/ltdl.h, libltdl/ltdl.mk,
libltdl/slist.c, tests/am-subdir.at, tests/archive-in-archive.at,
tests/bindir.at, tests/bug_62343.at, tests/cdemo.at, tests/cmdline_wrap.at,
tests/configure-funcs.at, tests/configure-iface.at, tests/convenience.at,
tests/ctor.at, tests/cwrapper.at, tests/darwin.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at, tests/deplibs-ident.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/dlloader-api.at,
tests/dumpbin-symbols.at, tests/duplicate_conv.at, tests/duplicate_deps.at,
tests/duplicate_members.at, tests/early-libtool.at, tests/exceptions.at,
tests/execute-mode.at, tests/exeext.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fail.at, tests/fcdemo.at,
tests/flags.at, tests/help.at, tests/indirect_deps.at, tests/infer-tag.at,
tests/inherited_flags.at, tests/install.at, tests/lalib-syntax.at,
tests/libtool.at, tests/libtoolize.at, tests/link-order.at,
tests/link-order2.at, tests/loadlibrary.at, tests/localization.at,
tests/lt_dladvise.at, tests/lt_dlexit.at, tests/lt_dlopen.at,
tests/lt_dlopen_a.at, tests/lt_dlopenext.at, tests/ltdl-api.at,
tests/ltdl-libdir.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/no-executables.at, tests/nocase.at, tests/nonrecursive.at,
tests/old-m4-iface.at, tests/pic_flag.at, tests/recursive.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/shlibpath.at, tests/slist.at, tests/standalone.at, tests/static.at,
tests/stresstest.at, tests/subproject.at, tests/sysroot.at, tests/tagdemo.at,
tests/template.at, tests/testsuite.at, tests/versioning.at,
tests/with-pic.at: Replace FSF address in each file's license block with
a URL that points to licenses online hosted by GNU.
2024-09-03 23:02:46 +08:00
|
|
|
# along with GNU Libtool. If not, see <https://www.gnu.org/licenses/>.
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
####
|
|
|
|
|
|
|
|
|
|
|
|
AT_BANNER([Dynamic ltdl runtime loading.])
|
|
|
|
|
|
|
|
# _LT_SETUP
|
|
|
|
# ---------
|
|
|
|
m4_define([_LT_SETUP],
|
|
|
|
[dnl We can't use AT_DATA here, because we need an unquoted here-
|
|
|
|
dnl document to splice in the path to the top level libltdl directory,
|
|
|
|
dnl but, we do need to double m4-quote to prevent premature expansion
|
|
|
|
dnl of any active m4 symbols in the here-doc content, and to maintain
|
|
|
|
dnl the square-bracket symbols as is.
|
|
|
|
[cat >configure.ac <<_EOT_
|
|
|
|
AC_INIT([mdemo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
libtoolize: migrate to new AC_CONFIG_MACRO_DIRS api.
* libtoolize.in (func_install_pkgmacro_files): Uee
AC_CONFIG_MACRO_DIRS.
(func_check_macros): Advise using AC_CONFIG_MACRO_DIRS.
(require_ac_macro_dir): Give priority to AC_CONFIG_MACRO_DIRS.
(require_macro_dir): Likewise.
* bootstrap: Give priority to AC_CONFIG_MACRO_DIRS.
* configure.ac: Define dummy AC_CONFIG_MACRO_DIRS for older
Autotools, that is allow bootstrap with current release versions.
Use AC_CONFIG_MACRO_DIRS instead of AC_CONFIG_MACRO_DIR.
* tests/testsuite.at: Source build-aux/extract-trace for access
to func_extract_trace.
(LT_AT_ACLOCAL): Use it to get the AC_CONFIG_MACRO_DIRS argument
to pass manually to aclocal for compatibility with old Automake.
Add a fallback AC_CONFIG_MACRO_DIRS definition to acinclude.m4
in the test directory.
(LT_AT_AUTORECONF): Likewise.
* tests/cdemo.at, tests/configure-iface.at, tests/darwin.at,
tests/demo.at, tests/depdemo.at, tests/early-libtool.at,
tests/libtoolize.at, tests/mdemo.at, tests/no-executables.at,
tests/nonrecursive.at, tests/old-ltdl-iface.at,
tests/recursive.at, tests/subproject.at, tests/tagdemo.at,
tests/template.at: Likewise.
* doc/libtool.texi: Update.
* NEWS: Update.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-18 21:37:03 +08:00
|
|
|
AC_CONFIG_MACRO_DIRS([m4])
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
LT_CONFIG_LTDL_DIR([libltdl])
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
AC_PROG_CC
|
|
|
|
LT_INIT([dlopen win32-dll])
|
2012-10-06 13:53:33 +08:00
|
|
|
LTDL_INIT([nonrecursive convenience])
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
AC_SUBST([LIBTOOL_DEPS])
|
|
|
|
AC_SUBST([INCLTDL])
|
|
|
|
AC_SUBST([LIBLTDL])
|
|
|
|
STATIC=
|
|
|
|
test yes = "$enable_static" && STATIC=-static
|
|
|
|
AC_SUBST([STATIC])
|
|
|
|
LT_LIB_M
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_CONFIG_HEADERS([config.h:config.in.h])
|
|
|
|
AC_OUTPUT
|
|
|
|
_EOT_]
|
|
|
|
|
|
|
|
|
|
|
|
[cat >Makefile.am <<_EOT_
|
2012-10-06 13:53:33 +08:00
|
|
|
AUTOMAKE_OPTIONS = no-dependencies subdir-objects foreign
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
ACLOCAL_AMFLAGS = -I m4
|
|
|
|
AM_CPPFLAGS = \$(INCLTDL)
|
|
|
|
AM_LDFLAGS =
|
|
|
|
|
|
|
|
noinst_LTLIBRARIES =
|
|
|
|
EXTRA_LTLIBRARIES =
|
|
|
|
|
|
|
|
include_HEADERS =
|
|
|
|
|
|
|
|
EXTRA_DIST =
|
|
|
|
|
|
|
|
BUILT_SOURCES =
|
|
|
|
CLEANFILES =
|
|
|
|
MOSTLYCLEANFILES =
|
|
|
|
|
|
|
|
lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la libmlib.la
|
|
|
|
|
|
|
|
foo1_la_SOURCES = foo1.c
|
|
|
|
foo1_la_LIBADD = \$(LIBM) libsub.la
|
|
|
|
foo1_la_LDFLAGS = -no-undefined -module -avoid-version
|
|
|
|
|
|
|
|
libfoo2_la_SOURCES = foo2.c
|
|
|
|
libfoo2_la_LIBADD = \$(LIBM) libsub.la
|
|
|
|
libfoo2_la_LDFLAGS = -no-undefined -module -export-symbols-regex "libfoo2.*"
|
|
|
|
|
|
|
|
libsub_la_SOURCES = sub.c
|
|
|
|
libsub_la_LDFLAGS = -no-undefined
|
|
|
|
|
|
|
|
## Use -export-symbols-regex here explicitly because libltdl marks
|
|
|
|
## its exported symbols, and we use libltdl as a convenience archive.
|
|
|
|
## Thus, on w32, auto-exporting is turned off.
|
|
|
|
libmlib_la_SOURCES = mlib.c
|
|
|
|
libmlib_la_LIBADD = \$(LIBLTDL) "-dlopen" foo1.la "-dlopen" libfoo2.la
|
|
|
|
libmlib_la_LDFLAGS = -no-undefined -export-symbols-regex ".*"
|
|
|
|
libmlib_la_DEPENDENCIES = \$(LIBLTDL) libsub.la foo1.la libfoo2.la
|
|
|
|
|
|
|
|
noinst_HEADERS = foo.h
|
|
|
|
|
|
|
|
bin_PROGRAMS = mdemo mdemo_static
|
|
|
|
|
|
|
|
# Create a version of mdemo that does dlopen.
|
|
|
|
mdemo_SOURCES = main.c
|
|
|
|
mdemo_LDFLAGS = -export-dynamic
|
|
|
|
## The quotes around -dlopen below fool automake into accepting it
|
|
|
|
mdemo_LDADD = \$(LIBLTDL) libsub.la "-dlopen" self \
|
|
|
|
"-dlopen" foo1.la "-dlopen" libfoo2.la
|
|
|
|
mdemo_DEPENDENCIES = \$(LIBLTDL) libsub.la foo1.la libfoo2.la
|
|
|
|
|
|
|
|
# Create a statically linked version of mdemo.
|
|
|
|
mdemo_static_SOURCES = \$(mdemo_SOURCES)
|
|
|
|
mdemo_static_LDFLAGS = \$(STATIC) \$(mdemo_LDFLAGS)
|
|
|
|
mdemo_static_LDADD = \$(mdemo_LDADD)
|
|
|
|
mdemo_static_DEPENDENCIES = \$(mdemo_DEPENDENCIES)
|
|
|
|
|
|
|
|
libtool: \$(LIBTOOL_DEPS)
|
|
|
|
\$(SHELL) ./config.status --recheck
|
|
|
|
|
|
|
|
include \$(srcdir)/libltdl/ltdl.mk
|
|
|
|
include \$(srcdir)/mdemo.mk
|
|
|
|
_EOT_]
|
|
|
|
|
|
|
|
AT_DATA([mdemo.mk],
|
|
|
|
[[# Don't abort for lack of mdemo.mk
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([foo.h],
|
|
|
|
[[#ifndef FOO_H
|
|
|
|
#define FOO_H
|
|
|
|
|
|
|
|
/* Silly constants that the functions return. */
|
|
|
|
#define HELLO_RET 0xe110
|
|
|
|
#define FOO_RET 0xf00
|
|
|
|
|
|
|
|
int sub (void);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([foo1.c],
|
|
|
|
[[#include <config.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include "foo.h"
|
|
|
|
|
|
|
|
#define nothing foo1_LTX_nothing
|
|
|
|
#define foo1 foo1_LTX_foo1
|
|
|
|
#define hello foo1_LTX_hello
|
|
|
|
|
|
|
|
/* Give a global variable definition. */
|
|
|
|
int nothing = FOO_RET;
|
|
|
|
|
|
|
|
/* private function */
|
|
|
|
int _foo1_helper (void) {
|
|
|
|
sub ();
|
|
|
|
return FOO_RET;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* export functions */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int foo1 (void) {
|
|
|
|
printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
|
|
|
|
return _foo1_helper ();
|
|
|
|
}
|
|
|
|
|
|
|
|
int hello () {
|
|
|
|
printf ("** This is foolib 1 **\n");
|
|
|
|
return HELLO_RET;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([foo2.c],
|
|
|
|
[[#include <config.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include "foo.h"
|
|
|
|
|
|
|
|
#define nothing libfoo2_LTX_nothing
|
|
|
|
#define foo2 libfoo2_LTX_foo2
|
|
|
|
#define hello libfoo2_LTX_hello
|
|
|
|
|
|
|
|
/* Give a global variable definition. */
|
|
|
|
int nothing;
|
|
|
|
|
|
|
|
/* private function */
|
|
|
|
int _foo2_helper (void) {
|
|
|
|
sub ();
|
|
|
|
return FOO_RET;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* export functions */
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int foo2 (void) {
|
|
|
|
printf ("sin (0.0) = %g\n", (double) sin ((double) 0.0));
|
|
|
|
return _foo2_helper ();
|
|
|
|
}
|
|
|
|
|
|
|
|
int hello () {
|
|
|
|
printf ("** This is foolib 2 **\n");
|
|
|
|
return HELLO_RET;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([mlib.c],
|
|
|
|
[[#include <config.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "foo.h"
|
|
|
|
#include "ltdl.h"
|
|
|
|
|
|
|
|
int test_dl (char *filename) {
|
|
|
|
lt_dlhandle handle;
|
|
|
|
const lt_dlinfo *info;
|
|
|
|
int (*pfoo1)() = 0;
|
|
|
|
int (*pfoo2)() = 0;
|
|
|
|
int (*phello)() = 0;
|
|
|
|
int *pnothing = 0;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
handle = lt_dlopen(filename);
|
|
|
|
if (!handle) {
|
|
|
|
fprintf (stderr, "can't open the module %s!\n", filename);
|
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
info = lt_dlgetinfo(handle);
|
|
|
|
if (!info) {
|
|
|
|
fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (info->name) {
|
|
|
|
printf ("module name: %s\n", info->name);
|
|
|
|
} else {
|
|
|
|
printf ("module is not a libtool module\n");
|
|
|
|
}
|
|
|
|
printf ("module filename: %s\n", info->filename);
|
|
|
|
printf ("module reference count: %i\n", info->ref_count);
|
|
|
|
|
|
|
|
phello = (int(*)())lt_dlsym(handle, "hello");
|
|
|
|
if (phello)
|
|
|
|
{
|
|
|
|
int value = (*phello) ();
|
|
|
|
|
|
|
|
printf ("hello returned: %i\n", value);
|
|
|
|
if (value == HELLO_RET)
|
|
|
|
printf("hello is ok!\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
fprintf (stderr, "did not find the 'hello' function\n");
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
pnothing = (int*)lt_dlsym(handle, "nothing");
|
|
|
|
/* Try assigning to the nothing variable. */
|
|
|
|
if (pnothing)
|
|
|
|
*pnothing = 1;
|
|
|
|
else
|
|
|
|
{
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
fprintf (stderr, "did not find the 'nothing' variable\n");
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
|
|
|
|
/* Just call the functions and check return values. */
|
|
|
|
if (pfoo1)
|
|
|
|
{
|
|
|
|
if ((*pfoo1) () == FOO_RET)
|
|
|
|
printf("foo1 is ok!\n");
|
|
|
|
else
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
|
|
|
|
if (pfoo2)
|
|
|
|
{
|
|
|
|
if ((*pfoo2) () == FOO_RET)
|
|
|
|
printf("foo2 is ok!\n");
|
|
|
|
else ret = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
fprintf (stderr, "did not find any of the 'foo' functions\n");
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lt_dlclose(handle);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
mlib_func (int argc, char **argv)
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
int i;
|
|
|
|
/*
|
|
|
|
* Would be nice if this somehow worked for libraries, not just executables.
|
|
|
|
* LTDL_SET_PRELOADED_SYMBOLS();
|
|
|
|
*/
|
|
|
|
if (lt_dlinit() != 0) {
|
|
|
|
fprintf (stderr, "error during initialization: %s\n", lt_dlerror());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
if (test_dl(argv[i]))
|
|
|
|
ret = 1;
|
|
|
|
|
|
|
|
lt_dlexit();
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([sub.c],
|
|
|
|
[[#include <config.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
void sub (void) { printf ("sub() called\n"); }
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([main.c],
|
|
|
|
[[#include <config.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "foo.h"
|
|
|
|
#include "ltdl.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
# define EXPORT extern "C"
|
|
|
|
#else
|
|
|
|
# define EXPORT extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
EXPORT int myfunc (void);
|
|
|
|
|
|
|
|
int
|
|
|
|
test_dl (char *filename, int test_ext)
|
|
|
|
{
|
|
|
|
lt_dlhandle handle;
|
|
|
|
const lt_dlinfo *info;
|
|
|
|
int (*pfoo1)() = 0;
|
|
|
|
int (*pfoo2)() = 0;
|
|
|
|
int (*phello)() = 0;
|
|
|
|
int *pnothing = 0;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
if (test_ext)
|
|
|
|
handle = lt_dlopenext (filename);
|
|
|
|
else
|
|
|
|
handle = lt_dlopen (filename);
|
|
|
|
|
|
|
|
if (!handle) {
|
|
|
|
fprintf (stderr, "can't open the module %s!\n", filename);
|
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
info = lt_dlgetinfo(handle);
|
|
|
|
if (!info) {
|
|
|
|
fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (info->name) {
|
|
|
|
printf ("module name: %s\n", info->name);
|
|
|
|
} else {
|
|
|
|
printf ("module is not a libtool module\n");
|
|
|
|
}
|
|
|
|
printf ("module filename: %s\n", info->filename);
|
|
|
|
printf ("module reference count: %i\n", info->ref_count);
|
|
|
|
|
|
|
|
phello = (int(*)())lt_dlsym(handle, "hello");
|
|
|
|
if (phello)
|
|
|
|
{
|
|
|
|
int value = (*phello) ();
|
|
|
|
|
|
|
|
printf ("hello returned: %i\n", value);
|
|
|
|
if (value == HELLO_RET)
|
|
|
|
printf("hello is ok!\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
fprintf (stderr, "did not find the 'hello' function\n");
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
pnothing = (int*)lt_dlsym(handle, "nothing");
|
|
|
|
/* Try assigning to the nothing variable. */
|
|
|
|
if (pnothing)
|
|
|
|
*pnothing = 1;
|
|
|
|
else
|
|
|
|
{
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
fprintf (stderr, "did not find the 'nothing' variable\n");
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
|
|
|
|
/* Just call the functions and check return values. */
|
|
|
|
if (pfoo1)
|
|
|
|
{
|
|
|
|
if ((*pfoo1) () == FOO_RET)
|
|
|
|
printf("foo1 is ok!\n");
|
|
|
|
else
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
|
|
|
|
if (pfoo2)
|
|
|
|
{
|
|
|
|
if ((*pfoo2) () == FOO_RET)
|
|
|
|
printf("foo2 is ok!\n");
|
|
|
|
else ret = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
fprintf (stderr, "did not find any of the 'foo' functions\n");
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lt_dlclose(handle);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
myfunc ()
|
|
|
|
{
|
|
|
|
return HELLO_RET;
|
|
|
|
}
|
|
|
|
|
|
|
|
int myvar;
|
|
|
|
|
|
|
|
int
|
|
|
|
test_dlself ()
|
|
|
|
{
|
|
|
|
lt_dlhandle handle;
|
|
|
|
int (*pmyfunc)() = 0;
|
|
|
|
int *pmyvar = 0;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
handle = lt_dlopen(0);
|
|
|
|
if (!handle) {
|
|
|
|
fprintf (stderr, "can't dlopen the program!\n");
|
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
pmyfunc = (int(*)())lt_dlsym(handle, "myfunc");
|
|
|
|
if (pmyfunc)
|
|
|
|
{
|
|
|
|
int value = (*pmyfunc) ();
|
|
|
|
|
|
|
|
printf ("myfunc returned: %i\n", value);
|
|
|
|
if (value == HELLO_RET)
|
|
|
|
printf("myfunc is ok!\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
fprintf (stderr, "did not find the 'myfunc' function\n");
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
pmyvar = (int*)lt_dlsym(handle, "myvar");
|
|
|
|
/* Try assigning to the variable. */
|
|
|
|
if (pmyvar)
|
|
|
|
*pmyvar = 1;
|
|
|
|
else
|
|
|
|
{
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
fprintf (stderr, "did not find the 'myvar' variable\n");
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
fprintf (stderr, "error was: %s\n", lt_dlerror());
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
lt_dlclose(handle);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
callback (const char *filename, void *data)
|
|
|
|
{
|
|
|
|
printf ("%s: %s\n", (char *)data, filename);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
try_iterate (const char *search_path)
|
|
|
|
{
|
|
|
|
char *s = "try_iterate";
|
|
|
|
return lt_dlforeachfile (search_path, callback, s);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* cheap dirname clone. We require a '/' separator, nonempty and large
|
|
|
|
enough input, not ending with '/', and we will overwrite the input. */
|
|
|
|
static char *
|
|
|
|
my_dirname (char *path)
|
|
|
|
{
|
|
|
|
char *p = strrchr (path, '/');
|
|
|
|
if (p)
|
|
|
|
*p = '\0';
|
|
|
|
else
|
|
|
|
{
|
|
|
|
path[0] = '.';
|
|
|
|
path[1] = '\0';
|
|
|
|
}
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int ret = 0;
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
printf ("Welcome to GNU libtool mdemo!\n");
|
|
|
|
|
|
|
|
if (argc < 2) {
|
|
|
|
fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
LTDL_SET_PRELOADED_SYMBOLS();
|
|
|
|
if (lt_dlinit() != 0) {
|
|
|
|
fprintf (stderr, "error during initialization: %s\n", lt_dlerror());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
{
|
|
|
|
if (test_dl(argv[i], 0))
|
|
|
|
ret = 1;
|
|
|
|
p = strrchr(argv[i], '.');
|
|
|
|
if (p)
|
|
|
|
{
|
|
|
|
*p = '\0';
|
|
|
|
if (test_dl(argv[i], 1))
|
|
|
|
ret = 1;
|
|
|
|
*p = '.';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (test_dlself())
|
|
|
|
ret = 1;
|
|
|
|
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
if (argv[i][0] != '\0')
|
|
|
|
{
|
|
|
|
my_dirname (argv[i]);
|
|
|
|
if (try_iterate (argv[i]))
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
lt_dlexit();
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
]])
|
|
|
|
|
2012-10-06 03:31:33 +08:00
|
|
|
LT_AT_HOST_DATA([expout],
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
[[Welcome to GNU Hell!
|
|
|
|
cos (0.0) = 1
|
|
|
|
** This is not GNU Hello. There is no built-in mail reader. **
|
|
|
|
]])
|
|
|
|
|
2014-10-30 21:13:21 +08:00
|
|
|
prefix=`pwd`/_inst
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
]) # _LT_SETUP
|
|
|
|
|
|
|
|
|
|
|
|
# _LT_CHECK_EXECUTE
|
|
|
|
# -----------------
|
|
|
|
# Run the listed make rules, and check that the built binaries work.
|
|
|
|
m4_define([_LT_CHECK_EXECUTE],
|
|
|
|
[LT_AT_MAKE
|
|
|
|
LT_AT_EXEC_CHECK([./mdemo_static], 0, [ignore], [],
|
tests: use $GREP throughout.
Trust the user, and use $GREP from TESTS_EVVIRONMENT uniformly.
* Makefile.am (TESTS_ENVIRONMENT): Add GREP setting.
* tests/am-subdir.at, tests/archive-in-archive.at, tests/bindir.at,
tests/configure-iface.at, tests/cwrapper.at, tests/darwin.at,
tests/demo.at, tests/destdir.at, tests/dumpbin-symbols.at,
tests/early-libtool.at, tests/execute-mode.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fcdemo.at, tests/flags.at,
tests/help.at, tests/inherited_flags.at, tests/install.at,
tests/lalib-syntax.at, tests/libtool.at, tests/libtoolize.at,
tests/localization.at, tests/lt_dladvise.at, tests/lt_dlopen.at,
tests/lt_dlopenext.at, tests/ltdl-api.at, tests/ltdl-libdir.at,
tests/mdemo.at, tests/old-m4-iface.at, tests/pic_flag.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/static.at, tests/sysroot.at, tests/template.at,
tests/testsuite.at, tests/versioning.at: Replace all hardcoded grep
invocations with $GREP.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2013-10-30 12:39:06 +08:00
|
|
|
[./foo1.la ./libfoo2.la | $GREP '^try_iterate: '])
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
LT_AT_EXEC_CHECK([./mdemo], 0, [ignore], [],
|
tests: use $GREP throughout.
Trust the user, and use $GREP from TESTS_EVVIRONMENT uniformly.
* Makefile.am (TESTS_ENVIRONMENT): Add GREP setting.
* tests/am-subdir.at, tests/archive-in-archive.at, tests/bindir.at,
tests/configure-iface.at, tests/cwrapper.at, tests/darwin.at,
tests/demo.at, tests/destdir.at, tests/dumpbin-symbols.at,
tests/early-libtool.at, tests/execute-mode.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fcdemo.at, tests/flags.at,
tests/help.at, tests/inherited_flags.at, tests/install.at,
tests/lalib-syntax.at, tests/libtool.at, tests/libtoolize.at,
tests/localization.at, tests/lt_dladvise.at, tests/lt_dlopen.at,
tests/lt_dlopenext.at, tests/ltdl-api.at, tests/ltdl-libdir.at,
tests/mdemo.at, tests/old-m4-iface.at, tests/pic_flag.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/static.at, tests/sysroot.at, tests/template.at,
tests/testsuite.at, tests/versioning.at: Replace all hardcoded grep
invocations with $GREP.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2013-10-30 12:39:06 +08:00
|
|
|
[./foo1.la ./libfoo2.la | $GREP '^try_iterate: '])
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
LT_AT_EXEC_CHECK([./mdemo_static], 0, [ignore], [],
|
tests: use $GREP throughout.
Trust the user, and use $GREP from TESTS_EVVIRONMENT uniformly.
* Makefile.am (TESTS_ENVIRONMENT): Add GREP setting.
* tests/am-subdir.at, tests/archive-in-archive.at, tests/bindir.at,
tests/configure-iface.at, tests/cwrapper.at, tests/darwin.at,
tests/demo.at, tests/destdir.at, tests/dumpbin-symbols.at,
tests/early-libtool.at, tests/execute-mode.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fcdemo.at, tests/flags.at,
tests/help.at, tests/inherited_flags.at, tests/install.at,
tests/lalib-syntax.at, tests/libtool.at, tests/libtoolize.at,
tests/localization.at, tests/lt_dladvise.at, tests/lt_dlopen.at,
tests/lt_dlopenext.at, tests/ltdl-api.at, tests/ltdl-libdir.at,
tests/mdemo.at, tests/old-m4-iface.at, tests/pic_flag.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/static.at, tests/sysroot.at, tests/template.at,
tests/testsuite.at, tests/versioning.at: Replace all hardcoded grep
invocations with $GREP.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2013-10-30 12:39:06 +08:00
|
|
|
[`pwd`/foo1.la `pwd`/libfoo2.la | $GREP '^try_iterate: '])
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
LT_AT_EXEC_CHECK([./mdemo], 0, [ignore], [],
|
tests: use $GREP throughout.
Trust the user, and use $GREP from TESTS_EVVIRONMENT uniformly.
* Makefile.am (TESTS_ENVIRONMENT): Add GREP setting.
* tests/am-subdir.at, tests/archive-in-archive.at, tests/bindir.at,
tests/configure-iface.at, tests/cwrapper.at, tests/darwin.at,
tests/demo.at, tests/destdir.at, tests/dumpbin-symbols.at,
tests/early-libtool.at, tests/execute-mode.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fcdemo.at, tests/flags.at,
tests/help.at, tests/inherited_flags.at, tests/install.at,
tests/lalib-syntax.at, tests/libtool.at, tests/libtoolize.at,
tests/localization.at, tests/lt_dladvise.at, tests/lt_dlopen.at,
tests/lt_dlopenext.at, tests/ltdl-api.at, tests/ltdl-libdir.at,
tests/mdemo.at, tests/old-m4-iface.at, tests/pic_flag.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/static.at, tests/sysroot.at, tests/template.at,
tests/testsuite.at, tests/versioning.at: Replace all hardcoded grep
invocations with $GREP.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2013-10-30 12:39:06 +08:00
|
|
|
[`pwd`/foo1.la `pwd`/libfoo2.la | $GREP '^try_iterate: '])
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
# _LT_CHECK_INSTALL
|
|
|
|
# -----------------
|
|
|
|
# Run the make install rule, and check that installed binaries work too.
|
|
|
|
m4_define([_LT_CHECK_INSTALL],
|
|
|
|
[LT_AT_MAKE([install])
|
|
|
|
|
|
|
|
# Windows hosts search for dlls in the command path.
|
2014-10-30 21:13:21 +08:00
|
|
|
PATH=$prefix/lib:$PATH
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
|
2014-10-30 21:13:21 +08:00
|
|
|
LT_AT_EXEC_CHECK([$prefix/bin/mdemo_static], 0, [ignore], [],
|
|
|
|
[$prefix/lib/foo1.la $prefix/lib/libfoo2.la | $GREP '^try_iterate: '])
|
|
|
|
LT_AT_EXEC_CHECK([$prefix/bin/mdemo], 0, [ignore], [],
|
|
|
|
[$prefix/lib/foo1.la $prefix/lib/libfoo2.la | $GREP '^try_iterate: '])
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
## ------------- ##
|
|
|
|
## Mdemo static. ##
|
|
|
|
## ------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([dynamically ltdl preload static modules])
|
|
|
|
|
|
|
|
_LT_SETUP
|
|
|
|
|
2012-10-06 13:53:33 +08:00
|
|
|
LT_AT_CHECK_CONFIG([--with-included-ltdl --disable-shared],
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
[^build_old_libs=yes], [^build_libtool_libs=no])
|
|
|
|
_LT_CHECK_EXECUTE
|
|
|
|
_LT_CHECK_INSTALL
|
|
|
|
LT_AT_CHECK_UNINSTALL
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ------------- ##
|
|
|
|
## Mdemo shared. ##
|
|
|
|
## ------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([dynamically ltdl load a shared module])
|
|
|
|
|
|
|
|
_LT_SETUP
|
|
|
|
|
2012-10-06 13:53:33 +08:00
|
|
|
LT_AT_CHECK_CONFIG([--with-included-ltdl --disable-static],
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
[^build_old_libs=no], [^build_libtool_libs=yes])
|
|
|
|
_LT_CHECK_EXECUTE
|
|
|
|
_LT_CHECK_INSTALL
|
|
|
|
LT_AT_CHECK_UNINSTALL
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ----------- ##
|
|
|
|
## Mdemo conf. ##
|
|
|
|
## ----------- ##
|
|
|
|
|
|
|
|
AT_SETUP([ltdl load shared and static modules])
|
|
|
|
|
|
|
|
_LT_SETUP
|
|
|
|
|
2012-10-06 13:53:33 +08:00
|
|
|
LT_AT_CHECK_CONFIG([--with-included-ltdl],
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
[^build_old_libs=yes], [^build_libtool_libs=yes])
|
|
|
|
_LT_CHECK_EXECUTE
|
|
|
|
_LT_CHECK_INSTALL
|
|
|
|
LT_AT_CHECK_UNINSTALL
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ------------- ##
|
|
|
|
## Mdemo dryrun. ##
|
|
|
|
## ------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([ltdl dryrun])
|
|
|
|
|
|
|
|
_LT_SETUP
|
|
|
|
|
2012-10-06 13:53:33 +08:00
|
|
|
LT_AT_CHECK_CONFIG([--with-included-ltdl])
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
LT_AT_MAKE([all-local libltdl/libltdlc.la])
|
|
|
|
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
# create 'before' and 'after' in a directory deep within objdir,
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
# so that their creation and removal does not modify even a timestamp
|
syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:41:07 +08:00
|
|
|
# in the output of 'ls -l . $objdir'
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
$lt_INSTALL -d "$objdir/temp/temp"
|
|
|
|
before=$objdir/temp/temp/before
|
|
|
|
after=$objdir/temp/temp/after
|
|
|
|
|
|
|
|
# Create a new libtool script that will enter dry run if the environment
|
|
|
|
# variable force_dry_run is set
|
tests: use $SED throughout.
Trust the user, and use $SED from TESTS_ENVIRONMENT uniformly.
Hardcoding 'sed' for "simple" edits is a premature optimisation.
* tests/cdemo.at, tests/cmdline_wrap.at, tests/cwrapper.at,
tests/darwin.at, tests/demo.at, tests/duplicate_conv.at,
tests/duplicate_members.at, tests/execute-mode.at, tests/export.at,
tests/inherited_flags.at, tests/install.at, tests/libtoolize.at,
tests/mdemo.at, tests/need_lib_prefix.at, tests/old-m4-iface.at,
tests/sysroot.at, tests/tagdemo.at, tests/testsuite.at: Replace all
hardcoded sed invocations with $SED.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2013-10-30 12:21:38 +08:00
|
|
|
$SED 's|^[[ ]]*opt_dry_run=.*$|opt_dry_run=$force_dry_run|' libtool > ltnew && mv ltnew libtool
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
export force_dry_run
|
|
|
|
|
|
|
|
# main.o is not compiled with libtool, but it depends on it, so make
|
|
|
|
# sure it is up-to-date. libfoo2.la is linked with libsub.la, so make
|
|
|
|
# sure it exists, otherwise libtool will complain.
|
|
|
|
force_dry_run=false
|
|
|
|
LT_AT_MAKE([main.$objext])
|
|
|
|
|
|
|
|
# Making object files
|
|
|
|
# ls -l in MSYS sometimes shows year, not time, for really fresh files.
|
|
|
|
sleep 1
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
|
|
|
|
force_dry_run=:
|
|
|
|
LT_AT_MAKE([foo1.lo foo2.lo libsub.la])
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
|
|
|
|
AT_CHECK([cmp "$before" "$after"], 0, [ignore])
|
|
|
|
|
|
|
|
# Now really make them
|
|
|
|
force_dry_run=false
|
|
|
|
LT_AT_MAKE([foo1.lo foo2.lo libsub.la])
|
|
|
|
|
|
|
|
# Making libraries
|
|
|
|
sleep 1 # for MSYS
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
|
|
|
|
force_dry_run=:
|
|
|
|
LT_AT_MAKE([foo1.la libfoo2.la])
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
|
|
|
|
AT_CHECK([cmp "$before" "$after"], 0, [ignore])
|
|
|
|
|
|
|
|
# Now really make them
|
|
|
|
force_dry_run=false
|
|
|
|
LT_AT_MAKE([foo1.la libfoo2.la])
|
|
|
|
|
|
|
|
# Making programs
|
|
|
|
sleep 1 # for MSYS
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
|
|
|
|
force_dry_run=:
|
|
|
|
LT_AT_MAKE([mdemo$EXEEXT mdemo_static$EXEEXT])
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
|
|
|
|
AT_CHECK([cmp "$before" "$after"], 0, [ignore])
|
|
|
|
|
|
|
|
# Running $MAKE install
|
|
|
|
# Libtool does not create these directories
|
2014-10-30 21:13:21 +08:00
|
|
|
$lt_INSTALL -d "$prefix/bin"
|
|
|
|
$lt_INSTALL -d "$prefix/include"
|
|
|
|
$lt_INSTALL -d "$prefix/lib"
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
|
|
|
|
sleep 1 # for MSYS
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
|
2014-10-30 21:13:21 +08:00
|
|
|
ls -lR "$prefix" | $EGREP -v '(^total|testsuite.log$)' >> "$before"
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
force_dry_run=:
|
|
|
|
LT_AT_MAKE([install])
|
|
|
|
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
|
2014-10-30 21:13:21 +08:00
|
|
|
ls -lR "$prefix" | $EGREP -v '(^total|testsuite.log$)' >> "$after"
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
AT_CHECK([cmp "$before" "$after"], 0, [ignore])
|
|
|
|
|
|
|
|
# Now really install
|
|
|
|
force_dry_run=false
|
|
|
|
LT_AT_MAKE([install])
|
|
|
|
|
|
|
|
# Running $MAKE uninstall
|
|
|
|
# Libtool does not uninstall the programs, remove them first
|
2014-10-30 21:13:21 +08:00
|
|
|
rm -f "$prefix/bin/mdemo$EXEEXT" "$prefix/bin/mdemo_static$EXEEXT"
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
|
|
|
|
sleep 1 # for MSYS
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$before"
|
2014-10-30 21:13:21 +08:00
|
|
|
ls -lR "$prefix" | $EGREP -v '(^total|testsuite.log$)' >> "$before"
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
force_dry_run=:
|
|
|
|
LT_AT_MAKE([uninstall])
|
|
|
|
ls -l . "$objdir" | $EGREP -v '(^total|testsuite.log$)' > "$after"
|
2014-10-30 21:13:21 +08:00
|
|
|
ls -lR "$prefix" | $EGREP -v '(^total|testsuite.log$)' >> "$after"
|
tests: migrate legacy tests/mdemo tests to Autotest.
* tests/mdemo.at: New autotest groups, based on...
* tests/mdemo-conf.test, tests/mdemo-dryrun.test,
tests/mdemo-exec.test, tests/mdemo-inst.test,
tests/mdemo-make.test, tests/mdemo-shared-exec.test,
tests/mdemo-shared-inst.test, tests/mdemo-shared-make.test,
tests/mdemo-shared-unst.test, tests/mdemo-shared.test,
tests/mdemo-static-exec.test, tests/mdemo-static-inst.test,
tests/mdemo-static-make.test, tests/mdemo-static-unst.test,
tests/mdemo-static.test, tests/mdemo-unst.test: ...these legacy
tests, now removed.
* tests/mdemo/Makefile.am, tests/mdemo/README,
tests/mdemo/configure.ac, tests/mdemo/foo.h, tests/mdemo/foo1.c,
tests/mdemo/foo2.c, tests/mdemo/main.c, tests/mdemo/mlib.c,
tests/mdemo/sub.c: Remove.
* configure.ac (CONF_SUBDIRS): Remove tests/mdemo.
* Makefile.am: Adjust.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 16:10:11 +08:00
|
|
|
AT_CHECK([cmp "$before" "$after"], 0, [ignore])
|
|
|
|
|
|
|
|
# Now really uninstall
|
|
|
|
force_dry_run=false
|
|
|
|
LT_AT_CHECK_UNINSTALL
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2011-11-24 16:49:07 +08:00
|
|
|
|
|
|
|
## ------- ##
|
|
|
|
## Mdemo2. ##
|
|
|
|
## ------- ##
|
|
|
|
|
|
|
|
AT_SETUP([link with library that loads ltdl modules])
|
|
|
|
|
|
|
|
_LT_SETUP
|
|
|
|
|
|
|
|
AT_DATA([mdemo.mk],
|
|
|
|
[[bin_PROGRAMS += mdemo2 mdemo2_static
|
|
|
|
|
|
|
|
# Create a version of mdemo2 that links a library that does dlopen.
|
|
|
|
mdemo2_LDFLAGS = -export-dynamic "-dlopen" force
|
|
|
|
mdemo2_LDADD = libmlib.la
|
|
|
|
|
|
|
|
# Create a statically linked version of mdemo.
|
|
|
|
mdemo2_static_SOURCES = mdemo2.c
|
|
|
|
mdemo2_static_LDFLAGS = $(STATIC) $(mdemo2_LDFLAGS)
|
|
|
|
mdemo2_static_LDADD = $(mdemo2_LDADD)
|
|
|
|
mdemo2_static_DEPENDENCIES = $(mdemo2_DEPENDENCIES)
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([mdemo2.c],
|
|
|
|
[[#include <stdio.h>
|
|
|
|
#include "ltdl.h"
|
|
|
|
|
|
|
|
extern int mlib_func (int, char **);
|
|
|
|
|
|
|
|
int main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
printf ("Welcome to GNU libtool mdemo2!\n");
|
|
|
|
if (argc < 2) {
|
|
|
|
fprintf (stderr, "usage: %s module [module...]\n", argv[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This must be called in the program to get the preloaded symbols */
|
|
|
|
LTDL_SET_PRELOADED_SYMBOLS();
|
|
|
|
|
|
|
|
ret = mlib_func(argc, argv);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
]])
|
|
|
|
|
2012-10-08 19:10:02 +08:00
|
|
|
# Normalize line endings after $EGREP instead of using LT_AT_HOST_DATA
|
|
|
|
# here, since $EGREP *may* normalize line endings for us.
|
2012-10-07 06:57:26 +08:00
|
|
|
AT_DATA([expout],
|
2011-11-24 16:49:07 +08:00
|
|
|
[[Welcome to GNU libtool mdemo2!
|
|
|
|
module name: foo1
|
|
|
|
module reference count: 1
|
|
|
|
** This is foolib 1 **
|
|
|
|
hello returned: 57616
|
|
|
|
hello is ok!
|
|
|
|
cos (0.0) = 1
|
|
|
|
sub() called
|
|
|
|
foo1 is ok!
|
|
|
|
module name: libfoo2
|
|
|
|
module reference count: 1
|
|
|
|
** This is foolib 2 **
|
|
|
|
hello returned: 57616
|
|
|
|
hello is ok!
|
|
|
|
sin (0.0) = 0
|
|
|
|
sub() called
|
|
|
|
foo2 is ok!
|
|
|
|
]])
|
|
|
|
|
2012-10-06 13:53:33 +08:00
|
|
|
LT_AT_CHECK_CONFIG([--with-included-ltdl])
|
2011-11-24 16:49:07 +08:00
|
|
|
|
|
|
|
LT_AT_MAKE
|
|
|
|
|
2012-10-08 19:10:02 +08:00
|
|
|
LT_AT_EXEC_CHECK([./mdemo2_static], 0, [stdout], [],
|
2011-11-24 16:49:07 +08:00
|
|
|
[./foo1.la ./libfoo2.la | $EGREP -v '^module filename: '])
|
2012-10-08 19:10:02 +08:00
|
|
|
LT_AT_UNIFY_NL([stdout])
|
|
|
|
LT_AT_CHECK([diff expout stdout])
|
|
|
|
|
|
|
|
LT_AT_EXEC_CHECK([./mdemo2], 0, [stdout], [],
|
2011-11-24 16:49:07 +08:00
|
|
|
[./foo1.la ./libfoo2.la | $EGREP -v '^module filename: '])
|
2012-10-08 19:10:02 +08:00
|
|
|
LT_AT_UNIFY_NL([stdout])
|
|
|
|
LT_AT_CHECK([diff expout stdout])
|
2011-11-24 16:49:07 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|