summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--make/build.xml6
-rw-r--r--make/lib/gluegen-cpptasks-android-armv7.xml17
-rw-r--r--make/scripts/crosstest-java-android-armv7-rel.sh17
-rw-r--r--make/scripts/crosstest-junit-android-armv7-rel.sh65
-rw-r--r--src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java6
5 files changed, 88 insertions, 23 deletions
diff --git a/make/build.xml b/make/build.xml
index f91d3a2..b1b8616 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -302,6 +302,10 @@
<property name="java.includes.dir.platform" value="${java.includes.dir}/linux" />
</target>
+ <target name="declare.android" if="isAndroid" >
+ <property name="c.src.dir.os" value="unix" />
+ </target>
+
<target name="declare.solaris32" if="isSolaris32Bit">
<echo message="Solaris" />
<property name="compiler.cfg.id" value="compiler.cfg.solaris" />
@@ -359,7 +363,7 @@
<property name="java.includes.dir.hpux" value="${java.includes.dir}/hp-ux" />
</target>
- <target name="c.configure" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler,declare.win32,declare.linux,declare.solaris,declare.macosx,declare.freebsd,declare.hpux,gluegen.cpptasks.configure.compiler" unless="build.javaonly" />
+ <target name="c.configure" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler,declare.win32,declare.linux,declare.android,declare.solaris,declare.macosx,declare.freebsd,declare.hpux,gluegen.cpptasks.configure.compiler" unless="build.javaonly" />
<target name="c.rename.lib.mingw" if="isMingW">
<!-- FIXME: this is a hack; the cpptask should have an option to change the
diff --git a/make/lib/gluegen-cpptasks-android-armv7.xml b/make/lib/gluegen-cpptasks-android-armv7.xml
index 90db706..38b42f2 100644
--- a/make/lib/gluegen-cpptasks-android-armv7.xml
+++ b/make/lib/gluegen-cpptasks-android-armv7.xml
@@ -28,20 +28,6 @@
<compilerarg value="-fpic" />
<compilerarg value="${env.NDK_INCLUDE}" />
<compilerarg value="-I${env.TARGET_TOOL_PATH}/lib/gcc/${env.TARGET_ARCH}/${env.GCC_VERSION}/include" /> <!--inclides stdarg.h -->
- <compilerarg value="-Wl,--demangle" />
- <compilerarg value="-nostdlib" />
- <compilerarg value="-Bdynamic" />
- <compilerarg value="-Wl,-dynamic-linker,/system/bin/linker" />
- <compilerarg value="-Wl,--gc-sections" />
- <compilerarg value="-Wl,-z,nocopyreloc" />
- <compilerarg value="${env.TARGET_OS_PATH}/lib/libc.so" />
- <compilerarg value="${env.TARGET_OS_PATH}/lib/libdl.so" />
- <compilerarg value="${env.TARGET_OS_PATH}/lib/libm.so" />
-<!-- <compilerarg value="${env.TARGET_OS_PATH}/lib/crtbegin_dynamic.o" /> -->
- <compilerarg value="-Wl,--no-undefined" />
- <compilerarg value="-Wl,-rpath-link=${env.TARGET_OS_PATH}/lib" />
- <compilerarg value="${env.TARGET_TOOL_PATH}/lib/gcc/${env.TARGET_ARCH}/${env.GCC_VERSION}/${env.TARGET_CPU_NAME}/libgcc.a" />
- <compilerarg value="${env.TARGET_OS_PATH}/lib/crtend_android.o" />
<defineset>
<define name="__unix__"/>
<define name="ANDROID" />
@@ -53,6 +39,8 @@
<!--<linker id="linker.cfg.android" name="arm-linux-androideabi-gcc">-->
<linker id="linker.cfg.android" name="gcc">
+ <linkerarg value="-march=armv7-a" />
+ <linkerarg value="-fpic" />
<linkerarg value="-Wl,--demangle" />
<linkerarg value="--sysroot=${env.TARGET_OS_PATH}" /> <!-- set root dir for lib and include -->
<linkerarg value="-nostdlib" />
@@ -62,7 +50,6 @@
<linkerarg value="-Wl,-z,nocopyreloc" />
<linkerarg value="${env.TARGET_OS_PATH}/lib/libc.so" />
<linkerarg value="${env.TARGET_OS_PATH}/lib/libdl.so" />
-<!-- <linkerarg value="${env.TARGET_OS_PATH}/lib/libstdc++.so" /> -->
<linkerarg value="${env.TARGET_OS_PATH}/lib/libm.so" />
<!-- <linkerarg value="${env.TARGET_OS_PATH}/lib/crtbegin_dynamic.o" /> -->
<linkerarg value="-Wl,--no-undefined" />
diff --git a/make/scripts/crosstest-java-android-armv7-rel.sh b/make/scripts/crosstest-java-android-armv7-rel.sh
index 08df575..822d03d 100644
--- a/make/scripts/crosstest-java-android-armv7-rel.sh
+++ b/make/scripts/crosstest-java-android-armv7-rel.sh
@@ -1,3 +1,5 @@
+#! /bin/bash
+
export HOST_UID=sven
export HOST_IP=192.168.0.52
export HOST_RSYNC_ROOT=PROJECTS/JOGL
@@ -19,28 +21,35 @@ fi
# export BOOTCLASSPATH /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
#
+#TSTCLASS=com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter
#TSTCLASS=com.jogamp.gluegen.test.junit.generation.Test1p2ProcAddressEmitter
TSTCLASS=com.jogamp.common.GlueGenVersion
LOGFILE=`basename $0 .sh`.log
# -Djava.class.path=lib/junit.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-junit.jar:$BUILD_DIR/gluegen.jar:$BUILD_DIR/test/build/gluegen-test.jar \
+# -Djava.class.path=lib/ant-junit-all.apk:$BUILD_DIR/gluegen-rt.apk \
# -Djava.library.path=/system/lib:$TARGET_ROOT/gluegen/make/$BUILD_DIR/obj:$BUILD_DIR/test/build/natives \
-adb shell "\
+echo "#! /system/bin/sh" > $BUILD_DIR/targetcommand.sh
+
+echo "\
rsync -av --delete --delete-after --exclude 'build-x86*/' $HOST_UID@$HOST_IP::$HOST_RSYNC_ROOT/gluegen $TARGET_ROOT ; \
cd $TARGET_ROOT/gluegen/make ; \
export LD_LIBRARY_PATH=/system/lib:$TARGET_ROOT/gluegen/make/$BUILD_DIR/obj:$TARGET_ROOT/gluegen/make/$BUILD_DIR/test/build/natives ; \
export BOOTCLASSPATH=/system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar ; \
dalvikvm \
-Xjnigreflimit:2000 \
- -Djava.class.path=lib/ant-junit-all.apk:$BUILD_DIR/gluegen-rt.apk \
+ -cp ../make/lib/ant-junit-all.apk:../build-android-armv7/gluegen.apk:../build-android-armv7/test/build/gluegen-test.apk \
-Djogamp.debug.JNILibLoader=true \
-Djogamp.debug.NativeLibrary=true \
-Djogamp.debug.NativeLibrary.Lookup=true \
-Djogamp.debug.ProcAddressHelper=true \
com.android.internal.util.WithFramework \
$TSTCLASS \
-" 2>&1 | tee $LOGFILE
+" >> $BUILD_DIR/targetcommand.sh
+
+chmod ugo+x $BUILD_DIR/targetcommand.sh
+adb push $BUILD_DIR/targetcommand.sh $TARGET_ROOT/targetcommand.sh
+adb shell $TARGET_ROOT/targetcommand.sh 2>&1 | tee $LOGFILE
-adb pull $TARGET_ROOT/gluegen/make/$LOGFILE .
diff --git a/make/scripts/crosstest-junit-android-armv7-rel.sh b/make/scripts/crosstest-junit-android-armv7-rel.sh
new file mode 100644
index 0000000..3b61e29
--- /dev/null
+++ b/make/scripts/crosstest-junit-android-armv7-rel.sh
@@ -0,0 +1,65 @@
+#! /bin/bash
+
+export HOST_UID=sven
+export HOST_IP=192.168.0.52
+export HOST_RSYNC_ROOT=PROJECTS/JOGL
+
+export TARGET_UID=jogamp
+export TARGET_IP=beagle02
+export TARGET_ROOT=/projects
+
+export BUILD_DIR=../build-android-armv7
+
+if [ -e /opt-linux-x86/android-sdk-linux_x86 ] ; then
+ export ANDROID_SDK_HOME=/opt-linux-x86/android-sdk-linux_x86
+ export PATH=$ANDROID_SDK_HOME/platform-tools:$PATH
+fi
+
+#
+# orig android:
+# export LD_LIBRARY_PATH /system/lib
+# export BOOTCLASSPATH /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
+#
+
+#TSTCLASS=com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter
+TSTCLASS=com.jogamp.gluegen.test.junit.generation.Test1p2ProcAddressEmitter
+
+LOGFILE=`basename $0 .sh`.log
+
+# -Djava.class.path=lib/junit.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-junit.jar:$BUILD_DIR/gluegen.jar:$BUILD_DIR/test/build/gluegen-test.jar \
+# -Djava.class.path=lib/ant-junit-all.apk:$BUILD_DIR/gluegen-rt.apk \
+# -Djava.library.path=/system/lib:$TARGET_ROOT/gluegen/make/$BUILD_DIR/obj:$BUILD_DIR/test/build/natives \
+
+echo "#! /system/bin/sh" > $BUILD_DIR/targetcommand.sh
+
+echo "\
+rsync -av --delete --delete-after --exclude 'build-x86*/' $HOST_UID@$HOST_IP::$HOST_RSYNC_ROOT/gluegen $TARGET_ROOT ; \
+cd $TARGET_ROOT/gluegen/make ; \
+export LD_LIBRARY_PATH=/system/lib:$TARGET_ROOT/gluegen/make/$BUILD_DIR/obj:$TARGET_ROOT/gluegen/make/$BUILD_DIR/test/build/natives ; \
+export BOOTCLASSPATH=/system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar ; \
+dalvikvm \
+ -Xjnigreflimit:2000 \
+ -cp ../make/lib/ant-junit-all.apk:../build-android-armv7/gluegen.apk:../build-android-armv7/test/build/gluegen-test.apk \
+ -Djogamp.debug.JNILibLoader=true \
+ -Djogamp.debug.NativeLibrary=true \
+ -Djogamp.debug.NativeLibrary.Lookup=true \
+ -Djogamp.debug.ProcAddressHelper=true \
+ com.android.internal.util.WithFramework \
+ org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner \
+ $TSTCLASS \
+ filtertrace=true \
+ haltOnError=false \
+ haltOnFailure=false \
+ showoutput=true \
+ outputtoformatters=true \
+ logfailedtests=true \
+ logtestlistenerevents=true \
+ formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter \
+ formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,./TEST-result.xml \
+" >> $BUILD_DIR/targetcommand.sh
+
+chmod ugo+x $BUILD_DIR/targetcommand.sh
+adb push $BUILD_DIR/targetcommand.sh $TARGET_ROOT/targetcommand.sh
+adb shell $TARGET_ROOT/targetcommand.sh 2>&1 | tee $LOGFILE
+adb pull $TARGET_ROOT/gluegen/make/TEST-result.xml TEST-result.xml
+
diff --git a/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java b/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java
index cd6e85d..c5dcdef 100644
--- a/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java
+++ b/src/junit/com/jogamp/gluegen/test/junit/generation/Test1p2ProcAddressEmitter.java
@@ -85,7 +85,7 @@ public class Test1p2ProcAddressEmitter extends BaseClass {
*/
@Test
public void chapter03aTestCoverageFunctionalityDirectNIOAndPrimitiveArray() throws Exception {
- chapter03TestCoverageFunctionalityNIOAndPrimitiveArray(new Bindingtest1p1Impl(), true);
+ chapter03TestCoverageFunctionalityNIOAndPrimitiveArray(new Bindingtest1p2Impl(), true);
}
/**
@@ -96,7 +96,7 @@ public class Test1p2ProcAddressEmitter extends BaseClass {
*/
@Test
public void chapter03bTestCoverageFunctionalityIndirectNIOAndPrimitiveArray() throws Exception {
- chapter03TestCoverageFunctionalityNIOAndPrimitiveArray(new Bindingtest1p1Impl(), false);
+ chapter03TestCoverageFunctionalityNIOAndPrimitiveArray(new Bindingtest1p2Impl(), false);
}
/**
@@ -120,7 +120,7 @@ public class Test1p2ProcAddressEmitter extends BaseClass {
*/
@Test
public void chapter09TestCompoundAndAlignment() throws Exception {
- chapter09TestCompoundAndAlignment(new Bindingtest1p1Impl());
+ chapter09TestCompoundAndAlignment(new Bindingtest1p2Impl());
}
public static void main(String args[]) throws IOException {