[dpkg] 18/28: scripts/mk: Add new buildtools variables

Mattia Rizzolo mattia at debian.org
Mon Jan 22 17:11:24 UTC 2018


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository dpkg.

commit 797ed78bd87c77b6fa9c3867d0fefa90bb21014c
Author: Guillem Jover <guillem at debian.org>
Date:   Tue Dec 5 01:56:15 2017 +0100

    scripts/mk: Add new buildtools variables
    
    This adds support for AS, STRIP, OBJCOPY, OBJDUMP, NM, AR and RANLIB.
    
    Prompted-by: Helmut Grohne <helmut at subdivi.de>
---
 debian/changelog           |  2 ++
 scripts/mk/buildtools.mk   | 14 ++++++++++++++
 scripts/t/mk.t             |  7 +++++++
 scripts/t/mk/buildtools.mk | 14 ++++++++++++++
 4 files changed, 37 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 820135a..9b6533f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium
   * Fix directory traversal with dpkg-deb --raw-extract, by guaranteeing
     that the DEBIAN pathname does not exist. Closes: #879982
     Reported by Jakub Wilk <jwilk at jwilk.net>.
+  * Add new AS, STRIP, OBJCOPY, OBJDUMP, NM, AR and RANLIB buildtools
+    variables to buildtools.mk. Prompted by Helmut Grohne <helmut at subdivi.de>.
   * Perl modules:
     - Check that $tarname is defined before use in Dpkg::Source::Package::V1.
       Thanks to Christoph Biedl <debian.axhn at manchmal.in-ulm.de>.
diff --git a/scripts/mk/buildtools.mk b/scripts/mk/buildtools.mk
index d5638f5..c3b44bb 100644
--- a/scripts/mk/buildtools.mk
+++ b/scripts/mk/buildtools.mk
@@ -1,5 +1,6 @@
 # This Makefile snippet defines the following variables for host tools:
 #
+# AS: assembler
 # CPP: C preprocessor
 # CC: C compiler
 # CXX: C++ compiler
@@ -9,6 +10,12 @@
 # F77: Fortran 77 compiler
 # FC: Fortran 9x compiler
 # LD: linker
+# STRIP: strip objects
+# OBJCOPY: copy objects
+# OBJDUMP: dump objects
+# NM: names lister
+# AR: archiver
+# RANLIB: archive index generator
 # PKG_CONFIG: pkg-config tool
 #
 # All the above variables have a counterpart variable for the build tool,
@@ -44,6 +51,7 @@ export $(1)_FOR_BUILD
 endif
 endef
 
+$(eval $(call dpkg_buildtool_setvar,AS,as))
 $(eval $(call dpkg_buildtool_setvar,CPP,gcc -E))
 $(eval $(call dpkg_buildtool_setvar,CC,gcc))
 $(eval $(call dpkg_buildtool_setvar,CXX,g++))
@@ -53,4 +61,10 @@ $(eval $(call dpkg_buildtool_setvar,GCJ,gcj))
 $(eval $(call dpkg_buildtool_setvar,F77,f77))
 $(eval $(call dpkg_buildtool_setvar,FC,f77))
 $(eval $(call dpkg_buildtool_setvar,LD,ld))
+$(eval $(call dpkg_buildtool_setvar,STRIP,strip))
+$(eval $(call dpkg_buildtool_setvar,OBJCOPY,objcopy))
+$(eval $(call dpkg_buildtool_setvar,OBJDUMP,objdump))
+$(eval $(call dpkg_buildtool_setvar,NM,nm))
+$(eval $(call dpkg_buildtool_setvar,AR,ar))
+$(eval $(call dpkg_buildtool_setvar,RANLIB,ranlib))
 $(eval $(call dpkg_buildtool_setvar,PKG_CONFIG,pkg-config))
diff --git a/scripts/t/mk.t b/scripts/t/mk.t
index 7eaf40c..0062e99 100644
--- a/scripts/t/mk.t
+++ b/scripts/t/mk.t
@@ -82,6 +82,7 @@ $ENV{"TEST_$_"} = $buildflag{$_} foreach keys %buildflag;
 test_makefile('buildflags.mk');
 
 my %buildtools = (
+    AS => 'as',
     CPP => 'gcc -E',
     CC => 'gcc',
     CXX => 'g++',
@@ -91,6 +92,12 @@ my %buildtools = (
     F77 => 'f77',
     FC => 'f77',
     LD => 'ld',
+    STRIP => 'strip',
+    OBJCOPY => 'objcopy',
+    OBJDUMP => 'objdump',
+    NM => 'nm',
+    AR => 'ar',
+    RANLIB => 'ranlib',
     PKG_CONFIG => 'pkg-config',
 );
 
diff --git a/scripts/t/mk/buildtools.mk b/scripts/t/mk/buildtools.mk
index 8bba964..0077791 100644
--- a/scripts/t/mk/buildtools.mk
+++ b/scripts/t/mk/buildtools.mk
@@ -1,6 +1,8 @@
 include $(srcdir)/mk/buildtools.mk
 
 test:
+	test "$(AS)" = "$(TEST_AS)"
+	test "$(AS_FOR_BUILD)" = "$(TEST_AS_FOR_BUILD)"
 	test "$(CC)" = "$(TEST_CC)"
 	test "$(CC_FOR_BUILD)" = "$(TEST_CC_FOR_BUILD)"
 	test "$(CXX)" = "$(TEST_CXX)"
@@ -17,5 +19,17 @@ test:
 	test "$(FC_FOR_BUILD)" = "$(TEST_FC_FOR_BUILD)"
 	test "$(LD)" = "$(TEST_LD)"
 	test "$(LD_FOR_BUILD)" = "$(TEST_LD_FOR_BUILD)"
+	test "$(STRIP)" = "$(TEST_STRIP)"
+	test "$(STRIP_FOR_BUILD)" = "$(TEST_STRIP_FOR_BUILD)"
+	test "$(OBJCOPY)" = "$(TEST_OBJCOPY)"
+	test "$(OBJCOPY_FOR_BUILD)" = "$(TEST_OBJCOPY_FOR_BUILD)"
+	test "$(OBJDUMP)" = "$(TEST_OBJDUMP)"
+	test "$(OBJDUMP_FOR_BUILD)" = "$(TEST_OBJDUMP_FOR_BUILD)"
+	test "$(NM)" = "$(TEST_NM)"
+	test "$(NM_FOR_BUILD)" = "$(TEST_NM_FOR_BUILD)"
+	test "$(AR)" = "$(TEST_AR)"
+	test "$(AR_FOR_BUILD)" = "$(TEST_AR_FOR_BUILD)"
+	test "$(RANLIB)" = "$(TEST_RANLIB)"
+	test "$(RANLIB_FOR_BUILD)" = "$(TEST_RANLIB_FOR_BUILD)"
 	test "$(PKG_CONFIG)" = "$(TEST_PKG_CONFIG)"
 	test "$(PKG_CONFIG_FOR_BUILD)" = "$(TEST_PKG_CONFIG_FOR_BUILD)"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list