X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=7b0678c1d6f5001ed48dc025ec9db95a66f67e83;hb=6cace9502f5a7e9cb9e924e1ef3483021c6a4e28;hp=8e7c062b062b8feb75bdb7ebca9604e2719efeda;hpb=2710741e10eb856f341e866bdc274e8a89463587;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 8e7c062b0..7b0678c1d 100755 --- a/configure +++ b/configure @@ -24,6 +24,7 @@ use make::configure; GetOptions ( 'enable-gnutls' => \$opt_use_gnutls, + 'rebuild' => \$opt_rebuild, 'enable-openssl' => \$opt_use_openssl, 'disable-interactive' => \$opt_nointeractive, 'with-nick-length=i' => \$opt_nick_length, @@ -144,11 +145,11 @@ if (defined $opt_use_openssl) $config{OPTIMITEMP} = "0"; # Default Optimisation Value if (!defined $opt_disable_debug) { - $config{OPTIMISATI} = "-O2 -g1"; # Optimisation Flag + $config{OPTIMISATI} = "-g1"; # Optimisation Flag } else { - $config{OPTIMISATI} = "-O2"; # DEBUGGING OFF! + $config{OPTIMISATI} = "-O2"; # DEBUGGING OFF! } $config{NICK_LENGT} = "31"; # Default Nick Length @@ -215,8 +216,12 @@ 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 $config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue -$config{OSNAME} = $^O; # Operating System Name +$config{OSNAME} = $^O; # Operating System Name $config{IS_DARWIN} = "NO"; # Is OSX? +if ($config{OSNAME} =~ /darwin/i) +{ + $config{IS_DARWIN} = "YES"; +} $config{CC} = "g++"; # C++ compiler if (defined $opt_cc) { @@ -265,11 +270,6 @@ if ($config{GCCVER} eq "") { exit; } -if ($config{OSNAME} =~ /darwin/) -{ - $config{IS_DARWIN} = "YES"; -} - # Minihack! Convert Cygwin to 'Cyg-Static' so i can # Keep my dynamic module experiments here for later # consideration! @@ -368,9 +368,13 @@ sub svnupdate print "This is not an SVN copy of InspIRCd.\n"; exit; } + else + { + close(FH); + } system("svn update"); system("perl configure -update"); - if ($ARGV[1] eq "rebuild") { + if (defined $opt_rebuild) { system("make install"); } exit; @@ -579,10 +583,10 @@ should NOT be used. You should probably specify a newer compiler.\n\n"; 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"; + print "You have chosen to build an \033[1;32mIPV6-enabled\033[0m server.\nTo accept IPV4 users, you can still use IPV4 addresses\nin your port bindings..\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."); + 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?\nIf you are using a recent operating\nsystem and are unsure, answer yes.\nIf you answer 'no' here, your InspIRCd server will be unable\nto parse IPV6 addresses (e.g. for CIDR bans)"); print "\n"; } @@ -652,7 +656,6 @@ if ($config{USE_GNUTLS} eq "y") { print "Symlinking src/modules/m_ssl_gnutls.cpp from extra/\n"; chdir("src/modules"); system("ln -s extra/m_ssl_gnutls.cpp"); - system("ln -s extra/ssl_cert.h"); chdir("../.."); } getmodules(); @@ -694,7 +697,6 @@ if ($config{USE_GNUTLS} eq "y") { print "Symlinking src/modules/m_ssl_openssl.cpp from extra/\n"; chdir("src/modules"); system("ln -s extra/m_ssl_openssl.cpp"); - system("ln -s extra/ssl_cert.h"); chdir("../.."); } getmodules(); @@ -845,8 +847,15 @@ sub getosflags { $config{LDLIBS} = "-lstdc++"; $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}"; - $config{MAKEPROG} = "make"; + $config{DEVELOPER} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual -g"; $SHARED = "-Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared"; + $config{MAKEPROG} = "make"; + + if ($config{OSNAME} =~ /darwin/i) { + $config{FLAGS} = "-DDARWIN -frtti -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}"; + $SHARED = "-bundle -twolevel_namespace -undefined dynamic_lookup"; + $config{LDLIBS} = "-ldl -lstdc++"; + } if ($config{OSNAME} =~ /OpenBSD/i) { $config{MAKEPROG} = "gmake"; @@ -861,10 +870,6 @@ sub getosflags { return "OpenBSD"; } - if ($config{OSNAME} =~ /darwin/i) { - $SHARED = "-bundle -undefined dynamic_lookup"; - $config{LDLIBS} = "-ldl -lstdc++"; - } if ($config{OSNAME} =~ /Linux/i) { $config{LDLIBS} = "-ldl -lstdc++"; $config{FLAGS} = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}"; @@ -914,9 +919,7 @@ sub writefiles { my($writeheader) = @_; # First File.. inspircd_config.h chomp(my $incos = `uname -n -s -r`); - chomp(my $version = `sh ./src/version.sh`); - chomp(my $revision = getrevision()); - $version = "$version(r$revision)"; + chomp($version = `sh src/version.sh`); chomp(my $revision2 = getrevision()); if ($writeheader == 1) { @@ -1066,6 +1069,11 @@ EOF chomp(my $revision = getrevision()); $version = "$version(r$revision)"; + my $LIBEXT = "so"; + if ($config{IS_DARWIN} eq "YES") + { + $LIBEXT = "dylib"; + } # We can actually parse any file starting with . and ending with .inc, # but right now we only parse .inspircd.inc to form './inspircd' @@ -1083,17 +1091,18 @@ EOF $tmp =~ s/\@CC\@/$config{CC}/; $tmp =~ s/\@MAKEPROG\@/$config{MAKEPROG}/; $tmp =~ s/\@FLAGS\@/$config{FLAGS}/; + $tmp =~ s/\@DEVELOPER\@/$config{DEVELOPER}/; $tmp =~ s/\@LDLIBS\@/$config{LDLIBS}/; $tmp =~ s/\@BASE_DIR\@/$config{BASE_DIR}/; $tmp =~ s/\@CONFIG_DIR\@/$config{CONFIG_DIR}/; $tmp =~ s/\@MODULE_DIR\@/$config{MODULE_DIR}/; $tmp =~ s/\@BINARY_DIR\@/$config{BINARY_DIR}/; $tmp =~ s/\@LIBRARY_DIR\@/$config{LIBRARY_DIR}/; + $tmp =~ s/\@LIBRARY_EXT\@/$LIBEXT/; $tmp =~ s/\@MODULES\@/$modules/; $tmp =~ s/\@EXECUTABLE\@/$exe/; $tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/; $tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/; - $tmp =~ s/\@IS_DARWIN\@/$config{IS_DARWIN}/; $tmp =~ s/\@VERSION\@/$version/; print "Writing \033[1;32m$file\033[0m\n"; @@ -1310,7 +1319,7 @@ EOCHEESE } } print "(\033[1;32m$i files found\033[0m)\n"; - if ($config{OSNAME} =~ /darwin/) { + if ($config{IS_DARWIN} eq "YES") { print FILEHANDLE "\n \$(CC) -pipe -twolevel_namespace -undefined dynamic_lookup \$(FLAGS) -bundle -o $name.so $crap3\n"; } else { print FILEHANDLE "\n \$(CC) -pipe \$(FLAGS) -shared $liflags -o $name.so $crap3\n"; @@ -1517,36 +1526,19 @@ CXXFLAGS = -I../include \${FLAGS} CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn) RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn) -CMD_SRC = \\ -EOM - - foreach my $cmd (@cmdlist) { - print FH <