summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-10 16:30:52 +0000
committerfrostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-10 16:30:52 +0000
commitfc084d5ffa982eaf0143c4350b66e3f61ae110e5 (patch)
tree47aa451afe8fbabd374ea02d23bf4e2ca0492506
parent2d5b44e4275571e8d56bb503124b6752f090629d (diff)
Added Cache support for the KQueue Question
Fixed Optimisations not being set. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1357 e03df62e-2008-0410-955e-edbf42e46eb7
-rwxr-xr-xconfigure52
1 files changed, 24 insertions, 28 deletions
diff --git a/configure b/configure
index 5a8f0e7bc..f02392c0d 100755
--- a/configure
+++ b/configure
@@ -27,7 +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
+$config{USE_KQUEUE} = "n"; # 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
@@ -124,13 +124,7 @@ 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";
- }
- else
- {
- $config{USE_KQUEUE} = "false";
- }
+ yesno(USE_KQUEUE,"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?");
}
# File Descriptor Settings..
@@ -204,15 +198,19 @@ 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 a) Dont enter a number, or b) Enter a value outside the range.\n";
-print "[\033[1;32m0\033[0m] -> ";
+print "[\033[1;32m$config{OPTIMITEMP}\033[0m] -> ";
chomp($var = <STDIN>);
-if ($var == 1) {
+if ($var eq "") {
+ $var = $config{OPTIMITEMP};
+}
+
+if ($var eq "1") {
$config{OPTIMITEMP} = 1;
$config{OPTIMISATI} = "-O";
-} elsif ($var == 2) {
+} elsif ($var eq "2") {
$config{OPTIMITEMP} = 2;
$config{OPTIMISATI} = "-O2";
-} elsif ($var == 3) {
+} elsif ($var eq "3") {
$config{OPTIMITEMP} = 3;
$config{OPTIMISATI} = "-O3";
} else {
@@ -322,11 +320,11 @@ sub dir_check {
sub getosflags {
if ($config{OSNAME} eq "FreeBSD") {
$config{LDLIBS} = "-Ldl";
- $config{FLAGS} = "-fPIC -frtti $OPTIMISATI -Woverloaded-virtual -g";
+ $config{FLAGS} = "-fPIC -frtti $OPTIMISATI -Woverloaded-virtual $config{OPTIMISATI}";
$config{MAKEPROG} = "gmake";
} else {
$config{LDLIBS} = "-ldl";
- $config{FLAGS} = "-fPIC -frtti $OPTIMISATI -Woverloaded-virtual -g";
+ $config{FLAGS} = "-fPIC -frtti $OPTIMISATI -Woverloaded-virtual $config{OPTIMISATI}";
$config{MAKEPROG} = "make";
}
}
@@ -395,7 +393,7 @@ EOF
if ($config{HAS_STRLCPY} eq "true") {
print FILEHANDLE "#define HAS_STRLCPY\n";
}
- if ($config{USE_KQUEUE} eq "true") {
+ if ($config{USE_KQUEUE} eq "y") {
print FILEHANDLE "#define USE_KQUEUE\n";
}
close(FILEHANDLE);
@@ -507,17 +505,15 @@ sub resolve_directory {
}
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;
+ my ($flag,$prompt) = @_;
+ print "$prompt [\033[1;32m$config{$flag}\033[0m] -> ";
+ chomp($tmp = <STDIN>);
+ if ($tmp eq "") { $tmp = $config{$flag} }
+
+ if (($tmp eq "") || ($tmp =~ /^y/i)) {
+ $config{$flag} = "y";
+ } else {
+ $config{$flag} = "n";
+ }
+ return;
}