]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
* Fix inspsocket to not include uio.h on windows.
[user/henk/code/inspircd.git] / configure
index d9ed2e48d2ba20f13b5647780632656be4a05d2d..cd21375b5dd06557f0d977a858a982a6bb51d28b 100755 (executable)
--- a/configure
+++ b/configure
@@ -44,7 +44,7 @@ use make::opensslcert;
 
 our ($opt_use_gnutls, $opt_rebuild, $opt_use_openssl, $opt_nointeractive, $opt_ports,
     $opt_epoll, $opt_kqueue, $opt_noports, $opt_noepoll, $opt_nokqueue,
-    $opt_ipv6, $opt_maxbuf, $opt_disable_debug, $opt_freebsd_port);
+    $opt_noipv6, $opt_maxbuf, $opt_disable_debug, $opt_freebsd_port);
 
 our ($opt_cc, $opt_base_dir, $opt_config_dir, $opt_module_dir, $opt_binary_dir,
     $opt_library_dir);
@@ -69,7 +69,7 @@ GetOptions (
        'disable-ports' => \$opt_noports,
        'disable-epoll' => \$opt_noepoll,
        'disable-kqueue' => \$opt_nokqueue,
-       'enable-ipv6' => \$opt_ipv6,
+       'disable-ipv6' => \$opt_noipv6,
        'with-cc=s' => \$opt_cc,
        'with-maxbuf=i' => \$opt_maxbuf,
        'enable-freebsd-ports-openssl' => \$opt_freebsd_port,
@@ -109,7 +109,7 @@ our $non_interactive = (
        (defined $opt_binary_dir) ||
        (defined $opt_nointeractive) ||
        (defined $opt_cc) ||
-       (defined $opt_ipv6) ||
+       (defined $opt_noipv6) ||
        (defined $opt_kqueue) ||
        (defined $opt_epoll) ||
        (defined $opt_ports) ||
@@ -139,7 +139,7 @@ if (defined $opt_base_dir)
 $config{CONFIG_DIR}     = resolve_directory($config{BASE_DIR}."/conf");        # Configuration Directory
 $config{MODULE_DIR}     = resolve_directory($config{BASE_DIR}."/modules");     # Modules Directory
 $config{BINARY_DIR}     = resolve_directory($config{BASE_DIR}."/bin");         # Binary Directory
-$config{LIBRARY_DIR}   = resolve_directory($config{BASE_DIR}."/lib");          # Library Directory
+$config{BUILD_DIR}      = resolve_directory($config{ME}."/build");         # Build Directory
 
 if (defined $opt_config_dir)
 {
@@ -153,10 +153,6 @@ if (defined $opt_binary_dir)
 {
        $config{BINARY_DIR} = $opt_binary_dir;
 }
-if (defined $opt_library_dir)
-{
-       $config{LIBRARY_DIR} = $opt_library_dir;
-}
 chomp($config{HAS_GNUTLS}   = `pkg-config --modversion gnutls 2>/dev/null | cut -c 1,2,3`); # GNUTLS Version.
 
 if (defined $opt_freebsd_port)
@@ -234,10 +230,10 @@ if (defined $opt_noports)
 {
        $config{USE_PORTS} = "n";
 }
-$config{IPV6}         = "n";                                           # IPv6 support (experimental)
-if (defined $opt_ipv6)
+$config{IPV6}         = "y";                                   # IPv6 support
+if (defined $opt_noipv6)
 {
-       $config{IPV6} = "y";
+       $config{IPV6} = "n";
 }
 chomp($config{GCCVER}       = `g++ -dumpversion | cut -c 1`);          # Major GCC Version
 chomp($config{GCCMINOR}     = `g++ -dumpversion | cut -c 3`);
@@ -523,8 +519,10 @@ if ($config{OSNAME} =~ /FreeBSD/i)
        my $version = `uname -r`;
        if ($version =~ /^4\./)
        {
-               print "yes\n";
-               exit 1;
+               print "yes.\n";
+               print "FreeBSD 4.x is no longer supported. By ANYONE.\n";
+               print "To build, you will need to add the following to CXXFLAGS:\n";
+               print "\t-L/usr/local/lib -lgnugetopt -DHAVE_DECL_GETOPT=1\n";
        }
        else
        {
@@ -609,13 +607,12 @@ should NOT be used. You should probably specify a newer compiler.\n\n";
                $config{CONFIG_DIR}      = resolve_directory($config{BASE_DIR}."/conf");           # Configuration Dir
                $config{MODULE_DIR}      = resolve_directory($config{BASE_DIR}."/modules");     # Modules Directory
                $config{BINARY_DIR}      = resolve_directory($config{BASE_DIR}."/bin");     # Binary Directory
-               $config{LIBRARY_DIR}    = resolve_directory($config{BASE_DIR}."/lib");      # Library Directory
        }
 
        dir_check("are the configuration files", "CONFIG_DIR");
        dir_check("are the modules to be compiled to", "MODULE_DIR");
        dir_check("is the IRCd binary to be placed", "BINARY_DIR");
-       dir_check("are the IRCd libraries to be placed", "LIBRARY_DIR");
+       dir_check("do you want the build to take place", "BUILD_DIR");
 
        my $chose_hiperf = 0;
        if ($has_kqueue) {
@@ -931,11 +928,8 @@ sub writefiles {
 #define CoreExport /**/
 #define DllExport /**/
 
-#define CONFIG_FILE "$config{CONFIG_DIR}/inspircd.conf"
 #define MOD_PATH "$config{MODULE_DIR}"
 #define SOMAXCONN_S "$config{_SOMAXCONN}"
-#define OPTIMISATION $config{OPTIMITEMP}
-#define LIBRARYDIR "$config{LIBRARY_DIR}"
 #define ENTRYPOINT int main(int argc, char** argv)
 
 EOF
@@ -1003,18 +997,6 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n";
                print FILEHANDLE "\n#include \"threadengines/threadengine_pthread.h\"\n\n#endif\n";
                close(FILEHANDLE);
 
-               open(FILEHANDLE, ">include/inspircd_se_config.h.tmp");
-               print FILEHANDLE <<EOF;
-/* Auto generated by configure, do not modify or commit to svn! */
-#ifndef __CONFIGURATION_SOCKETENGINE__
-#define __CONFIGURATION_SOCKETENGINE__
-
-#include "socketengines/$config{SOCKETENGINE}.h"
-
-#endif
-EOF
-               close(FILEHANDLE);
-
                open(FILEHANDLE, ">include/inspircd_version.h.tmp");
                print FILEHANDLE <<EOF;
 #define VERSION "$version"
@@ -1023,7 +1005,7 @@ EOF
 EOF
                close FILEHANDLE;
 
-               for my $file (qw(include/inspircd_config.h include/inspircd_se_config.h include/inspircd_version.h)) {
+               for my $file (qw(include/inspircd_config.h include/inspircd_version.h)) {
                        my $diff = 0;
                        open my $fh1, $file or $diff = 1;
                        open my $fh2, $file.'.tmp' or die "Can't read $file.tmp that we just wrote: $!";
@@ -1082,9 +1064,12 @@ EOF
                        close(FILEHANDLE);
 
                        print "Writing \e[1;32m$file\e[0m ...\n";
+
+                       $config{BUILD_DIR} ||= resolve_directory($config{ME}."/build");
+
                        for my $var (qw(
-                               CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR LIBRARY_DIR
-                               STARTSCRIPT DESTINATION EXTRA_DIR SOCKETENGINE CORE_FLAGS
+                               CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR
+                               STARTSCRIPT DESTINATION EXTRA_DIR SOCKETENGINE
                        )) {
                                s/\@$var\@/$config{$var}/g;
                        }