]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Stupid string checks
[user/henk/code/inspircd.git] / configure
index 15adf5bdfe44c73b16f3f6c167dd1dce01202092..358510bce1ed8f1ab145675c63e712967546a0d6 100755 (executable)
--- a/configure
+++ b/configure
@@ -32,10 +32,17 @@ $config{USE_EPOLL}          = "y";                                          # epoll enabled
 chomp($config{MAX_CLIENT_T} = `sh -c \"ulimit -n\"`);                          # FD Limit
 chomp($config{GCCVER}       = `gcc -dumpversion | cut -c 1`);                  # Major GCC Version
 chomp($config{GCC34}        = `gcc -dumpversion | cut -c 3`);                  # Minor GCC Version
-chomp($config{OSNAME}       = `/bin/uname -s`);                                # Operating System Name
+chomp($config{OSNAME}       = `/bin/uname`);                                   # Operating System Name
 
-if (!$config{OSNAME}) {
-  $config{OSNAME} = "Unknown";                                  # For use when uname fails.
+print "OSN: '" . $config{OSNAME} . "'\n";
+
+if ((!$config{OSNAME}) || ($config{OSNAME} eq "")) {
+  print "Running 2nd uname\n";
+  chomp($config{OSNAME} = `/usr/bin/uname`);
+  print "OSN: '" . $config{OSNAME} . "'\n";
+  if ((!$config{OSNAME}) || ($config{OSNAME} eq "")){
+       $config{OSNAME} = "Unknown";
+  }
 }
 
 if (!$config{MAX_CLIENT_T}) { 
@@ -374,7 +381,7 @@ sub dir_check {
 }
 
 sub getosflags {
-  if ($config{OSNAME} eq "FreeBSD") {
+  if ($config{OSNAME} =~ /BSD$/) {
     $config{LDLIBS} = "-Ldl";
     $config{FLAGS}  = "-fPIC -frtti $OPTIMISATI -Woverloaded-virtual $config{OPTIMISATI}";
     $config{MAKEPROG} = "gmake";
@@ -385,7 +392,11 @@ sub getosflags {
   }
   if ($config{OSNAME} =~ /SunOS/) {
     # solaris/sunos needs these
-    $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl";
+    # socket = bsd sockets api
+    # nsl = dns stuff
+    # rt = POSIX realtime extensions
+    # resolv = inet_aton only (why isnt this in nsl?!)
+    $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv";
   }
 }