X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=e1e8156b8495077f7edaf1609f118c9b1ab5e3ed;hb=6a35f96eb272821d42f0757e2654d84bd5b2c05a;hp=c9cd330a9efb68c891e767b627d4d212ccea42be;hpb=7075c32b41f39783f2bcbeaaf544f5e8e0bd430e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index c9cd330a9..e1e8156b8 100755 --- a/configure +++ b/configure @@ -1,5 +1,4 @@ #!/usr/bin/perl - # InspIRCd Configuration Script # # Copyright 2003 The ChatSpike Development Team @@ -56,6 +55,14 @@ $config{MAX_AWAY} = "200"; # max AWAY size $config{HAS_OPENSSL} =~ /OpenSSL (\S+) \d+ \S+ \d{4}/; $config{HAS_OPENSSL} = $1; +# Minihack! Convert Cygwin to 'Cyg-Static' so i can +# Keep my dynamic module experiments here for later +# concideration! + +if ($config{OSNAME} =~ /CYGWIN/) { + $config{OSNAME} = "CYG-STATIC"; +} + if ((!$config{OSNAME}) || ($config{OSNAME} eq "")) { chomp($config{OSNAME} = `/usr/bin/uname`); if ((!$config{OSNAME}) || ($config{OSNAME} eq "")){ @@ -104,7 +111,7 @@ if ($arg eq "-modupdate") { getosflags(); $has_epoll = $config{HAS_EPOLL}; $has_kqueue = $config{HAS_KQUEUE}; - if ($config{OSNAME} =~ /CYGWIN/) { + if ($config{STATIC_LINK} eq "yes") { write_static_modules_makefile(); } else { write_dynamic_modules_makefile(); @@ -194,7 +201,7 @@ if ($has_epoll) { print "yes\n" if $has_epoll == 1; print "no\n" if $has_epoll == 0; -if ($config{OSNAME} =~ /CYGWIN/) { +if (($config{OSNAME} =~ /CYGWIN/) || ($config{OSNAME} eq "CYG-STATIC")) { $config{HAS_STRLCPY} = "true"; } @@ -316,10 +323,14 @@ if (($config{HAS_GNUTLS} eq "y") && ($config{HAS_OPENSSL} eq "y")) { if ($config{HAS_GNUTLS} eq "y") { yesno(USE_GNUTLS, "Would you like to enable SSL Support?"); - print "\nUsing GnuTLS SSL module.\n"; + if ($config{USE_GNUTLS} eq "y") { + print "\nUsing GnuTLS SSL module.\n"; + } } elsif ($config{HAS_OPENSSL} eq "y") { yesno(USE_OPENSSL, "Would you like to enable SSL Support?"); - print "\nUsing OpenSSL SSL module.\nYou will get better performance if you move to GnuTLS in the future.\n"; + if ($config{USE_OPENSSL} eq "y") { + print "\nUsing OpenSSL SSL module.\nYou will get better performance if you move to GnuTLS in the future.\n"; + } } print "\nThe following questions will ask you for various figures relating\n"; @@ -584,15 +595,15 @@ print "\033[0mMax kick length:\033[1;32m\t\t$config{MAX_KICK}\n"; print "\033[0mMax name length:\033[1;32m\t\t$config{MAX_GECOS}\n"; print "\033[0mMax away length:\033[1;32m\t\t$config{MAX_AWAY}\n"; print "\033[0mGCC Version Found:\033[1;32m\t\t$config{GCCVER}.$config{GCC34}\n"; -print "\033[0mOptimatizaton Flag:\033[1;32m\t\t$config{OPTIMISATI}\033[0m\n"; +print "\033[0mOptimization Flag:\033[1;32m\t\t$config{OPTIMISATI}\033[0m\n"; 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[0mGnuTLS Support:\033[1;32m\t\t$config{USE_GNUTLS}\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"; if ($config{USE_GNUTLS} eq "y") { - system("cp src/modules/extra/m_ssl_gnutls.cpp src/modules/m_ssl_gnutls.cpp"); + system("ln -s src/modules/extra/m_ssl_gnutls.cpp src/modules/m_ssl_gnutls.cpp"); getmodules(); $failed = 0; open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1; @@ -618,7 +629,7 @@ if ($config{USE_GNUTLS} eq "y") { print "SSL Certificates found, skipping.\n\n" } } elsif ($config{USE_OPENSSL} eq "y") { - system("cp src/modules/extra/m_ssl_openssl.cpp src/modules/m_ssl_openssl.cpp"); + system("ln -s src/modules/extra/m_ssl_openssl.cpp src/modules/m_ssl_openssl.cpp"); getmodules(); $failed = 0; open(TMP, "<$config{CONFIG_DIR}/key.pem") or $failed = 1; @@ -646,6 +657,7 @@ if (($config{USE_GNUTLS} eq "n") && ($config{USE_OPENSSL} eq "n")) { print "Skipping SSL Certificate generation, SSL support is not available.\n\n"; } +getosflags(); makecache(); writefiles(); @@ -661,15 +673,6 @@ print "*** \033[1;32mRemember to edit your configuration files!!!\033[0m ***\n\n if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) { print "\033[1;32mWARNING!\033[0m You are running OpenBSD but you are using the base gcc package\nrather than eg++. This compile will most likely fail, but i'm letting you\ngo ahead with it anyway, just in case i'm wrong :-)\n"; } -if ($config{OSNAME} =~ /CYGWIN/) { - print <src/modules/Makefile"); + my $extra = ""; + + if ($config{OSNAME} =~ /CYGWIN/) { + $extra = "../inspircd.dll.a"; + } ### # Module Makefile Header @@ -1172,7 +1192,7 @@ foreach $i (@modlist) { print FILEHANDLE < -# Makefile version 2 (dynamically linked core) by +# Makefile version 2 (statically linked core) by # CC = im a cheezeball CXXFLAGS = -I../include \${FLAGS} +EOM +### +# This next section is for cygwin dynamic module builds. +# Basically, what we do, is build the inspircd core as a library +# then the main executable uses that. the library is capable of +# loading / unloading the modules dynamically :) +# Massive thanks to the guys on #cygwin @ irc.freenode.net for helping +# make this work :) +### + +if ($config{OSNAME} =~ /CYGWIN/) { + print FH <