Do not force -frecord-gcc-switches flag
The -frecord-gcc-switches flag does not exist for GCC <= 4.3; hence only use it when available.pull/212/head
parent
5983c5cf4d
commit
a69e99b4c8
15
general.make
15
general.make
|
@ -1,3 +1,16 @@
|
||||||
|
# Macros that allow testing for GCC flag existence
|
||||||
|
try-run = $(shell set -e; \
|
||||||
|
TMP="/tmp/SOGo-gcc-flags-check.$$$$.tmp"; \
|
||||||
|
TMPO="/tmp/SOGo-gcc-flags-check.$$$$.o"; \
|
||||||
|
if ($(1)) >/dev/null 2>&1; \
|
||||||
|
then echo "$(2)"; \
|
||||||
|
else echo "$(3)"; \
|
||||||
|
fi; \
|
||||||
|
rm -f "$$TMP" "$$TMPO")
|
||||||
|
|
||||||
|
cc-option = $(call try-run,\
|
||||||
|
$(CC) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
|
||||||
|
|
||||||
# Use GCC level 2 optimization by default
|
# Use GCC level 2 optimization by default
|
||||||
# Might be overridden below
|
# Might be overridden below
|
||||||
ADDITIONAL_OBJCFLAGS=-O2
|
ADDITIONAL_OBJCFLAGS=-O2
|
||||||
|
@ -12,5 +25,5 @@ endif
|
||||||
# information plus the compiler flags used; that can
|
# information plus the compiler flags used; that can
|
||||||
# be afterwards read with:
|
# be afterwards read with:
|
||||||
# readelf -p .GCC.command.line /path/to/elf_file
|
# readelf -p .GCC.command.line /path/to/elf_file
|
||||||
ADDITIONAL_OBJCFLAGS += -g -frecord-gcc-switches
|
ADDITIONAL_OBJCFLAGS += -g $(call cc-option,-frecord-gcc-switches)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue