aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-02-17 15:16:03 +0100
committerSven Gothel <[email protected]>2013-02-17 15:16:03 +0100
commit4aa36ed61fd1bb434f2a5dd4d7dbffd6f87a446d (patch)
treef73789f888ecae6fcf554410e2f3ee5eb3c4d873
parent1604f2341e496b380fbb3cf8d1e0134d947d8536 (diff)
OSX Java6/Java7: Adapt to used JDK (Apple's Java6 or Oracle's Java7)
- Pick-up OSX Java7 locations if setup via ${java.home} and files available - host.rt.jar, target.rt.jar - java.home.dir - java.includes.dir - java.includes.dir.platform - java.lib.dir.platform - Remove 'very old' Java4/5 OSX locations - Remove java.osx.frameworks.dir, since JavaNativeFoundation.h dependencies are removed
-rwxr-xr-xmake/gluegen-cpptasks-base.xml47
-rwxr-xr-xmake/jogamp-env.xml45
-rwxr-xr-xmake/scripts/make.gluegen.all.macosx-java7.sh2
3 files changed, 65 insertions, 29 deletions
diff --git a/make/gluegen-cpptasks-base.xml b/make/gluegen-cpptasks-base.xml
index 723c7c2..4319bcf 100755
--- a/make/gluegen-cpptasks-base.xml
+++ b/make/gluegen-cpptasks-base.xml
@@ -841,16 +841,29 @@
<!--
- Set up java.home.dir appropriately on all platforms.
-->
- <target name="setup.java.home.dir.nonmacosx" unless="isOSX">
+ <target name="setup.java.home.dir.nonmacosx" unless="isOSX">
<!-- java home dir is up one directory as java.home points to '<java-install-dir>/jre' -->
<property name="java.home.dir" value="${java.home}/.." />
- </target>
- <target name="setup.java.home.dir.macosx" if="isOSX">
+ <property name="java.includes.dir" value="${java.home.dir}/include" />
+ </target>
+ <target name="setup.java.home.dir.macosx" if="isOSX">
+ <!-- Java7 std location -->
+ <condition property="java.home.dir"
+ value="${java.home}/..">
+ <available file="${java.home}/../include/jni.h"/>
+ </condition>
+ <condition property="java.includes.dir"
+ value="${java.home}/../include">
+ <available file="${java.home}/../include/jni.h"/>
+ </condition>
+ <!-- Fallback value Java6 -->
<property name="java.home.dir" value="/System/Library/Frameworks/JavaVM.framework/Home" />
- </target>
- <target name="setup.java.home.dir" depends="setup.java.home.dir.nonmacosx,setup.java.home.dir.macosx">
- <property name="java.includes.dir" value="${java.home.dir}/include" />
- </target>
+ <property name="java.includes.dir" value="/System/Library/Frameworks/JavaVM.framework/Headers" />
+ </target>
+ <target name="setup.java.home.dir" depends="setup.java.home.dir.nonmacosx,setup.java.home.dir.macosx">
+ <echo message="java.home.dir ${java.home.dir}" />
+ <echo message="java.includes.dir ${java.includes.dir}" />
+ </target>
<target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir">
@@ -1414,18 +1427,20 @@
<echo message="MacOSX" />
<property name="compiler.cfg.id.base" value="compiler.cfg.macosx" />
<property name="linker.cfg.id.base" value="linker.cfg.macosx" />
- <!-- Need to select either Java 10.6 Update 4's location or the old one -->
+ <!-- Java7 std location -->
<condition property="java.includes.dir.platform"
- value="/System/Library/Frameworks/JavaVM.framework/Headers"
- else="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers">
- <available file="/System/Library/Frameworks/JavaVM.framework/Headers/jni.h"/>
+ value="${java.includes.dir}/darwin">
+ <available file="${java.includes.dir}/darwin/jawt_md.h"/>
</condition>
- <condition property="java.osx.frameworks.dir"
- value="/System/Library/Frameworks/JavaVM.framework/Frameworks"
- else="/OSX/JavaVM.framework/Frameworks/does/not/exist">
- <available file="/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaNativeFoundation.framework/Headers/JavaNativeFoundation.h"/>
+ <condition property="java.lib.dir.platform"
+ value="${java.home.dir}/jre/lib">
+ <available file="${java.home.dir}/jre/lib/libjawt.dylib"/>
</condition>
- <property name="java.lib.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Libraries" />
+ <!-- Fallback value Java6 -->
+ <property name="java.includes.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Headers" />
+ <property name="java.lib.dir.platform" value="/System/Library/Frameworks/JavaVM.framework/Libraries" />
+ <echo message="java.includes.dir.platform ${java.includes.dir.platform}" />
+ <echo message="java.lib.dir.platform ${java.lib.dir.platform}" />
</target>
<target name="gluegen.cpptasks.declare.compiler.freebsd.x86" if="isFreeBSDX86">
diff --git a/make/jogamp-env.xml b/make/jogamp-env.xml
index 07083c7..f02901e 100755
--- a/make/jogamp-env.xml
+++ b/make/jogamp-env.xml
@@ -136,30 +136,51 @@
<property name="target.sourcelevel" value="${ant.java.version}" /> <!-- default fallback values -->
<property name="target.targetlevel" value="${ant.java.version}" /> <!-- default fallback values -->
+ <!-- default value for std Java -->
+ <condition property="target.rt.jar"
+ value="${java.home}/lib/rt.jar">
+ <available file="${java.home}/lib/rt.jar"/>
+ </condition>
<!-- default fallback value on OS X -->
- <available property="target.rt.jar"
- type="file"
- file="/System/Library/Frameworks/JavaVM.framework/Versions/${ant.java.version}/Classes/classes.jar"
- value="/System/Library/Frameworks/JavaVM.framework/Versions/${ant.java.version}/Classes/classes.jar"/>
+ <condition property="target.rt.jar"
+ value="/System/Library/Frameworks/JavaVM.framework/Versions/${ant.java.version}/Classes/classes.jar">
+ <available file="/System/Library/Frameworks/JavaVM.framework/Versions/${ant.java.version}/Classes/classes.jar"/>
+ </condition>
<!-- default fallback value on std Java -->
- <property name="target.rt.jar" value="${java.home}/lib/rt.jar" />
<echo message="target.user.set ${target.user.set}"/>
<echo message="target.sourcelevel ${target.sourcelevel}"/>
<echo message="target.targetlevel ${target.targetlevel}"/>
<echo message="target.rt.jar ${target.rt.jar}"/>
+ <fail message="No target.rt.jar specified not found.">
+ <condition>
+ <not>
+ <isset property="target.rt.jar"/>
+ </not>
+ </condition>
+ </fail>
<property name="host.sourcelevel" value="${ant.java.version}" /> <!-- default values for compile time components -->
<property name="host.targetlevel" value="${ant.java.version}" /> <!-- default values for compile time components -->
- <!-- default fallback value for compile time components on OS X -->
- <available property="host.rt.jar"
- type="file"
- file="/System/Library/Frameworks/JavaVM.framework/Versions/${ant.java.version}/Classes/classes.jar"
- value="/System/Library/Frameworks/JavaVM.framework/Versions/${ant.java.version}/Classes/classes.jar"/>
- <!-- default fallback value for compile time components on std Java -->
- <property name="host.rt.jar" value="${java.home}/lib/rt.jar" />
+ <!-- default value for std Java -->
+ <condition property="host.rt.jar"
+ value="${java.home}/lib/rt.jar">
+ <available file="${java.home}/lib/rt.jar"/>
+ </condition>
+ <!-- default fallback value on OS X -->
+ <condition property="host.rt.jar"
+ value="/System/Library/Frameworks/JavaVM.framework/Versions/${ant.java.version}/Classes/classes.jar">
+ <available file="/System/Library/Frameworks/JavaVM.framework/Versions/${ant.java.version}/Classes/classes.jar"/>
+ </condition>
<echo message="host.sourcelevel ${host.sourcelevel}"/>
<echo message="host.targetlevel ${host.targetlevel}"/>
<echo message="host.rt.jar ${host.rt.jar}"/>
+ <fail message="No host.rt.jar specified not found.">
+ <condition>
+ <not>
+ <isset property="host.rt.jar"/>
+ </not>
+ </condition>
+ </fail>
<fail message="Unsupported Target Java version (sourcelevel): ${target.sourcelevel}. Make sure that the version of the Java compiler is 1.6 (6.0) or greater.">
<condition>
diff --git a/make/scripts/make.gluegen.all.macosx-java7.sh b/make/scripts/make.gluegen.all.macosx-java7.sh
index 6ffefc4..1a69f9e 100755
--- a/make/scripts/make.gluegen.all.macosx-java7.sh
+++ b/make/scripts/make.gluegen.all.macosx-java7.sh
@@ -19,4 +19,4 @@ ant \
-Dtarget.targetlevel=1.6 \
-Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \
-Drootrel.build=build-macosx-java7 \
- $* 2>&1 | tee make.gluegen.all.macosx.log
+ $* 2>&1 | tee make.gluegen.all.macosx-java7.log