File: honor-cflags-cppflags-cxxflags.patch

package info (click to toggle)
octave-parallel 4.0.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,752 kB
  • sloc: ansic: 23,442; cpp: 6,790; sh: 4,476; makefile: 290; perl: 170; xml: 22
file content (37 lines) | stat: -rw-r--r-- 1,459 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Description: Honor the environment variables CFLAGS, CPPFLAGS, and CXXFLAGS
 This is required in Debian, such that hardening flags like
 -D_FORTIFY_SOURCE=2, -fstack-protector-strong, -Wformat, and
 -Werror=format-security are used in the compilation of C++ files.
Author: Rafael Laboissière <rafael@debian.org>
Forwarded: https://savannah.gnu.org/bugs/index.php?61516
Last-Update: 2021-11-20

--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -45,7 +45,7 @@
 # not for calling mkoctfile
 CC = @CC@
 # not for calling mkoctfile
-CFLAGS = -g -O2
+CFLAGS += -g -O2
 
 HAVE_GNUTLS := @HAVE_GNUTLS@
 HAVE_GNUTLS_EXTRA := @HAVE_GNUTLS_EXTRA@
@@ -165,7 +165,7 @@
 # the various gnulib header files under gl/ might have been updated,
 # to avoid having to mention them all here
 gnulib-wrappers.o: gnulib-wrappers.c gl/libgnu.a
-	$(CC) -c gnulib-wrappers.c -Igl $(CFLAGS) -fPIC
+	$(CC) $(CPPFLAGS) -c gnulib-wrappers.c -Igl $(CFLAGS) -fPIC
 
 error-helpers.o: error-helpers.cc error-helpers.h
 	CXXFLAGS="$(CXXFLAGS) $(RELEASE_CXXFLAGS)" $(MKOCTFILE) -c error-helpers.cc
@@ -220,7 +220,7 @@
 	$(MKOCTFILE) $< error-helpers.o minimal-load-save.o gl/libgnu.a gnulib-wrappers.o $(gnulib_libs)
 
 $(standalone): octave-pserver.cc octave-pserver.h
-	$(CXX) -pthread -Wall -o octave-pserver octave-pserver.cc
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -pthread -Wall $(LDFLAGS) -o octave-pserver octave-pserver.cc
 	install -D octave-pserver ../bin/octave-pserver
 
 doc: $(INFOFILE)