Welcome to mirror list, hosted at ThFree Co, Russian Federation.

native.build « native - github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 919c4d96d3b9c737f9e121cfea88ca81bd6b9b90 (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
<?xml version="1.0"?>
<project name="ikvm-native" default="ikvm-native">
    <target name="ikvm-native">
        <if test="${platform::is-unix()}">
            <call target="ikvm-native-unix"/>
        </if>
        <if test="${platform::is-win32()}">
            <call target="ikvm-native-win32"/>
        </if>
    </target>
    <target name="ikvm-native-unix">
        <property name="LDFLAGS" value="" />
        <if test="${environment::variable-exists('LDFLAGS')}">
            <property name="LDFLAGS" value="${environment::get-variable('LDFLAGS')}" />
        </if>
        <exec program="/bin/bash" commandline="-c 'gcc ${LDFLAGS} -o libikvm-native.so --shared -fPIC `pkg-config --cflags --libs gmodule-2.0` jni.c os.c'"/>
        <copy file="libikvm-native.so" todir="../bin"/>
    </target>
    <target name="ikvm-native-win32">
        <property name="cpu-arch" value="x86" />
        <!-- HACK this is pretty lame hack to guess if we're about to run the x64 version of CL.EXE -->
        <property name="cpu-arch" value="x64" if="${string::contains(string::to-lower(environment::get-variable('PATH')), 'vc\bin\amd64')}" />
        <property name="cpu-arch" value="x64" if="${string::contains(string::to-lower(environment::get-variable('PATH')), 'vc\bin\x86_amd64')}" />
        <mkdir dir="Release-${cpu-arch}"/>
        <cl outputdir="Release-${cpu-arch}" options="/O2 /D WIN32 /D NDEBUG /D _WINDLL /D _MBCS /GS /W3 /nologo /c">
            <sources>
                <include name="*.c"/>
            </sources>
        </cl>
        <link output="Release-${cpu-arch}/ikvm-native.dll" options="/DLL user32.lib">
            <sources>
                <include name="Release-${cpu-arch}/*.obj"/>
            </sources>
        </link>
        <copy file="Release-${cpu-arch}/ikvm-native.dll" tofile="../bin/ikvm-native-win32-${cpu-arch}.dll" />
    </target>
</project>