From 621e9edfe9ac4ad20ce297787fa308b032b3fa8e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 7 Sep 2014 20:12:12 -0400 Subject: * tests/config-flags.pm.in, tests/scripts/features/archives: [SV 43046] Use the "ar" program detected by configure when running the test suite. --- tests/config-flags.pm.in | 1 + tests/scripts/features/archives | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/config-flags.pm.in b/tests/config-flags.pm.in index a26b8dc..29ba146 100644 --- a/tests/config-flags.pm.in +++ b/tests/config-flags.pm.in @@ -5,6 +5,7 @@ %CONFIG_FLAGS = ( AM_LDFLAGS => '@AM_LDFLAGS@', + AR => '@AR@', CC => '@CC@', CFLAGS => '@CFLAGS@', CPP => '@CPP@', diff --git a/tests/scripts/features/archives b/tests/scripts/features/archives index a7ec881..b0acfec 100644 --- a/tests/scripts/features/archives +++ b/tests/scripts/features/archives @@ -11,32 +11,34 @@ exists $FEATURES{archives} or return -1; # Create some .o files to work with utouch(-60, qw(a1.o a2.o a3.o)); +my $ar = $CONFIG_FLAGS{AR}; + # Some versions of ar print different things on creation. Find out. -my $created = `ar rv libxx.a a1.o 2>&1`; +my $created = `$ar rv libxx.a a1.o 2>&1`; # Some versions of ar print different things on add. Find out. -my $add = `ar rv libxx.a a2.o 2>&1`; +my $add = `$ar rv libxx.a a2.o 2>&1`; $add =~ s/a2\.o/#OBJECT#/g; # Some versions of ar print different things on replacement. Find out. -my $repl = `ar rv libxx.a a2.o 2>&1`; +my $repl = `$ar rv libxx.a a2.o 2>&1`; $repl =~ s/a2\.o/#OBJECT#/g; unlink('libxx.a'); # Very simple run_make_test('all: libxx.a(a1.o)', - '', "ar rv libxx.a a1.o\n$created"); + '', "$ar rv libxx.a a1.o\n$created"); # Multiple .o's. Add a new one to the existing library ($_ = $add) =~ s/#OBJECT#/a2.o/g; run_make_test('all: libxx.a(a1.o a2.o)', - '', "ar rv libxx.a a2.o\n$_"); + '', "$ar rv libxx.a a2.o\n$_"); # Touch one of the .o's so it's rebuilt utouch(-40, 'a1.o'); ($_ = $repl) =~ s/#OBJECT#/a1.o/g; -run_make_test(undef, '', "ar rv libxx.a a1.o\n$_"); +run_make_test(undef, '', "$ar rv libxx.a a1.o\n$_"); # Use wildcards run_make_test('all: libxx.a(*.o)', @@ -45,21 +47,21 @@ run_make_test('all: libxx.a(*.o)', # Touch one of the .o's so it's rebuilt utouch(-30, 'a1.o'); ($_ = $repl) =~ s/#OBJECT#/a1.o/g; -run_make_test(undef, '', "ar rv libxx.a a1.o\n$_"); +run_make_test(undef, '', "$ar rv libxx.a a1.o\n$_"); # Use both wildcards and simple names utouch(-50, 'a2.o'); ($_ = $add) =~ s/#OBJECT#/a3.o/g; -$_ .= "ar rv libxx.a a2.o\n"; +$_ .= "$ar rv libxx.a a2.o\n"; ($_ .= $repl) =~ s/#OBJECT#/a2.o/g; run_make_test('all: libxx.a(a3.o *.o)', '', - "ar rv libxx.a a3.o\n$_"); + "$ar rv libxx.a a3.o\n$_"); # Check whitespace handling utouch(-40, 'a2.o'); ($_ = $repl) =~ s/#OBJECT#/a2.o/g; run_make_test('all: libxx.a( a3.o *.o )', '', - "ar rv libxx.a a2.o\n$_"); + "$ar rv libxx.a a2.o\n$_"); rmfiles(qw(a1.o a2.o a3.o libxx.a)); -- cgit v1.2.3