summaryrefslogtreecommitdiff
path: root/scripts/t
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-03-02 23:56:08 +0100
committerGuillem Jover <guillem@debian.org>2017-10-16 11:03:38 +0200
commit4618ae2495a843b40ea5223fa7a4910543194297 (patch)
tree6ce3370f9b12112a986f5596f1cb8e8d681739f7 /scripts/t
parentd917dd74cfb8c78f7a99a7e02d4098866f3f763d (diff)
downloaddpkg-4618ae2495a843b40ea5223fa7a4910543194297.tar.gz
scripts/mk: Add new buildtools.mk support
This make fragment contains setup for build tool variables for both TOOL and TOOL_FOR_BUILD. It does not get included by default from default.mk
Diffstat (limited to 'scripts/t')
-rw-r--r--scripts/t/mk.t28
-rw-r--r--scripts/t/mk/buildtools.mk21
2 files changed, 48 insertions, 1 deletions
diff --git a/scripts/t/mk.t b/scripts/t/mk.t
index 95ccedf82..e711270c7 100644
--- a/scripts/t/mk.t
+++ b/scripts/t/mk.t
@@ -16,7 +16,7 @@
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 6;
use File::Spec::Functions qw(rel2abs);
use Dpkg ();
@@ -79,6 +79,32 @@ delete $ENV{$_} foreach keys %buildflag;
$ENV{"TEST_$_"} = $buildflag{$_} foreach keys %buildflag;
test_makefile('buildflags.mk');
+my %buildtools = (
+ CPP => 'gcc -E',
+ CC => 'gcc',
+ CXX => 'g++',
+ OBJC => 'gcc',
+ OBJCXX => 'g++',
+ GCJ => 'gcj',
+ F77 => 'f77',
+ FC => 'f77',
+ LD => 'ld',
+ PKG_CONFIG => 'pkg-config',
+);
+
+foreach my $tool (keys %buildtools) {
+ delete $ENV{$tool};
+ $ENV{"TEST_$tool"} = "$ENV{DEB_HOST_GNU_TYPE}-$buildtools{$tool}";
+ delete $ENV{"${tool}_FOR_BUILD"};
+ $ENV{"TEST_${tool}_FOR_BUILD"} = "$ENV{DEB_BUILD_GNU_TYPE}-$buildtools{$tool}";
+}
+test_makefile('buildtools.mk');
+
+foreach my $tool (keys %buildtools) {
+ delete $ENV{${tool}};
+ delete $ENV{"${tool}_FOR_BUILD"};
+}
+
test_makefile('pkg-info.mk');
test_makefile('vendor.mk');
diff --git a/scripts/t/mk/buildtools.mk b/scripts/t/mk/buildtools.mk
new file mode 100644
index 000000000..8bba96430
--- /dev/null
+++ b/scripts/t/mk/buildtools.mk
@@ -0,0 +1,21 @@
+include $(srcdir)/mk/buildtools.mk
+
+test:
+ test "$(CC)" = "$(TEST_CC)"
+ test "$(CC_FOR_BUILD)" = "$(TEST_CC_FOR_BUILD)"
+ test "$(CXX)" = "$(TEST_CXX)"
+ test "$(CXX_FOR_BUILD)" = "$(TEST_CXX_FOR_BUILD)"
+ test "$(OBJC)" = "$(TEST_OBJC)"
+ test "$(OBJC_FOR_BUILD)" = "$(TEST_OBJC_FOR_BUILD)"
+ test "$(OBJCXX)" = "$(TEST_OBJCXX)"
+ test "$(OBJCXX_FOR_BUILD)" = "$(TEST_OBJCXX_FOR_BUILD)"
+ test "$(GCJ)" = "$(TEST_GCJ)"
+ test "$(GCJ_FOR_BUILD)" = "$(TEST_GCJ_FOR_BUILD)"
+ test "$(F77)" = "$(TEST_F77)"
+ test "$(F77_FOR_BUILD)" = "$(TEST_F77_FOR_BUILD)"
+ test "$(FC)" = "$(TEST_FC)"
+ test "$(FC_FOR_BUILD)" = "$(TEST_FC_FOR_BUILD)"
+ test "$(LD)" = "$(TEST_LD)"
+ test "$(LD_FOR_BUILD)" = "$(TEST_LD_FOR_BUILD)"
+ test "$(PKG_CONFIG)" = "$(TEST_PKG_CONFIG)"
+ test "$(PKG_CONFIG_FOR_BUILD)" = "$(TEST_PKG_CONFIG_FOR_BUILD)"