Check if gcc >= 5.0 before enabling stack smashing protection
This commit is contained in:
parent
9d86bf2af6
commit
0d0a2cbbd7
1 changed files with 9 additions and 1 deletions
10
Makefile.in
10
Makefile.in
|
@ -22,7 +22,7 @@ datarootdir=@datarootdir@
|
|||
localedir=@localedir@
|
||||
gettext_package=@GETTEXT_PACKAGE@
|
||||
|
||||
CFLAGS=@CFLAGS@ @PURPLE_CFLAGS@ @DEFS@ -DENABLE_NLS -DLOCALEDIR='"$(localedir)"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I${srcdir} -I. -fno-strict-aliasing -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2
|
||||
CFLAGS=@CFLAGS@ @PURPLE_CFLAGS@ @DEFS@ -DENABLE_NLS -DLOCALEDIR='"$(localedir)"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I${srcdir} -I. -fno-strict-aliasing -fPIC -D_FORTIFY_SOURCE=2
|
||||
LDFLAGS=@LDFLAGS@ @OPENSSL_LIBS@ @PURPLE_LIBS@ @LIBS@ -rdynamic -ggdb
|
||||
DIR_PERM=0755
|
||||
FILE_PERM=0644
|
||||
|
@ -31,6 +31,14 @@ CC=@CC@
|
|||
PKG_CONFIG=@PKG_CONFIG@
|
||||
MSGFMT_PATH=@MSGFMT_PATH@
|
||||
|
||||
# Check if GCC >= 5.0 before enabling stack smashing protection
|
||||
ifeq "$(CC)" "gcc"
|
||||
GCCVERGEQ5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 5)
|
||||
ifeq "$(GCCVERGEQ5)" "1"
|
||||
CFLAGS += -fstack-protector-strong
|
||||
endif
|
||||
endif
|
||||
|
||||
DEP=dep
|
||||
EXE=bin
|
||||
OBJ=objs
|
||||
|
|
Loading…
Add table
Reference in a new issue