]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Documentation of the new m_alias
[user/henk/code/inspircd.git] / configure
index 6017ae379feaa130080120b3a3ca00ac35f4d163..64059152d0bcb4ac776b9f61b590f0469e9673cf 100755 (executable)
--- a/configure
+++ b/configure
@@ -37,17 +37,15 @@ $config{MAX_OPERCH}         = "60";                                                 # Default Max. Channels per oper
 $config{MAXI_MODES}         = "20";                                            # Default Max. Number of Modes set at once.
 $config{HAS_STRLCPY}        = "false";                                         # strlcpy Check.
 $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
 $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
 chomp($config{GCCVER}       = `g++ -dumpversion | cut -c 1`);                  # Major GCC Version
-chomp($config{OSNAME}       = `/bin/uname`);                                   # Operating System Name
+chomp($config{OSNAME}       = `uname`);                                # Operating System Name
 $config{CC}                = "g++";                                            # C++ compiler
 $config{MAKEORDER}         = "ircd mods";                                      # build order
 $config{STATICLIBS}         = "";                                              # library archive path
@@ -60,7 +58,7 @@ $config{MAX_AWAY}           = "200";                                          # max AWAY size
 
 $no_svn = 0;
 
-$config{HAS_OPENSSL} =~ /OpenSSL (\S+) \d+ \S+ \d{4}/;
+$config{HAS_OPENSSL} =~ /OpenSSL ([-[:digit:].]+)([a-z])? (\w{3}|[0-9]+) (\w{3}|[0-9]+) [0-9]{4}/;
 $config{HAS_OPENSSL} = $1;
 
 if ($config{GCCVER} eq "") {
@@ -197,27 +195,6 @@ if (!$fail) {
 print "yes\n" if $config{HAS_STRLCPY} eq "true";
 print "no\n" if $config{HAS_STRLCPY} eq "false";
 
-printf "Checking if execinfo.h exists... ";
-$config{HAS_EXECINFO} = "0";
-my $fail = 0;
-open(EXECINFO, "</usr/include/execinfo.h") or $fail = 1;
-if ($fail) {
-       $fail = 0;
-       open(EXECINFO, "</usr/local/include/execinfo.h") or $fail = 1;
-       if (!$fail) {
-               printf "/usr/local/include/execinfo.h\n";
-               $config{HAS_EXECINFO} = "1";
-               close(EXECINFO);
-       }
-       else {
-               printf "Not found!\n";
-       }
-}
-else {
-       printf "/usr/include/execinfo.h\n";
-       $config{HAS_EXECINFO} = "1";
-       close(EXECINFO);
-}
 
 printf "Checking if kqueue exists... ";
 $has_kqueue = 0;
@@ -689,7 +666,6 @@ print "\033[0mGCC Version Found:\033[1;32m\t\t$config{GCCVER}.x\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[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";
@@ -703,6 +679,7 @@ 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();
@@ -737,6 +714,7 @@ 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();
@@ -850,7 +828,7 @@ sub dir_check {
                        if (($tmp eq "") || ($tmp =~ /^y/i)) {
                                # Attempt to Create the Dir..
                                
-                               print("mkdir -p \"$var\" >> /dev/null 2>&1");
+                               system("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";
@@ -878,7 +856,7 @@ sub dir_check {
 
 sub getosflags {
        if ($config{OSNAME} =~ /BSD$/) {
-               $config{LDLIBS} = "-Ldl -lstdc++";
+               $config{LDLIBS} = "-lstdc++";
                $config{FLAGS}  = "-fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
                $config{MAKEPROG} = "gmake";
                if ($config{OSNAME} eq "OpenBSD") {
@@ -1013,6 +991,7 @@ sub writefiles {
 #define MAXGECOS $config{MAX_GECOS}
 #define MAXAWAY $config{MAX_AWAY}
 #define OPTIMISATION $config{OPTIMITEMP}
+#define LIBRARYDIR "$config{LIBRARY_DIR}"
 #define SYSTEM "$incos"
 #define MAXBUF 514
 EOF
@@ -1029,9 +1008,6 @@ EOF
                if ($config{OSNAME} eq "CYG-STATIC") {
                        print FILEHANDLE "#ifndef FD_SETSIZE\n#define FD_SETSIZE    1024\n#endif\n";
                }
-               if ($config{HAS_EXECINFO} eq "1") {
-                       print FILEHANDLE "#define HAS_EXECINFO\n";
-               }
                if ($config{STATIC_LINK} eq "yes") {
                        print FILEHANDLE "#define STATIC_LINK\n";
                }
@@ -1044,9 +1020,6 @@ EOF
                if ($config{HAS_STDINT} eq "true") {
                        print FILEHANDLE "#define HAS_STDINT\n";
                }
-               if ($config{THREADED_DNS} =~ /y/i) {
-                       print FILEHANDLE "#define THREADED_DNS\n";
-               }
                if ($config{IPV6} =~ /y/i) {
                        print FILEHANDLE "#define IPV6\n";
                }
@@ -1114,9 +1087,7 @@ EOF
        }
 
        opendir(DIRHANDLE, $this);
-       if ($config{THREADED_DNS} =~ /y/i) {
-               $config{LDLIBS} = $config{LDLIBS} . " -pthread";
-       }
+
        foreach $name (sort readdir(DIRHANDLE)) {
                if ($name =~ /^\.(.+)\.inc$/) {
                        $file = $1;
@@ -1542,19 +1513,13 @@ sub write_dynamic_makefile {
                $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
        }
 
-if (($config{OSNAME} !~ /Linux/i) && ($config{HAS_EXECINFO} eq "1")) {
-       $extra = "-L/usr/local/lib -lexecinfo";
-} else {
-       $extra = "";
-}
-
-$se = "socketengine_select";
-if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
-       $se = "socketengine_kqueue";
-}
-elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
-       $se = "socketengine_epoll";
-}
+       $se = "socketengine_select";
+       if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) {
+               $se = "socketengine_kqueue";
+       }
+       elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) {
+               $se = "socketengine_epoll";
+       }
 
        open(FH,">src/Makefile") or die("Could not write src/Makefile");
        print FH <<EOM;
@@ -1573,8 +1538,8 @@ RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//
 
 all: libIRCDtimer.so libIRCDaes.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so libIRCDsnomasks.so inspircd
 
-inspircd: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/socket.h libIRCDtimer.so libIRCDaes.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDsnomasks.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so $cmdobjs
-       \$(CC) -I../include $extra -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so libIRCDsocketengine.so libIRCDuserprocess.so libIRCDcull_list.so libIRCDcommand_parse.so libIRCDaes.so libIRCDtimer.so libIRCDsnomasks.so $cmdobjs
+inspircd: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/socket.h libIRCDtimer.so libIRCDaes.so libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so $cmdobjs libIRCDsnomasks.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so
+       \$(CC) -I../include $extra -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,$config{LIBRARY_DIR} \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDconfigreader.so libIRCDinspsocket.so libIRCDcommands.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so libIRCDsocketengine.so libIRCDuserprocess.so libIRCDcull_list.so libIRCDcommand_parse.so libIRCDaes.so libIRCDtimer.so libIRCDsnomasks.so
 
 libIRCDsocketengine.so: $se.cpp socketengine.cpp ../include/base.h ../include/hashcomp.h ../include/globals.h ../include/inspircd_config.h ../include/$se.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socketengine.cpp $se.cpp
@@ -1633,9 +1598,9 @@ libIRCDconfigreader.so: configreader.cpp ../include/base.h ../include/configread
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c configreader.cpp
        \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDconfigreader.so configreader.o
 
-libIRCDcommands.so: commands.cpp ../include/base.h ../include/commands.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h $cmdobjs
+libIRCDcommands.so: commands.cpp ../include/base.h ../include/commands.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
-       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommands.so commands.o $cmdobjs
+       \$(CC) -Wl,--rpath -Wl,$config{LIBRARY_DIR} -shared -o libIRCDcommands.so commands.o
 
 libIRCDdynamic.so: dynamic.cpp ../include/base.h ../include/dynamic.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
        \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dynamic.cpp