summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rwxr-xr-xmake/calcdep.pl2
-rw-r--r--make/check_epoll.cpp1
-rw-r--r--make/check_eventfd.cpp2
-rw-r--r--make/check_kqueue.cpp26
-rw-r--r--make/check_stdint.cpp25
-rw-r--r--make/check_strlcpy.cpp25
-rw-r--r--make/opensslcert.pm6
-rw-r--r--make/template/inspircd4
-rw-r--r--make/template/main.mk32
-rw-r--r--make/utilities.pm3
10 files changed, 108 insertions, 18 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl
index 4a759a24a..49506dd3b 100755
--- a/make/calcdep.pl
+++ b/make/calcdep.pl
@@ -160,7 +160,7 @@ END
obj/ld-extra.cmd: $core_src
\@\$(SOURCEPATH)/make/unit-cc.pl gen-ld\$(VERBOSE) \$\@ \$^ \$>
-bin/inspircd: obj/ld-extra.cmd $core_mk
+bin/inspircd: $core_mk obj/ld-extra.cmd
\@\$(SOURCEPATH)/make/unit-cc.pl static-ld\$(VERBOSE) \$\@ \$^ \$>
inspircd: bin/inspircd
diff --git a/make/check_epoll.cpp b/make/check_epoll.cpp
index 918d3907e..a5ed1c10b 100644
--- a/make/check_epoll.cpp
+++ b/make/check_epoll.cpp
@@ -1,6 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
+ * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
diff --git a/make/check_eventfd.cpp b/make/check_eventfd.cpp
index 980d04485..9b38b793b 100644
--- a/make/check_eventfd.cpp
+++ b/make/check_eventfd.cpp
@@ -1,6 +1,8 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
+ * Copyright (C) 2012 William Pitcock <nenolod@dereferenced.org>
+ * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
diff --git a/make/check_kqueue.cpp b/make/check_kqueue.cpp
new file mode 100644
index 000000000..6034253df
--- /dev/null
+++ b/make/check_kqueue.cpp
@@ -0,0 +1,26 @@
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
+ *
+ * Copyright (C) 2015 Peter Powell <petpow@saberuk.com>
+ *
+ * This file is part of InspIRCd. InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <sys/types.h>
+#include <sys/event.h>
+
+int main() {
+ int fd = kqueue();
+ return (fd < 0);
+}
diff --git a/make/check_stdint.cpp b/make/check_stdint.cpp
new file mode 100644
index 000000000..fbd01b80d
--- /dev/null
+++ b/make/check_stdint.cpp
@@ -0,0 +1,25 @@
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
+ *
+ * Copyright (C) 2015 Peter Powell <petpow@saberuk.com>
+ *
+ * This file is part of InspIRCd. InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <stdint.h>
+
+int main() {
+ uint32_t ret = 0;
+ return ret;
+}
diff --git a/make/check_strlcpy.cpp b/make/check_strlcpy.cpp
new file mode 100644
index 000000000..e51d18d40
--- /dev/null
+++ b/make/check_strlcpy.cpp
@@ -0,0 +1,25 @@
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
+ *
+ * Copyright (C) 2015 Peter Powell <petpow@saberuk.com>
+ *
+ * This file is part of InspIRCd. InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include <string.h>
+
+int main() {
+ char test[5];
+ strlcpy(test, "test", sizeof(test));
+}
diff --git a/make/opensslcert.pm b/make/opensslcert.pm
index 1bf27df15..20da704f7 100644
--- a/make/opensslcert.pm
+++ b/make/opensslcert.pm
@@ -46,6 +46,7 @@ sub make_openssl_cert()
my $state = promptstring_s('What state are you located in?', 'Example State');
my $country = promptstring_s('What is the ISO 3166-1 code for the country you are located in?', 'XZ');
my $time = promptstring_s('How many days do you want your certificate to be valid for?', '365');
+ my $use_1024 = promptstring_s('Do you want to generate less secure dhparams which are compatible with old versions of Java?', 'n');
print FH <<__END__;
$country
$state
@@ -56,8 +57,9 @@ $commonname
$email
__END__
close(FH);
-system("cat openssl.template | openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem -days $time 2>/dev/null");
-system("openssl dhparam -out dhparams.pem 1024");
+my $dhbits = $use_1024 =~ /^(1|on|true|yes|y)$/ ? 1024 : 2048;
+system("cat openssl.template | openssl req -x509 -nodes -newkey rsa:2048 -keyout key.pem -out cert.pem -days $time 2>/dev/null");
+system("openssl dhparam -out dhparams.pem $dhbits");
unlink("openssl.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()
diff --git a/make/template/main.mk b/make/template/main.mk
index 1dff0fc20..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
@@ -124,8 +129,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 +165,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
@@ -227,9 +232,9 @@ install: target
@-$(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)
+ [ "$(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
@@ -258,16 +263,17 @@ 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 $(MODPATH)/cmd_*.so
+ -rm -f $(MODPATH)/m_*.so
-rm -f $(BASE)/.gdbargs
-rm -f $(BASE)/org.inspircd.plist
@@ -283,8 +289,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'
@@ -314,4 +320,6 @@ help:
@echo ' deinstall Removes the files created by "make install"'
@echo
+.NOTPARALLEL:
+
.PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall squeakyclean configureclean help
diff --git a/make/utilities.pm b/make/utilities.pm
index ae16ce3dc..baba584ad 100644
--- a/make/utilities.pm
+++ b/make/utilities.pm
@@ -29,6 +29,7 @@ use warnings FATAL => qw(all);
use Exporter 'import';
use POSIX;
+use File::Temp;
use Getopt::Long;
use Fcntl;
our @EXPORT = qw(make_rpath pkgconfig_get_include_dirs pkgconfig_get_lib_dirs pkgconfig_check_version translate_functions promptstring);
@@ -404,7 +405,7 @@ sub translate_functions($$)
my $tmpfile;
do
{
- $tmpfile = tmpnam();
+ $tmpfile = File::Temp::tmpnam();
} until sysopen(TF, $tmpfile, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, 0700);
print "(Created and executed \e[1;32m$tmpfile\e[0m)\n";
print TF $1;