mirror of
https://github.com/mirror/make.git
synced 2025-01-27 21:00:22 +08:00
[SV 40240] Use configure info to build load test shared libs
* tests/config-flags.pm.in: A new file containing variable assignments for the test suite; these variables are set by configure to contain the values detected there for compilers, flags, etc. * tests/run_make_tests.pl: Require the config-flags.pm file * tests/scripts/features/load, tests/scripts/features/loadapi: Use the configure-provided values when building the shared test library. * configure.ac: Replace tests/config-flags.pm.in * Makefile.am: Make sure tests/config-flags.pm is up to date
This commit is contained in:
parent
07f2666b91
commit
107ab16bf6
@ -172,7 +172,7 @@ loadavg_LDADD = @GETLOADAVG_LIBS@
|
|||||||
#
|
#
|
||||||
MAKETESTFLAGS =
|
MAKETESTFLAGS =
|
||||||
|
|
||||||
check-regression:
|
check-regression: tests/config-flags.pm
|
||||||
@if test -f '$(srcdir)/tests/run_make_tests'; then \
|
@if test -f '$(srcdir)/tests/run_make_tests'; then \
|
||||||
if $(PERL) -v >/dev/null 2>&1; then \
|
if $(PERL) -v >/dev/null 2>&1; then \
|
||||||
case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
|
case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
|
||||||
|
@ -499,7 +499,7 @@ AS_IF([test "x$make_cv_load" = xno && test "x$user_load" = xyes],
|
|||||||
|
|
||||||
# Specify what files are to be created.
|
# Specify what files are to be created.
|
||||||
AC_CONFIG_FILES([Makefile glob/Makefile po/Makefile.in config/Makefile \
|
AC_CONFIG_FILES([Makefile glob/Makefile po/Makefile.in config/Makefile \
|
||||||
doc/Makefile w32/Makefile])
|
doc/Makefile w32/Makefile tests/config-flags.pm])
|
||||||
|
|
||||||
# OK, do it!
|
# OK, do it!
|
||||||
|
|
||||||
|
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
|
config-flags.pm
|
||||||
work
|
work
|
||||||
|
18
tests/config-flags.pm.in
Normal file
18
tests/config-flags.pm.in
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# This is a -*-perl-*- script
|
||||||
|
#
|
||||||
|
# Set variables that were defined by configure, in case we need them
|
||||||
|
# during the tests.
|
||||||
|
|
||||||
|
%CONFIG_FLAGS = (
|
||||||
|
AM_LDFLAGS => '@AM_LDFLAGS@',
|
||||||
|
CC => '@CC@',
|
||||||
|
CFLAGS => '@CFLAGS@',
|
||||||
|
CPP => '@CPP@',
|
||||||
|
CPPFLAGS => '@CPPFLAGS@',
|
||||||
|
GUILE_CFLAGS => '@GUILE_CFLAGS@',
|
||||||
|
GUILE_LIBS => '@GUILE_LIBS@',
|
||||||
|
LDFLAGS => '@LDFLAGS@',
|
||||||
|
LIBS => '@LIBS@'
|
||||||
|
);
|
||||||
|
|
||||||
|
1;
|
@ -43,6 +43,7 @@ $command_string = '';
|
|||||||
$all_tests = 0;
|
$all_tests = 0;
|
||||||
|
|
||||||
require "test_driver.pl";
|
require "test_driver.pl";
|
||||||
|
require "config-flags.pm";
|
||||||
|
|
||||||
# Some target systems might not have the POSIX module...
|
# Some target systems might not have the POSIX module...
|
||||||
$has_POSIX = eval { require "POSIX.pm" };
|
$has_POSIX = eval { require "POSIX.pm" };
|
||||||
|
@ -6,8 +6,6 @@ $details = "Test dynamic loading of modules.";
|
|||||||
# Don't do anything if this system doesn't support "load"
|
# Don't do anything if this system doesn't support "load"
|
||||||
exists $FEATURES{load} or return -1;
|
exists $FEATURES{load} or return -1;
|
||||||
|
|
||||||
my $sobuild = '$(CC) '.($srcdir? "-I$srcdir":'').' -g -shared -fPIC -o $@ $<';
|
|
||||||
|
|
||||||
# First build a shared object
|
# First build a shared object
|
||||||
# Provide both a default and non-default load symbol
|
# Provide both a default and non-default load symbol
|
||||||
|
|
||||||
@ -39,7 +37,15 @@ EOF
|
|||||||
close($F) or die "close: testload.c: $!\n";
|
close($F) or die "close: testload.c: $!\n";
|
||||||
|
|
||||||
# Make sure we can compile
|
# Make sure we can compile
|
||||||
run_make_test('testload.so: testload.c ; @'.$sobuild, '', '');
|
# CONFIG_FLAGS are loaded from config-flags.pm and set by configure
|
||||||
|
|
||||||
|
my $sobuild = "$CONFIG_FLAGS{CC} ".($srcdir? "-I$srcdir":'')." $CONFIG_FLAGS{CPPFLAGS} $CONFIG_FLAGS{CFLAGS} -shared -fPIC $CONFIG_FLAGS{LDFLAGS} -o testload.so testload.c";
|
||||||
|
|
||||||
|
my $clog = `$sobuild 2>&1`;
|
||||||
|
if ($? != 0) {
|
||||||
|
$verbose and print "Failed to build testload.so:\n$sobuild\n$_";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
# TEST 1
|
# TEST 1
|
||||||
run_make_test(q!
|
run_make_test(q!
|
||||||
|
@ -6,8 +6,6 @@ $details = "Verify the different aspects of the shared object API.";
|
|||||||
# Don't do anything if this system doesn't support "load"
|
# Don't do anything if this system doesn't support "load"
|
||||||
exists $FEATURES{load} or return -1;
|
exists $FEATURES{load} or return -1;
|
||||||
|
|
||||||
my $sobuild = '$(CC) '.($srcdir? "-I$srcdir":'').' -g -shared -fPIC -o $@ $<';
|
|
||||||
|
|
||||||
# First build a shared object
|
# First build a shared object
|
||||||
# Provide both a default and non-default load symbol
|
# Provide both a default and non-default load symbol
|
||||||
|
|
||||||
@ -74,7 +72,13 @@ testapi_gmk_setup ()
|
|||||||
EOF
|
EOF
|
||||||
close($F) or die "close: testapi.c: $!\n";
|
close($F) or die "close: testapi.c: $!\n";
|
||||||
|
|
||||||
run_make_test('testapi.so: testapi.c ; @'.$sobuild, '', '');
|
my $sobuild = "$CONFIG_FLAGS{CC} ".($srcdir? "-I$srcdir":'')." $CONFIG_FLAGS{CPPFLAGS} $CONFIG_FLAGS{CFLAGS} -shared -fPIC $CONFIG_FLAGS{LDFLAGS} -o testapi.so testapi.c";
|
||||||
|
|
||||||
|
my $clog = `$sobuild 2>&1`;
|
||||||
|
if ($? != 0) {
|
||||||
|
$verbose and print "Failed to build testapi.so:\n$sobuild\n$_";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
# TEST 1
|
# TEST 1
|
||||||
# Check the gmk_expand() function
|
# Check the gmk_expand() function
|
||||||
|
Loading…
Reference in New Issue
Block a user