#
########################################
+
require 5.6.0;
use Cwd;
use Getopt::Long;
'with-max-channels=i' => \$opt_maxchans,
'with-max-oper-channels=i' => \$opt_opermaxchans,
'with-max-clients' => \$opt_maxclients,
- 'enable-optimization' => \$opt_optimise,
'enable-epoll' => \$opt_epoll,
'enable-kqueue' => \$opt_kqueue,
'disable-epoll' => \$opt_noepoll,
'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(); },
);
(defined $opt_opermaxchans) ||
(defined $opt_chan_length) ||
(defined $opt_nick_length) ||
- (defined $opt_optimise) ||
(defined $opt_use_openssl) ||
(defined $opt_nokqueue) ||
(defined $opt_noepoll) ||
{
$config{USE_OPENSSL} = "y";
}
+
+# no, let's not change these.
$config{OPTIMITEMP} = "0"; # Default Optimisation Value
$config{OPTIMISATI} = "-g"; # Optimisation Flag
-if (defined $opt_optimise)
-{
- $config{OPTIMISATI} = "-O" . $opt_optimise;
- $config{OPTIMITEMP} = $opt_optimise;
-}
+
$config{NICK_LENGT} = "31"; # Default Nick Length
if (defined $opt_nick_length)
{
$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*
$var = $config{MAX_CLIENT};
}
if ($var =~ /^\d+$/) {
- if (($var > $config{MAX_CLIENT_T}) && ($fd_scan_failed ne true)) {
+ if (($var > $config{MAX_CLIENT_T}) && ($fd_scan_fail ne "true")) {
# Client has entered a larger number than the 'discovered' value
# Confirm.
print "WARNING: Our scans have indicated that you are attempting
}
# If we get here, we should be good to go.
$config{MAX_CLIENT} = $var;
+ $config{MAX_DESCRIPTORS} = $var;
$continue = 1;
print "\n";
}
print "You must enter a number in this field. Please try again.\n\n";
}
}
-
- # Code Optimisation
- print "Enter the Level Of Binary optimisation. This is a number between 0 and 3.
-The InspIRCd Team will NOT support any bug reports above 0. Also note,
-the IRCd behaviour will be different depending on this value. Please
-read the documentation for more information.
-
-The higher the number, the more optimised your binary will be. This
-value will default to 0 if you either don't enter a number, or enter
-a value outside the range.
-
-As always, if you are unsure, just press enter and accept the default.\n\n";
- print "[\033[1;32m$config{OPTIMITEMP}\033[0m] -> ";
- chomp($var = <STDIN>);
- if ($var eq "") {
- $var = $config{OPTIMITEMP};
- }
-
- if ($var eq "1") {
- $config{OPTIMITEMP} = 1;
- $config{OPTIMISATI} = "-O";
- } elsif ($var eq "2") {
- $config{OPTIMITEMP} = 2;
- $config{OPTIMISATI} = "-O2";
- } elsif ($var eq "3") {
- $config{OPTIMITEMP} = 3;
- $config{OPTIMISATI} = "-O3";
- } else {
- $config{OPTIMITEMP} = 0;
- $config{OPTIMISATI} = "-g";
- }
}
print "\n\033[1;32mPre-build configuration is complete!\033[0m\n\n";
print "\033[0mMax name length:\033[1;32m\t\t$config{MAX_GECOS}\033[0m\n";
print "\033[0mMax away length:\033[1;32m\t\t$config{MAX_AWAY}\033[0m\n";
print "\033[0mGCC Version Found:\033[1;32m\t\t$config{GCCVER}.x\033[0m\n";
-print "\033[0mOptimization Flag:\033[1;32m\t\t$config{OPTIMISATI}\033[0m\n";
+# and not echo it out so we don't get some ricer fuck complaining
+#print "\033[0mOptimization Flag:\033[1;32m\t\t$config{OPTIMISATI}\033[0m\n";
print "\033[0mCompiler program:\033[1;32m\t\t$config{CC}\033[0m\n";
print "\033[0mStatic modules:\033[1;32m\t\t\t$config{STATIC_LINK}\033[0m\n";
print "\033[0mIPv6 Support:\033[1;32m\t\t\t$config{IPV6}\033[0m\n";
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;
return undef;
}
+sub getdependencies {
+ my ($file) = @_;
+ open(FLAGS, $file);
+ while (<FLAGS>) {
+ if ($_ =~ /^\/\* \$ModDep: (.+) \*\/$/) {
+ close(FLAGS);
+ return $1;
+ }
+ }
+ close(FLAGS);
+ return undef;
+}
+
sub resolve_directory {
use File::Spec;
return File::Spec->rel2abs($_[0]);
if ($i !~ /_static$/) {
$cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
$liflags = getlinkerflags("src/modules/m_".$i.".cpp");
+ $deps = getdependencies("src/modules/m_".$i.".cpp");
###
# Write Entry to the Makefile
###
print FILEHANDLE <<EOCHEESE;
-m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h
+m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h $deps
\$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c .m_$i\_static.cpp
mv .m_$i\_static.o ../m_$i.o
###
$cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
$liflags = getlinkerflags("src/modules/m_".$i.".cpp");
+ $deps = getdependencies("src/modules/m_".$i.".cpp");
print FILEHANDLE <<EOCHEESE;
-m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h
+m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps
\$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
\$(CC) \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra
hashcomp.o: hashcomp.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
-helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/helperfuncs.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
+helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I/usr/local/include -L/usr/local/lib -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
channels.o: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
configreader.o: configreader.cpp ../include/base.h ../include/configreader.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
-commands.o: commands.cpp ../include/base.h ../include/commands.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h $srcobjs
+commands.o: commands.cpp ../include/base.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h $srcobjs
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp $cmdobjs
dynamic.o: dynamic.cpp ../include/base.h ../include/dynamic.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c hashcomp.cpp
\$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhash.so hashcomp.o
-libIRCDhelper.so: helperfuncs.cpp ../include/base.h ../include/helperfuncs.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
+libIRCDhelper.so: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I/usr/local/include -L/usr/local/lib -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
\$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhelper.so helperfuncs.o
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
\$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDconfigreader.so configreader.o
-libIRCDcommands.so: commands.cpp ../include/base.h ../include/commands.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
+libIRCDcommands.so: commands.cpp ../include/base.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
\$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommands.so commands.o
{
chomp($PWD = `pwd`);
print "Usage: configure [options]
+
+*** NOTE: NON-INTERACTIVE CONFIGURE IS *NOT* SUPPORTED BY THE ***
+*** INSPIRCD DEVELOPMENT TEAM. DO NOT ASK FOR HELP REGARDING ***
+*** NON-INTERACTIVE CONFIGURE ON THE FORUMS OR ON IRC! ***
+
Options: [defaults in brackets after descriptions]
When no options are specified, interactive