summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-04-08 03:36:31 +0200
committerSven Gothel <[email protected]>2019-04-08 03:36:31 +0200
commit0bd5136c2df8407cea7b0dcc7fb1e62432ba18bb (patch)
tree99b96af85460ad860d85ab7dcc5af40c25555798
parent7bbb0822608fa9c832588c35874ead558a479322 (diff)
Bug 1190: Define TARGET_PLATFORM_SYSROOT TARGET_PLATFORM_USRROOT TARGET_PLATFORM_USRLIBS for crosscompilation
Android Crosscompilation Usage: - TARGET_PLATFORM_ROOT -> TARGET_PLATFORM_SYSROOT General - TARGET_PLATFORM_SYSROOT Crosscompiler and system specified 'sysroot' (as in gcc --print-sysroot) - TARGET_PLATFORM_USRROOT Additional optional user headers and libraries for target - TARGET_PLATFORM_USRLIBS Actual location of target user libraries within TARGET_PLATFORM_USRROOT - TARGET_JAVA_LIBS Actual location of the Java libraries within TARGET_PLATFORM_USRROOT
-rwxr-xr-xmake/jogamp-env.xml18
-rw-r--r--make/lib/gluegen-cpptasks-android-aarch64.xml4
-rw-r--r--make/lib/gluegen-cpptasks-android-armv6.xml4
-rw-r--r--make/lib/gluegen-cpptasks-android-x86.xml4
-rwxr-xr-xmake/scripts/make.gluegen.all.android-aarch64-cross.sh2
-rwxr-xr-xmake/scripts/make.gluegen.all.android-armv6-cross.sh2
-rwxr-xr-xmake/scripts/make.gluegen.all.android-x86-cross.sh2
-rwxr-xr-xmake/scripts/make.gluegen.all.linux-aarch64-cross.sh7
-rwxr-xr-xmake/scripts/make.gluegen.all.linux-aarch64.sh5
-rwxr-xr-xmake/scripts/make.gluegen.all.linux-armv6hf-cross.sh7
-rwxr-xr-xmake/scripts/make.gluegen.all.linux-armv6hf.sh5
-rw-r--r--make/scripts/make.gluegen.all.linux-ppc64le.sh2
12 files changed, 42 insertions, 20 deletions
diff --git a/make/jogamp-env.xml b/make/jogamp-env.xml
index 384903b..95d277e 100755
--- a/make/jogamp-env.xml
+++ b/make/jogamp-env.xml
@@ -17,6 +17,12 @@
Current GlueGen code utilizes some minor Java 1.6 features
which could be replaced, however it's not desired at this point
since we have no mode hard Java 1.5 constraints.
+
+ For crosscompilation the following shall be set:
+ - TARGET_PLATFORM_SYSROOT Crosscompiler and system specified 'sysroot' (as in gcc \-\-print-sysroot)
+ - TARGET_PLATFORM_USRROOT Additional optional user headers and libraries for target
+ - TARGET_PLATFORM_USRLIBS Actual location of target user libraries within TARGET_PLATFORM_USRROOT
+ - TARGET_JAVA_LIBS Actual location of the Java libraries within TARGET_PLATFORM_USRROOT
-->
<project name="jogamp-env" basedir=".">
@@ -283,6 +289,18 @@
</condition>
<echo message="macosx.sdkroot ${macosx.sdkroot}"/>
+ <condition property="TARGET_PLATFORM_SYSROOT" value="${env.TARGET_PLATFORM_SYSROOT}">
+ <not>
+ <equals arg1="${env.TARGET_PLATFORM_SYSROOT}" arg2="$${env.TARGET_PLATFORM_SYSROOT}" casesensitive="true" />
+ </not>
+ </condition>
+ <condition property="TARGET_PLATFORM_USRROOT" value="${env.TARGET_PLATFORM_USRROOT}">
+ <not>
+ <equals arg1="${env.TARGET_PLATFORM_USRROOT}" arg2="$${env.TARGET_PLATFORM_USRROOT}" casesensitive="true" />
+ </not>
+ </condition>
+ <echo message='TARGET_PLATFORM_SYSROOT ${TARGET_PLATFORM_SYSROOT}'/>
+ <echo message='TARGET_PLATFORM_USRROOT ${TARGET_PLATFORM_USRROOT}'/>
</target>
</project>
diff --git a/make/lib/gluegen-cpptasks-android-aarch64.xml b/make/lib/gluegen-cpptasks-android-aarch64.xml
index c6956f4..90805a1 100644
--- a/make/lib/gluegen-cpptasks-android-aarch64.xml
+++ b/make/lib/gluegen-cpptasks-android-aarch64.xml
@@ -33,7 +33,7 @@
<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir,declare.linux.android">
<echo message="Custom forced compiler Android NDK, linker.cfg.android" />
<compiler id="compiler.cfg.android" name="gcc">
- <compilerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+ <compilerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
<!-- The default search dirs for 'gcc from $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin will not find
subprograms properly (see gcc -print-search-dirs). Not sure if this is a bug in the NDK
or not. Need to explicitly indicate where subprograms are with -B.
@@ -86,7 +86,7 @@
</compiler>
<linker id="linker.cfg.android" name="gcc">
- <linkerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+ <linkerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
<linkerarg value="-fpic" />
<!-- linkerarg value="-fPIE" / --> <!-- not for shared libs, won't produce symbols -->
diff --git a/make/lib/gluegen-cpptasks-android-armv6.xml b/make/lib/gluegen-cpptasks-android-armv6.xml
index 57999b2..c7e2c83 100644
--- a/make/lib/gluegen-cpptasks-android-armv6.xml
+++ b/make/lib/gluegen-cpptasks-android-armv6.xml
@@ -33,7 +33,7 @@
<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir,declare.linux.android">
<echo message="Custom forced compiler Android NDK, linker.cfg.android" />
<compiler id="compiler.cfg.android" name="gcc">
- <compilerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+ <compilerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
<!-- The default search dirs for 'gcc from $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin will not find
subprograms properly (see gcc -print-search-dirs). Not sure if this is a bug in the NDK
or not. Need to explicitly indicate where subprograms are with -B.
@@ -87,7 +87,7 @@
</compiler>
<linker id="linker.cfg.android" name="gcc">
- <linkerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+ <linkerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
<linkerarg value="-fpic" />
<linkerarg value="-ffunction-sections" />
diff --git a/make/lib/gluegen-cpptasks-android-x86.xml b/make/lib/gluegen-cpptasks-android-x86.xml
index 1cb0216..04cbb2c 100644
--- a/make/lib/gluegen-cpptasks-android-x86.xml
+++ b/make/lib/gluegen-cpptasks-android-x86.xml
@@ -32,7 +32,7 @@
<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir,declare.linux.android">
<echo message="Custom forced compiler Android NDK, linker.cfg.android" />
<compiler id="compiler.cfg.android" name="gcc">
- <compilerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+ <compilerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
<!-- The default search dirs for 'gcc from $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin will not find
subprograms properly (see gcc -print-search-dirs). Not sure if this is a bug in the NDK
or not. Need to explicitly indicate where subprograms are with -B.
@@ -78,7 +78,7 @@
</compiler>
<linker id="linker.cfg.android" name="gcc">
- <linkerarg value="--sysroot=${env.TARGET_PLATFORM_ROOT}" />
+ <linkerarg value="--sysroot=${TARGET_PLATFORM_SYSROOT}" />
<linkerarg value="-fpic" />
<!-- linkerarg value="-fPIE" / --> <!-- not for shared libs, won't produce symbols -->
diff --git a/make/scripts/make.gluegen.all.android-aarch64-cross.sh b/make/scripts/make.gluegen.all.android-aarch64-cross.sh
index 6d46779..189fae3 100755
--- a/make/scripts/make.gluegen.all.android-aarch64-cross.sh
+++ b/make/scripts/make.gluegen.all.android-aarch64-cross.sh
@@ -37,7 +37,7 @@ HOST_ARCH=linux-x86_64
export TARGET_TRIPLE=aarch64-linux-android
export NDK_TOOLCHAIN_ROOT=$NDK_ROOT/toolchains/${TARGET_TRIPLE}-${GCC_VERSION}/prebuilt/${HOST_ARCH}
-export TARGET_PLATFORM_ROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-arm64
+export TARGET_PLATFORM_SYSROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-arm64
# Need to add toolchain bins to the PATH.
# May need to create symbolic links within $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin
diff --git a/make/scripts/make.gluegen.all.android-armv6-cross.sh b/make/scripts/make.gluegen.all.android-armv6-cross.sh
index 7c3043f..81bd8a1 100755
--- a/make/scripts/make.gluegen.all.android-armv6-cross.sh
+++ b/make/scripts/make.gluegen.all.android-armv6-cross.sh
@@ -37,7 +37,7 @@ HOST_ARCH=linux-x86_64
export TARGET_TRIPLE=arm-linux-androideabi
export NDK_TOOLCHAIN_ROOT=$NDK_ROOT/toolchains/${TARGET_TRIPLE}-${GCC_VERSION}/prebuilt/${HOST_ARCH}
-export TARGET_PLATFORM_ROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-arm
+export TARGET_PLATFORM_SYSROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-arm
# Need to add toolchain bins to the PATH.
export PATH="$NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH"
diff --git a/make/scripts/make.gluegen.all.android-x86-cross.sh b/make/scripts/make.gluegen.all.android-x86-cross.sh
index 0889ca7..4c12c2f 100755
--- a/make/scripts/make.gluegen.all.android-x86-cross.sh
+++ b/make/scripts/make.gluegen.all.android-x86-cross.sh
@@ -38,7 +38,7 @@ export TARGET_TRIPLE=i686-linux-android
export TOOLCHAIN_NAME=x86
export NDK_TOOLCHAIN_ROOT=$NDK_ROOT/toolchains/${TOOLCHAIN_NAME}-${GCC_VERSION}/prebuilt/${HOST_ARCH}
-export TARGET_PLATFORM_ROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-x86
+export TARGET_PLATFORM_SYSROOT=${NDK_ROOT}/platforms/android-${ANDROID_VERSION}/arch-x86
# Need to add toolchain bins to the PATH.
# May need to create symbolic links within $NDK_TOOLCHAIN_ROOT/$TARGET_TRIPLE/bin
diff --git a/make/scripts/make.gluegen.all.linux-aarch64-cross.sh b/make/scripts/make.gluegen.all.linux-aarch64-cross.sh
index 5d050cd..1b39bd3 100755
--- a/make/scripts/make.gluegen.all.linux-aarch64-cross.sh
+++ b/make/scripts/make.gluegen.all.linux-aarch64-cross.sh
@@ -17,9 +17,10 @@ export PATH
# -DisLinuxARM64=true \
# -DisX11=true \
-export TARGET_PLATFORM_ROOT=/opt-linux-arm64
-export TARGET_PLATFORM_LIBS=$TARGET_PLATFORM_ROOT/usr/lib
-export TARGET_JAVA_LIBS=$TARGET_PLATFORM_ROOT/jre/lib/aarch64
+export TARGET_PLATFORM_SYSROOT=`gcc --print-sysroot`
+export TARGET_PLATFORM_USRROOT=/opt-linux-arm64
+export TARGET_PLATFORM_USRLIBS=$TARGET_PLATFORM_USRROOT/usr/lib
+export TARGET_JAVA_LIBS=$TARGET_PLATFORM_USRROOT/jre/lib/aarch64
export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-linux-aarch64.xml"
diff --git a/make/scripts/make.gluegen.all.linux-aarch64.sh b/make/scripts/make.gluegen.all.linux-aarch64.sh
index 42c9ad3..e537fde 100755
--- a/make/scripts/make.gluegen.all.linux-aarch64.sh
+++ b/make/scripts/make.gluegen.all.linux-aarch64.sh
@@ -8,8 +8,9 @@
# -DisX11=true \
# aarch64-linux-gnue == aarch64 triplet
-export TARGET_PLATFORM_LIBS=/usr/lib/aarch64-linux-gnu
-export TARGET_JAVA_LIBS=/usr/lib/jvm/java-8-openjdk-aarch64/jre/lib/aarch64
+export TARGET_PLATFORM_USRROOT=
+export TARGET_PLATFORM_USRLIBS=$TARGET_PLATFORM_USRROOT/usr/lib/aarch64-linux-gnu
+export TARGET_JAVA_LIBS=$TARGET_PLATFORM_USRROOT/usr/lib/jvm/java-8-openjdk-aarch64/jre/lib/aarch64
export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-linux-aarch64-ontarget.xml"
diff --git a/make/scripts/make.gluegen.all.linux-armv6hf-cross.sh b/make/scripts/make.gluegen.all.linux-armv6hf-cross.sh
index a3f64a5..6b26153 100755
--- a/make/scripts/make.gluegen.all.linux-armv6hf-cross.sh
+++ b/make/scripts/make.gluegen.all.linux-armv6hf-cross.sh
@@ -28,9 +28,10 @@ export TARGET_IP=panda02
export TARGET_ROOT=/home/jogamp/projects-cross
export TARGET_ANT_HOME=/usr/share/ant
-export TARGET_PLATFORM_ROOT=/opt-linux-armv6-armhf
-export TARGET_PLATFORM_LIBS=$TARGET_PLATFORM_ROOT/usr/lib
-export TARGET_JAVA_LIBS=$TARGET_PLATFORM_ROOT/jre/lib/arm
+export TARGET_PLATFORM_SYSROOT=`gcc --print-sysroot`
+export TARGET_PLATFORM_USRROOT=/opt-linux-armv6-armhf
+export TARGET_PLATFORM_USRLIBS=$TARGET_PLATFORM_USRROOT/usr/lib
+export TARGET_JAVA_LIBS=$TARGET_PLATFORM_USRROOT/jre/lib/arm
export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-linux-armv6hf.xml"
diff --git a/make/scripts/make.gluegen.all.linux-armv6hf.sh b/make/scripts/make.gluegen.all.linux-armv6hf.sh
index e66f0e0..8f0cca5 100755
--- a/make/scripts/make.gluegen.all.linux-armv6hf.sh
+++ b/make/scripts/make.gluegen.all.linux-armv6hf.sh
@@ -8,8 +8,9 @@
# -DisX11=true \
# arm-linux-gnueabihf == armhf triplet
-export TARGET_PLATFORM_LIBS=/usr/lib/arm-linux-gnueabihf
-export TARGET_JAVA_LIBS=/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/arm
+export TARGET_PLATFORM_USRROOT=
+export TARGET_PLATFORM_USRLIBS=$TARGET_PLATFORM_USRROOT/usr/lib/arm-linux-gnueabihf
+export TARGET_JAVA_LIBS=$TARGET_PLATFORM_USRROOT/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/arm
export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-linux-armv6hf-ontarget.xml"
diff --git a/make/scripts/make.gluegen.all.linux-ppc64le.sh b/make/scripts/make.gluegen.all.linux-ppc64le.sh
index 0adc5d4..b5243cb 100644
--- a/make/scripts/make.gluegen.all.linux-ppc64le.sh
+++ b/make/scripts/make.gluegen.all.linux-ppc64le.sh
@@ -11,7 +11,7 @@ MACHINE=ppc64le
ARCH=ppc64el
TRIPLET=powerpc64le-linux-gnu
-export TARGET_PLATFORM_LIBS=/usr/lib/$TRIPLET
+export TARGET_PLATFORM_USRLIBS=/usr/lib/$TRIPLET
export TARGET_JAVA_LIBS=/usr/lib/jvm/java-7-openjdk-$ARCH/jre/lib/$MACHINE
export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-linux-$MACHINE.xml"