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}) {
}
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";
# socket = bsd sockets api
# nsl = dns stuff
# rt = POSIX realtime extensions
- $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt";
+ # resolv = inet_aton only (why isnt this in nsl?!)
+ $config{LDLIBS} = $config{LDLIBS} . " -lsocket -lnsl -lrt -lresolv";
}
}