Author: Andreas Tille <tille@debian.org>
Reviewed-By: Étienne Mollier <emollier@debian.org>
Last-Update: 2025-01-05
Forwarded: not-needed
Description: Propagate hardening options
 Later edited to add support for CPPFLAGS.  This change modifies the
 build infrastructure for needs that are somewhat Debian specific, hence
 forwarding not needed.

--- a/src/make-include.mk
+++ b/src/make-include.mk
@@ -48,7 +48,7 @@ ifneq ($(TARGETOS), Windows)
 # CFLAGS = -g -fno-inline -Wall -DPHAST_DEBUG -DNDEBUG -mtune=native -fno-strict-aliasing -fPIC -O2 -pedantic -Wconversion -Wno-sign-conversion
 #  CFLAGS = -g -fno-inline -Wall -DPHAST_DEBUG
  # for best performance
- CFLAGS = -O3 -Wall
+ CFLAGS += $(CPPFLAGS) -O3 -Wall
  # some other options
  #CFLAGS = -mcpu=opteron -O3
  #CFLAGS = -mcpu=pentiumpro -O3 
@@ -137,8 +137,8 @@ LIBS = -lphast -framework vecLib -lc -lm
 else
 ifdef CLAPACKPATH
 ifneq ($(TARGETOS), Windows)
-  LIBS = -lphast -llapack -ltmglib -lblas -lc -lm -lpcre
+  LIBS = -lphast -llapack -ltmglib -lblas -lc -lm -lpcre $(LDFLAGS)
 else
   CFLAGS += -I${CLAPACKPATH}/INCLUDE -I${F2CPATH} -DPCRE_STATIC
   LIBS = -lphast -lm  ${CLAPACKPATH}/liblapack.a ${CLAPACKPATH}/libf2c.a ${CLAPACKPATH}/libblas.a
 endif
