ikvm-fork/native/native.build

38 строки
1.8 KiB
XML

<?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>