Commit 701b7dc1 authored by Kan-Ru Chen's avatar Kan-Ru Chen

debian/rules: use Debian flavor build options

Closes: #877067
parent f9a9459f
From: Kan-Ru Chen <kanru@kanru.info>
Date: Mon, 30 Apr 2018 09:40:47 +0900
Subject: use debian flavor build options
Do not strip binaries by default and use Debian LDFLAGS
---
Makerules | 3 +++
thirdparty/mujs/Makefile | 2 ++
2 files changed, 5 insertions(+)
diff --git a/Makerules b/Makerules
index 57065f3..9f06b98 100644
--- a/Makerules
+++ b/Makerules
@@ -27,6 +27,9 @@ SANITIZE_FLAGS += -fsanitize=leak
ifeq "$(build)" "debug"
CFLAGS += -pipe -g
LDFLAGS += -g
+else ifeq "$(build)" "debian"
+CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
+LDFLAGS += $(LDREMOVEUNREACH)
else ifeq "$(build)" "release"
CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
diff --git a/thirdparty/mujs/Makefile b/thirdparty/mujs/Makefile
index 2193c96..85842b0 100644
--- a/thirdparty/mujs/Makefile
+++ b/thirdparty/mujs/Makefile
@@ -31,6 +31,8 @@ CFLAGS += -g
else ifeq "$(build)" "sanitize"
CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address
+else ifeq "$(build)" "debian"
+LDFLAGS += $(XLDFLAGS)
else
CFLAGS += -Os
LDFLAGS += -Wl,-s
0001-mupdf_manpage.patch
0003-Sort-files-in-static-library-to-make-the-build-repro.patch
0003-use-debian-flavor-build-options.patch
......@@ -10,7 +10,6 @@
# This has to be exported to make some magic below work.
export DH_OPTIONS
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk
# The build system doesn't use CPPFLAGS, pass them to CFLAGS to enable the
......@@ -24,7 +23,7 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
BUILD_FLAGS=build=release OS=Linux verbose=yes XCFLAGS="$(CFLAGS)"
BUILD_FLAGS=build=debian OS=Linux verbose=yes XCFLAGS="$(CFLAGS)" XLDFLAGS="$(LDFLAGS)"
override_dh_auto_build:
$(MAKE) $(BUILD_FLAGS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment