Browse Source

[build] Allow workaround-specific flags to override default flags

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
b8924c1aed
1 changed files with 11 additions and 7 deletions
  1. 11
    7
      src/Makefile.housekeeping

+ 11
- 7
src/Makefile.housekeeping View File

109
 # Check for various tool workarounds
109
 # Check for various tool workarounds
110
 #
110
 #
111
 
111
 
112
+WORKAROUND_CFLAGS :=
113
+WORKAROUND_ASFLAGS :=
114
+WORKAROUND_LDFLAGS :=
115
+
112
 # Make syntax does not allow use of comma or space in certain places.
116
 # Make syntax does not allow use of comma or space in certain places.
113
 # This ugly workaround is suggested in the manual.
117
 # This ugly workaround is suggested in the manual.
114
 #
118
 #
119
 # Check for an old version of gas (binutils 2.9.1)
123
 # Check for an old version of gas (binutils 2.9.1)
120
 #
124
 #
121
 OLDGAS	:= $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)
125
 OLDGAS	:= $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)
122
-CFLAGS	+= $(OLDGAS)
126
+WORKAROUND_CFLAGS += $(OLDGAS)
123
 oldgas :
127
 oldgas :
124
 	@$(ECHO) $(oldgas)
128
 	@$(ECHO) $(oldgas)
125
 
129
 
131
 SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
135
 SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
132
 		-o /dev/null >/dev/null 2>&1
136
 		-o /dev/null >/dev/null 2>&1
133
 SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
137
 SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
134
-CFLAGS	+= $(SP_FLAGS)
138
+WORKAROUND_CFLAGS += $(SP_FLAGS)
135
 endif
139
 endif
136
 
140
 
137
 # gcc 4.4 generates .eh_frame sections by default, which distort the
141
 # gcc 4.4 generates .eh_frame sections by default, which distort the
141
 CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \
145
 CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \
142
 		 -o /dev/null >/dev/null 2>&1
146
 		 -o /dev/null >/dev/null 2>&1
143
 CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm')
147
 CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm')
144
-CFLAGS	+= $(CFI_FLAGS)
148
+WORKAROUND_CFLAGS += $(CFI_FLAGS)
145
 endif
149
 endif
146
 
150
 
147
 # Some versions of gas choke on division operators, treating them as
151
 # Some versions of gas choke on division operators, treating them as
150
 #
154
 #
151
 DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null
155
 DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null
152
 DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide')
156
 DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide')
153
-ASFLAGS	+= $(DIVIDE_FLAGS)
157
+WORKAROUND_ASFLAGS += $(DIVIDE_FLAGS)
154
 
158
 
155
 ###############################################################################
159
 ###############################################################################
156
 #
160
 #
375
 CFLAGS		+= -diag-disable 1599 # Hidden variables
379
 CFLAGS		+= -diag-disable 1599 # Hidden variables
376
 CFLAGS		+= -Wall -Wmissing-declarations
380
 CFLAGS		+= -Wall -Wmissing-declarations
377
 endif
381
 endif
378
-CFLAGS		+= $(EXTRA_CFLAGS)
379
-ASFLAGS		+= $(EXTRA_ASFLAGS)
380
-LDFLAGS		+= $(EXTRA_LDFLAGS)
382
+CFLAGS		+= $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
383
+ASFLAGS		+= $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
384
+LDFLAGS		+= $(WORKAROUND_LDFLAGS) $(EXTRA_LDFLAGS)
381
 
385
 
382
 # Inhibit -Werror if NO_WERROR is specified on make command line
386
 # Inhibit -Werror if NO_WERROR is specified on make command line
383
 #
387
 #

Loading…
Cancel
Save