diff options
author | Sven Gothel <[email protected]> | 2012-03-28 03:09:39 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-03-28 03:09:39 +0200 |
commit | 0d486ab4bc73a53218cb015936aed755e8e9e6de (patch) | |
tree | f6d02062c504c3a23ba5bd9df0a1c50b725c1721 | |
parent | dd19355464d63ff2e77013f2e537e49d3ba750a1 (diff) |
Add support for armhf/gnueabihf resulting in new 'os.and.arch' := [ 'android-armv7hf' and 'linux-armv7hf' ]
- Platform gets new ABIType [ GENERIC, ARMEL, ARMHF ]
- Platform impl. needs to guess ABIType in case of ARM,
since no Java system property ('os.arch' ..) reflects the new EABI.
I consider this a bug, since this will also hinder JNLP to work.
The latter also uses 'os.arch' sys property to determine the nativelib resource!
(See Platform.guessABITypeImpl(..) for details how we guess the type.)
- Adding symbolic links to ubuntu's gnueabihf cross tool chain
- Adding armhf crossbuild script
-rwxr-xr-x | make/gluegen-cpptasks-base.xml | 32 | ||||
-rw-r--r-- | make/lib/gluegen-cpptasks-linux-armv7.xml | 2 | ||||
-rw-r--r-- | make/lib/gluegen-cpptasks-linux-armv7hf.xml | 35 | ||||
l--------- | make/lib/linux/arm-linux-gnueabihf/bin/gcc | 1 | ||||
l--------- | make/lib/linux/arm-linux-gnueabihf/bin/ld | 1 | ||||
l--------- | make/lib/linux/arm-linux-gnueabihf/bin/objdump | 1 | ||||
l--------- | make/lib/linux/arm-linux-gnueabihf/bin/strip | 1 | ||||
-rwxr-xr-x | make/scripts/make.gluegen.all.linux-armv7hf-cross.sh | 44 | ||||
-rwxr-xr-x | make/scripts/runtest.sh | 9 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/Platform.java | 119 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/VersionUtil.java | 3 | ||||
-rw-r--r-- | src/java/com/jogamp/common/util/cache/TempJarCache.java | 12 | ||||
-rw-r--r-- | src/junit/com/jogamp/common/util/TestSystemProperties.java | 60 | ||||
-rw-r--r-- | src/junit/com/jogamp/common/util/TestVersionInfo.java | 7 |
14 files changed, 281 insertions, 46 deletions
diff --git a/make/gluegen-cpptasks-base.xml b/make/gluegen-cpptasks-base.xml index 7f5c30b..a6f3db5 100755 --- a/make/gluegen-cpptasks-base.xml +++ b/make/gluegen-cpptasks-base.xml @@ -30,6 +30,8 @@ - isLinuxIA64 - isLinuxX86 - isLinuxARMv7 + - isAbiEabiGnuArmel (implicit if isAndroidARMv7 or isLinuxARMv7) + - isAbiEabiGnuArmhf (shall be declared explicit) - isLinuxAlpha - isLinuxHppa - isLinuxMips @@ -304,6 +306,12 @@ </or> </and> </condition> + <condition property="isAbiEabiGnuArmel"> + <or> + <os arch="isAndroidARMv7" /> + <os arch="isLinuxARMv7" /> + </or> + </condition> <condition property="isLinuxAlpha"> <and> <istrue value="${isLinux}" /> @@ -495,6 +503,8 @@ <echo message="FreeBSDAMD64=${isFreeBSDAMD64}" /> <echo message="HPUX=${isHPUX}" /> <echo message="IA64=${isIA64}" /> + <echo message="isAbiEabiGnuArmel=${isAbiEabiGnuArmel}" /> + <echo message="isAbiEabiGnuArmhf=${isAbiEabiGnuArmhf}" /> <echo message="Android=${isAndroid}" /> <echo message="AndroidARMv7=${isAndroidARMv7}" /> <echo message="Linux=${isLinux}" /> @@ -555,10 +565,19 @@ <property name="os.and.arch" value="linux-i586" /> </target> - <target name="gluegen.cpptasks.detect.os.linux.armv7" unless="gluegen.cpptasks.detected.os.2" if="isLinuxARMv7"> + <target name="gluegen.cpptasks.detect.os.linux.armv7.armel" unless="gluegen.cpptasks.detected.os.2" if="isAbiEabiGnuArmel"> <property name="os.and.arch" value="linux-armv7" /> </target> + <target name="gluegen.cpptasks.detect.os.linux.armv7.armhf" unless="gluegen.cpptasks.detected.os.2" if="isAbiEabiGnuArmhf"> + <property name="os.and.arch" value="linux-armv7hf" /> + </target> + + <target name="gluegen.cpptasks.detect.os.linux.armv7" + depends="gluegen.cpptasks.detect.os.linux.armv7.armel, gluegen.cpptasks.detect.os.linux.armv7.armhf" + unless="gluegen.cpptasks.detected.os.2" + if="isLinuxARMv7"/> + <target name="gluegen.cpptasks.detect.os.linux.alpha" unless="gluegen.cpptasks.detected.os.2" if="isLinuxAlpha"> <property name="os.and.arch" value="linux-alpha" /> </target> @@ -592,10 +611,19 @@ </target> - <target name="gluegen.cpptasks.detect.os.android.armv7" unless="gluegen.cpptasks.detected.os.2" if="isAndroidARMv7"> + <target name="gluegen.cpptasks.detect.os.android.armv7.armel" unless="gluegen.cpptasks.detected.os.2" if="isAbiEabiGnuArmel"> <property name="os.and.arch" value="android-armv7" /> </target> + <target name="gluegen.cpptasks.detect.os.android.armv7.armhf" unless="gluegen.cpptasks.detected.os.2" if="isAbiEabiGnuArmhf"> + <property name="os.and.arch" value="android-armv7hf" /> + </target> + + <target name="gluegen.cpptasks.detect.os.android.armv7" + depends="gluegen.cpptasks.detect.os.android.armv7.armel, gluegen.cpptasks.detect.os.android.armv7.armhf" + unless="gluegen.cpptasks.detected.os.2" + if="isAndroidARMv7"/> + <target name="gluegen.cpptasks.detect.os.linux" depends="gluegen.cpptasks.detect.os.linux.amd64,gluegen.cpptasks.detect.os.linux.ia64,gluegen.cpptasks.detect.os.linux.x86,gluegen.cpptasks.detect.os.linux.armv7,gluegen.cpptasks.detect.os.android.armv7,gluegen.cpptasks.detect.os.linux.alpha,gluegen.cpptasks.detect.os.linux.hppa,gluegen.cpptasks.detect.os.linux.mips,gluegen.cpptasks.detect.os.linux.mipsel,gluegen.cpptasks.detect.os.linux.ppc,gluegen.cpptasks.detect.os.linux.s390,gluegen.cpptasks.detect.os.linux.s390x,gluegen.cpptasks.detect.os.linux.sparc" unless="gluegen.cpptasks.detected.os.2" /> <target name="gluegen.cpptasks.detect.os.osx" unless="gluegen.cpptasks.detected.os.2" if="isOSX"> diff --git a/make/lib/gluegen-cpptasks-linux-armv7.xml b/make/lib/gluegen-cpptasks-linux-armv7.xml index fad15af..e07d58e 100644 --- a/make/lib/gluegen-cpptasks-linux-armv7.xml +++ b/make/lib/gluegen-cpptasks-linux-armv7.xml @@ -24,7 +24,7 @@ <property name="isX11" value="true" /> <property name="jvmDataModel.arg" value="-Djnlp.no.jvm.data.model.set=true" /> <property name="isCrosscompilation" value="true" /> - + <property name="isAbiEabiGnuArmel" value="true" /> <echo message="gluegen.cpptasks.detect.os.custom: GLUEGEN_CPPTASKS_FILE 'gluegen-cpptasks-linux-armv7' done"/> </target> diff --git a/make/lib/gluegen-cpptasks-linux-armv7hf.xml b/make/lib/gluegen-cpptasks-linux-armv7hf.xml new file mode 100644 index 0000000..7e20f24 --- /dev/null +++ b/make/lib/gluegen-cpptasks-linux-armv7hf.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + This is an example of how to add custom compiler/linker + arguments for a crosscompiler. + + You can use such files with setting the property 'gluegen-cpptasks.file', ie: + + -Dgluegen-cpptasks.file=`pwd`/lib/gluegen-cpptasks-linux-32bit.xml + + In case you want to compile for 32bit on a 64bit machine, + you might also need to set the 'os.arch' to 'x86'. + Example: gluegen/make/make.gluegen.all.linux-x86.sh + --> + +<project name="GlueGen-cpptasks-linux-armv7hf" basedir="." > + +<!-- Set OS and ARCH for crosscompilation compiler configuration --> +<target name="gluegen.cpptasks.detect.os.custom"> + <property name="gluegen.cpptasks.detected.os" value="true" /> + <property name="isUnix" value="true" /> + <property name="isLinux" value="true" /> + <property name="isLinuxARMv7" value="true" /> + <property name="isX11" value="true" /> + <property name="jvmDataModel.arg" value="-Djnlp.no.jvm.data.model.set=true" /> + <property name="isCrosscompilation" value="true" /> + <property name="isAbiEabiGnuArmhf" value="true" /> + <echo message="gluegen.cpptasks.detect.os.custom: GLUEGEN_CPPTASKS_FILE 'gluegen-cpptasks-linux-armv7hf' done"/> +</target> + +<import file="${gluegen.root.abs-path}/make/gluegen-cpptasks-base.xml" optional="false" /> + +</project> + + diff --git a/make/lib/linux/arm-linux-gnueabihf/bin/gcc b/make/lib/linux/arm-linux-gnueabihf/bin/gcc new file mode 120000 index 0000000..dca59c0 --- /dev/null +++ b/make/lib/linux/arm-linux-gnueabihf/bin/gcc @@ -0,0 +1 @@ +/usr/bin/arm-linux-gnueabihf-gcc
\ No newline at end of file diff --git a/make/lib/linux/arm-linux-gnueabihf/bin/ld b/make/lib/linux/arm-linux-gnueabihf/bin/ld new file mode 120000 index 0000000..bce9f7f --- /dev/null +++ b/make/lib/linux/arm-linux-gnueabihf/bin/ld @@ -0,0 +1 @@ +/usr/bin/arm-linux-gnueabihf-ld
\ No newline at end of file diff --git a/make/lib/linux/arm-linux-gnueabihf/bin/objdump b/make/lib/linux/arm-linux-gnueabihf/bin/objdump new file mode 120000 index 0000000..ded739c --- /dev/null +++ b/make/lib/linux/arm-linux-gnueabihf/bin/objdump @@ -0,0 +1 @@ +/usr/bin/arm-linux-gnueabihf-objdump
\ No newline at end of file diff --git a/make/lib/linux/arm-linux-gnueabihf/bin/strip b/make/lib/linux/arm-linux-gnueabihf/bin/strip new file mode 120000 index 0000000..c941465 --- /dev/null +++ b/make/lib/linux/arm-linux-gnueabihf/bin/strip @@ -0,0 +1 @@ +/usr/bin/arm-linux-gnueabihf-strip
\ No newline at end of file diff --git a/make/scripts/make.gluegen.all.linux-armv7hf-cross.sh b/make/scripts/make.gluegen.all.linux-armv7hf-cross.sh new file mode 100755 index 0000000..f9b1b54 --- /dev/null +++ b/make/scripts/make.gluegen.all.linux-armv7hf-cross.sh @@ -0,0 +1,44 @@ +#! /bin/sh + +SDIR=`dirname $0` + +if [ -e $SDIR/setenv-build-jogl-x86_64.sh ] ; then + . $SDIR/setenv-build-jogl-x86_64.sh +fi + +# arm-linux-gnueabihf == armhf triplet +PATH=`pwd`/lib/linux/arm-linux-gnueabihf/bin:$PATH +export PATH + +# -Dc.compiler.debug=true +# -Dgluegen.cpptasks.detected.os=true \ +# -DisUnix=true \ +# -DisLinux=true \ +# -DisLinuxARMv7=true \ +# -DisX11=false \ + +export NODE_LABEL=. + +export HOST_UID=jogamp +export HOST_IP=jogamp02 +export HOST_RSYNC_ROOT=PROJECTS/JOGL + +export TARGET_UID=jogamp +export TARGET_IP=panda01 +export TARGET_ROOT=/home/jogamp/projects-cross +export TARGET_ANT_HOME=/usr/share/ant + +export TARGET_PLATFORM_ROOT=/opt-linux-armv7-armhf +export TARGET_PLATFORM_LIBS=$TARGET_PLATFORM_ROOT/usr/lib +export TARGET_JAVA_LIBS=$TARGET_PLATFORM_ROOT/jre/lib/arm + +export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-linux-armv7hf.xml" + +#export JUNIT_DISABLED="true" +export JUNIT_RUN_ARG0="-Dnewt.test.Screen.disableScreenMode" + +ant \ + -Drootrel.build=build-linux-armv7hf \ + $* 2>&1 | tee make.gluegen.all.linux-armv7hf-cross.log + + diff --git a/make/scripts/runtest.sh b/make/scripts/runtest.sh index 3037d8a..a0034d6 100755 --- a/make/scripts/runtest.sh +++ b/make/scripts/runtest.sh @@ -42,6 +42,7 @@ rm -f $LOG #D_ARGS="-Djogamp.debug.ProcAddressHelper=true -Djogamp.debug.NativeLibrary=true" #D_ARGS="-Djogamp.debug.TraceLock" #D_ARGS="-Djogamp.debug.JarUtil" +#D_ARGS="-Djogamp.debug.TempJarCache" #D_ARGS="-Djogamp.debug.TempFileCache" #D_ARGS="-Djogamp.debug.JNILibLoader -Djogamp.debug.TempFileCache -Djogamp.debug.JarUtil" #D_ARGS="-Djogamp.debug.JNILibLoader -Djogamp.gluegen.UseTempJarCache=false" @@ -49,7 +50,8 @@ rm -f $LOG #D_ARGS="-Djogamp.debug.Lock" #D_ARGS="-Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock" #D_ARGS="-Djogamp.debug.Lock.TraceLock" -D_ARGS="-Djogamp.debug.IOUtil" +#D_ARGS="-Djogamp.debug.IOUtil" +#D_ARGS="-Djogamp.debug=all" function onetest() { clazz=$1 @@ -66,7 +68,8 @@ function onetest() { echo } -#onetest com.jogamp.common.GlueGenVersion 2>&1 | tee -a $LOG +onetest com.jogamp.common.GlueGenVersion 2>&1 | tee -a $LOG +#onetest com.jogamp.common.util.TestSystemProperties 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestVersionInfo 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestIteratorIndexCORE 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.locks.TestRecursiveLock01 2>&1 | tee -a $LOG @@ -80,7 +83,7 @@ function onetest() { #onetest com.jogamp.common.nio.TestPointerBufferEndian 2>&1 | tee -a $LOG #onetest com.jogamp.common.nio.TestStructAccessorEndian 2>&1 | tee -a $LOG #onetest com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter 2>&1 | tee -a $LOG -onetest com.jogamp.gluegen.test.junit.generation.Test1p2ProcAddressEmitter 2>&1 | tee -a $LOG +#onetest com.jogamp.gluegen.test.junit.generation.Test1p2ProcAddressEmitter 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestPlatform01 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestRunnableTask01 2>&1 | tee -a $LOG #onetest com.jogamp.common.util.TestIOUtil01 2>&1 | tee -a $LOG diff --git a/src/java/com/jogamp/common/os/Platform.java b/src/java/com/jogamp/common/os/Platform.java index 6553b07..461ed2a 100644 --- a/src/java/com/jogamp/common/os/Platform.java +++ b/src/java/com/jogamp/common/os/Platform.java @@ -148,6 +148,21 @@ public class Platform { } public static final CPUType CPU_ARCH; + public enum ABIType { + GENERIC_ABI ( 0x0000 ), + /** ARM GNU-EABI ARMEL -mfloat-abi=softfp */ + EABI_GNU_ARMEL ( 0x0001 ), + /** ARM GNU-EABI ARMHF -mfloat-abi=hard */ + EABI_GNU_ARMHF ( 0x0002 ); + + public final int id; + + ABIType(int id){ + this.id = id; + } + } + public static final ABIType ABI_TYPE; + private static final boolean is32Bit; private static final MachineDescription machineDescription; @@ -174,44 +189,16 @@ public class Platform { LITTLE_ENDIAN = queryIsLittleEndianImpl(); - if( ARCH_lower.equals("x86") || - ARCH_lower.equals("i386") || - ARCH_lower.equals("i486") || - ARCH_lower.equals("i586") || - ARCH_lower.equals("i686") ) { - CPU_ARCH = CPUType.X86_32; - } else if( ARCH_lower.equals("x86_64") || - ARCH_lower.equals("amd64") ) { - CPU_ARCH = CPUType.X86_64; - } else if( ARCH_lower.equals("ia64") ) { - CPU_ARCH = CPUType.IA64; - } else if( ARCH_lower.equals("arm") ) { - CPU_ARCH = CPUType.ARM; - } else if( ARCH_lower.equals("armv5l") ) { - CPU_ARCH = CPUType.ARMv5; - } else if( ARCH_lower.equals("armv6l") ) { - CPU_ARCH = CPUType.ARMv6; - } else if( ARCH_lower.equals("armv7l") ) { - CPU_ARCH = CPUType.ARMv7; - } else if( ARCH_lower.equals("sparc") ) { - CPU_ARCH = CPUType.SPARC_32; - } else if( ARCH_lower.equals("sparcv9") ) { - CPU_ARCH = CPUType.SPARCV9_64; - } else if( ARCH_lower.equals("pa_risc2.0") ) { - CPU_ARCH = CPUType.PA_RISC2_0; - } else if( ARCH_lower.equals("ppc") ) { - CPU_ARCH = CPUType.PPC; - } else { - throw new RuntimeException("Please port CPU detection to your platform (" + OS_lower + "/" + ARCH_lower + ")"); - } + CPU_ARCH = getCPUTypeImpl(ARCH_lower); + ABI_TYPE = guessABITypeImpl(CPU_ARCH); OS_TYPE = getOSTypeImpl(); - - os_and_arch = getOSAndArch(OS_TYPE, CPU_ARCH); + os_and_arch = getOSAndArch(OS_TYPE, CPU_ARCH, ABI_TYPE); USE_TEMP_JAR_CACHE = (OS_TYPE != OSType.ANDROID) && isRunningFromJarURL() && Debug.getBooleanProperty(useTempJarCachePropName, true, true); loadGlueGenRTImpl(); + JVMUtil.initSingleton(); // requires gluegen-rt, one-time init. MachineDescription md = MachineDescriptionRuntime.getRuntime(); @@ -267,6 +254,65 @@ public class Platform { return 0x0C0D == tst_s.get(0); } + private static CPUType getCPUTypeImpl(String archLower) { + if( archLower.equals("x86") || + archLower.equals("i386") || + archLower.equals("i486") || + archLower.equals("i586") || + archLower.equals("i686") ) { + return CPUType.X86_32; + } else if( archLower.equals("x86_64") || + archLower.equals("amd64") ) { + return CPUType.X86_64; + } else if( archLower.equals("ia64") ) { + return CPUType.IA64; + } else if( archLower.equals("arm") ) { + return CPUType.ARM; + } else if( archLower.equals("armv5l") ) { + return CPUType.ARMv5; + } else if( archLower.equals("armv6l") ) { + return CPUType.ARMv6; + } else if( archLower.equals("armv7l") ) { + return CPUType.ARMv7; + } else if( archLower.equals("sparc") ) { + return CPUType.SPARC_32; + } else if( archLower.equals("sparcv9") ) { + return CPUType.SPARCV9_64; + } else if( archLower.equals("pa_risc2.0") ) { + return CPUType.PA_RISC2_0; + } else if( archLower.equals("ppc") ) { + return CPUType.PPC; + } else { + throw new RuntimeException("Please port CPU detection to your platform (" + OS_lower + "/" + archLower + ")"); + } + } + + private static boolean contains(String data, String[] search) { + if(null != data && null != search) { + for(int i=0; i<search.length; i++) { + if(data.indexOf(search[i]) >= 0) { + return true; + } + } + } + return false; + } + private static ABIType guessABITypeImpl(CPUType cpuType) { + if(CPUFamily.ARM != cpuType.family) { + return ABIType.GENERIC_ABI; + } + return AccessController.doPrivileged(new PrivilegedAction<ABIType>() { + private final String[] gnueabihf = new String[] { "gnueabihf", "armhf" }; + public ABIType run() { + if ( contains(System.getProperty("sun.boot.library.path"), gnueabihf) || + contains(System.getProperty("java.library.path"), gnueabihf) || + contains(System.getProperty("java.home"), gnueabihf) ) { + return ABIType.EABI_GNU_ARMHF; + } + return ABIType.EABI_GNU_ARMEL; + } } ); + } + private static OSType getOSTypeImpl() throws RuntimeException { if ( AndroidVersion.isAvailable ) { return OSType.ANDROID; @@ -451,10 +497,10 @@ public class Platform { * </ul> * @return */ - public static String getOSAndArch(OSType osType, CPUType cpuType) { + public static String getOSAndArch(OSType osType, CPUType cpuType, ABIType abiType) { String _os_and_arch; - switch( CPU_ARCH ) { + switch( cpuType ) { case X86_32: _os_and_arch = "i586"; break; @@ -491,7 +537,10 @@ public class Platform { default: throw new InternalError("Complete case block"); } - switch(OS_TYPE) { + if( ABIType.EABI_GNU_ARMHF == abiType ) { + _os_and_arch = _os_and_arch + "hf" ; + } + switch( osType ) { case ANDROID: _os_and_arch = "android-" + _os_and_arch; break; diff --git a/src/java/com/jogamp/common/util/VersionUtil.java b/src/java/com/jogamp/common/util/VersionUtil.java index 4d2d0f2..820035c 100644 --- a/src/java/com/jogamp/common/util/VersionUtil.java +++ b/src/java/com/jogamp/common/util/VersionUtil.java @@ -56,7 +56,8 @@ public class VersionUtil { // environment sb.append("Platform: ").append(Platform.getOSType()).append(" / ").append(Platform.getOSName()).append(' ').append(Platform.getOSVersion()).append(" (os), "); - sb.append(Platform.getArchName()).append(" (arch) ").append(Runtime.getRuntime().availableProcessors()).append(" cores"); + sb.append(Platform.getArchName()).append(" (arch), ").append(Platform.ABI_TYPE).append(", "); + sb.append(Runtime.getRuntime().availableProcessors()).append(" cores"); sb.append(Platform.getNewline()); if( AndroidVersion.isAvailable) { sb.append("Platform: Android Version: ").append(AndroidVersion.CODENAME).append(", "); diff --git a/src/java/com/jogamp/common/util/cache/TempJarCache.java b/src/java/com/jogamp/common/util/cache/TempJarCache.java index 96e68df..8aaab94 100644 --- a/src/java/com/jogamp/common/util/cache/TempJarCache.java +++ b/src/java/com/jogamp/common/util/cache/TempJarCache.java @@ -96,6 +96,9 @@ public class TempJarCache { classFileJars = new HashSet<URL>(); resourceFileJars = new HashSet<URL>(); } + if(DEBUG) { + System.err.println("TempJarCache.initSingleton(): ok "+(false==staticInitError)+", "+ tmpFileCache.getTempDir()); + } } } } @@ -109,11 +112,20 @@ public class TempJarCache { * <p> * In JogAmp, JNI native libraries loaded and registered by {@link JNILibLoaderBase} * derivations, where the native JARs might be loaded via {@link JNILibLoaderBase#addNativeJarLibs(Class, String) }. + * </p> + * <p> + * The only valid use case to shutdown the TempJarCache is at bootstrapping, + * i.e. when no native library is guaranteed to be loaded. This could be useful + * if bootstrapping needs to find the proper native library type. * </p> + * public static void shutdown() { if (isInit) { // volatile: ok synchronized (TempJarCache.class) { if (isInit) { + if(DEBUG) { + System.err.println("TempJarCache.shutdown(): real "+(false==staticInitError)+", "+ tmpFileCache.getTempDir()); + } isInit = false; if(!staticInitError) { nativeLibMap.clear(); diff --git a/src/junit/com/jogamp/common/util/TestSystemProperties.java b/src/junit/com/jogamp/common/util/TestSystemProperties.java new file mode 100644 index 0000000..8ede038 --- /dev/null +++ b/src/junit/com/jogamp/common/util/TestSystemProperties.java @@ -0,0 +1,60 @@ +/** + * Copyright 2012 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ + +package com.jogamp.common.util; + +import java.io.IOException; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import org.junit.Test; + +import com.jogamp.junit.util.JunitTracer; + +public class TestSystemProperties extends JunitTracer { + + @Test + public void dumpProperties() { + int i=0; + Properties props = System.getProperties(); + Iterator<Map.Entry<Object,Object>> iter = props.entrySet().iterator(); + while (iter.hasNext()) { + i++; + Map.Entry<Object, Object> entry = iter.next(); + System.out.println(i+": "+entry.getKey() + " = " + entry.getValue()); + } + System.out.println("Property count: "+i); + } + + public static void main(String args[]) throws IOException { + String tstname = TestSystemProperties.class.getName(); + org.junit.runner.JUnitCore.main(tstname); + } + +} diff --git a/src/junit/com/jogamp/common/util/TestVersionInfo.java b/src/junit/com/jogamp/common/util/TestVersionInfo.java index 272ef73..f9c748b 100644 --- a/src/junit/com/jogamp/common/util/TestVersionInfo.java +++ b/src/junit/com/jogamp/common/util/TestVersionInfo.java @@ -28,13 +28,12 @@ package com.jogamp.common.util; -import com.jogamp.common.GlueGenVersion; -import com.jogamp.junit.util.JunitTracer; - import java.io.IOException; - import org.junit.Test; +import com.jogamp.common.GlueGenVersion; +import com.jogamp.junit.util.JunitTracer; + public class TestVersionInfo extends JunitTracer { @Test |