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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
|
Author: Laszlo Kajan <lkajan@rostlab.org>
Description: use hardening flags from environment
Forwarded: http://lists.alioth.debian.org/pipermail/debian-med-packaging/2012-August/016975.html
--- a/cif-file/Makefile
+++ b/cif-file/Makefile
@@ -141,5 +141,5 @@ $(L_MOD_LIB): $(OBJ_FILES)
# Rule for making object files
%.o: $(SRC_DIR)/%.C
- libtool --mode=compile $(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
+ libtool --mode=compile $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
--- a/cif-file-util/Makefile
+++ b/cif-file-util/Makefile
@@ -141,5 +141,5 @@ $(L_MOD_LIB): $(OBJ_FILES)
# Rule for making object files
%.o: $(SRC_DIR)/%.C
- libtool --mode=compile $(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
+ libtool --mode=compile $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
--- a/cif-parser/Makefile
+++ b/cif-parser/Makefile
@@ -181,17 +181,17 @@ obj/%Parser.o $(SRC_DIR)/%Parser.h: $(SR
sh -c 'cd $(SRC_DIR); $(YACC) $(${^F:.y=_YACC_FLAGS}) ../$<'
mv $(^:.y=.tab.c) $(^:.y=.c)
mv $(^:.y=.tab.h) $(^:.y=.h)
- libtool --mode=compile $(CC) $(CFLAGS_NONANSI) -c $(^:.y=.c) -o obj/$(*)Parser.o
+ libtool --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS_NONANSI) -c $(^:.y=.c) -o obj/$(*)Parser.o
obj/%Scanner.o: $(SRC_DIR)/%Scanner.l $(OBJ_DIR)/%Parser.o $(SRC_DIR)/%Parser.h
$(LEX) $($(@F:.o=_LEX_FLAGS)) -t $(SRC_DIR)/$(@F:.o=.l) > $(SRC_DIR)/$(@F:.o=.c)
- libtool --mode=compile $(CC) $(CFLAGS_NONANSI) -c $(SRC_DIR)/$(@F:.o=.c) -o $(OBJ_DIR)/$(@F)
+ libtool --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS_NONANSI) -c $(SRC_DIR)/$(@F:.o=.c) -o $(OBJ_DIR)/$(@F)
# Rule for making other object files
obj/%ScannerBase.o: $(SRC_DIR)/%ScannerBase.C $(SRC_DIR)/%Parser.h
- libtool --mode=compile $(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$(@F)
+ libtool --mode=compile $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$(@F)
obj/%.o: $(SRC_DIR)/%.C
- libtool --mode=compile $(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$(@F)
+ libtool --mode=compile $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$(@F)
--- a/common/Makefile
+++ b/common/Makefile
@@ -153,5 +153,5 @@ $(L_MOD_LIB): $(OBJ_FILES)
# Rule for making object files
%.o: $(SRC_DIR)/%.C
- libtool --mode=compile $(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
+ libtool --mode=compile $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
--- a/dict-obj-file/Makefile
+++ b/dict-obj-file/Makefile
@@ -142,7 +142,7 @@ clean: clean_build clean_test
# Rule for making executables
%: $(OBJ_DIR)/%.o $(M_MOD_LIB) $(ALL_DEP_LIBS)
- $(CCC) $(LDFLAGS) $< $(M_MOD_LIB) $(ALL_DEP_LIBS) $(MALLOCLIB) -lm -o $(L_BIN_DIR)/$@
+ $(CCC) $(CPPFLAGS) $(LDFLAGS) $< $(M_MOD_LIB) $(ALL_DEP_LIBS) $(MALLOCLIB) -lm -o $(L_BIN_DIR)/$@
@cp -f $(L_BIN_DIR)/$@ $(M_BIN_DIR)/$@
@@ -203,10 +203,10 @@ $(L_MOD_LIB): $(OBJ_OTHER_FILES)
# Rule for making object files
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.C
- $(CCC) $(C++FLAGS) -c $< -o $@
+ $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $@
# Phony rule for making object files
%.o: $(SRC_DIR)/%.C
- libtool --mode=compile $(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
+ libtool --mode=compile $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
--- a/etc/make.platform.gnu4
+++ b/etc/make.platform.gnu4
@@ -108,8 +108,8 @@ NON_ANSI_C_FLAG=
C_WARNINGS=$(WARNINGS)
# C compiler flags
-CFLAGS=$(OPT) $(ABI) $(PIC) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
-CFLAGS_NONANSI=$(OPT) $(ABI) $(PIC) $(NON_ANSI_C_FLAG) $(DEFINES) $(INCLUDES)
+CFLAGS_NONANSI := $(CFLAGS) $(OPT) $(ABI) $(PIC) $(NON_ANSI_C_FLAG) $(DEFINES) $(INCLUDES)
+CFLAGS += $(OPT) $(ABI) $(PIC) $(ANSI_C_FLAG) $(C_WARNINGS) $(DEFINES) $(INCLUDES)
## C++ compiler
## This part defines C++ compiler information
@@ -128,14 +128,14 @@ C_PLUS_WARNINGS=$(WARNINGS) $(NO_DEPRECA
EXT=C
# C++ compiler flags
-C++FLAGS=$(OPT) $(ABI) $(PIC) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
+C++FLAGS= $(CXXFLAGS) $(OPT) $(ABI) $(PIC) $(ANSI_C_PLUS_FLAG) $(C_PLUS_WARNINGS) \
$(DEFINES) $(INCLUDES)
-C++FLAGS_NONANSI=$(OPT) $(ABI) $(PIC) $(NON_ANSI_C_PLUS_FLAG) \
+C++FLAGS_NONANSI= $(CXXFLAGS) $(OPT) $(ABI) $(PIC) $(NON_ANSI_C_PLUS_FLAG) \
$(C_PLUS_WARNINGS) $(DEFINES) $(INCLUDES)
# C++FLAGS_RELAXED should be set to avoid warnings reported by third party
# source code that is not maintained by PDB
-C++FLAGS_RELAXED=$(OPT) $(ABI) $(PIC) $(ANSI_C_PLUS_FLAG) $(NO_DEPRECATED) \
+C++FLAGS_RELAXED= $(CXXFLAGS) $(OPT) $(ABI) $(PIC) $(ANSI_C_PLUS_FLAG) $(NO_DEPRECATED) \
$(DEFINES) $(INCLUDES)
## Fortran compiler
@@ -158,8 +158,8 @@ F77LIBS=
STATIC_LINKING=-static
# Linker flags
-LDFLAGS=$(ABI) -w $(STATIC_LINKING)
-LDFLAGS_NO_STATIC=$(ABI) -w
+LDFLAGS_NO_STATIC := $(LDFLAGS) $(ABI) -w
+LDFLAGS += $(ABI) -w $(STATIC_LINKING)
# Fortran linker
F77_LINKER=f77
--- a/pdbml-parser/Makefile
+++ b/pdbml-parser/Makefile
@@ -222,10 +222,10 @@ $(L_MOD_LIB): $(OBJ_OTHER_FILES)
# General rule for making object files
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.C
- $(CCC) $(C++FLAGS) -c $< -o $@
+ $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $@
# Phony rule for making object files
%.o: $(SRC_DIR)/%.C
- libtool --mode=compile $(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
+ libtool --mode=compile $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
--- a/tables/Makefile
+++ b/tables/Makefile
@@ -138,5 +138,5 @@ $(L_MOD_LIB): $(OBJ_FILES)
# Rule for making object files
%.o: $(SRC_DIR)/%.C
- libtool --mode=compile $(CCC) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
+ libtool --mode=compile $(CCC) $(CPPFLAGS) $(C++FLAGS) -c $< -o $(OBJ_DIR)/$@
--- a/wrapper/Makefile
+++ b/wrapper/Makefile
@@ -148,10 +148,10 @@ clean_build:
$(L_MOD_LIB): $(OBJ_FILES) $(ALL_DEP_LIBS)
# Create module library
- @cd $(OBJ_DIR); $(CCC) $(LINK_METHOD) $(EXT_LIBS_DIRS) $(OBJ_FILES) $(ALL_DEP_LIBS) $(EXT_LIBS) $(SYS_LIBS) -o ../$@
+ @cd $(OBJ_DIR); $(CCC) $(CPPFLAGS) $(LINK_METHOD) $(EXT_LIBS_DIRS) $(OBJ_FILES) $(ALL_DEP_LIBS) $(EXT_LIBS) $(SYS_LIBS) -o ../$@
# Rule for making object files
%.o: $(SRC_DIR)/%.C
- $(CCC) $(C++FLAGS) $(EXT_COMP_OPT) -c $< -o $(OBJ_DIR)/$@
+ $(CCC) $(CPPFLAGS) $(C++FLAGS) $(EXT_COMP_OPT) -c $< -o $(OBJ_DIR)/$@
--- a/regex/Makefile
+++ b/regex/Makefile
@@ -152,7 +152,7 @@ $(L_MOD_LIB): $(OBJ_FILES)
# Rule for making object files
%.o: $(SRC_DIR)/%.c
- libtool --mode=compile $(CC) $(CFLAGS_NONANSI) -DPOSIX_MISTAKE -c $< -o $(OBJ_DIR)/$@
+ libtool --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS_NONANSI) -DPOSIX_MISTAKE -c $< -o $(OBJ_DIR)/$@
# Extra, non-used in PDB build
@@ -180,18 +180,18 @@ TARGET = $(L_BIN_DIR)/re
$(OBJ_DIR)/main.o: $(H) $(HEADER_FILES) $(SRC_DIR)/main.c $(L_INCL_DIR)/main.ih
- $(CC) $(CFLAGS_NONANSI) -DPOSIX_MISTAKE -c $(SRC_DIR)/main.c -o $@
+ $(CC) $(CPPFLAGS) $(CFLAGS_NONANSI) -DPOSIX_MISTAKE -c $(SRC_DIR)/main.c -o $@
$(OBJ_DIR)/split.o: $(H) $(HEADER_FILES) $(SRC_DIR)/split.c
- libtool --mode=compile $(CC) $(CFLAGS_NONANSI) -DPOSIX_MISTAKE -c $(SRC_DIR)/split.c -o $@
+ libtool --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS_NONANSI) -DPOSIX_MISTAKE -c $(SRC_DIR)/split.c -o $@
debug.o: $(H) $(HEADER_FILES) $(SRC_DIR)/debug.c $(L_INCL_DIR)/debug.ih
- $(CC) $(CFLAGS_NONANSI) -DPOSIX_MISTAKE -c $(SRC_DIR)/debug.c -o $(OBJ_DIR)/$@
+ $(CC) $(CPPFLAGS) $(CFLAGS_NONANSI) -DPOSIX_MISTAKE -c $(SRC_DIR)/debug.c -o $(OBJ_DIR)/$@
# tester
$(TARGET): $(ALLOBJS)
- $(CC) $(CFLAGS) -DPOSIX_MISTAKE $(LDFLAGS) $(ALLOBJS) $(LIBS) -o $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) -DPOSIX_MISTAKE $(LDFLAGS) $(ALLOBJS) $(LIBS) -o $@
# regression test
|