summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.xml123
-rw-r--r--nbproject/project.properties3
2 files changed, 92 insertions, 34 deletions
diff --git a/build.xml b/build.xml
index 14952cec..96bf8ebf 100644
--- a/build.xml
+++ b/build.xml
@@ -79,26 +79,68 @@
</target>
- <target name="-post-compile" depends="c.configure.all">
+ <target name="-post-compile" depends="cross-compile-on-linux64, c.compile.default" />
+
+ <target name="c.compile.default" depends="gluegen.cpptasks.detect.os, c.compile" />
+
+ <!-- crosscompiles to other platforms TODO: win32, win64 -->
+ <target name="cross-compile-on-linux64" if="crosscompile">
+
+ <echo message=" - - - cross-compiling JOCL natives - - - "/>
+
+ <antcall target="c.compile" inheritall="false">
+ <param name="namespace" value="linux-amd64"/>
+ <param name="crosscompile" value="true"/>
+ <param name="build.dir" value="${build.dir}"/>
+ <param name="isLinuxAMD64" value="true"/>
+ <param name="isLinux" value="true"/>
+ <param name="isUnix" value="true"/>
+ <param name="isX11" value="true"/>
+ </antcall>
+
+ <antcall target="c.compile" inheritall="false">
+ <param name="namespace" value="linux-x86"/>
+ <param name="crosscompile" value="true"/>
+ <param name="build.dir" value="${build.dir}"/>
+ <param name="isLinuxX86" value="true"/>
+ <param name="isLinux" value="true"/>
+ <param name="isUnix" value="true"/>
+ <param name="isX11" value="true"/>
+ </antcall>
+
+<!--
+ <antcall target="c.compile" inheritall="false">
+ <param name="namespace" value="win-x86"/>
+ <param name="crosscompile" value="true"/>
+ <param name="build.dir" value="${build.dir}"/>
+ <param name="isWindows" value="true"/>
+ </antcall>
+
+ <antcall target="c.compile" inheritall="false">
+ <param name="namespace" value="win-amd64"/>
+ <param name="crosscompile" value="true"/>
+ <param name="build.dir" value="${build.dir}"/>
+ <param name="isWindows" value="true"/>
+ </antcall>
+-->
- <property name="obj.dir" value="${build.dir}/obj"/>
- <property name="natives.dir" value="${build.dir}/natives"/>
+ <echo message=" - - - JOCL natives cross-compiled - - - "/>
- <property name="output.lib.name" value="jocl"/>
- <property name="obj.jocl.dir" value="${obj.dir}/${output.lib.name}"/>
- <property name="natives.jocl.dir" value="${build.dir}/natives/${output.lib.name}"/>
+ </target>
- <property name="c.compiler.optimise" value="none"/>
- <property name="c.compiler.debug" value="false"/>
- <mkdir dir="${obj.jocl.dir}" />
- <mkdir dir="${natives.jocl.dir}" />
+ <target name="c.compile" depends="c.setup.build">
<echo message=" - - - compiling JOCL natives - - - "/>
+ <echo message="${compiler.cfg.id}"/>
+ <echo message="${linker.cfg.id}"/>
+
+ <mkdir dir="${obj.jocl.dir}/${namespace}" />
+ <mkdir dir="${natives.jocl.dir}/${namespace}" />
<cc outtype="shared"
- objdir="${obj.jocl.dir}"
- outfile="${natives.jocl.dir}/${output.lib.name}"
+ objdir="${obj.jocl.dir}/${namespace}"
+ outfile="${natives.jocl.dir}/${namespace}/${output.lib.name}"
optimize="${c.compiler.optimise}"
debug="${c.compiler.debug}"
multithreaded="true"
@@ -121,27 +163,38 @@
</compiler>
- <linker extends="${linker.cfg.id}">
+ <linker extends="${linker.cfg.id}"/>
- </linker>
</cc>
-
+
<echo message=" - - - JOCL natives compiled - - - "/>
</target>
- <target name="c.configure.all" depends="gluegen.cpptasks.detect.os, gluegen.cpptasks.setup.compiler, jocl.setup.linker, c.configure.os" />
- <target name="c.configure.os" depends="c.configure.win32, c.configure.linux, c.configure.macosx" />
- <target name="c.configure.win32" depends="c.configure.win32.mingw" if="isWindows" />
- <target name="c.configure.linux" depends="c.configure.linux.x86, c.configure.linux.amd64, c.configure.linux.ia64" if="isLinux" />
+ <target name="c.setup.build" depends="gluegen.cpptasks.configure.compiler, gluegen.cpptasks.declare.compiler, c.configure.default, jocl.configure.linker">
+
+ <property name="obj.dir" value="${build.dir}/obj"/>
+ <property name="natives.dir" value="${build.dir}/natives"/>
+
+ <property name="output.lib.name" value="jocl"/>
+ <property name="obj.jocl.dir" value="${obj.dir}/${output.lib.name}"/>
+ <property name="natives.jocl.dir" value="${build.dir}/natives/${output.lib.name}"/>
+
+ <property name="c.compiler.optimise" value="none"/>
+ <property name="c.compiler.debug" value="false"/>
+ <property name="namespace" value=""/>
+
+ </target>
<!-- linker configuration -->
- <target name="jocl.setup.linker">
- <linker id="linker.cfg.linux.jocl">
+ <target name="jocl.configure.linker">
+ <linker id="linker.cfg.linux.jocl" extends="linker.cfg.linux">
+ <syslibset dir="${basedir}/lib/OpenCL/linux/x86" libs="OpenCL" if="crosscompile"/>
<syslibset dir="/usr/lib" libs="OpenCL"/>
</linker>
- <linker id="linker.cfg.linux.amd64.jocl">
+ <linker id="linker.cfg.linux.amd64.jocl" extends="linker.cfg.linux.amd64" >
+ <syslibset dir="${basedir}/lib/OpenCL/linux/amd64" libs="OpenCL" if="crosscompile"/>
<syslibset dir="/usr/lib" libs="OpenCL"/>
</linker>
@@ -156,33 +209,35 @@
</linker>
</target>
+ <!-- configure for current platform -->
+ <target name="c.configure.default" depends="c.configure.os" />
+ <target name="c.configure.os" depends="c.configure.win32, c.configure.linux, c.configure.macosx" />
+ <target name="c.configure.win32" depends="c.configure.win32.mingw" if="isWindows" />
+ <target name="c.configure.linux" depends="c.configure.linux.x86, c.configure.linux.amd64, c.configure.linux.ia64" if="isLinux" />
+
<target name="c.configure.win32.mingw" if="isMingW">
<echo message="Win32.MingW" />
- <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" />
+ <property name="compiler.cfg.id" value="${compiler.cfg.id.base}" />
<property name="linker.cfg.id" value="linker.cfg.win32.mingw.jocl" />
</target>
-
- <target name="c.configure.linux.x86" if="isLinuxX86">
+ <target name="c.configure.linux.x86" if="isLinuxX86">
<echo message="Linux.x86" />
- <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <property name="compiler.cfg.id" value="${compiler.cfg.id.base}" />
<property name="linker.cfg.id" value="linker.cfg.linux.jocl" />
</target>
-
<target name="c.configure.linux.amd64" if="isLinuxAMD64">
<echo message="Linux.AMD64" />
- <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" />
+ <property name="compiler.cfg.id" value="${compiler.cfg.id.base}" />
<property name="linker.cfg.id" value="linker.cfg.linux.amd64.jocl" />
</target>
-
- <target name="c.configure.linux.ia64" if="isLinuxIA64">
+ <target name="c.configure.linux.ia64" if="isLinuxIA64">
<echo message="Linux.IA64" />
- <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <property name="compiler.cfg.id" value="${compiler.cfg.id.base}" />
<property name="linker.cfg.id" value="linker.cfg.linux.jocl" />
</target>
-
- <target name="c.configure.macosx" if="isOSX">
+ <target name="c.configure.macosx" if="isOSX">
<echo message="MacOS" />
- <property name="compiler.cfg.id" value="compiler.cfg.macosx" />
+ <property name="compiler.cfg.id" value="${compiler.cfg.id.base}" />
<property name="linker.cfg.id" value="linker.cfg.macosx.jocl" />
</target>
diff --git a/nbproject/project.properties b/nbproject/project.properties
index 1d64a436..7000eed3 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -47,6 +47,7 @@ javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=Java Binding for the OpenCL API
+jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
jnlp.codebase.type=local
jnlp.codebase.url=file:${basedir}/dist/
jnlp.descriptor=application
@@ -75,3 +76,5 @@ src.dir=src
src.java.dir=gensrc/java
src.native.dir=gensrc/native
test.src.dir=test
+
+#crosscompile=true