# InspIRCd Configuration Script
#
-# Copyright 2003 The ChatSpike Development Team
+# Copyright 2002-2006 The ChatSpike Development Team
# <brain@chatspike.net>
# <Craig@chatspike.net>
#
'binary-dir=s' => \$opt_binary_dir,
'library-dir=s' => \$opt_library_dir,
'help' => sub { showhelp(); },
- 'modupdate' => sub { update(); },
- 'update' => sub { modupdate(); },
+ 'modupdate' => sub { modupdate(); },
+ 'update' => sub { update(); },
'svnupdate' => sub { svnupdate(); },
'clean' => sub { clean(); },
);
$no_svn = 0;
-$config{HAS_OPENSSL} =~ /OpenSSL ([-[:digit:].]+)([a-z])? (\w{3}|[0-9]+) (\w{3}|[0-9]+) [0-9]{4}/;
+$config{HAS_OPENSSL} =~ /OpenSSL ([-[:digit:].]+)([a-z])?(\-[a-z][0-9])? (\w{3}|[0-9]+) (\w{3}|[0-9]+) [0-9]{4}/;
$config{HAS_OPENSSL} = $1;
if ($config{GCCVER} eq "") {
sub update
{
+ chomp($topdir = getcwd());
+ $this = resolve_directory($topdir); # PWD, Regardless.
+ getmodules();
# Does the cache file exist?
if (!getcache()) {
# No, No it doesn't.. *BASH*
sub modupdate
{
+ chomp($topdir = getcwd());
+ $this = resolve_directory($topdir); # PWD, Regardless.
+ getmodules();
# Does the cache file exist?
if (!getcache()) {
# No, No it doesn't.. *BASH*
}
print "Running non-interactive configure...\n" unless $interactive;
-
-print "Checking for cache from previous configure...\n";
-getcache();
-print "Checking operating system version...\n";
-getosflags();
+print "Checking for cache from previous configure... ";
+print ((getcache() eq "true") ? "found\n" : "not found\n");
+print "Checking operating system version... ";
+print getosflags() . "\n";
if (defined $opt_maxclients)
{
print "\033[0mGnuTLS Support:\033[1;32m\t\t\t$config{USE_GNUTLS}\033[0m\n";
print "\033[0mOpenSSL Support:\033[1;32m\t\t$config{USE_OPENSSL}\033[0m\n\n";
+if (($config{USE_GNUTLS} eq "y") && ($config{HAS_GNUTLS} ne "y"))
+{
+ print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n";
+ exit(0);
+}
+if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y"))
+{
+ print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n";
+ exit(0);
+}
+
if ($config{USE_GNUTLS} eq "y") {
$failed = 0;
open(TMP, "<src/modules/m_ssl_gnutls.cpp") or $failed = 1;
$config{CC} = "eg++";
chomp($config{GCCVER} = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path
}
+ return "OpenBSD";
}
+ return $config{OSNAME};
} else {
$config{LDLIBS} = "-ldl -lstdc++";
$config{FLAGS} = "-fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
$config{LDLIBS} = "";
$config{MAKEPROG} = "/usr/bin/make";
$config{MAKEORDER} = "ircd mods";
+ return "Cygwin";
} elsif ($config{OSNAME} eq "CYG-STATIC") {
$config{FLAGS} = "-Wall -Woverloaded-virtual $config{OPTIMISATI}";
$config{LDLIBS} = "";
$config{MAKEORDER} = "mods ircd";
$config{STATICLIBS} = "modules/mods.a";
$config{STATIC_LINK} = "yes";
+ return "Cygwin-Static";
}
+ return "Linux";
}
if ($config{OSNAME} =~ /SunOS/)
# rt = POSIX realtime extensions
# resolv = inet_aton only (why isnt this in nsl?!)
$config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv";
+ return "Solaris";
}
if($config{OSNAME} eq "MINGW32")
{
# All code is position-independent on windows
$config{FLAGS} =~ s/-fPIC //;
+ return "MinGW";
}
}