|
|
|
@ -1,16 +1,23 @@
@@ -1,16 +1,23 @@
|
|
|
|
|
CXXFLAGS = -g -Wall -fPIC |
|
|
|
|
INCFLAGS = |
|
|
|
|
|
|
|
|
|
## NOTE: The NEEDED_CXXFLAGS are here so that custom CXXFLAGS can be specified at build time
|
|
|
|
|
## **without** overwriting the CXXFLAGS which we need in order to build.
|
|
|
|
|
## For example, when adding 'hardening flags' to the build
|
|
|
|
|
## (e.g. -fstack-protector-strong -Wformat -Werror=format-security), we do not want to remove
|
|
|
|
|
## -std=c++11. If you want to remove this variable please do so in a way that allows setting
|
|
|
|
|
## custom FLAGS to work at build-time.
|
|
|
|
|
|
|
|
|
|
# detect proper flag for c++11 support by gcc
|
|
|
|
|
CXXVER := $(shell $(CXX) -dumpversion) |
|
|
|
|
ifeq ($(shell expr match ${CXXVER} "4\.[0-9][0-9]"),4) # >= 4.10
|
|
|
|
|
NEEDED_CXXFLAGS += -std=c++11 |
|
|
|
|
NEEDED_CXXFLAGS += -std=c++11 |
|
|
|
|
else ifeq ($(shell expr match ${CXXVER} "4\.[7-9]"),3) # >= 4.7
|
|
|
|
|
NEEDED_CXXFLAGS += -std=c++11 |
|
|
|
|
NEEDED_CXXFLAGS += -std=c++11 |
|
|
|
|
else ifeq ($(shell expr match ${CXXVER} "4\.6"),3) # = 4.6
|
|
|
|
|
NEEDED_CXXFLAGS += -std=c++0x |
|
|
|
|
NEEDED_CXXFLAGS += -std=c++0x |
|
|
|
|
else ifeq ($(shell expr match $(CXX) 'clang'),5) |
|
|
|
|
NEEDED_CXXFLAGS += -std=c++11 |
|
|
|
|
NEEDED_CXXFLAGS += -std=c++11 |
|
|
|
|
else # not supported
|
|
|
|
|
$(error Compiler too old) |
|
|
|
|
endif |
|
|
|
|