]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Remove global namespacing, makes modules compile FASTAH. Also massive update on heade...
[user/henk/code/inspircd.git] / configure
index 86dbc444e0660240d734ef5c8104b09e3990ef18..f332e73959314ac42ce66c3fc8d066863a6722dc 100755 (executable)
--- a/configure
+++ b/configure
@@ -2,7 +2,7 @@
 
 # InspIRCd Configuration Script
 #
-# Copyright 2003 The ChatSpike Development Team
+# Copyright 2002-2006 The ChatSpike Development Team
 # <brain@chatspike.net>
 # <Craig@chatspike.net>
 #
 #
 ########################################
 
+
+require 5.6.0;
 use Cwd;
 use Getopt::Long;
 
 GetOptions (
        'enable-gnutls' => \$opt_use_gnutls,
        'enable-openssl' => \$opt_use_openssl,
+       'disable-interactive' => \$opt_nointeractive,
        'with-nick-length=i' => \$opt_nick_length,
        'with-channel-length=i' => \$opt_chan_length,
        '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,
@@ -44,7 +46,12 @@ GetOptions (
        'module-dir=s' => \$opt_module_dir,
        'binary-dir=s' => \$opt_binary_dir,
        'library-dir=s' => \$opt_library_dir,
+       'disable-debuginfo' => sub { $opt_disable_debug = 1 },
        'help'  => sub { showhelp(); },
+       'modupdate' => sub { modupdate(); },
+       'update' => sub { update(); },
+       'svnupdate' => sub { svnupdate(); },
+       'clean' => sub { clean(); },
 );
 
 my $non_interactive = (
@@ -54,6 +61,7 @@ my $non_interactive = (
        (defined $opt_module_dir) ||
        (defined $opt_base_dir) ||
        (defined $opt_binary_dir) ||
+       (defined $opt_nointeractive) ||
        (defined $opt_away) ||
        (defined $opt_gecos) ||
        (defined $opt_kick) ||
@@ -72,7 +80,6 @@ my $non_interactive = (
        (defined $opt_opermaxchans) ||
        (defined $opt_chan_length) ||
        (defined $opt_nick_length) ||
-       (defined $opt_optimise) ||
        (defined $opt_use_openssl) ||
        (defined $opt_nokqueue) ||
        (defined $opt_noepoll) ||
@@ -127,13 +134,18 @@ if (defined $opt_use_openssl)
 {
        $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)
+if (!defined $opt_disable_debug)
 {
-       $config{OPTIMISATI} = "-O" . $opt_optimise;
-       $config{OPTIMITEMP} = $opt_optimise;
+       $config{OPTIMISATI}         = "-g";                                     # Optimisation Flag
 }
+else
+{
+       $config{OPTIMISATI}         = "";                                       # DEBUGGING OFF!
+}
+
 $config{NICK_LENGT}         = "31";                                            # Default Nick Length
 if (defined $opt_nick_length)
 {
@@ -240,7 +252,7 @@ if (defined $opt_away)
 
 $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 "") {
@@ -278,12 +290,18 @@ if (!$config{MAX_CLIENT_T}) {
 # Get and Set some important vars..
 getmodules();
 
-my $arg = $ARGV[0];                                            # Do Some Argument Checks..
-if ($arg eq "-clean") {
-       system("rm -rf .config.cache");
-}               # Remove the config.cache file.
+sub clean
+{
+       if ($arg eq "-clean") {
+               system("rm -rf .config.cache");
+       }
+}
 
-if ($arg eq "-update") {
+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*
@@ -293,6 +311,12 @@ if ($arg eq "-update") {
                # We've Loaded the cache file and all our variables..
                print "Updating Files..\n";
                getosflags();
+               if ($opt_disable_debug == 1)
+               {
+                       print "Disabling debug information (-g).\n";
+                       $config{OPTIMISATI} = "";
+                       getosflags();
+               }
                $has_epoll = $config{HAS_EPOLL};
                $has_kqueue = $config{HAS_KQUEUE};
                writefiles(1);
@@ -301,7 +325,11 @@ if ($arg eq "-update") {
        }
 }
 
-if ($arg eq "-modupdate") {
+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*
@@ -321,7 +349,8 @@ if ($arg eq "-modupdate") {
 
 
 
-if ($arg eq "-svnupdate") {
+sub svnupdate
+{
        my $fail = 0;
        open(FH,"<.svn/entries") or $fail = 1;
        if ($fail) {
@@ -337,11 +366,10 @@ if ($arg eq "-svnupdate") {
 }
 
 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)
 {
@@ -453,26 +481,24 @@ if (($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL} >= 0.8) || ($config{HAS_OPE
 if ($interactive)
 {
        system("clear");
-       # Display Splash Logo..
-       show_splash();
-       chomp($wholeos = `uname -mnr`);
+       chomp($wholeos = `uname -sr`);
 
        my $rev = getrevision();
        # Display Introduction Message..
        print "
-Welcome to the InspIRCd Configuration program!
+Welcome to the \033[1mInspIRCd\033[0m Configuration program! (\033[1minteractive mode\033[0m)
+\033[1mPackage maintainers: Type ./configure --help for non-interactive help\033[0m
 
 *** If you are unsure of any of these values, leave it blank for    ***
 *** standard settings that will work, and your server will run      ***
-*** using them. If you are running this server as part of a         ***
-*** larger network, you must consult with your network admins       ***
-*** for the proper values to use, or server links will be unstable! ***
+*** using them. Please consult your IRC network admin if in doubt.  ***
 
 Press \033[1m<RETURN>\033[0m to accept the default for any option, or enter
 a new value. Please note: You will \033[1mHAVE\033[0m to read the docs
 dir, otherwise you won't have a config file!
 
-Your operating system is: \033[1;32m$config{OSNAME}\033[0m ($wholeos), fdmax: $config{MAX_CLIENT_T}
+Your operating system is: \033[1;32m$config{OSNAME}\033[0m ($wholeos)
+Maximum file descriptors: \033[1;32m$config{MAX_CLIENT_T}\033[0m
 Your InspIRCd revision ID is \033[1;32mr$rev\033[0m";
        if ($rev eq "r0") {
                print " (Non-SVN build)";
@@ -586,7 +612,7 @@ should NOT be used. You should probably specify a newer compiler.\n\n";
                        $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
@@ -605,6 +631,7 @@ you wish to do this? It may cause the IRCd to malfunction [y/n]
                }
                # If we get here, we should be good to go.
                $config{MAX_CLIENT} = $var;
+               $config{MAX_DESCRIPTORS} = $var;
                $continue = 1;
                print "\n";
        }
@@ -804,37 +831,6 @@ you wish to do this? It may cause the IRCd to malfunction [y/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";
@@ -855,7 +851,8 @@ print "\033[0mMax kick length:\033[1;32m\t\t$config{MAX_KICK}\033[0m\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";
@@ -863,6 +860,17 @@ print "\033[0mIPv6 to IPv4 Links:\033[1;32m\t\t$config{SUPPORT_IP6LINKS}\033[0m\
 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;
@@ -875,13 +883,15 @@ if ($config{USE_GNUTLS} eq "y") {
                chdir("../..");
        }
        getmodules();
-       $failed = 0;
-       open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
-       close(TMP);
-       open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
-       close(TMP);
-       if ($failed) {
-               print "SSL Certificates Not found, Generating.. \n\n
+       if ($interactive)
+       {
+               $failed = 0;
+               open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
+               close(TMP);
+               open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
+               close(TMP);
+               if ($failed) {
+                       print "SSL Certificates Not found, Generating.. \n\n
 *************************************************************
 * Generating the Private Key may take some time, go grab a  *
 * Coffee. Even better, to generate some more entropy if it  *
@@ -889,15 +899,20 @@ if ($config{USE_GNUTLS} eq "y") {
 * few times and get that HD going :) Then answer the        *
 * Questions which follow. If you are unsure, just hit enter *
 *************************************************************\n\n";
-               system("certtool --generate-privkey --outfile key.pem");
-               system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem");
-               print "\nCertificate generation complete, copying to config directory... ";
-               system("mv key.pem $config{CONFIG_DIR}/key.pem");
-               system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
-               print "Done.\n\n";
-       } else {
-               print "SSL Certificates found, skipping.\n\n"
-       }       
+                       system("certtool --generate-privkey --outfile key.pem");
+                       system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem");
+                       print "\nCertificate generation complete, copying to config directory... ";
+                       system("mv key.pem $config{CONFIG_DIR}/key.pem");
+                       system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
+                       print "Done.\n\n";
+               } else {
+                       print "SSL Certificates found, skipping.\n\n"
+               }
+       }
+       else
+       {
+               print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
+       }
 } elsif ($config{USE_OPENSSL} eq "y") {
        $failed = 0;
        open(TMP, "<src/modules/m_ssl_openssl.cpp") or $failed = 1;
@@ -911,25 +926,32 @@ if ($config{USE_GNUTLS} eq "y") {
        }
        getmodules();
        $failed = 0;
-       open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
-       close(TMP);
-       open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
-       close(TMP);
-       if ($failed) {
-               print "SSL Certificates Not found, Generating.. \n\n
+       if ($interactive)
+       {
+               open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1;
+               close(TMP);
+               open(TMP, "<$config{CONFIG_DIR}/cert.pem") or $failed = 1;
+               close(TMP);
+               if ($failed) {
+                       print "SSL Certificates Not found, Generating.. \n\n
 *************************************************************
 * Generating the certificates may take some time, go grab a *
 * coffee, or something.                                     *
 *************************************************************\n\n";
-               system("openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem");
-               system("openssl dhparam -out dhparams.pem 1024");
-               print "\nCertificate generation complete, copying to config directory... ";
-               system("mv key.pem $config{CONFIG_DIR}/key.pem");
-               system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
-               system("mv dhparams.pem $config{CONFIG_DIR}/dhparams.pem");
-               print "Done.\n\n";
-       } else {
-               print "SSL Certificates found, skipping.\n\n"
+                       system("openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem");
+                       system("openssl dhparam -out dhparams.pem 1024");
+                       print "\nCertificate generation complete, copying to config directory... ";
+                       system("mv key.pem $config{CONFIG_DIR}/key.pem");
+                       system("mv cert.pem $config{CONFIG_DIR}/cert.pem");
+                       system("mv dhparams.pem $config{CONFIG_DIR}/dhparams.pem");
+                       print "Done.\n\n";
+               } else {
+                       print "SSL Certificates found, skipping.\n\n"
+               }
+       }
+       else
+       {
+               print "Skipping SSL certificate generation\nin non-interactive mode.\n\n";
        }
 }
 if (($config{USE_GNUTLS} eq "n") && ($config{USE_OPENSSL} eq "n")) {
@@ -1047,37 +1069,45 @@ sub dir_check {
 }
 
 sub getosflags {
-       if ($config{OSNAME} =~ /BSD$/) {
-               $config{LDLIBS} = "-lstdc++";
-               $config{FLAGS}  = "-fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
+
+       $config{LDLIBS} = "-lstdc++";
+       $config{FLAGS}  = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
+       $config{MAKEPROG} = "make";
+
+       if ($config{OSNAME} eq "OpenBSD") {
                $config{MAKEPROG} = "gmake";
-               if ($config{OSNAME} eq "OpenBSD") {
-                       chomp($foo = `eg++ -dumpversion | cut -c 1`);
-                       # theyre running the package version of gcc (eg++)... detect it and set up its version numbers.
-                       # if theyre not running this, configure lets the build continue but they probably wont manage to
-                       # compile as this standard version is 2.95.3!
-                       if ($foo ne "") {
-                               $config{CC} = "eg++";
-                               chomp($config{GCCVER}       = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path
-                       }
+               chomp($foo = `eg++ -dumpversion | cut -c 1`);
+               # theyre running the package version of gcc (eg++)... detect it and set up its version numbers.
+               # if theyre not running this, configure lets the build continue but they probably wont manage to
+               # compile as this standard version is 2.95.3!
+               if ($foo ne "") {
+                       $config{CC} = "eg++";
+                       chomp($config{GCCVER}       = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path
                }
-       } else {
+               return "OpenBSD";
+       }
+
+       if ($config{OSNAME} =~ /Linux/) {
                $config{LDLIBS} = "-ldl -lstdc++";
-               $config{FLAGS}  = "-fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
+               $config{FLAGS}  = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
+               $config{FLAGS}  .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
                $config{MAKEPROG} = "make";
                if ($config{OSNAME} =~ /CYGWIN/) {
-                       $config{FLAGS}  = "-Wall -Woverloaded-virtual $config{OPTIMISATI}";
+                       $config{FLAGS}  = "-fno-strict-aliasing -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{FLAGS} = "-fno-strict-aliasing -Wall -Woverloaded-virtual $config{OPTIMISATI}";
                        $config{LDLIBS} = "";
                        $config{MAKEPROG} = "/usr/bin/make";
                        $config{MAKEORDER} = "mods ircd";
                        $config{STATICLIBS} = "modules/mods.a";
                        $config{STATIC_LINK} = "yes";
+                       return "Cygwin-Static";
                }
+               $config{FLAGS}  .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
        }
        
        if ($config{OSNAME} =~ /SunOS/)
@@ -1087,14 +1117,19 @@ sub getosflags {
                # nsl = dns stuff
                # rt = POSIX realtime extensions
                # resolv = inet_aton only (why isnt this in nsl?!)
+               $config{MAKEPROG} = "gmake";
                $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";
        }
+
+       return $config{OSNAME};
 }
 
 sub is_dir {
@@ -1280,6 +1315,18 @@ EOF
 
        opendir(DIRHANDLE, $this);
 
+       # Do this once here, and cache it in the .*.inc files,
+       # rather than attempting to read src/version.sh from
+       # compiled code -- we might not have the source to hand.
+       # Fix for bug#177 by Brain.
+
+       chomp(my $version = `sh ./src/version.sh`);
+       chomp(my $revision = getrevision());
+       $version = "$version(r$revision)";
+
+       # We can actually parse any file starting with . and ending with .inc,
+       # but right now we only parse .inspircd.inc to form './inspircd'
+
        foreach $name (sort readdir(DIRHANDLE)) {
                if ($name =~ /^\.(.+)\.inc$/) {
                        $file = $1;
@@ -1304,6 +1351,7 @@ EOF
                        $tmp =~ s/\@EXECUTABLE\@/$exe/;
                        $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
                        $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
+                       $tmp =~ s/\@VERSION\@/$version/;
 
                        print "Writing \033[1;32m$file\033[0m\n";
                        open(FILEHANDLE, ">$file");
@@ -1356,15 +1404,17 @@ sub getlinkerflags {
        return undef;
 }
 
-sub show_splash {
-  print "'\033[1;33m####\033[0m:'\033[1;33m##\033[0m::: \033[1;33m##\033[0m::'\033[1;33m######\033[0m::'\033[1;33m########\033[0m::'\033[1;33m####\033[0m:'\033[1;33m########\033[0m:::'\033[1;33m######\033[0m::'\033[1;33m########\033[0m::\n";
-  print ". \033[1;33m##\033[0m:: \033[1;33m###\033[0m:: \033[1;33m##\033[0m:'\033[1;33m##\033[0m... \033[1;33m##\033[0m: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:. \033[1;33m##\033[0m:: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:'\033[1;33m##\033[0m... \033[1;33m##\033[0m: \033[1;33m##\033[0m.... \033[1;33m##\033[0m:\n";
-  print ": \033[1;33m##\033[0m:: \033[1;33m####\033[0m: \033[1;33m##\033[0m: \033[1;33m##\033[0m:::..:: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:: \033[1;33m##\033[0m:: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m: \033[1;33m##\033[0m:::..:: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:\n";
-  print ": \033[1;33m##\033[0m:: \033[1;33m##\033[0m \033[1;33m##\033[0m \033[1;33m##\033[0m:. \033[1;33m######\033[0m:: \033[1;33m########\033[0m::: \033[1;33m##\033[0m:: \033[1;33m########\033[0m:: \033[1;33m##\033[0m::::::: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:\n";
-  print ": \033[1;33m##\033[0m:: \033[1;33m##\033[0m. \033[1;33m####\033[0m::..... \033[1;33m##\033[0m: \033[1;33m##\033[0m.....:::: \033[1;33m##\033[0m:: \033[1;33m##\033[0m.. \033[1;33m##\033[0m::: \033[1;33m##\033[0m::::::: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:\n";
-  print ": \033[1;33m##\033[0m:: \033[1;33m##\033[0m:. \033[1;33m###\033[0m:'\033[1;33m##\033[0m::: \033[1;33m##\033[0m: \033[1;33m##\033[0m::::::::: \033[1;33m##\033[0m:: \033[1;33m##\033[0m::. \033[1;33m##\033[0m:: \033[1;33m##\033[0m::: \033[1;33m##\033[0m: \033[1;33m##\033[0m:::: \033[1;33m##\033[0m:\n";
-  print "'\033[1;33m####\033[0m: \033[1;33m##\033[0m::. \033[1;33m##\033[0m:. \033[1;33m######\033[0m:: \033[1;33m##\033[0m::::::::'\033[1;33m####\033[0m: \033[1;33m##\033[0m:::. \033[1;33m##\033[0m:. \033[1;33m######\033[0m:: \033[1;33m########\033[0m::\n";
-  print "\033[0m\033[0m....::..::::..:::......:::..:::::::::....::..:::::..:::......:::........:::\n\n";
+sub getdependencies {
+       my ($file) = @_;
+       open(FLAGS, $file);
+       while (<FLAGS>) {
+               if ($_ =~ /^\/\* \$ModDep: (.+) \*\/$/) {
+                       close(FLAGS);
+                       return $1;
+               }
+       }
+       close(FLAGS);
+       return undef;
 }
 
 sub resolve_directory {
@@ -1447,12 +1497,13 @@ HEADER
                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
 
@@ -1520,10 +1571,11 @@ EOF
        ###
        $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
+       \$(CC) -pipe \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra
 
 EOCHEESE
        $crud = $crud . "       install -m 0700 m_$i.so \$(MODPATH)\n";
@@ -1587,20 +1639,20 @@ elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
 
        if ($config{OSNAME} =~ /CYGWIN/) {
                print FH <<EOM;
-all: timer.o aes.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o snomasks.o inspircd.exe
+all: timer.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o snomasks.o inspircd.exe
 
 inspircd.exe: inspircd.dll.a
        \$(CC) -o \$@ \$^
 
-inspircd.dll inspircd.dll.a: inspircd.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs  commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o aes.o timer.o snomasks.o
+inspircd.dll inspircd.dll.a: inspircd.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs  commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o timer.o snomasks.o
        \$(CC) -shared -Wl,--out-implib=inspircd.dll.a -o inspircd.dll \$^
 EOM
        } else {
                print FH <<EOM;
-all: timer.o aes.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o snomasks.o \$(MODULES) inspircd.exe
+all: timer.o command_parse.o cull_list.o userprocess.o socketengine.o socket.o hashcomp.o channels.o mode.o xline.o inspstring.o dns.o base.o configreader.o inspsocket.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o snomasks.o \$(MODULES) inspircd.exe
 
 inspircd.exe: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/base.h
-       \$(CC) -I../include \$(FLAGS) inspircd.cpp -o inspircd.exe \$(LDLIBS) channels.o mode.o xline.o inspstring.o dns.o base.o inspsocket.o configreader.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o aes.o timer.o snomasks.o modes/modeclasses.a \$(MODULES)
+       \$(CC) -I../include \$(FLAGS) inspircd.cpp -o inspircd.exe \$(LDLIBS) channels.o mode.o xline.o inspstring.o dns.o base.o inspsocket.o configreader.o $cmdobjs commands.o dynamic.o users.o modules.o wildcard.o helperfuncs.o hashcomp.o socket.o socketengine.o userprocess.o cull_list.o command_parse.o timer.o snomasks.o modes/modeclasses.a \$(MODULES)
 EOM
        }
 
@@ -1624,14 +1676,14 @@ socketengine.o: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h
 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
-       \$(CC) -pipe -I/usr/local/include -L/usr/local/lib -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
+helperfuncs.o: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
+       \$(CC) -pipe -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
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
 
 mode.o: mode.cpp ../include/base.h ../include/mode.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h \$(RELCPPFILES) modes/modeclasses.a
-       \${MAKE} -C "modes" DIRNAME="src/modes" \$(MAKEARGS)
+       \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS)
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
 
 xline.o: xline.cpp ../include/base.h ../include/xline.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
@@ -1649,7 +1701,7 @@ base.o: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_conf
 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
@@ -1670,9 +1722,6 @@ socket.o: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.
 inspsocket.o: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
 
-aes.o: aes.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
-       \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c aes.cpp
-
 timer.o: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
 
@@ -1728,110 +1777,106 @@ CXXFLAGS = -I../include \${FLAGS}
 CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
 RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
 
-all: libIRCDtimer.so libIRCDaes.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so libIRCDsnomasks.so inspircd
+all: libIRCDtimer.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so libIRCDsnomasks.so inspircd
 
-inspircd: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/socket.h libIRCDtimer.so libIRCDaes.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDsnomasks.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so
-       \$(CC) -I../include $extra -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so libIRCDsocketengine.so libIRCDuserprocess.so libIRCDcull_list.so libIRCDcommand_parse.so libIRCDaes.so libIRCDtimer.so libIRCDsnomasks.so
+inspircd: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/socket.h libIRCDtimer.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDsnomasks.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so
+       \$(CC) -pipe -I../include $extra -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so libIRCDsocketengine.so libIRCDuserprocess.so libIRCDcull_list.so libIRCDcommand_parse.so libIRCDtimer.so libIRCDsnomasks.so
 
 libIRCDsocketengine.so: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocketengine.so socketengine.o $se.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocketengine.so socketengine.o $se.o
 
 libIRCDsnomasks.so: snomasks.cpp ../include/base.h ../include/hashcomp.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/channels.h
-        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
-         \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsnomasks.so snomasks.o
+       \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c snomasks.cpp
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsnomasks.so snomasks.o
 
 libIRCDcommand_parse.so: command_parse.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 command_parse.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommand_parse.so command_parse.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommand_parse.so command_parse.o
 
 libIRCDcull_list.so: cull_list.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/users.h ../include/channels.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cull_list.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcull_list.so cull_list.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcull_list.so cull_list.o
 
 libIRCDuserprocess.so: userprocess.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c userprocess.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDuserprocess.so userprocess.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDuserprocess.so userprocess.o
 
 libIRCDhash.so: 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
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhash.so hashcomp.o
+       \$(CC) -pipe -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
-       \$(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
+libIRCDhelper.so: helperfuncs.cpp ../include/base.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
+       \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c helperfuncs.cpp
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDhelper.so helperfuncs.o
 
 libIRCDchannels.so: channels.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c channels.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDchannels.so channels.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDchannels.so channels.o
 
 libIRCDmode.so: mode.cpp ../include/base.h ../include/mode.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h \$(RELCPPFILES)
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c mode.cpp
-       \${MAKE} -C "modes" DIRNAME="src/modes" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmode.so mode.o modes/modeclasses.a
+       \${MAKE} -C "modes" DIRNAME="src/modes" CC="\$(CC)" \$(MAKEARGS) CPPFILES="\$(CPPFILES)"
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmode.so mode.o modes/modeclasses.a
 
 libIRCDxline.so: xline.cpp ../include/base.h ../include/xline.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 xline.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDxline.so xline.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDxline.so xline.o
 
 libIRCDstring.so: inspstring.cpp ../include/base.h ../include/inspstring.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 inspstring.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDstring.so inspstring.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDstring.so inspstring.o
 
 libIRCDasyncdns.so: dns.cpp ../include/base.h ../include/dns.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 dns.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDasyncdns.so dns.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDasyncdns.so dns.o
 
 libIRCDbase.so: base.cpp ../include/base.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c base.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDbase.so base.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDbase.so base.o
 
 libIRCDconfigreader.so: 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
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDconfigreader.so configreader.o
+       \$(CC) -pipe -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
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommands.so commands.o
 
 libIRCDdynamic.so: 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 dynamic.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDdynamic.so dynamic.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDdynamic.so dynamic.o
 
 libIRCDusers.so: users.cpp ../include/base.h ../include/users.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 users.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDusers.so users.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDusers.so users.o
 
 libIRCDmodules.so: modules.cpp ../include/base.h ../include/modules.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 modules.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmodules.so modules.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDmodules.so modules.o
 
 libIRCDwildcard.so: wildcard.cpp ../include/base.h ../include/wildcard.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 wildcard.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDwildcard.so wildcard.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDwildcard.so wildcard.o
 
 libIRCDsocket.so: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocket.so socket.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDsocket.so socket.o
 
 libIRCDinspsocket.so: inspsocket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c inspsocket.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDinspsocket.so inspsocket.o
-
-libIRCDaes.so: aes.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
-       \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c aes.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDaes.so aes.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDinspsocket.so inspsocket.o
 
 libIRCDtimer.so: timer.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c timer.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDtimer.so timer.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDtimer.so timer.o
 
 EOM
        foreach my $cmd (@cmdlist) {
                print FH <<ITEM;
 cmd_$cmd.so: cmd_$cmd.cpp ../include/base.h ../include/modules.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h ../include/commands/cmd_$cmd.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o cmd_$cmd.so cmd_$cmd.o
+       \$(CC) -pipe -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o cmd_$cmd.so cmd_$cmd.o
 
 ITEM
        }
@@ -1840,7 +1885,13 @@ ITEM
 
 sub showhelp
 {
+       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
@@ -1849,21 +1900,20 @@ any required values manually. If one or more
 options are specified, non-interactive configuration
 is started, and any omitted values are defaulted.
 
-Interactive configuration and reconfiguration:
-
-  -update                      Update makefiles
-  -modupdate                   Detect new modules
-  -svnupdate {rebuild}         Update working copy
-                               {and optionally rebuild}
-  -clean                       Remove .config.cache
-
-Non-interactive and initial configuration:
+Arguments with a single \"-\" symbol, as in
+InspIRCd 1.0.x, are also allowed.
 
+  --disable-interactive        Sets no options intself, but
+                               will disable any interactive prompting.
+  --update                     Update makefiles and dependencies
+  --modupdate                  Detect new modules and write makefiles
+  --svnupdate {rebuild}        Update working copy via subversion
+                               {and optionally rebuild it}
+  --clean                      Remove .config.cache file and go interactive
   --enable-gnutls              Enable GnuTLS module [no]
   --enable-openssl             Enable OpenSSL module [no]
   --with-nick-length=[n]       Specify max. nick length [32]
-  --with-channel-length=[n]    Specify max. channel length
-                               [64]
+  --with-channel-length=[n]    Specify max. channel length [64]
   --with-max-channels=[n]      Specify max. number of channels
                                a normal user may join [20]
   --with-max-oper-channels=[n] Specify max. number of channels
@@ -1871,10 +1921,8 @@ Non-interactive and initial configuration:
   --with-max-clients=[n]       Specify maximum number of users
                                which may connect locally
   --enable-optimization=[n]    Optimize using -O[n] gcc flag
-  --enable-epoll               Enable epoll() where supported
-                               [set]
-  --enable-kqueue              Enable kqueue() where supported
-                               [set]
+  --enable-epoll               Enable epoll() where supported [set]
+  --enable-kqueue              Enable kqueue() where supported [set]
   --disable-epoll              Do not enable epoll(), fall back
                                to select() [not set]
   --disable-kqueue             Do not enable kqueue(), fall back
@@ -1882,8 +1930,7 @@ Non-interactive and initial configuration:
   --enable-ipv6                Build ipv6 native InspIRCd [no]
   --enable-remote-ipv6         Build with ipv6 support for remote
                                servers on the network [yes]
-  --disable-remote-ipv6        No not allow remote ipv6 servers
-                               [not set]
+  --disable-remote-ipv6        Do not allow remote ipv6 servers [not set]
   --with-cc=[filename]         Use an alternative g++ binary to
                                build InspIRCd [g++]
   --with-ident-length=[n]      Specify max length of ident [12]
@@ -1894,13 +1941,20 @@ Non-interactive and initial configuration:
   --with-away-length=[n]       Specify max length of away [150]
   --with-max-modes=[n]         Specify max modes per line which
                                have parameters [20]
-  --prefix=[directory]         Base directory to install into
-                               [current directory]
-  --config-dir=[directory]     Config file directory [prefix/conf]
-  --module-dir=[directory]     Modules directory [prefix/modules]
-  --binary-dir=[directory]     Binaries directory [prefix/bin]
-  --library-dir=[directory]    Library directory [prefix/lib]
-  --help                       Show this help text
+  --prefix=[directory]         Base directory to install into (if defined,
+                               can automatically define config, module, bin
+                              and library dirs as subdirectories of prefix)
+                               [$PWD]
+  --config-dir=[directory]     Config file directory for config and SSL certs
+                               [$PWD/conf]
+  --module-dir=[directory]     Modules directory for loadable modules
+                               [$PWD/modules]
+  --binary-dir=[directory]     Binaries directory for core binary
+                               [$PWD/bin]
+  --library-dir=[directory]    Library directory for core libraries
+                               [$PWD/lib]
+  --help                       Show this help text and exit
+
 ";
        exit(0);
 }