mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
validate gcc version for use -fstack-protector-strong in the Makefile
This commit is contained in:
parent
1217ca9e9f
commit
98fb2c9437
12
Makefile
12
Makefile
@ -21,7 +21,17 @@ INSTALL_LIBRARY_PATH = $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH)
|
|||||||
|
|
||||||
INSTALL ?= cp -a
|
INSTALL ?= cp -a
|
||||||
|
|
||||||
R_CFLAGS = -fPIC -std=c89 -pedantic -Wall -Werror -Wstrict-prototypes -Wwrite-strings -Wshadow -Winit-self -Wcast-align -Wformat=2 -Wmissing-prototypes -Wstrict-overflow=2 -Wcast-qual -Wc++-compat -Wundef -Wswitch-default -Wconversion -fstack-protector-strong $(CFLAGS)
|
# validate gcc version for use fstack-protector-strong
|
||||||
|
MIN_GCC_VERSION = "4.9"
|
||||||
|
GCC_VERSION := "`gcc -dumpversion`"
|
||||||
|
IS_GCC_ABOVE_MIN_VERSION := $(shell expr "$(GCC_VERSION)" ">=" "$(MIN_GCC_VERSION)")
|
||||||
|
ifeq "$(IS_GCC_ABOVE_MIN_VERSION)" "1"
|
||||||
|
CFLAGS += -fstack-protector-strong
|
||||||
|
else
|
||||||
|
CFLAGS += -fstack-protector
|
||||||
|
endif
|
||||||
|
|
||||||
|
R_CFLAGS = -fPIC -std=c89 -pedantic -Wall -Werror -Wstrict-prototypes -Wwrite-strings -Wshadow -Winit-self -Wcast-align -Wformat=2 -Wmissing-prototypes -Wstrict-overflow=2 -Wcast-qual -Wc++-compat -Wundef -Wswitch-default -Wconversion $(CFLAGS)
|
||||||
|
|
||||||
uname := $(shell sh -c 'uname -s 2>/dev/null || echo false')
|
uname := $(shell sh -c 'uname -s 2>/dev/null || echo false')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user