X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=89e310c73eb3b97ab6a22c1ba6eacf54e9d36207;hb=687531999ced9e457463b1a6de2bfcef97c6250c;hp=22855727f43d71dff8b4e256fa1c660d1b34fee4;hpb=3a6885d6a1d30f6e2eb9b1fcd20e949768267318;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 22855727f..89e310c73 100755 --- a/configure +++ b/configure @@ -12,7 +12,9 @@ # ######################################## -chomp($topdir = `pwd`); +use Cwd; + +chomp($topdir = getcwd()); $this = resolve_directory($topdir); # PWD, Regardless. @modlist = (); # Declare for Module List.. %config = (); # Initiate Configuration Hash.. @@ -38,8 +40,9 @@ $config{HAS_STDINT} = "false"; # stdint.h check $config{HAS_EXECINFO} = "0"; # execinfo.h Check. $config{USE_KQUEUE} = "y"; # kqueue enabled $config{USE_EPOLL} = "y"; # epoll enabled -$config{THREADED_DNS} = "n"; # threaded dns (experimental) +$config{THREADED_DNS} = "n"; # threaded dns $config{IPV6} = "n"; # IPv6 support (experimental) +$config{SUPPORT_IP6LINKS} = "y"; # IPv4 supporting IPv6 links (experimental) $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 @@ -62,22 +65,29 @@ $config{HAS_OPENSSL} = $1; if ($config{GCCVER} eq "") { print "g++ was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n"; - return 0; + exit; } # Minihack! Convert Cygwin to 'Cyg-Static' so i can # Keep my dynamic module experiments here for later # concideration! -if ($config{OSNAME} =~ /CYGWIN/) { +if ($config{OSNAME} =~ /CYGWIN/) +{ $config{OSNAME} = "CYG-STATIC"; } - -if ((!$config{OSNAME}) || ($config{OSNAME} eq "")) { +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 "")){ + + if((!$config{OSNAME}) || ($config{OSNAME} eq "")) + { $config{OSNAME} = "Unknown"; - } + } } if (!$config{MAX_CLIENT_T}) { @@ -360,11 +370,16 @@ 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?"); +yesno(IPV6,"Would you like to build InspIRCd with IPv6 support?"); print "\n"; -yesno(IPV6,"Would you like to enable IPv6 support?"); -print "\n"; +if ($config{IPV6} eq "y") { + print "You have chosen to build an \033[1;32mIPV6-only\033[0m server.\nTo accept IPV4 users, you must use the '::ffff:' notation of addresses.\n\n"; + $config{SUPPORT_IP6LINKS} = "y"; +} else { + yesno(SUPPORT_IP6LINKS,"You have chosen to build an \033[1;32mIPV4-only\033[0m server.\nWould you like to enable support for linking to IPV6-enabled\nInspIRCd servers which are using '::ffff:' notation?\nIf you are using a recent operating\nsystem and are unsure, answer yes."); + print "\n"; +} if (($config{HAS_GNUTLS} eq "y") && ($config{HAS_OPENSSL} eq "y")) { print "I have detected both GnuTLS and OpenSSL on your system.\n"; @@ -676,6 +691,7 @@ 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[0mMultithread DNS:\033[1;32m\t\t$config{THREADED_DNS}\033[0m\n"; print "\033[0mIPv6 Support:\033[1;32m\t\t\t$config{IPV6}\033[0m\n"; +print "\033[0mIPv6 to IPv4 Links:\033[1;32m\t\t$config{SUPPORT_IP6LINKS}\033[0m\n"; 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"; @@ -821,17 +837,20 @@ sub dir_check { # Convert it to a full path.. $var = resolve_directory($ENV{HOME} . "/" . $1); } - if (substr($var,0,1) ne "/") + elsif ((($config{OSNAME} == "MINGW32") and ($var !~ /^[A-Z]{1}:\\.*/)) and (substr($var,0,1) ne "/")) { # Assume relative Path was given.. fill in the rest. $var = $this . "/$var"; } + $var = resolve_directory($var); if (! -e $var) { print "$var does not exist. Create it?\n[\033[1;32my\033[0m] "; chomp($tmp = ); if (($tmp eq "") || ($tmp =~ /^y/i)) { # Attempt to Create the Dir.. + + print("mkdir -p \"$var\" >> /dev/null 2>&1"); $chk = system("mkdir -p \"$var\" >> /dev/null 2>&1") / 256; if ($chk != 0) { print "Unable to create directory. ($var)\n\n"; @@ -860,7 +879,7 @@ sub dir_check { sub getosflags { if ($config{OSNAME} =~ /BSD$/) { $config{LDLIBS} = "-Ldl -lstdc++"; - $config{FLAGS} = "-fPIC -frtti -Wall -Woverloaded-virtual $config{OPTIMISATI}"; + $config{FLAGS} = "-fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}"; $config{MAKEPROG} = "gmake"; if ($config{OSNAME} eq "OpenBSD") { chomp($foo = `eg++ -dumpversion | cut -c 1`); @@ -874,15 +893,15 @@ sub getosflags { } } else { $config{LDLIBS} = "-ldl -lstdc++"; - $config{FLAGS} = "-fPIC -frtti -Wall -Woverloaded-virtual $config{OPTIMISATI}"; + $config{FLAGS} = "-fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}"; $config{MAKEPROG} = "make"; if ($config{OSNAME} =~ /CYGWIN/) { - $config{FLAGS} = "-frtti -Wall -Woverloaded-virtual $config{OPTIMISATI}"; + $config{FLAGS} = "-Wall -Woverloaded-virtual $config{OPTIMISATI}"; $config{LDLIBS} = ""; $config{MAKEPROG} = "/usr/bin/make"; $config{MAKEORDER} = "ircd mods"; } elsif ($config{OSNAME} eq "CYG-STATIC") { - $config{FLAGS} = "-frtti -Wall -Woverloaded-virtual $config{OPTIMISATI}"; + $config{FLAGS} = "-Wall -Woverloaded-virtual $config{OPTIMISATI}"; $config{LDLIBS} = ""; $config{MAKEPROG} = "/usr/bin/make"; $config{MAKEORDER} = "mods ircd"; @@ -890,7 +909,9 @@ sub getosflags { $config{STATIC_LINK} = "yes"; } } - if ($config{OSNAME} =~ /SunOS/) { + + if ($config{OSNAME} =~ /SunOS/) + { # solaris/sunos needs these # socket = bsd sockets api # nsl = dns stuff @@ -898,6 +919,12 @@ sub getosflags { # resolv = inet_aton only (why isnt this in nsl?!) $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv"; } + + if($config{OSNAME} eq "MINGW32") + { + # All code is position-independent on windows + $config{FLAGS} =~ s/-fPIC //; + } } sub is_dir { @@ -935,6 +962,7 @@ sub getrevision { return "0"; } my $data = `svn info`; + if ($data eq "") { $no_svn = 1; $rev = "0"; @@ -995,6 +1023,9 @@ EOF print FILEHANDLE "#define IS_CYGWIN\n"; print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n"; } + if ($config{OSNAME} eq "MINGW32") { + print FILEHANDLE "#define IS_MINGW\n"; + } if ($config{OSNAME} eq "CYG-STATIC") { print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE 1024\n#endif\n"; } @@ -1016,9 +1047,12 @@ EOF if ($config{THREADED_DNS} =~ /y/i) { print FILEHANDLE "#define THREADED_DNS\n"; } - if ($config{IPV6} =~/y/i) { + if ($config{IPV6} =~ /y/i) { print FILEHANDLE "#define IPV6\n"; } + if ($config{SUPPORT_IP6LINKS} =~ /y/i) { + print FILEHANDLE "#define SUPPORT_IP6LINKS\n"; + } my $use_hiperf = 0; if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) { print FILEHANDLE "#define USE_KQUEUE\n"; @@ -1040,8 +1074,10 @@ EOF close(FILEHANDLE); } -open(FILEHANDLE, ">include/inspircd_se_config.h"); - print FILEHANDLE <include/inspircd_se_config.h"); + print FILEHANDLE <include/inspircd_se_config.h"); #endif EOF -close(FILEHANDLE); + close(FILEHANDLE); + } # Create a Modules List.. @@ -1254,7 +1291,7 @@ HEADER print FILEHANDLE <