]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Fix bug experienced by satmd, remove space indents + tidy a little
[user/henk/code/inspircd.git] / configure
index a95cf3da4a7500f8b2f7920aed9e618321a9de0b..8af40ef104704863db4e33310c68cd194811761b 100755 (executable)
--- a/configure
+++ b/configure
@@ -47,8 +47,8 @@ GetOptions (
        'binary-dir=s' => \$opt_binary_dir,
        'library-dir=s' => \$opt_library_dir,
        'help'  => sub { showhelp(); },
-       'modupdate' => sub { update(); },
-       'update' => sub { modupdate(); },
+       'modupdate' => sub { modupdate(); },
+       'update' => sub { update(); },
        'svnupdate' => sub { svnupdate(); },
        'clean' => sub { clean(); },
 );
@@ -247,7 +247,7 @@ if (defined $opt_away)
 
 $no_svn = 0;
 
-$config{HAS_OPENSSL} =~ /OpenSSL ([-[:digit:].]+)([a-z])? (\w{3}|[0-9]+) (\w{3}|[0-9]+) [0-9]{4}/;
+$config{HAS_OPENSSL} =~ /OpenSSL ([-[:digit:].]+)([a-z])?(\-[a-z][0-9])? (\w{3}|[0-9]+) (\w{3}|[0-9]+) [0-9]{4}/;
 $config{HAS_OPENSSL} = $1;
 
 if ($config{GCCVER} eq "") {
@@ -294,6 +294,9 @@ sub clean
 
 sub update
 {
+       chomp($topdir = getcwd());
+       $this = resolve_directory($topdir);                                             # PWD, Regardless.
+       getmodules();
        # Does the cache file exist?
        if (!getcache()) {
                # No, No it doesn't.. *BASH*
@@ -313,6 +316,9 @@ sub update
 
 sub modupdate
 {
+       chomp($topdir = getcwd());
+       $this = resolve_directory($topdir);                                             # PWD, Regardless.
+       getmodules();
         # Does the cache file exist?
         if (!getcache()) {
                 # No, No it doesn't.. *BASH*
@@ -872,6 +878,17 @@ print "\033[0mIPv6 to IPv4 Links:\033[1;32m\t\t$config{SUPPORT_IP6LINKS}\033[0m\
 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") && ($config{HAS_GNUTLS} ne "y"))
+{
+       print "Sorry, but i couldn't detect gnutls. Make sure gnutls-config is in your path.\n";
+       exit(0);
+}
+if (($config{USE_OPENSSL} eq "y") && ($config{HAS_OPENSSL} ne "y"))
+{
+       print "Sorry, but i couldn't detect openssl. Make sure openssl is in your path.\n";
+       exit(0);
+}
+
 if ($config{USE_GNUTLS} eq "y") {
        $failed = 0;
        open(TMP, "<src/modules/m_ssl_gnutls.cpp") or $failed = 1;
@@ -1386,6 +1403,19 @@ sub getlinkerflags {
        return undef;
 }
 
+sub getdependencies {
+       my ($file) = @_;
+       open(FLAGS, $file);
+       while (<FLAGS>) {
+               if ($_ =~ /^\/\* \$ModDep: (.+) \*\/$/) {
+                       close(FLAGS);
+                       return $1;
+               }
+       }
+       close(FLAGS);
+       return undef;
+}
+
 sub resolve_directory {
        use File::Spec;
        return File::Spec->rel2abs($_[0]);
@@ -1466,12 +1496,13 @@ HEADER
                if ($i !~ /_static$/) {
                        $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
                        $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
+                       $deps = getdependencies("src/modules/m_".$i.".cpp");
 
                        ###
                        # Write Entry to the Makefile
                        ###
                        print FILEHANDLE <<EOCHEESE;
-m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h
+m_$i.o: .m_$i\_static.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h $deps
        \$(CC) -pipe -I../../include \$(FLAGS) $flags -export-dynamic -c .m_$i\_static.cpp
        mv .m_$i\_static.o ../m_$i.o
 
@@ -1539,8 +1570,9 @@ EOF
        ###
        $cmflags = getcompilerflags("src/modules/m_".$i.".cpp");
        $liflags = getlinkerflags("src/modules/m_".$i.".cpp");
+       $deps = getdependencies("src/modules/m_".$i.".cpp");
        print FILEHANDLE <<EOCHEESE;
-m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h
+m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps
        \$(CC) -pipe -I../../include \$(FLAGS) $cmflags -export-dynamic -c m_$i.cpp
        \$(CC) \$(FLAGS) -shared $liflags -o m_$i.so m_$i.o $extra