[Pkg-mongodb-maintainers] [pkg-mongodb] 352/394: Pass CPPFLAGS and LDFLAGS to the compiler
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Wed Sep 21 14:00:25 UTC 2016
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository pkg-mongodb.
commit 6dd052a7207bb4ad0a0050f11087685fb49c95be
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date: Fri Jan 15 17:11:15 2016 +0200
Pass CPPFLAGS and LDFLAGS to the compiler
Add a patch to initialize SCons' build flags from the respective
environment variables. The previous approach of specifying them through
the command line did not work, as SConstruct completely ignores the
ARGUMENTS dictionary.
Rely on debhelper's compatibility level 9 to pass the build flags
through to the environment.
Also remove the --directory="." argument from scons calls.
---
debian/patches/hardened-build.patch | 18 ++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 10 +++-------
3 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/debian/patches/hardened-build.patch b/debian/patches/hardened-build.patch
new file mode 100644
index 0000000..e3c5b68
--- /dev/null
+++ b/debian/patches/hardened-build.patch
@@ -0,0 +1,18 @@
+Index: mongodb-2.6.11/SConstruct
+===================================================================
+--- mongodb-2.6.11.orig/SConstruct 2016-01-15 17:29:08.000000000 +0200
++++ mongodb-2.6.11/SConstruct 2016-01-15 17:37:54.000000000 +0200
+@@ -474,7 +474,12 @@
+
+ PCRE_VERSION='8.37',
+ CONFIGUREDIR = '#' + scons_data_dir + '/sconf_temp',
+- CONFIGURELOG = '#' + scons_data_dir + '/config.log'
++ CONFIGURELOG = '#' + scons_data_dir + '/config.log',
++
++ CFLAGS=os.environ.get("CFLAGS", "-O3").split(),
++ CXXFLAGS=os.environ.get("CXXFLAGS", "-O3").split(),
++ CPPFLAGS=os.environ.get("CPPFLAGS", "").split(),
++ LINKFLAGS=os.environ.get("LDFLAGS", "").split(),
+ )
+
+ if has_option("cache"):
diff --git a/debian/patches/series b/debian/patches/series
index e74a972..220a5d9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ disable-warnings.patch
0014-Fix-GCC-5-FTBFS.patch
fix-yaml-detection.patch
add-option-to-disable-javascript.patch
+hardened-build.patch
diff --git a/debian/rules b/debian/rules
index 324ea45..ca75319 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,8 +16,6 @@ ifneq (,$(findstring parallel,$(DEB_BUILD_OPTIONS)))
DEB_SCONS_OPTIONS += -j$(PROCS)
endif
-HARDENING_OPTIONS = CC="$(CC)" CFLAGS="$(CFLAGS)" \
- CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)"
COMMON_OPTIONS = --use-system-snappy --use-system-pcre \
--use-system-boost --use-system-v8 --use-system-yaml --ssl \
$(DEB_SCONS_OPTIONS)
@@ -34,13 +32,11 @@ ifneq (,$(filter $(DEB_HOST_ARCH), $(no_v8_archs)))
COMMON_OPTIONS += --disable-scripting
endif
-DEB_SCONS_CLEAN = --directory="." $(HARDENING_OPTIONS) . --keep-going --clean \
- $(COMMON_OPTIONS)
-DEB_SCONS_BUILD = --directory="." $(HARDENING_OPTIONS) all $(COMMON_OPTIONS)
+DEB_SCONS_CLEAN = . --keep-going --clean $(COMMON_OPTIONS)
+DEB_SCONS_BUILD = all $(COMMON_OPTIONS)
DEB_SCONS_CHECK = --smokedbprefix=$(CURDIR)/debian/tmp-test smoke \
$(COMMON_OPTIONS)
-DEB_SCONS_INSTALL = --directory="." $(HARDENING_OPTIONS) \
- --prefix=$(CURDIR)/debian/tmp/usr install $(COMMON_OPTIONS)
+DEB_SCONS_INSTALL = --prefix=$(CURDIR)/debian/tmp/usr install $(COMMON_OPTIONS)
override_dh_clean:
scons $(DEB_SCONS_CLEAN)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mongodb/pkg-mongodb.git
More information about the Pkg-mongodb-maintainers
mailing list