#
########################################
-chomp($topdir = `pwd`);
+use Cwd;
+
+chomp($topdir = getcwd());
$this = resolve_directory($topdir); # PWD, Regardless.
@modlist = (); # Declare for Module List..
%config = (); # Initiate Configuration Hash..
$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
# 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}) {
print "not to enable one. Defaulting to select() engine.\n\n";
}
-yesno(IPV6,"Would you like to enable experimental IPv6 support?");
+yesno(IPV6,"Would you like to build InspIRCd with 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";
print "I will default to GnuTLS. If you wish to use OpenSSL\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";
# 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 = <STDIN>);
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";
$config{STATIC_LINK} = "yes";
}
}
- if ($config{OSNAME} =~ /SunOS/) {
+
+ if ($config{OSNAME} =~ /SunOS/)
+ {
# solaris/sunos needs these
# socket = bsd sockets api
# nsl = dns stuff
# 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 {
return "0";
}
my $data = `svn info`;
+
if ($data eq "") {
$no_svn = 1;
$rev = "0";
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";
}
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";