-sub getosflags {
-
- # Beware: Linux sets it's own cflags below for some retarded reason
- $config{LDLIBS} = "-pthread -lstdc++";
- $config{FLAGS} = "-pipe -fPIC -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall $config{OPTIMISATI}";
- $config{DEVELOPER} = "-pipe -fPIC -Woverloaded-virtual -Wshadow -Wall -Wformat=2 -Wmissing-format-attribute -g";
- $SHARED = "-shared -export-dynamic";
- $config{MAKEPROG} = "make";
-
- if ($config{OSNAME} =~ /darwin/i) {
- $config{FLAGS} = "-pipe -DDARWIN -frtti -fPIC -Wall $config{OPTIMISATI}";
- $SHARED = "-bundle -twolevel_namespace -undefined dynamic_lookup";
- $config{LDLIBS} = "-ldl -pthread -lstdc++";
- }
-
- if ($config{OSNAME} =~ /OpenBSD/i) {
- $config{MAKEPROG} = "gmake";
-# apparantly (Dagonet says) that this causes problems, so let's try without it.
-# $config{LDLIBS} = $config{LDLIBS} . " -lunwind";
- chomp(my $foo = `eg++ -dumpversion | cut -c 1`);
- # theyre running the package version of gcc (eg++)... detect it and set up its version numbers.
- # if theyre not running this, configure lets the build continue but they probably wont manage to
- # compile as this standard version is 2.95.3!
- if ($foo ne "") {
- $config{CC} = "eg++";
- chomp($config{GCCVER} = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path
- chomp($config{GCCMINOR} = `eg++ -dumpversion | cut -c 3`);
- }
- return "OpenBSD";
- }
-
- if ($config{OSNAME} =~ /Linux/i) {
- $config{LDLIBS} = "-ldl -lstdc++ -pthread";
-# $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wall $config{OPTIMISATI}";
- $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
- $config{LDLIBS} .= " " . $ENV{LDLIBS} if exists($ENV{LDLIBS});
- $config{LDLIBS} .= " " . $ENV{LDFLAGS} if exists($ENV{LDFLAGS});
- $config{MAKEPROG} = "make";
- }
-
- if ($config{OSNAME} =~ /FreeBSD/i) {
- $config{FLAGS} .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
- $config{LDLIBS} .= " " . $ENV{LDLIBS} if exists($ENV{LDLIBS});
- $config{LDLIBS} .= " " . $ENV{LDFLAGS} if exists($ENV{LDFLAGS});
- }
-
- if ($config{OSNAME} =~ /SunOS/i or $config{OSNAME} =~ /solaris/i)
- {
- # solaris/sunos needs these
- # socket = bsd sockets api
- # nsl = dns stuff
- # rt = POSIX realtime extensions
- # resolv = inet_aton only (why isnt this in nsl?!)
- $config{MAKEPROG} = "gmake";
- $config{LDLIBS} .= " -lsocket -lnsl -lrt -lresolv -pthread";
- return "Solaris";
- }
-
- if($config{OSNAME} =~ /MINGW32/i)
- {
- # All code is position-independent on windows
- $config{FLAGS} =~ s/-fPIC //;
- return "MinGW";
- }
-
- return $config{OSNAME};
-}
-