Add support to jbigi/jcpuid for Solaris/SunOS

This commit is contained in:
kytv
2011-05-31 11:30:10 +00:00
parent d4bf2523a6
commit 527c9ba5dd
3 changed files with 18 additions and 0 deletions

View File

@@ -23,6 +23,12 @@ Darwin*)
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include"
LINKFLAGS="-dynamiclib -framework JavaVM"
LIBFILE="libjbigi.jnilib";;
SunOS*)
COMPILEFLAGS="-fPIC -Wall"
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/solaris"
LINKFLAGS="-shared -Wl,-soname,libjbigi.so"
LIBFILE="libjbigi.so";;
*)
COMPILEFLAGS="-fPIC -Wall"
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"

View File

@@ -3,6 +3,8 @@
case `uname -sr` in
MINGW*)
echo "Building windows .dll's";;
SunOS*)
echo "Building solaris .so's";;
CYGWIN*)
echo "Building windows .dll's";;
Linux*)
@@ -31,6 +33,11 @@ MINGW*)
INCLUDES="-I. -Iinclude -I$JAVA_HOME/include/ -I$JAVA_HOME/include/win32/"
LINKFLAGS="-shared -static -static-libgcc -Wl,--kill-at"
LIBFILE="lib/freenet/support/CPUInformation/jcpuid-x86-windows.dll";;
SunOS*)
COMPILEFLAGS="-Wall"
INCLUDES="-I. -Iinclude -I$JAVA_HOME/include/ -I$JAVA_HOME/include/solaris/"
LINKFLAGS="-shared -static -Wl,-soname,libjcpuid-x86-solaris.so"
LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-solaris.so";;
FreeBSD*)
COMPILEFLAGS="-Wall"
INCLUDES="-I. -Iinclude -I$JAVA_HOME/include/ -I$JAVA_HOME/include/freebsd/"

View File

@@ -52,6 +52,7 @@ public class CPUID {
private static final boolean isWindows = System.getProperty("os.name").toLowerCase().contains("windows");
private static final boolean isLinux = System.getProperty("os.name").toLowerCase().contains("linux");
private static final boolean isFreebsd = System.getProperty("os.name").toLowerCase().contains("freebsd");
private static final boolean isSunos = System.getProperty("os.name").toLowerCase().contains("sunos");
/**
* This isn't always correct.
@@ -719,6 +720,8 @@ public class CPUID {
return "jcpuid-x86-windows"; // The convention on Windows
if(isFreebsd)
return "jcpuid-x86-freebsd"; // The convention on freebsd...
if(isSunos)
return "jcpuid-x86-solaris"; // The convention on SunOS
//throw new RuntimeException("Dont know jcpuid library name for os type '"+System.getProperty("os.name")+"'");
// use linux as the default, don't throw exception
return "jcpuid-x86-linux";
@@ -730,6 +733,8 @@ public class CPUID {
return "jcpuid-x86_64-windows";
if(isFreebsd)
return "jcpuid-x86_64-freebsd";
if(isSunos)
return "jcpuid-x86_64-solaris";
// use linux as the default, don't throw exception
return "jcpuid-x86_64-linux";
}