2005-01-21 Jhor
* Updated jbigi build scripts for OSX. 2005-01-21 jrandom * Added support for OSX to the NativeBigInteger code so that it will look in the classpath for libjbigi-osx-none.jnilib. At the moment, that file is not bundled with the shipped jbigi.jar yet though.
This commit is contained in:
@ -8,7 +8,13 @@ echo "Building..."
|
|||||||
mkdir -p lib/
|
mkdir -p lib/
|
||||||
mkdir -p bin/local
|
mkdir -p bin/local
|
||||||
cd bin/local
|
cd bin/local
|
||||||
../../gmp-4.1.4/configure
|
case `uname -sr` in
|
||||||
|
Darwin*)
|
||||||
|
# --with-pic is required for static linking
|
||||||
|
../../gmp-4.1.4/configure --with-pic;;
|
||||||
|
*)
|
||||||
|
../../gmp-4.1.4/configure;;
|
||||||
|
esac
|
||||||
make
|
make
|
||||||
sh ../../build_jbigi.sh static
|
sh ../../build_jbigi.sh static
|
||||||
cp *jbigi???* ../../lib/
|
cp *jbigi???* ../../lib/
|
||||||
|
@ -17,6 +17,12 @@ CYGWIN*)
|
|||||||
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include/win32/ -I$JAVA_HOME/include/"
|
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include/win32/ -I$JAVA_HOME/include/"
|
||||||
LINKFLAGS="-shared -Wl,--kill-at"
|
LINKFLAGS="-shared -Wl,--kill-at"
|
||||||
LIBFILE="jbigi.dll";;
|
LIBFILE="jbigi.dll";;
|
||||||
|
Darwin*)
|
||||||
|
JAVA_HOME="/Library/Java/Home"
|
||||||
|
COMPILEFLAGS="-Wall"
|
||||||
|
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include"
|
||||||
|
LINKFLAGS="-dynamiclib -framework JavaVM"
|
||||||
|
LIBFILE="libjbigi.jnilib";;
|
||||||
*)
|
*)
|
||||||
COMPILEFLAGS="-fPIC -Wall"
|
COMPILEFLAGS="-fPIC -Wall"
|
||||||
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
||||||
|
@ -103,14 +103,22 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
private final static String JBIGI_OPTIMIZATION_PENTIUM3 = "pentium3";
|
private final static String JBIGI_OPTIMIZATION_PENTIUM3 = "pentium3";
|
||||||
private final static String JBIGI_OPTIMIZATION_PENTIUM4 = "pentium4";
|
private final static String JBIGI_OPTIMIZATION_PENTIUM4 = "pentium4";
|
||||||
|
|
||||||
|
private static final boolean _isWin = System.getProperty("os.name").startsWith("Win");
|
||||||
|
private static final boolean _isMac = System.getProperty("os.name").startsWith("Mac");
|
||||||
|
private static final boolean _isLinux = System.getProperty("os.name").toLowerCase().indexOf("linux") != -1;
|
||||||
|
private static final boolean _isFreebsd = System.getProperty("os.name").toLowerCase().indexOf("freebsd") != -1;
|
||||||
|
private static final boolean _isNix = !(_isWin || _isMac);
|
||||||
/* libjbigi.so vs jbigi.dll */
|
/* libjbigi.so vs jbigi.dll */
|
||||||
private static final String _libPrefix = (System.getProperty("os.name").startsWith("Win") ? "" : "lib");
|
private static final String _libPrefix = (_isWin ? "" : "lib");
|
||||||
private static final String _libSuffix = (System.getProperty("os.name").startsWith("Win") ? ".dll" : ".so");
|
private static final String _libSuffix = (_isWin ? ".dll" : _isMac ? ".jnilib" : ".so");
|
||||||
|
|
||||||
private final static String sCPUType; //The CPU Type to optimize for (one of the above strings)
|
private final static String sCPUType; //The CPU Type to optimize for (one of the above strings)
|
||||||
|
|
||||||
static {
|
static {
|
||||||
sCPUType = resolveCPUType();
|
if (_isMac) // replace with osx/mac friendly jni cpu type detection when we have one
|
||||||
|
sCPUType = null;
|
||||||
|
else
|
||||||
|
sCPUType = resolveCPUType();
|
||||||
loadNative();
|
loadNative();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,12 +526,12 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final String getResourceName(boolean optimized) {
|
private static final String getResourceName(boolean optimized) {
|
||||||
String pref = getLibraryPrefix();
|
String pref = _libPrefix;
|
||||||
String middle = getMiddleName(optimized);
|
String middle = getMiddleName(optimized);
|
||||||
String suff = getLibrarySuffix();
|
String suff = _libSuffix;
|
||||||
if(pref == null || middle == null || suff == null)
|
if(pref == null || middle == null || suff == null)
|
||||||
return null;
|
return null;
|
||||||
return pref+middle+"."+suff;
|
return pref+middle+suff;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String getMiddleName(boolean optimized){
|
private static final String getMiddleName(boolean optimized){
|
||||||
@ -538,31 +546,14 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
}else
|
}else
|
||||||
sAppend = "-none";
|
sAppend = "-none";
|
||||||
|
|
||||||
boolean isWindows =(System.getProperty("os.name").toLowerCase().indexOf("windows") != -1);
|
if(_isWin)
|
||||||
boolean isLinux =(System.getProperty("os.name").toLowerCase().indexOf("linux") != -1);
|
|
||||||
boolean isFreebsd =(System.getProperty("os.name").toLowerCase().indexOf("freebsd") != -1);
|
|
||||||
if(isWindows)
|
|
||||||
return "jbigi-windows"+sAppend; // The convention on Windows
|
return "jbigi-windows"+sAppend; // The convention on Windows
|
||||||
if(isLinux)
|
if(_isLinux)
|
||||||
return "jbigi-linux"+sAppend; // The convention on linux...
|
return "jbigi-linux"+sAppend; // The convention on linux...
|
||||||
if(isFreebsd)
|
if(_isFreebsd)
|
||||||
return "jbigi-freebsd"+sAppend; // The convention on freebsd...
|
return "jbigi-freebsd"+sAppend; // The convention on freebsd...
|
||||||
|
if(_isMac)
|
||||||
|
return "jbigi-osx"+sAppend;
|
||||||
throw new RuntimeException("Dont know jbigi library name for os type '"+System.getProperty("os.name")+"'");
|
throw new RuntimeException("Dont know jbigi library name for os type '"+System.getProperty("os.name")+"'");
|
||||||
}
|
}
|
||||||
private static final String getLibrarySuffix()
|
|
||||||
{
|
|
||||||
boolean isWindows =System.getProperty("os.name").toLowerCase().indexOf("windows") != -1;
|
|
||||||
if(isWindows)
|
|
||||||
return "dll";
|
|
||||||
else
|
|
||||||
return "so";
|
|
||||||
}
|
|
||||||
private static final String getLibraryPrefix()
|
|
||||||
{
|
|
||||||
boolean isWindows =System.getProperty("os.name").toLowerCase().indexOf("windows") != -1;
|
|
||||||
if(isWindows)
|
|
||||||
return "";
|
|
||||||
else
|
|
||||||
return "lib";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
10
history.txt
10
history.txt
@ -1,4 +1,12 @@
|
|||||||
$Id: history.txt,v 1.129 2005/01/17 03:15:00 jrandom Exp $
|
$Id: history.txt,v 1.130 2005/01/18 19:08:13 jrandom Exp $
|
||||||
|
|
||||||
|
2005-01-21 Jhor
|
||||||
|
* Updated jbigi build scripts for OSX.
|
||||||
|
|
||||||
|
2005-01-21 jrandom
|
||||||
|
* Added support for OSX to the NativeBigInteger code so that it will look
|
||||||
|
in the classpath for libjbigi-osx-none.jnilib. At the moment, that file
|
||||||
|
is not bundled with the shipped jbigi.jar yet though.
|
||||||
|
|
||||||
2005-01-18 jrandom
|
2005-01-18 jrandom
|
||||||
* Increased the max # session tags maintained and decreased slightly the
|
* Increased the max # session tags maintained and decreased slightly the
|
||||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RouterVersion {
|
public class RouterVersion {
|
||||||
public final static String ID = "$Revision: 1.134 $ $Date: 2005/01/17 03:15:03 $";
|
public final static String ID = "$Revision: 1.135 $ $Date: 2005/01/18 19:08:13 $";
|
||||||
public final static String VERSION = "0.4.2.6";
|
public final static String VERSION = "0.4.2.6";
|
||||||
public final static long BUILD = 4;
|
public final static long BUILD = 5;
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
System.out.println("I2P Router version: " + VERSION);
|
System.out.println("I2P Router version: " + VERSION);
|
||||||
System.out.println("Router ID: " + RouterVersion.ID);
|
System.out.println("Router ID: " + RouterVersion.ID);
|
||||||
|
Reference in New Issue
Block a user