summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-09 20:56:44 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-09 20:56:44 +0000
commit8399a0bede79afd8f8a7cb23a4ded974584d437a (patch)
treee6251fa20dcbf07046730bb92e26142ca5abf811 /configure
parent5f5d2c12315effeeee24637266a25a814b9fdd73 (diff)
Basics of kqueue() implementation for socket engine
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1348 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure33
1 files changed, 25 insertions, 8 deletions
diff --git a/configure b/configure
index f33a8d503..0d8b13146 100755
--- a/configure
+++ b/configure
@@ -27,6 +27,7 @@ $config{CHAN_LENGT} = "64"; # Default Chan
$config{MAX_CHANNE} = "20"; # Default Max. Channels per user..
$config{MAXI_MODES} = "20"; # Default Max. Number of Modes set at once.
$config{HAS_STRLCPY} = "false"; # strlcpy Check.
+$config{USE_KQUEUE} = "false"; # kqueue enabled
chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit
chomp($config{GCCVER} = `gcc -dumpversion | cut -c 1`); # Major GCC Version
chomp($config{GCC34} = `gcc -dumpversion | cut -c 3`); # Minor GCC Version
@@ -122,6 +123,12 @@ dir_check("are the modules to be compiled to", "MODULE_DIR");
dir_check("is the IRCd binary to be placed", "BINARY_DIR");
dir_check("are the IRCd libraries to be placed", "LIBRARY_DIR");
+if ($config{OSNAME} =~ /BSD$/) {
+ if (yesno(0,"You are running a BSD operating system.\nWould you like to enable kqueue support?\nPlease be aware that kqueue support is\nEXPERIMENTAL and not gauranteed to work properly.\nIf you are unsure, answer no.\n\nEnable kqueue?")) {
+ $config{USE_KQUEUE} = "true";
+ }
+}
+
# File Descriptor Settings..
my $continue = 0;
while (!$continue) {
@@ -384,6 +391,9 @@ EOF
if ($config{HAS_STRLCPY} eq "true") {
print FILEHANDLE "#define HAS_STRLCPY\n";
}
+ if ($config{USE_KQUEUE} eq "true") {
+ print FILEHANDLE "#define USE_KQUEUE\n";
+ }
close(FILEHANDLE);
# Create a Modules List..
@@ -490,13 +500,20 @@ sub show_splash {
sub resolve_directory {
use File::Spec;
return File::Spec->rel2abs($_[0]);
+}
- #my $dir = $_[0];
- #my $old_dir = "";
- #my $real_dir = "";
- #getpwd($old_dir);
- #chdir($dir);
- #getpwd($real_dir);
- #chdir($old_dir);
- #return $real_dir;
+sub yesno {
+ my ($default,$prompt) = @_;
+ if (!$default) {
+ print "$prompt [\033[1;32mn\033[0m] ";
+ chomp($tmp = <STDIN>);
+ return ($tmp =~ /^y/i);
+
+ }
+ else {
+ print "$prompt [\033[1;32my\033[0m] ";
+ chomp($tmp = <STDIN>);
+ return (($tmp eq "") || ($tmp =~ /^y/i));
+ }
+ return 0;
}