summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-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/gnutlscert.pm13
-rw-r--r--make/opensslcert.pm5
-rw-r--r--make/template/main.mk7
-rw-r--r--make/template/org.inspircd.plist4
-rw-r--r--make/utilities.pm3
10 files changed, 102 insertions, 9 deletions
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/gnutlscert.pm b/make/gnutlscert.pm
index 1204369a9..2c46e0e63 100644
--- a/make/gnutlscert.pm
+++ b/make/gnutlscert.pm
@@ -29,9 +29,16 @@ use Exporter 'import';
use make::configure;
our @EXPORT = qw(make_gnutls_cert);
+# On OS X the GnuTLS certtool is prefixed to avoid collision with the system certtool.
+my $certtool = $^O eq 'darwin' ? 'gnutls-certtool' : 'certtool';
sub make_gnutls_cert()
{
+ if (system "$certtool --version >/dev/null 2>&1")
+ {
+ print "\e[1;31mError:\e[0m unable to find '$certtool' in the PATH!\n";
+ return 1;
+ }
open (FH, ">certtool.template");
my $timestr = time();
my $commonname = promptstring_s('What is the hostname of your server?', 'irc.example.com');
@@ -133,12 +140,6 @@ ocsp_signing_key
time_stamping_key
__END__
close(FH);
-my $certtool = "certtool";
-if (`uname -s` eq "Darwin\n") {
- # On OS X the certtool binary name is different to prevent
- # collisions with the system certtool from NSS.
- $certtool = "gnutls-certtool";
-}
if ( (my $status = system("$certtool --generate-privkey --outfile key.pem")) ne 0) { return 1; }
if ( (my $status = system("$certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem --template certtool.template")) ne 0) { return 1; }
unlink("certtool.template");
diff --git a/make/opensslcert.pm b/make/opensslcert.pm
index b8c9d164f..1bf27df15 100644
--- a/make/opensslcert.pm
+++ b/make/opensslcert.pm
@@ -32,6 +32,11 @@ our @EXPORT = qw(make_openssl_cert);
sub make_openssl_cert()
{
+ if (system 'openssl version >/dev/null 2>&1')
+ {
+ print "\e[1;31mCertificate generation failed:\e[0m unable to find 'openssl' in the PATH!\n";
+ return;
+ }
open (FH, ">openssl.template");
my $commonname = promptstring_s('What is the hostname of your server?', 'irc.example.com');
my $email = promptstring_s('What email address can you be contacted at?', 'example@example.com');
diff --git a/make/template/main.mk b/make/template/main.mk
index d5705d928..fa2375ac1 100644
--- a/make/template/main.mk
+++ b/make/template/main.mk
@@ -42,6 +42,7 @@ PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
BASE = "$(DESTDIR)@BASE_DIR@"
CONPATH = "$(DESTDIR)@CONFIG_DIR@"
MODPATH = "$(DESTDIR)@MODULE_DIR@"
+LOGPATH = "$(DESTDIR)@LOG_DIR@"
DATPATH = "$(DESTDIR)@DATA_DIR@"
BINPATH = "$(DESTDIR)@BINARY_DIR@"
INSTALL = install
@@ -220,8 +221,8 @@ install: target
exit 1; \
fi
@-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)
- @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/data
- @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/logs
+ @-$(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
@@ -313,4 +314,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/template/org.inspircd.plist b/make/template/org.inspircd.plist
index 2656d1df3..4dac209f6 100644
--- a/make/template/org.inspircd.plist
+++ b/make/template/org.inspircd.plist
@@ -21,6 +21,10 @@
</array>
<key>ServiceIPC</key>
<false/>
+ <key>StandardOutPath</key>
+ <string>@LOG_DIR@/launchd-stdout.log</string>
+ <key>StandardErrorPath</key>
+ <string>@LOG_DIR@/launchd-stderr.log</string>
<key>UserName</key>
<string>ircdaemon</string>
</dict>
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;