From 414d9f0b30542d9b90fcea4e8345b012050b7de7 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 14 Jun 2013 03:27:25 +0100 Subject: Remove support for Interix and SunOS from the Makefile. - SunOS was replaced with Solaris in 1992(!). - We have a native Windows port so Interix is not needed. --- make/template/main.mk | 7 ------- 1 file changed, 7 deletions(-) (limited to 'make/template/main.mk') diff --git a/make/template/main.mk b/make/template/main.mk index 032fff5e2..9d0e6e6d5 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -70,19 +70,12 @@ INSTMODE_LIB = 0644 LDLIBS += -lsocket -lnsl -lrt -lresolv INSTALL = ginstall @ENDIF -@IFEQ $(SYSTEM) sunos - LDLIBS += -lsocket -lnsl -lrt -lresolv - INSTALL = ginstall -@ENDIF @IFEQ $(SYSTEM) darwin CXXFLAGS += -DDARWIN -frtti LDLIBS += -ldl CORELDFLAGS = -dynamic -bind_at_load -L. $(LDFLAGS) PICLDFLAGS = -fPIC -shared -twolevel_namespace -undefined dynamic_lookup $(LDFLAGS) @ENDIF -@IFEQ $(SYSTEM) interix - CXXFLAGS += -D_ALL_SOURCE -I/usr/local/include -@ENDIF @IFNDEF D D=0 -- cgit v1.2.3 From 450e94945e08813538428f958b267baba1e4d5d1 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 14 Jun 2013 04:02:58 +0100 Subject: Tidy up CXXFLAGS and LDFLAGS. - Add -Iinclude at declaration instead of doing it later on. - Add -Wextra -Wfatal-errors and -Wno-unused-parameter. - Enable -Wall and -Wshadow on ICC. - Remove -DPIC (useless). - Remove empty declaration of LDFLAGS. - Remove unneeded CXXFLAGS on Darwin. --- make/template/main.mk | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'make/template/main.mk') diff --git a/make/template/main.mk b/make/template/main.mk index 9d0e6e6d5..dc811e021 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -34,9 +34,8 @@ CC = @CC@ SYSTEM = @SYSTEM@ BUILDPATH = @BUILD_DIR@ SOCKETENGINE = @SOCKETENGINE@ -CXXFLAGS = -pipe -fPIC -DPIC +CXXFLAGS = -fPIC -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow LDLIBS = -pthread -lstdc++ -LDFLAGS = CORELDFLAGS = -rdynamic -L. $(LDFLAGS) PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS) BASE = "$(DESTDIR)@BASE_DIR@" @@ -51,12 +50,10 @@ INSTMODE_BIN = 0755 INSTMODE_LIB = 0644 @IFEQ $(CC) icc - CXXFLAGS += -Wshadow @ELSE - CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall + CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute @ENDIF - @IFEQ $(SYSTEM) linux LDLIBS += -ldl -lrt @ENDIF @@ -71,7 +68,6 @@ INSTMODE_LIB = 0644 INSTALL = ginstall @ENDIF @IFEQ $(SYSTEM) darwin - CXXFLAGS += -DDARWIN -frtti LDLIBS += -ldl CORELDFLAGS = -dynamic -bind_at_load -L. $(LDFLAGS) PICLDFLAGS = -fPIC -shared -twolevel_namespace -undefined dynamic_lookup $(LDFLAGS) @@ -102,8 +98,6 @@ DBGOK=0 @ENDIF FOOTER = finishmessage -CXXFLAGS += -Iinclude - @GNU_ONLY MAKEFLAGS += --no-print-directory @GNU_ONLY SOURCEPATH = $(shell /bin/pwd) -- cgit v1.2.3 From b37dfc93412f17bb83fc180312850f678d0c30f8 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 14 Jun 2013 03:31:47 +0100 Subject: Remove 'make squeakyclean'. This was a non-standard alias for make distclean. --- make/template/main.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'make/template/main.mk') diff --git a/make/template/main.mk b/make/template/main.mk index dc811e021..210e1a500 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -257,8 +257,6 @@ deinstall: -rm -f $(BASE)/.gdbargs -rm -f $(BASE)/org.inspircd.plist -squeakyclean: distclean - configureclean: rm -f .config.cache rm -f BSDmakefile @@ -299,4 +297,4 @@ help: @echo ' deinstall Removes the files created by "make install"' @echo -.PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean configureclean help +.PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall configureclean help -- cgit v1.2.3 From 0b4a12dc5f1e4472cec1fc32773b399e1a93125a Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 14 Jun 2013 04:06:35 +0100 Subject: Add IFNEQ Makefile template macro. - Use template macro for ICC check. - Don't link against pthread on Darwin. --- configure | 2 ++ make/template/main.mk | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'make/template/main.mk') diff --git a/configure b/configure index e54318112..c3d8c4110 100755 --- a/configure +++ b/configure @@ -960,6 +960,7 @@ EOF s/\@IFDEF (\S+)/ifdef $1/g; s/\@IFNDEF (\S+)/ifndef $1/g; s/\@IFEQ (\S+) (\S+)/ifeq ($1,$2)/g; + s/\@IFNEQ (\S+) (\S+)/ifneq ($1,$2)/g; s/\@ELSIFEQ (\S+) (\S+)/else ifeq ($1,$2)/g; s/\@ELSE/else/g; s/\@ENDIF/endif/g; @@ -975,6 +976,7 @@ EOF s/\@IFDEF (\S+)/.if defined($1)/g; s/\@IFNDEF (\S+)/.if !defined($1)/g; s/\@IFEQ (\S+) (\S+)/.if $1 == $2/g; + s/\@IFNEQ (\S+) (\S+)/.if $1 != $2/g; s/\@ELSIFEQ (\S+) (\S+)/.elif $1 == $2/g; s/\@ELSE/.else/g; s/\@ENDIF/.endif/g; diff --git a/make/template/main.mk b/make/template/main.mk index 210e1a500..b24327e70 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -49,11 +49,14 @@ INSTMODE_DIR = 0755 INSTMODE_BIN = 0755 INSTMODE_LIB = 0644 -@IFEQ $(CC) icc -@ELSE +@IFNEQ $(CC) icc CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute @ENDIF +@IFNEQ $(SYSTEM) darwin + LDLIBS += -pthread +@ENDIF + @IFEQ $(SYSTEM) linux LDLIBS += -ldl -lrt @ENDIF -- cgit v1.2.3 From 8aff5d15d3434fa11974d01d3319f958ed548e7c Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 14 Jun 2013 04:13:27 +0100 Subject: Use CXX instead of CC. CXX is the correct variable to use as CC is the C compiler. --- make/template/main.mk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'make/template/main.mk') diff --git a/make/template/main.mk b/make/template/main.mk index b24327e70..51ef01cff 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -30,7 +30,7 @@ # -CC = @CC@ +CXX = @CC@ SYSTEM = @SYSTEM@ BUILDPATH = @BUILD_DIR@ SOCKETENGINE = @SOCKETENGINE@ @@ -49,7 +49,7 @@ INSTMODE_DIR = 0755 INSTMODE_BIN = 0755 INSTMODE_LIB = 0644 -@IFNEQ $(CC) icc +@IFNEQ $(CXX) icc CXXFLAGS += -pedantic -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute @ENDIF @@ -83,7 +83,7 @@ INSTMODE_LIB = 0644 DBGOK=0 @IFEQ $(D) 0 CXXFLAGS += -O2 -@IFEQ $(CC) gcc +@IFEQ $(CXX) g++ CXXFLAGS += -g1 @ENDIF HEADER = std-header @@ -107,14 +107,14 @@ FOOTER = finishmessage @BSD_ONLY SOURCEPATH != /bin/pwd @IFDEF V - RUNCC = $(CC) - RUNLD = $(CC) + RUNCC = $(CXX) + RUNLD = $(CXX) VERBOSE = -v @ELSE @GNU_ONLY MAKEFLAGS += --silent @BSD_ONLY MAKE += -s - RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC) - RUNLD = perl $(SOURCEPATH)/make/run-cc.pl $(CC) + RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CXX) + RUNLD = perl $(SOURCEPATH)/make/run-cc.pl $(CXX) @ENDIF @IFDEF PURE_STATIC -- cgit v1.2.3 From 240f34086a805dc4c3151aae00101f9bec6870df Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 4 Jul 2013 17:48:58 +0100 Subject: Rename CXXFLAGS to CORECXXFLAGS to respect users enviroment. --- make/template/main.mk | 20 ++++++++++++-------- make/unit-cc.pl | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'make/template/main.mk') 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); -- cgit v1.2.3