X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=2c2c4bd9b21644d8758363f8710dc1d78045c81f;hb=22a080c8f00ce9df421d77a9e0e5011470bf1276;hp=184d5b389bb8ee8987dae3ed7e19a7eaa67bd2a0;hpb=aa5ff42284dc5af948f556bf169008fa2991ef84;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 184d5b389..2c2c4bd9b 100755 --- a/configure +++ b/configure @@ -25,7 +25,7 @@ GetOptions ( '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, + 'with-max-clients=i' => \$opt_maxclients, 'enable-epoll' => \$opt_epoll, 'enable-kqueue' => \$opt_kqueue, 'disable-epoll' => \$opt_noepoll, @@ -209,7 +209,7 @@ $config{STATIC_LINK} = "no"; # are doing static modules? chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`); # FD Limit chomp($config{MAX_DESCRIPTORS} = `sh -c \"ulimit -n\"`); # Hard FD Limit chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version -chomp($config{OSNAME} = `uname`); # Operating System Name +$config{OSNAME} = $^O; # Operating System Name $config{CC} = "g++"; # C++ compiler if (defined $opt_cc) { @@ -264,23 +264,10 @@ if ($config{GCCVER} eq "") { # Keep my dynamic module experiments here for later # concideration! -if ($config{OSNAME} =~ /CYGWIN/) +if ($config{OSNAME} =~ /CYGWIN/i) { $config{OSNAME} = "CYG-STATIC"; } -elsif($config{OSNAME} =~ /^MINGW32/) -{ - $config{OSNAME} = "MINGW32"; -} -elsif ((!$config{OSNAME}) || ($config{OSNAME} eq "")) -{ - chomp($config{OSNAME} = `/usr/bin/uname`); - - if((!$config{OSNAME}) || ($config{OSNAME} eq "")) - { - $config{OSNAME} = "Unknown"; - } -} if (!$config{MAX_CLIENT_T}) { $config{MAX_CLIENT_T} = 1024; # Set a reasonable 'Default' @@ -292,9 +279,7 @@ getmodules(); sub clean { - if ($arg eq "-clean") { - system("rm -rf .config.cache"); - } + system("rm -rf .config.cache"); } sub update @@ -481,7 +466,7 @@ if (($config{HAS_OPENSSL}) && (($config{HAS_OPENSSL} >= 0.8) || ($config{HAS_OPE if ($interactive) { system("clear"); - chomp($wholeos = `uname -sr`); + $wholeos = $^O; my $rev = getrevision(); # Display Introduction Message.. @@ -1029,7 +1014,7 @@ sub dir_check { # Convert it to a full path.. $var = resolve_directory($ENV{HOME} . "/" . $1); } - elsif ((($config{OSNAME} == "MINGW32") and ($var !~ /^[A-Z]{1}:\\.*/)) and (substr($var,0,1) ne "/")) + elsif ((($config{OSNAME} =~ /MINGW32/i) and ($var !~ /^[A-Z]{1}:\\.*/)) and (substr($var,0,1) ne "/")) { # Assume relative Path was given.. fill in the rest. $var = $this . "/$var"; @@ -1069,23 +1054,25 @@ sub dir_check { } sub getosflags { - if ($config{OSNAME} =~ /BSD$/) { - $config{LDLIBS} = "-lstdc++"; - $config{FLAGS} = "-fno-strict-aliasing -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} =~ /OpenBSD/i) { $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 - } - return "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 } - return $config{OSNAME}; - } else { + return "OpenBSD"; + } + + if ($config{OSNAME} =~ /Linux/i) { $config{LDLIBS} = "-ldl -lstdc++"; $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}"; $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS}); @@ -1106,26 +1093,28 @@ sub getosflags { return "Cygwin-Static"; } $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS}); - return "Linux"; } - if ($config{OSNAME} =~ /SunOS/) + if ($config{OSNAME} =~ /SunOS/i) { # solaris/sunos needs these # socket = bsd sockets api # 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") + if($config{OSNAME} =~ /MINGW32/i) { # All code is position-independent on windows $config{FLAGS} =~ s/-fPIC //; return "MinGW"; } + + return $config{OSNAME}; } sub is_dir { @@ -1218,17 +1207,17 @@ sub writefiles { #define SYSTEM "$incos" #define MAXBUF 514 EOF - if ($config{OSNAME} =~ /SunOS/) { + if ($config{OSNAME} =~ /SunOS/i) { print FILEHANDLE "#define IS_SOLARIS\n"; } - if ($config{OSNAME} =~ /CYGWIN/) { + if ($config{OSNAME} =~ /CYGWIN/i) { print FILEHANDLE "#define IS_CYGWIN\n"; print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n"; } - if ($config{OSNAME} eq "MINGW32") { + if ($config{OSNAME} =~ /MINGW32/i) { print FILEHANDLE "#define IS_MINGW\n"; } - if ($config{OSNAME} eq "CYG-STATIC") { + if ($config{OSNAME} =~ /CYG-STATIC/i) { print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n"; } if ($config{STATIC_LINK} eq "yes") { @@ -1305,7 +1294,7 @@ EOF my $file = ""; my $exe = "inspircd"; - if ($config{OSNAME} =~ /CYGWIN/) { + if ($config{OSNAME} =~ /CYGWIN/i) { $exe = "inspircd.exe"; } @@ -1363,7 +1352,7 @@ EOF print "Writing static-build \033[1;32msrc/Makefile\033[0m\n"; write_static_makefile(); write_static_modules_makefile(); - } elsif ($config{OSNAME} =~ /CYGWIN/) { + } elsif ($config{OSNAME} =~ /CYGWIN/i) { print "Writing cygwin-build \033[1;32msrc/Makefile\033[0m\n"; write_static_makefile(); write_dynamic_modules_makefile(); @@ -1532,7 +1521,7 @@ sub write_dynamic_modules_makefile { open(FILEHANDLE, ">src/modules/Makefile"); my $extra = ""; - if ($config{OSNAME} =~ /CYGWIN/) { + if ($config{OSNAME} =~ /CYGWIN/i) { $extra = "../inspircd.dll.a"; } @@ -1633,7 +1622,7 @@ elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) { # make this work :) ### - if ($config{OSNAME} =~ /CYGWIN/) { + if ($config{OSNAME} =~ /CYGWIN/i) { print FH <