From b05f716cbcbc379588050c8f3d91579b3a14ec88 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 1 Oct 2013 15:34:05 +0200 Subject: Bug 845: Fix JNILibLoaderBase.addNativeJarLibsImpl(..) fat-jar case. Always use the jar-basename when calling TempJarCache.addNativeLibs(..), otherwise it is mapped and loaded multiple times leading to different native libraries. Simplify addNativeJarLibsImpl(..) argument semantics by passing complete jarBasename and nativeJarBasename (w/ suffix). Added manual test scripts validating [gluegen + jogl] usage with multi (Bug 843) and fat (Bug 845) jar configurations. --- test/TestMultiAndFatJar/make-fat_and_multi.sh | 45 +++++++++++++++++++++++++++ test/TestMultiAndFatJar/run-fat.sh | 9 ++++++ test/TestMultiAndFatJar/run-multi.sh | 9 ++++++ 3 files changed, 63 insertions(+) create mode 100644 test/TestMultiAndFatJar/make-fat_and_multi.sh create mode 100644 test/TestMultiAndFatJar/run-fat.sh create mode 100644 test/TestMultiAndFatJar/run-multi.sh (limited to 'test/TestMultiAndFatJar') diff --git a/test/TestMultiAndFatJar/make-fat_and_multi.sh b/test/TestMultiAndFatJar/make-fat_and_multi.sh new file mode 100644 index 0000000..945d29b --- /dev/null +++ b/test/TestMultiAndFatJar/make-fat_and_multi.sh @@ -0,0 +1,45 @@ +THISDIR=`pwd` +GLUEGEN=$THISDIR/../../../gluegen +JOGL=$THISDIR/../../../jogl + +bdir=build-x86_64 + +rm -rf temp + +# +# make fat +# +rm -f jogl-fat.jar +mkdir temp +cd temp +unzip -o $GLUEGEN/$bdir/gluegen-rt.jar +unzip -o $GLUEGEN/$bdir/gluegen-rt-natives-linux-amd64.jar +unzip -o $JOGL/$bdir/jar/jogl-all.jar +unzip -o $JOGL/$bdir/jar/jogl-all-natives-linux-amd64.jar +mkdir -p natives/linux-amd64 +mv lib*.so natives/linux-amd64/ +rm -rf META-INF +jar cf ../jogl-fat.jar * +cd .. +rm -rf temp + +# +# make multi +# +rm -f jogl-multi.jar jogl-multi-natives-linux-amd64.jar +mkdir temp +cd temp +unzip -o $GLUEGEN/$bdir/gluegen-rt.jar +unzip -o $JOGL/$bdir/jar/jogl-all.jar +rm -rf META-INF +jar cf ../jogl-multi.jar * +rm -rf * +unzip -o $GLUEGEN/$bdir/gluegen-rt-natives-linux-amd64.jar +unzip -o $JOGL/$bdir/jar/jogl-all-natives-linux-amd64.jar +mkdir -p natives/linux-amd64 +mv lib*.so natives/linux-amd64/ +rm -rf META-INF +jar cf ../jogl-multi-natives-linux-amd64.jar * +cd .. +rm -rf temp + diff --git a/test/TestMultiAndFatJar/run-fat.sh b/test/TestMultiAndFatJar/run-fat.sh new file mode 100644 index 0000000..60247a6 --- /dev/null +++ b/test/TestMultiAndFatJar/run-fat.sh @@ -0,0 +1,9 @@ + +D_ARGS="-Djogamp.debug.JNILibLoader -Djogamp.debug.TempFileCache -Djogamp.debug.JarUtil -Djogamp.debug.TempJarCache" +#D_ARGS="-Djogamp.debug.ProcAddressHelper -Djogamp.debug.NativeLibrary -Djogamp.debug.NativeLibrary.Lookup" +#D_ARGS="-Djogamp.debug.JNILibLoader -Djogamp.debug.TempFileCache -Djogamp.debug.JarUtil -Djogamp.debug.TempJarCache -Djogamp.debug.NativeLibrary -Djogamp.debug.NativeLibrary.Lookup -Djogl.debug=all" + +#T_CLASS="com.jogamp.opengl.JoglVersion" +T_CLASS="com.jogamp.newt.opengl.GLWindow" + +java -cp jogl-fat.jar $D_ARGS $T_CLASS 2>&1 | tee run-fat.log diff --git a/test/TestMultiAndFatJar/run-multi.sh b/test/TestMultiAndFatJar/run-multi.sh new file mode 100644 index 0000000..0cca10c --- /dev/null +++ b/test/TestMultiAndFatJar/run-multi.sh @@ -0,0 +1,9 @@ + +#D_ARGS="-Djogamp.debug.JNILibLoader -Djogamp.debug.TempFileCache -Djogamp.debug.JarUtil -Djogamp.debug.TempJarCache" +#D_ARGS="-Djogamp.debug.ProcAddressHelper -Djogamp.debug.NativeLibrary -Djogamp.debug.NativeLibrary.Lookup" +D_ARGS="-Djogamp.debug.JNILibLoader -Djogamp.debug.TempFileCache -Djogamp.debug.JarUtil -Djogamp.debug.TempJarCache -Djogamp.debug.NativeLibrary" + +#T_CLASS="com.jogamp.opengl.JoglVersion" +T_CLASS="com.jogamp.newt.opengl.GLWindow" + +java -cp jogl-multi.jar $D_ARGS $T_CLASS 2>&1 | tee run-multi.log -- cgit v1.2.3