- dll renamed to LibusbJava
- ant file for compiling on Windows and Linux - use g++ instead of gcc - version string in resource file (should be provided as command line argument, but doesn't work with windres -> bug?) git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@204 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -6,25 +6,78 @@
|
||||
Build file for LibusbWin Dll
|
||||
|
||||
REQUIREMENTS:
|
||||
gcc and make must be on your PATH
|
||||
winres
|
||||
g++
|
||||
|
||||
schlaepfer
|
||||
====================================================================== -->
|
||||
<project name="LibusbWinDll" default="dll">
|
||||
<description>
|
||||
Build file for LibusbWin Dll
|
||||
<project name="LibusbWinDll" basedir=".">
|
||||
<description>
|
||||
Build file for LibUsb-Win32 Java Wrapper
|
||||
</description>
|
||||
|
||||
<target name="clean" description="--> Clean LibusbWin Dll">
|
||||
<exec executable="make">
|
||||
<arg value="clean"/>
|
||||
</exec>
|
||||
</target>
|
||||
<property file="project.properties" />
|
||||
<property file="version.properties" />
|
||||
<property name="version.win.rc" value="${version.major},${version.minor},${version.micro},${version.nano}" />
|
||||
<property name="version.win.str" value="${version.major}.${version.minor}.${version.micro}.${version.nano}" />
|
||||
<property name="version.linux" value="${version.major}.${version.minor}.${version.micro}" />
|
||||
|
||||
<patternset id="buildfiles">
|
||||
<include name="**/*.o" />
|
||||
<include name="**/*.dll" />
|
||||
<include name="**/*.so" />
|
||||
</patternset>
|
||||
|
||||
<target name="clean" description="--> Clean build files">
|
||||
<delete>
|
||||
<fileset dir=".">
|
||||
<patternset refid="buildfiles" />
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="dll" description="--> Build LibusbWin Dll">
|
||||
<exec executable="make">
|
||||
<arg value="dll"/>
|
||||
</exec>
|
||||
</target>
|
||||
<target name="windows" description="--> Build ${build.shlib.win.shlibname}">
|
||||
<!-- The RC_VERSION_STR string is not recognized by windres as command line argument.
|
||||
I think this is a bug. The only (nasty) workaround I found is to write it directly to the file. -->
|
||||
<!--
|
||||
<exec dir="." executable="${build.win.windres}">
|
||||
<arg value="-o${build.win.resource.obj}" />
|
||||
<arg value="${build.win.resource.rc}" />
|
||||
<arg value="-DRC_VERSION=${version.rc}" />
|
||||
<arg value="-DRC_VERSION_STR='\"${version.str}\"'" />
|
||||
</exec>
|
||||
-->
|
||||
<echo level="warning" message="WARNING: If the version has changed -> change the RC_VERSION_STR define in resource.rc to "${version.str}"" />
|
||||
<exec dir="." executable="${build.win.windres}">
|
||||
<arg value="-o${build.win.resource.obj}" />
|
||||
<arg value="${build.win.resource.rc}" />
|
||||
<arg value="-DRC_VERSION=${version.win.rc}" />
|
||||
</exec>
|
||||
<exec executable="${build.win.compiler}">
|
||||
<arg value="-Wall" />
|
||||
<arg value="-D_JNI_IMPLEMENTATION_" />
|
||||
<arg value="-Wl,--kill-at" />
|
||||
<arg value="-mwindows" />
|
||||
<arg value="-shared" />
|
||||
<arg value="-I${user.dir}" />
|
||||
<arg value="${build.shlib.srcname}" />
|
||||
<arg value="-o${build.shlib.win.shlibname}" />
|
||||
<arg value="${build.win.resource.obj}" />
|
||||
<arg value="${build.lib.libusb}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="linux" depends="clean" description="--> Build ${build.shlib.linux.shlibname}">
|
||||
<exec dir="." executable="${build.win.compiler}">
|
||||
<arg value="-shared" />
|
||||
<arg value="-Wl,-soname,lib${build.shlib.linux.shlibname}" />
|
||||
<arg value="-I${build.linux.includes}" />
|
||||
<arg value="-mwindows" />
|
||||
<arg value="-shared" />
|
||||
<arg value="-o${build.shlib.linux.shlibname}.${version.linux}" />
|
||||
<arg value="${build.linux.includes}/${build.lib.libusb}" />
|
||||
<arg value="${build.linux.includes}/${build.lib.libusbpp}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user