chiark / gitweb /
Use dpkg-buildflags to enable hardening flags (Closes: #1119360)
authorMatthew Vernon <matthew@debian.org>
Fri, 7 Nov 2025 11:21:58 +0000 (11:21 +0000)
committerMatthew Vernon <matthew@debian.org>
Fri, 7 Nov 2025 11:21:58 +0000 (11:21 +0000)
Makefile
debian/rules

index 6365c543891416486768d07beeb10d0d46e89bdb..4073aa9f1af8639ec5cd55b9801227626b613fd7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -89,7 +89,8 @@ DESTMAN1      = $(DESTMAN)/man1
 # I use environment variables for these...
 #CFLAGS              = -g
 CFLAGS       = -Wall -Wformat -Werror -Wshadow -W -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wbad-function-cast -Wpointer-arith -g2 -ggdb -DDESTLIB=\"$(DESTLIB)\" -ffile-prefix-map=$(CURDIR)=.
-LDFLAGS       = 
+CFLAGS += `dpkg-buildflags --get CFLAGS`
+LDFLAGS       = `dpkg-buildflags --get LDFLAGS`
 LDADD         = -lreadline
 
 # release directories.  Nobody should care about this but me
index 6a1fd52f3a37de3c9e3702403fe9be31ac01ffd6..a73b302e0e35202f5002b94647ee892ee189e020 100755 (executable)
@@ -23,7 +23,7 @@ build:
        dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_build --no-parallel -- bible-index.c bible.data bible.data.conc 'LD=$$(CC)'
        rm -f *.o
        dh_auto_build --no-parallel -- bible 'LD=$$(CC)'
-       cd debian && $(CC) -g -O2 -ffile-prefix-map=$(CURDIR)=. -o randverse randverse.c
+       cd debian && $(CC) `dpkg-buildflags --get CFLAGS` -g -O2 -ffile-prefix-map=$(CURDIR)=. -o randverse randverse.c
        touch build
 
 build-arch: build