-#!/usr/bin/perl
-###################################################
-# InspIRCd Configuration Script
+#!/usr/bin/env perl
+
+#
+# InspIRCd -- Internet Relay Chat Daemon
#
-# Copyright 2002-2010 The InspIRCd Development Team
-# http://wiki.inspircd.org/Credits
+# Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+# Copyright (C) 2007, 2009 Dennis Friis <peavey@inspircd.org>
+# Copyright (C) 2003, 2006-2008 Craig Edwards <craigedwards@brainbox.cc>
+# Copyright (C) 2006-2008 Robin Burchell <robin+git@viroteck.net>
+# Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
+# Copyright (C) 2007 John Brooks <john.brooks@dereferenced.net>
+# Copyright (C) 2006 Oliver Lupton <oliverlupton@gmail.com>
+# Copyright (C) 2003-2006 Craig McLure <craig@chatspike.net>
#
-# Licensed under GPL, please see the COPYING file
-# for more information
+# 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.
#
-# $Id$
+# 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/>.
+#
+
BEGIN {
require 5.8.0;
'disable-debuginfo' => sub { $opt_disable_debug = 1 },
'help' => sub { showhelp(); },
'update' => sub { update(); },
- 'svnupdate' => sub { svnupdate(); },
'clean' => sub { clean(); },
'list-extras' => sub { list_extras; exit 0; }, # This, --enable-extras, and --disable-extras are for non-interactive managing.
'enable-extras=s@' => \@opt_enableextras, # ^
{
$config{USE_PORTS} = "n";
}
-$config{IPV6} = "y"; # IPv6 support
-if (defined $opt_noipv6)
-{
- $config{IPV6} = "n";
-}
$config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue
$config{OSNAME} = $^O; # Operating System Name
$config{IS_DARWIN} = "NO"; # Is OSX?
$config{STARTSCRIPT} = "inspircd"; # start script?
$config{DESTINATION} = "BASE"; # Is target path.
-$config{EXTRA_DIR} = ""; # Is empty.
if ($config{OSNAME} =~ /darwin/i)
{
$config{IS_DARWIN} = "YES";
$config{STARTSCRIPT} = "org.inspircd.plist"; # start script for OSX.
+ $config{CC} = "xcrun clang++"; # C++ compiler for OSX.
+}
+else
+{
+ $config{CC} = "g++"; # C++ compiler
}
-$config{CC} = "g++"; # C++ compiler
if (defined $opt_cc)
{
$config{CC} = $opt_cc;
}
if (($config{GCCVER} eq "") || ($config{GCCMINOR} eq "")) {
- print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n";
+ if ($config{IS_DARWIN} eq "YES") {
+ print $config{CC} . " was not found! You require clang++ (the LLVM C++ compiler, part of the OSX developer tools) to build InspIRCd!\n";
+ } else {
+ print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n";
+ }
exit;
}
exit;
}
-sub svnupdate
-{
- my $fail = 0;
- open(FH,"<.svn/entries") or $fail = 1;
- if ($fail) {
- print "This is not an SVN copy of InspIRCd.\n";
- exit 1;
- }
- else
- {
- close(FH);
- }
- open my $fd, "-|", "svn update";
- my $configurechanged = 0; # Needs ./configure -update
- my $rootincchanged = 0;
- my @conflicted = ();
- while (defined(my $line = <$fd>))
- {
- my ($action, $file);
- print $line;
- $line =~ m/^([ADUCG])\s+(.*)$/ or next;
- ($action, $file) = ($1, $2);
- if ($action eq "C")
- {
- push @conflicted, $file;
- if ($file eq "configure")
- {
- $configurechanged = 1;
- }
- elsif ($file =~ m/^\..*\.inc$/)
- {
- $rootincchanged = 1;
- }
- }
- elsif ($action eq "U" || $action eq "G")
- {
- if ($file eq "configure")
- {
- $configurechanged = 1;
- }
- elsif ($file =~ m/^\..*\.inc$/)
- {
- $rootincchanged = 1;
- }
- }
- }
- unless (close $fd) # close() waits for exit and returns false if the command failed
- {
- if ($! == 0)
- {
- print STDERR "Problem updating from SVN, please check above for errors\n";
- }
- else
- {
- print STDERR "Failed to run SVN: $!\n";
- }
- exit 1;
- }
- if (scalar(@conflicted) > 0)
- {
- print STDERR "\e[0;33;1mERROR:\e[0m You have local modifications which conflicted with the updates from SVN\n";
- print STDERR "Configure is not able to complete the update. Please resolve these conflicts, then run ./configure -update\n";
- print "Conflicted files: " . join ", ", @conflicted . "\n";
- exit 1;
- }
- if ($configurechanged)
- {
- system("perl configure -update");
- }
- else
- {
- print "No need to update Makefiles.\n";
- }
- if (defined $opt_rebuild) {
- system("make install");
- }
- exit;
-}
sub test_compile {
my $feature = shift;
}
}
- yesno('IPV6',"Would you like to build InspIRCd with IPv6 support?\nYou can still use IPv4 addresses in your port bindings.\n\nEnable IPv6?");
- print "\n";
-
$config{USE_FREEBSD_BASE_SSL} = "n";
$config{USE_FREEBSD_PORTS_SSL} = "n";
if ($config{HAS_OPENSSL_PORT} ne "")
}
}
+# We are on a POSIX system, we can enable POSIX extras without asking
+symlink "extra/m_regex_posix.cpp", "src/modules/m_regex_posix.cpp";
+
dumphash();
if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y"))
if ($config{HAS_STDINT} eq "true") {
print FILEHANDLE "#define HAS_STDINT\n";
}
- if ($config{IPV6} =~ /y/i) {
- print FILEHANDLE "#define IPV6\n";
- }
if ($config{HAS_EVENTFD} eq 'true') {
print FILEHANDLE "#define HAS_EVENTFD\n";
}
+ if ($config{OSNAME} !~ /DARWIN/i) {
+ print FILEHANDLE "#define HAS_CLOCK_GETTIME\n";
+ }
my $use_hiperf = 0;
if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
print FILEHANDLE "#define USE_KQUEUE\n";
for my $var (qw(
CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR UID
- STARTSCRIPT DESTINATION EXTRA_DIR SOCKETENGINE
+ STARTSCRIPT DESTINATION SOCKETENGINE
)) {
s/\@$var\@/$config{$var}/g;
}
my %extras = ();
EXTRA: for my $extra (@extras) {
next if (File::Spec->curdir() eq $extra || File::Spec->updir() eq $extra);
- next if ($extra eq '.svn');
my $abs_extra = File::Spec->catfile($abs_srcdir, "extra", $extra);
my $abs_source = File::Spec->catfile($abs_srcdir, $extra);
next unless ($extra =~ m/\.(cpp|h)$/ || (-d $abs_extra)); # C++ Source/Header, or directory