X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=f332e73959314ac42ce66c3fc8d066863a6722dc;hb=3a554ef1e9be9dbcf3de3301a4a6c2938d643bea;hp=8cc7c78559c54aa785473b4ae3eb48bc7b25bde3;hpb=32c1599c2180214e8c4d1684633b2e48f069a273;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 8cc7c7855..f332e7395 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # InspIRCd Configuration Script # -# Copyright 2003 The ChatSpike Development Team +# Copyright 2002-2006 The ChatSpike Development Team # # # @@ -12,18 +12,20 @@ # ######################################## + +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,9 +46,10 @@ 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 { update(); }, - 'update' => sub { modupdate(); }, + 'modupdate' => sub { modupdate(); }, + 'update' => sub { update(); }, 'svnupdate' => sub { svnupdate(); }, 'clean' => sub { clean(); }, ); @@ -58,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) || @@ -76,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) || @@ -131,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} = "-g"; # Optimisation Flag +} +else { - $config{OPTIMISATI} = "-O" . $opt_optimise; - $config{OPTIMITEMP} = $opt_optimise; + $config{OPTIMISATI} = ""; # DEBUGGING OFF! } + $config{NICK_LENGT} = "31"; # Default Nick Length if (defined $opt_nick_length) { @@ -244,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 "") { @@ -291,6 +299,9 @@ sub clean 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* @@ -300,6 +311,12 @@ sub 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); @@ -310,6 +327,9 @@ sub update 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* @@ -346,11 +366,10 @@ sub 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) { @@ -462,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\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)"; @@ -595,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 @@ -614,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"; } @@ -813,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 = ); - 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"; @@ -864,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"; @@ -872,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, "$file"); @@ -1379,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 () { + if ($_ =~ /^\/\* \$ModDep: (.+) \*\/$/) { + close(FLAGS); + return $1; + } + } + close(FLAGS); + return undef; } sub resolve_directory { @@ -1470,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 <