diff options
author | Michael Bien <[email protected]> | 2009-11-13 02:11:57 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2009-11-13 02:11:57 +0100 |
commit | 645f37e1bc7408182a4bcaeb3ab5395b6e620c5e (patch) | |
tree | e0a67814cae27e0c87506f9f1bb751830c678e16 /build.xml | |
parent | d2050aea14e6ab1a6429eab56f0612c2deb6184f (diff) |
began with restructuring the build for cross-compilation (WIP).
Diffstat (limited to 'build.xml')
-rw-r--r-- | build.xml | 123 |
1 files changed, 89 insertions, 34 deletions
@@ -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> |