summaryrefslogtreecommitdiffstats
path: root/crosscompiler.xml
blob: 36eec26e05a53c616a0387940ab1c0f227cd9a67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Document   : crosscompiler.xml
    Created on : November 18, 2009, 3:38 PM
    Author     : Michael Bien
    Description:
        crosscompiler configuration and ant task for crosscompiling for
        linux32/64 and win32/64 on linux64 as host system.
-->
<project name="jocl-crosscompiler" basedir="." default="jocl.cross-compile">

    <import file="build.xml"/>

    <!-- TODO remove hardcoded path -->
    <property name="java.includes.dir.windows" value="/home/buildadmin/project/common/platform-libs/jre-include/win32"/>
    <property name="opencl.platform.dir"       value="/home/buildadmin/project/common/platform-libs/OpenCL"/>

    <!-- crosscompiles to other platforms, requirement: linux64 host os -->
    <target name="jocl.cross-compile" depends="init">

        <echo message=" - - - cross-compiling JOCL natives - - - "/>

        <antcall target="jocl.c.compile" inheritall="false">
            <param name="namespace" value="linux-amd64"/>
            <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"/>

             <!-- overwrite -->
            <param name="linker.cfg.id" value="linker.cfg.linux64.amd64.jocl"/>
        </antcall>

        <antcall target="jocl.c.compile" inheritall="false">
            <param name="namespace" value="linux-x86"/>
            <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"/>

             <!-- overwrite -->
            <param name="linker.cfg.id" value="linker.cfg.linux64.x86.jocl"/>
        </antcall>

        <!-- use mingw crosscompiler to compile for win32 and win64 -->
        <antcall target="jocl.c.compile" inheritall="false">
            <param name="namespace" value="win-x86"/>
            <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"/>

             <!-- overwrite -->
            <param name="java.includes.dir.platform" value="${java.includes.dir.windows}"/>
            <param name="compiler.cfg.id" value="compiler.cfg.linux64.mingw32"/>
            <param name="linker.cfg.id" value="linker.cfg.linux64.mingw32.jocl"/>
        </antcall>

        <antcall target="jocl.c.compile" inheritall="false">
            <param name="namespace" value="win-amd64"/>
            <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"/>

             <!-- overwrite -->
            <param name="java.includes.dir.platform" value="${java.includes.dir.windows}"/>
            <param name="compiler.cfg.id" value="compiler.cfg.linux64.mingw64"/>
            <param name="linker.cfg.id" value="linker.cfg.linux64.mingw64.jocl"/>
        </antcall>

        <echo message=" - - - JOCL natives cross-compiled - - - "/>

    </target>


    <target name="jocl.configure.linker">

        <linker id="linker.cfg.linux64.x86.jocl" extends="linker.cfg.linux">
            <syslibset dir="${opencl.platform.dir}/linux/x86" libs="OpenCL"/>
        </linker>

        <linker id="linker.cfg.linux64.amd64.jocl" extends="linker.cfg.linux.amd64" >
            <syslibset dir="${opencl.platform.dir}/linux/amd64" libs="OpenCL"/>
        </linker>

        <linker id="linker.cfg.linux64.mingw32.jocl" extends="linker.cfg.linux64.mingw32">
            <syslibset dir="${opencl.platform.dir}/win/win32" libs="OpenCL"/>
        </linker>

        <linker id="linker.cfg.linux64.mingw64.jocl" extends="linker.cfg.linux64.mingw64">
            <syslibset dir="${opencl.platform.dir}/win/x64" libs="OpenCL"/>
        </linker>

    </target>

</project>