From dbcbf9647d0abb421f8a84b41e674f403c91ce8f Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 26 Feb 2016 09:52:35 +0000 Subject: Quote paths in the makefile. This prevents problems caused by paths with spaces in them. --- make/template/main.mk | 56 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'make/template') diff --git a/make/template/main.mk b/make/template/main.mk index fa2375ac1..c044bdaaa 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -124,8 +124,8 @@ CXXFLAGS += -Iinclude @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" $(CC) + RUNLD = perl "$(SOURCEPATH)/make/run-cc.pl" $(CC) VERBOSE = @ENDIF @@ -160,7 +160,7 @@ all: $(FOOTER) target: $(HEADER) $(MAKEENV) perl make/calcdep.pl - cd $(BUILDPATH); $(MAKEENV) $(MAKE) -f real.mk $(TARGET) + cd "$(BUILDPATH)"; $(MAKEENV) $(MAKE) -f real.mk $(TARGET) debug: @${MAKE} D=1 all @@ -220,22 +220,22 @@ install: target echo ""; \ exit 1; \ fi - @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE) - @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(DATPATH) - @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(LOGPATH) - @-$(INSTALL) -d -m $(INSTMODE_DIR) $(BINPATH) - @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/aliases - @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/modules - @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MODPATH) - [ $(BUILDPATH)/bin/ -ef $(BINPATH) ] || $(INSTALL) -m $(INSTMODE_BIN) $(BUILDPATH)/bin/inspircd $(BINPATH) + @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) "$(BASE)" + @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) "$(DATPATH)" + @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) "$(LOGPATH)" + @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(BINPATH)" + @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(CONPATH)/examples/aliases" + @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(CONPATH)/examples/modules" + @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(MODPATH)" + [ "$(BUILDPATH)/bin/" -ef "$(BINPATH)" ] || $(INSTALL) -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" "$(BINPATH)" @IFNDEF PURE_STATIC - [ $(BUILDPATH)/modules/ -ef $(MODPATH) ] || $(INSTALL) -m $(INSTMODE_LIB) $(BUILDPATH)/modules/*.so $(MODPATH) + [ "$(BUILDPATH)/modules/" -ef "$(MODPATH)" ] || $(INSTALL) -m $(INSTMODE_LIB) "$(BUILDPATH)/modules/"*.so "$(MODPATH)" @ENDIF - -$(INSTALL) -m $(INSTMODE_BIN) @STARTSCRIPT@ $(BASE) 2>/dev/null - -$(INSTALL) -m $(INSTMODE_LIB) tools/gdbargs $(BASE)/.gdbargs 2>/dev/null - -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/*.example $(CONPATH)/examples - -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/aliases/*.example $(CONPATH)/examples/aliases - -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/modules/*.example $(CONPATH)/examples/modules + -$(INSTALL) -m $(INSTMODE_BIN) @STARTSCRIPT@ "$(BASE)" 2>/dev/null + -$(INSTALL) -m $(INSTMODE_LIB) tools/gdbargs "$(BASE)/.gdbargs" 2>/dev/null + -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/*.example "$(CONPATH)/examples" + -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/aliases/*.example "$(CONPATH)/examples/aliases" + -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/modules/*.example "$(CONPATH)/examples/modules" @echo "" @echo "*************************************" @echo "* INSTALL COMPLETE! *" @@ -258,18 +258,18 @@ GNUmakefile BSDmakefile: make/template/main.mk configure $(RCS_FILES) clean: @echo Cleaning... - -rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk - -rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules - @-rmdir $(BUILDPATH)/bin 2>/dev/null - @-rmdir $(BUILDPATH) 2>/dev/null + -rm -f "$(BUILDPATH)/bin/inspircd" "$(BUILDPATH)/include" "$(BUILDPATH)/real.mk" + -rm -rf "$(BUILDPATH)/obj" "$(BUILDPATH)/modules" + @-rmdir "$(BUILDPATH)/bin" 2>/dev/null + @-rmdir "$(BUILDPATH)" 2>/dev/null @echo Completed. deinstall: - -rm -f $(BINPATH)/inspircd - -rm -rf $(CONPATH)/examples - -rm -f $(MODPATH)/*.so - -rm -f $(BASE)/.gdbargs - -rm -f $(BASE)/org.inspircd.plist + -rm -f "$(BINPATH)/inspircd" + -rm -rf "$(CONPATH)/examples" + -rm -f "$(MODPATH)/*.so" + -rm -f "$(BASE)/.gdbargs" + -rm -f "$(BASE)/org.inspircd.plist" squeakyclean: distclean @@ -283,8 +283,8 @@ configureclean: -rm -f org.inspircd.plist distclean: clean configureclean - -rm -rf $(SOURCEPATH)/run - find $(SOURCEPATH)/src/modules -type l | xargs rm -f + -rm -rf "$(SOURCEPATH)/run" + find "$(SOURCEPATH)/src/modules" -type l | xargs rm -f help: @echo 'InspIRCd Makefile' -- cgit v1.2.3 From 8aced446613e3d68a0c1666edcc0e8817ae2f812 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 19 Mar 2016 20:00:37 +0000 Subject: Fix 'cron' and 'restart' in the helper not forwarding arguments. --- make/template/inspircd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'make/template') diff --git a/make/template/inspircd b/make/template/inspircd index 7cd83a8e1..b43ad60c9 100644 --- a/make/template/inspircd +++ b/make/template/inspircd @@ -135,7 +135,7 @@ sub cmd_rehash() sub cmd_cron() { - if (getstatus() == 0) { goto &cmd_start(); } + if (getstatus() == 0) { goto &cmd_start(@_); } exit(); } @@ -149,7 +149,7 @@ sub cmd_restart(@) { cmd_stop(); unlink($pidfile) if (-e $pidfile); - goto &cmd_start; + goto &cmd_start(@_); } sub hid_cheese_sandwich() -- cgit v1.2.3 From ba0649304a73f7a5109af9a97a0ecbe3f4bbed36 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 25 Mar 2016 11:38:54 +0000 Subject: Partially revert "Quote paths in the makefile". There is no need to quote BASE and {BIN,CON,DAT,MOD,LOG}PATH because they are alreaady quoted. {BUILD,SOURCE}PATH however are unquoted so their usages still need to be quoted. This reverts commit dbcbf9647d0abb421f8a84b41e674f403c91ce8f. --- make/template/main.mk | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'make/template') diff --git a/make/template/main.mk b/make/template/main.mk index c044bdaaa..2a220f5a8 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -220,22 +220,22 @@ install: target echo ""; \ exit 1; \ fi - @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) "$(BASE)" - @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) "$(DATPATH)" - @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) "$(LOGPATH)" - @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(BINPATH)" - @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(CONPATH)/examples/aliases" - @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(CONPATH)/examples/modules" - @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(MODPATH)" - [ "$(BUILDPATH)/bin/" -ef "$(BINPATH)" ] || $(INSTALL) -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" "$(BINPATH)" + @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE) + @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(DATPATH) + @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(LOGPATH) + @-$(INSTALL) -d -m $(INSTMODE_DIR) $(BINPATH) + @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/aliases + @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/modules + @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MODPATH)" + [ "$(BUILDPATH)/bin/" -ef $(BINPATH) ] || $(INSTALL) -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" $(BINPATH) @IFNDEF PURE_STATIC - [ "$(BUILDPATH)/modules/" -ef "$(MODPATH)" ] || $(INSTALL) -m $(INSTMODE_LIB) "$(BUILDPATH)/modules/"*.so "$(MODPATH)" + [ "$(BUILDPATH)/modules/" -ef $(MODPATH) ] || $(INSTALL) -m $(INSTMODE_LIB) "$(BUILDPATH)/modules/"*.so $(MODPATH) @ENDIF - -$(INSTALL) -m $(INSTMODE_BIN) @STARTSCRIPT@ "$(BASE)" 2>/dev/null - -$(INSTALL) -m $(INSTMODE_LIB) tools/gdbargs "$(BASE)/.gdbargs" 2>/dev/null - -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/*.example "$(CONPATH)/examples" - -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/aliases/*.example "$(CONPATH)/examples/aliases" - -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/modules/*.example "$(CONPATH)/examples/modules" + -$(INSTALL) -m $(INSTMODE_BIN) @STARTSCRIPT@ $(BASE) 2>/dev/null + -$(INSTALL) -m $(INSTMODE_LIB) tools/gdbargs $(BASE)/.gdbargs 2>/dev/null + -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/*.example $(CONPATH)/examples + -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/aliases/*.example $(CONPATH)/examples/aliases + -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/modules/*.example $(CONPATH)/examples/modules @echo "" @echo "*************************************" @echo "* INSTALL COMPLETE! *" @@ -265,11 +265,11 @@ clean: @echo Completed. deinstall: - -rm -f "$(BINPATH)/inspircd" - -rm -rf "$(CONPATH)/examples" - -rm -f "$(MODPATH)/*.so" - -rm -f "$(BASE)/.gdbargs" - -rm -f "$(BASE)/org.inspircd.plist" + -rm -f $(BINPATH)/inspircd + -rm -rf $(CONPATH)/examples + -rm -f $(MODPATH)/*.so + -rm -f $(BASE)/.gdbargs + -rm -f $(BASE)/org.inspircd.plist squeakyclean: distclean -- cgit v1.2.3 From eced5062205cb9c2ae4af5ca0972340059ae3363 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 25 Mar 2016 11:44:51 +0000 Subject: Delete modules cautiously when doing a deinstall. --- make/template/main.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'make/template') diff --git a/make/template/main.mk b/make/template/main.mk index 2a220f5a8..08787a1bf 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -267,7 +267,8 @@ clean: deinstall: -rm -f $(BINPATH)/inspircd -rm -rf $(CONPATH)/examples - -rm -f $(MODPATH)/*.so + -rm -f $(MODPATH)/cmd_*.so + -rm -f $(MODPATH)/m_*.so -rm -f $(BASE)/.gdbargs -rm -f $(BASE)/org.inspircd.plist -- cgit v1.2.3 From 955b0d74dc65714163a8e1743ec10e91d4583c4c Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 10 Apr 2016 04:33:20 +0100 Subject: Fix extraneous quotes in makefile template. --- make/template/main.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'make/template') diff --git a/make/template/main.mk b/make/template/main.mk index 08787a1bf..c46d60502 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -226,7 +226,7 @@ install: target @-$(INSTALL) -d -m $(INSTMODE_DIR) $(BINPATH) @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/aliases @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/modules - @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MODPATH)" + @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MODPATH) [ "$(BUILDPATH)/bin/" -ef $(BINPATH) ] || $(INSTALL) -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" $(BINPATH) @IFNDEF PURE_STATIC [ "$(BUILDPATH)/modules/" -ef $(MODPATH) ] || $(INSTALL) -m $(INSTMODE_LIB) "$(BUILDPATH)/modules/"*.so $(MODPATH) -- cgit v1.2.3 From 9401f1fbc35bdcf4f24be447b1bdf47d157464fa Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 4 Jun 2016 12:55:17 +0100 Subject: GCC should never assume that this can not be null. --- configure | 5 ++++- make/template/main.mk | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'make/template') diff --git a/configure b/configure index fd00ff89c..e8c3deb0d 100755 --- a/configure +++ b/configure @@ -965,6 +965,9 @@ EOF my @dotfiles = qw(main.mk inspircd); push @dotfiles, 'org.inspircd.plist' if $config{OSNAME} eq 'darwin'; + # HACK: we need to know if we are on GCC6 to disable the omission of `this` null pointer checks. + $config{GCC6} = `$config{CC} --version 2>/dev/null` =~ /gcc/i && $config{GCCVER} ge "6" ? "true" : "false"; + foreach my $file (@dotfiles) { open(FILEHANDLE, "make/template/$file") or die "Can't open make/template/$file: $!"; $_ = join '', ; @@ -974,7 +977,7 @@ EOF for my $var (qw( CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR DATA_DIR UID - STARTSCRIPT DESTINATION SOCKETENGINE LOG_DIR + STARTSCRIPT DESTINATION SOCKETENGINE LOG_DIR GCC6 )) { s/\@$var\@/$config{$var}/g; } diff --git a/make/template/main.mk b/make/template/main.mk index c46d60502..23daa7efc 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -89,6 +89,11 @@ INSTMODE_LIB = 0644 D=0 @ENDIF +GCC6=@GCC6@ +@IFEQ $(GCC6) true + CXXFLAGS += -fno-delete-null-pointer-checks +@ENDIF + DBGOK=0 @IFEQ $(D) 0 CXXFLAGS += -O2 -- cgit v1.2.3