diff options
Diffstat (limited to 'make/gluegen-cpptasks-base.xml')
-rwxr-xr-x | make/gluegen-cpptasks-base.xml | 69 |
1 files changed, 50 insertions, 19 deletions
diff --git a/make/gluegen-cpptasks-base.xml b/make/gluegen-cpptasks-base.xml index 723c7c2..fcb382a 100755 --- a/make/gluegen-cpptasks-base.xml +++ b/make/gluegen-cpptasks-base.xml @@ -6,11 +6,14 @@ - by other projects which use GlueGen to generate native code and - need to compile that native code. - - - Before importing this file, the property "gluegen.root" must be - - defined; this is the relative path from the current working + - Before importing this file, the properties "gluegen.root" must be defined; + - this is the relative path from the current working - directory (e.g., from which the parent project's build.xml is being - executed) to the top of the checked-out GlueGen workspace. - + - The property "gluegen.root.abs-path" must be defined as well; + - this is the absolute path of "gluegen.root", see above. + - - The gluegen.cpptasks.detect.os target sets the following - properties appropriately. They are only set to "true" if the OS/CPU - configuration is exactly as specified. @@ -184,8 +187,16 @@ <!-- NOTE: the values of the macos<arch> attributes will not be overridden if already set externally --> <property name="macosppc" value="false" /> - <property name="macosx32" value="true" /> <property name="macosx64" value="true" /> + <!-- No 32bit binaries on OSX since Java7 --> + <condition property="macosx32" value="false" else="true"> + <or> + <contains string="${ant.java.version}" substring="1.7" casesensitive="false" /> + <contains string="${ant.java.version}" substring="1.8" casesensitive="false" /> + <contains string="${ant.java.version}" substring="1.9" casesensitive="false" /> + <contains string="${ant.java.version}" substring="2.0" casesensitive="false" /> + </or> + </condition> <!-- Need a way to be able to disable the macosx64 property specification in a build.xml --> <condition property="use.macosppc"> @@ -841,16 +852,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 +1438,25 @@ <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 --> + <!-- Temporary workaround: + Provided darwin/jawt_md.h from Oracle for OSX / Java7 + has X11 dependencies and does not define JAWT_SurfaceLayers. + value="${java.includes.dir}/darwin"> + --> <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="${gluegen.root.abs-path}/make/stub_includes/jni/macosx"> + <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"> |