X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=7ebe23714b2cff550c1fd49569953a4204da32d0;hb=766ef68519f7fc333476baf8a6d8914af9024612;hp=1ec70a1475b06d478bf69ce02193657d04541db0;hpb=77fdd81d49941428db7bb6e30a2abae4b2dfdaf2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 1ec70a147..7ebe23714 100755 --- a/configure +++ b/configure @@ -16,6 +16,7 @@ $this = resolve_directory($topdir); # PWD, Regardless. @modlist = (); # Declare for Module List.. %config = (); # Initiate Configuration Hash.. $config{ME} = resolve_directory($topdir); # Present Working Directory +$config{BASE_DIR} = $config{ME}; # Use CWD as 'Base' Directory. $config{CONFIG_DIR} = resolve_directory($config{ME}."/conf"); # Configuration Directory $config{MODULE_DIR} = resolve_directory($config{ME}."/modules"); # Modules Directory $config{BINARY_DIR} = resolve_directory($config{ME}."/bin"); # Binary Directory @@ -29,6 +30,7 @@ $config{MAXI_MODES} = "20"; # Default Max. $config{HAS_STRLCPY} = "false"; # strlcpy Check. $config{USE_KQUEUE} = "y"; # kqueue enabled $config{USE_EPOLL} = "y"; # epoll enabled +$config{THREADED_DNS} = "n"; # threaded dns (experimental) $config{STATIC_LINK} = "no"; # are doing static modules? chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit chomp($config{GCCVER} = `gcc -dumpversion | cut -c 1`); # Major GCC Version @@ -153,7 +155,7 @@ if (!$fail) if ($has_epoll) { my $kernel = `uname -r`; chomp($kernel); - if ($kernel !~ /2\.6/) { + if (($kernel =~ /2\.0/) || ($kernel =~ /2\.2/) || ($kernel =~ /2\.4/)) { $has_epoll = 0; } } @@ -223,6 +225,12 @@ if ($config{CHANGE_COMPILER} =~ /y/i) print "\n"; # Directory Settings.. +dir_check("do you wish to install the InspIRCd base", "BASE_DIR"); +$config{CONFIG_DIR} = resolve_directory($config{BASE_DIR}."/conf"); # Configuration Directory +$config{MODULE_DIR} = resolve_directory($config{BASE_DIR}."/modules"); # Modules Directory +$config{BINARY_DIR} = resolve_directory($config{BASE_DIR}."/bin"); # Binary Directory +$config{LIBRARY_DIR} = resolve_directory($config{BASE_DIR}."/lib"); # Library Directory + dir_check("are the configuration files", "CONFIG_DIR"); dir_check("are the modules to be compiled to", "MODULE_DIR"); dir_check("is the IRCd binary to be placed", "BINARY_DIR"); @@ -243,6 +251,9 @@ if (!$chose_hiperf) print "not to enable one. Defaulting to select() engine.\n\n"; } +yesno(THREADED_DNS,"Would you like to enable the experimental multi-threaded DNS lookup?"); +print "\n"; + print "\nThe following questions will ask you for various figures relating\n"; print "To your IRCd install. Please note that these should usually be left\n"; print "as defaults unless you have a real reason to change them. If they\n"; @@ -490,7 +501,8 @@ print "\033[0mMax away length:\033[1;32m\t\t$config{MAX_AWAY}\n"; print "\033[0mGCC Version Found:\033[1;32m\t\t$config{GCCVER}.$config{GCC34}\n"; print "\033[0mOptimatizaton 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\n"; +print "\033[0mStatic modules:\033[1;32m\t\t\t$config{STATIC_LINK}\033[0m\n"; +print "\033[0mMultithread DNS:\033[1;32m\t\t$config{THREADED_DNS}\033[0m\n\n"; makecache(); writefiles(); @@ -604,7 +616,7 @@ sub dir_check { sub getosflags { if ($config{OSNAME} =~ /BSD$/) { - $config{LDLIBS} = "-Ldl"; + $config{LDLIBS} = "-Ldl -lstdc++"; $config{FLAGS} = "-fPIC -frtti $OPTIMISATI -Wall -Woverloaded-virtual $config{OPTIMISATI}"; $config{MAKEPROG} = "gmake"; if ($config{OSNAME} eq "OpenBSD") { @@ -619,7 +631,7 @@ sub getosflags { } } } else { - $config{LDLIBS} = "-ldl"; + $config{LDLIBS} = "-ldl -lstdc++"; $config{FLAGS} = "-fPIC -frtti $OPTIMISATI -Wall -Woverloaded-virtual $config{OPTIMISATI}"; $config{MAKEPROG} = "make"; if ($config{OSNAME} =~ /CYGWIN/) { @@ -727,6 +739,9 @@ EOF if ($config{HAS_STRLCPY} eq "true") { print FILEHANDLE "#define HAS_STRLCPY\n"; } + if ($config{THREADED_DNS} =~ /y/i) { + print FILEHANDLE "#define THREADED_DNS\n"; + } my $use_hiperf = 0; if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) { print FILEHANDLE "#define USE_KQUEUE\n"; @@ -768,6 +783,9 @@ EOF } opendir(DIRHANDLE, $this); + if ($config{THREADED_DNS} =~ /y/i) { + $config{LDLIBS} = $config{LDLIBS} . " -pthread"; + } foreach $name (sort readdir(DIRHANDLE)) { if ($name =~ /^\.(.+)\.inc$/) { @@ -784,6 +802,7 @@ EOF $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/; $tmp =~ s/\@FLAGS\@/$config{FLAGS}/; $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/; + $tmp =~ s/\@BASE_DIR\@/$config{BASE_DIR}/; $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/; $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/; $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/; @@ -854,7 +873,7 @@ HEADER $flags = getcompilerflags("src/modules/m_".$i.".cpp"); if ($config{OSNAME} =~ /CYGWIN/) { print FILEHANDLE <