summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-07-04 17:48:58 +0100
committerPeter Powell <petpow@saberuk.com>2013-07-04 17:55:23 +0100
commit240f34086a805dc4c3151aae00101f9bec6870df (patch)
tree87621d8cecc160fa7b2089f7b32a6c6b61cea324 /make
parent8aff5d15d3434fa11974d01d3319f958ed548e7c (diff)
Rename CXXFLAGS to CORECXXFLAGS to respect users enviroment.
Diffstat (limited to 'make')
-rw-r--r--make/template/main.mk20
-rwxr-xr-xmake/unit-cc.pl2
2 files changed, 13 insertions, 9 deletions
diff --git a/make/template/main.mk b/make/template/main.mk
index 51ef01cff..fd094b578 100644
--- a/make/template/main.mk
+++ b/make/template/main.mk
@@ -34,7 +34,7 @@ CXX = @CC@
SYSTEM = @SYSTEM@
BUILDPATH = @BUILD_DIR@
SOCKETENGINE = @SOCKETENGINE@
-CXXFLAGS = -fPIC -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow
+CORECXXFLAGS = -fPIC -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow
LDLIBS = -pthread -lstdc++
CORELDFLAGS = -rdynamic -L. $(LDFLAGS)
PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
@@ -50,7 +50,7 @@ INSTMODE_BIN = 0755
INSTMODE_LIB = 0644
@IFNEQ $(CXX) icc
- CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute
+ CORECXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute
@ENDIF
@IFNEQ $(SYSTEM) darwin
@@ -82,20 +82,20 @@ INSTMODE_LIB = 0644
DBGOK=0
@IFEQ $(D) 0
- CXXFLAGS += -O2
+ CORECXXFLAGS += -O2
@IFEQ $(CXX) g++
- CXXFLAGS += -g1
+ CORECXXFLAGS += -g1
@ENDIF
HEADER = std-header
DBGOK=1
@ENDIF
@IFEQ $(D) 1
- CXXFLAGS += -O0 -g3 -Werror
+ CORECXXFLAGS += -O0 -g3 -Werror
HEADER = debug-header
DBGOK=1
@ENDIF
@IFEQ $(D) 2
- CXXFLAGS += -O2 -g3
+ CORECXXFLAGS += -O2 -g3
HEADER = debug-header
DBGOK=1
@ENDIF
@@ -118,10 +118,14 @@ FOOTER = finishmessage
@ENDIF
@IFDEF PURE_STATIC
- CXXFLAGS += -DPURE_STATIC
+ CORECXXFLAGS += -DPURE_STATIC
@ENDIF
-@DO_EXPORT RUNCC RUNLD CXXFLAGS LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
+# Add the users CXXFLAGS to the base ones to allow them to override
+# things like -Wfatal-errors if they wish to.
+CORECXXFLAGS += $(CXXFLAGS)
+
+@DO_EXPORT RUNCC RUNLD CORECXXFLAGS LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
@DO_EXPORT SOURCEPATH BUILDPATH PURE_STATIC SPLIT_CC
# Default target
diff --git a/make/unit-cc.pl b/make/unit-cc.pl
index 7474365aa..df718cdb8 100755
--- a/make/unit-cc.pl
+++ b/make/unit-cc.pl
@@ -97,7 +97,7 @@ sub do_compile {
my $libs = '';
my $binary = $ENV{RUNCC};
if ($do_compile) {
- $flags = $ENV{CXXFLAGS};
+ $flags = $ENV{CORECXXFLAGS};
$flags =~ s/ -pedantic// if nopedantic($file);
$flags .= ' ' . getcompilerflags($file);