Removed buid.xml and added shell scripts instead.
This commit is contained in:
parent
638d308c9f
commit
45aea8d9bc
@ -1,95 +0,0 @@
|
||||
<project name="libusb4java" default="help">
|
||||
|
||||
<property name="project.basedir" value="${basedir}/../../.." />
|
||||
<property name="tmpDir" value="${basedir}/tmp" />
|
||||
<property name="libusbwin32.version" value="1.2.2.0" />
|
||||
|
||||
<target name="prepare">
|
||||
<delete dir="${tmpDir}" />
|
||||
<mkdir dir="${tmpDir}" />
|
||||
</target>
|
||||
|
||||
<target name="build">
|
||||
<exec executable="./configure" failonerror="true">
|
||||
<arg line="${options}" />
|
||||
<arg value="CFLAGS=${CFLAGS}" />
|
||||
<arg value="CPPFLAGS=${CFLAGS}" />
|
||||
</exec>
|
||||
<exec executable="make" failonerror="true">
|
||||
<arg value="clean" />
|
||||
<arg value="install-strip" />
|
||||
<arg value="DESTDIR=${tmpDir}" />
|
||||
</exec>
|
||||
<mkdir dir="${project.basedir}/src/main/assembly/${os}-${arch}" />
|
||||
<copy file="${tmpDir}/${fromlib}"
|
||||
tofile="${project.basedir}/src/main/assembly/${os}-${arch}/${tolib}" />
|
||||
<delete dir="${tmpDir}" />
|
||||
</target>
|
||||
|
||||
<target name="linux-x86">
|
||||
<antcall target="prepare" />
|
||||
<antcall target="build">
|
||||
<param name="options">--prefix=/</param>
|
||||
<param name="CFLAGS">-m32</param>
|
||||
<param name="os">linux</param>
|
||||
<param name="arch">x86</param>
|
||||
<param name="fromlib">lib/libusb4java.so</param>
|
||||
<param name="tolib">libusb4java.so</param>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="linux-x86_64">
|
||||
<antcall target="prepare" />
|
||||
<antcall target="build">
|
||||
<param name="options">--prefix=/</param>
|
||||
<param name="CFLAGS">-m64</param>
|
||||
<param name="os">linux</param>
|
||||
<param name="arch">x86_64</param>
|
||||
<param name="fromlib">lib/libusb4java.so</param>
|
||||
<param name="tolib">libusb4java.so</param>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="linux-windows-x86">
|
||||
<antcall target="prepare" />
|
||||
<get src="http://downloads.sourceforge.net/project/libusb-win32/libusb-win32-releases/${libusbwin32.version}/libusb-win32-bin-${libusbwin32.version}.zip"
|
||||
dest="${tmpDir}/libusb-win32.zip" />
|
||||
<unzip src="${tmpDir}/libusb-win32.zip" dest="${tmpDir}" />
|
||||
<copy file="${tmpDir}/libusb-win32-bin-${libusbwin32.version}/bin/x86/libusb0_x86.dll"
|
||||
tofile="${project.basedir}/src/main/assembly/windows-x86/libusb0.dll" />
|
||||
<antcall target="build">
|
||||
<param name="options">--prefix=/ --host=i586-mingw32msvc --with-libusb-includes=${tmpDir}/libusb-win32-bin-${libusbwin32.version}/include --with-libusb-libs=${tmpDir}/libusb-win32-bin-${libusbwin32.version}/lib/gcc,${tmpDir}/libusb-win32-bin-${libusbwin32.version}/bin/x86</param>
|
||||
<param name="CFLAGS"> </param>
|
||||
<param name="os">windows</param>
|
||||
<param name="arch">x86</param>
|
||||
<param name="fromlib">bin/libusb4java-0.dll</param>
|
||||
<param name="tolib">libusb4java.dll</param>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="linux-windows-x86_64">
|
||||
<antcall target="prepare" />
|
||||
<get src="http://downloads.sourceforge.net/project/libusb-win32/libusb-win32-releases/${libusbwin32.version}/libusb-win32-bin-${libusbwin32.version}.zip"
|
||||
dest="${tmpDir}/libusb-win32.zip" />
|
||||
<unzip src="${tmpDir}/libusb-win32.zip" dest="${tmpDir}" />
|
||||
<copy file="${tmpDir}/libusb-win32-bin-${libusbwin32.version}/bin/amd64/libusb0.dll"
|
||||
tofile="${project.basedir}/src/main/assembly/windows-x86_64/libusb0.dll" />
|
||||
<antcall target="build">
|
||||
<param name="options">--prefix=/ --host=amd64-mingw32msvc --with-libusb-includes=${tmpDir}/libusb-win32-bin-${libusbwin32.version}/include --with-libusb-libs=${tmpDir}/libusb-win32-bin-${libusbwin32.version}/lib/gcc,${tmpDir}/libusb-win32-bin-${libusbwin32.version}/bin/amd64</param>
|
||||
<param name="CFLAGS"> </param>
|
||||
<param name="os">windows</param>
|
||||
<param name="arch">x86_64</param>
|
||||
<param name="fromlib">bin/libusb4java-0.dll</param>
|
||||
<param name="tolib">libusb4java.dll</param>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="help" description="Display usage help">
|
||||
<echo>Targets:</echo>
|
||||
<echo> linux-x86 Compile for linux x86.</echo>
|
||||
<echo> linux-x86_64 Compile for linux x86_64.</echo>
|
||||
<echo> linux-windows-x86 Cross-compile on linux for windows x86.</echo>
|
||||
<echo> linux-windows-x86_64 Cross-compile on linux for windows x86_64.</echo>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
30
src/main/c/build/linux-x86.sh
Executable file
30
src/main/c/build/linux-x86.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Builds libusb4java for 32 bit linux.
|
||||
# If running on 32 bit linux you need libusb-dev.
|
||||
# If running on 64 bit linux you need ia32-libs-dev and libc6-dev-i386.
|
||||
|
||||
set -e
|
||||
cd $(dirname $0)/..
|
||||
|
||||
OS=linux
|
||||
ARCH=x86
|
||||
TMPDIR=$(pwd)/tmp
|
||||
DISTDIR=$(pwd)/../assembly/${OS}-${ARCH}
|
||||
|
||||
# Clean up
|
||||
rm -rf $TMPDIR
|
||||
rm -rf $DISTDIR
|
||||
|
||||
# Build autoconf stuff if needed
|
||||
if [ ! -e configure ]
|
||||
then
|
||||
make -f Makefile.scm
|
||||
fi
|
||||
|
||||
# Build libusb4java
|
||||
./configure --prefix=/ CFLAGS="-m32"
|
||||
make clean install-strip DESTDIR=$TMPDIR
|
||||
mkdir -p $DISTDIR
|
||||
cp -faL $TMPDIR/lib/libusb4java.so $DISTDIR/
|
||||
rm -rf $TMPDIR
|
||||
29
src/main/c/build/linux-x86_64.sh
Executable file
29
src/main/c/build/linux-x86_64.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Builds libusb4java for 64 bit linux.
|
||||
# Must be executed on 64 bit linux machine and must have libusb-dev installed.
|
||||
|
||||
set -e
|
||||
cd $(dirname $0)/..
|
||||
|
||||
OS=linux
|
||||
ARCH=x86_64
|
||||
TMPDIR=$(pwd)/tmp
|
||||
DISTDIR=$(pwd)/../assembly/${OS}-${ARCH}
|
||||
|
||||
# Clean up
|
||||
rm -rf $TMPDIR
|
||||
rm -rf $DISTDIR
|
||||
|
||||
# Build autoconf stuff if needed
|
||||
if [ ! -e configure ]
|
||||
then
|
||||
make -f Makefile.scm
|
||||
fi
|
||||
|
||||
# Build libusb4java
|
||||
./configure --prefix=/ CFLAGS="-m64"
|
||||
make clean install-strip DESTDIR=$TMPDIR
|
||||
mkdir -p $DISTDIR
|
||||
cp -faL $TMPDIR/lib/libusb4java.so $DISTDIR/
|
||||
rm -rf $TMPDIR
|
||||
45
src/main/c/build/mingw-windows-x86.sh
Executable file
45
src/main/c/build/mingw-windows-x86.sh
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Cross-compiles libusb4java for 64 bit windows using mingw.
|
||||
# libusb-dev is needed.
|
||||
|
||||
set -e
|
||||
cd $(dirname $0)/..
|
||||
|
||||
OS=windows
|
||||
ARCH=x86
|
||||
TMPDIR=$(pwd)/tmp
|
||||
DISTDIR=$(pwd)/../assembly/${OS}-${ARCH}
|
||||
|
||||
# Clean up
|
||||
rm -rf $TMPDIR
|
||||
rm -rf $DISTDIR
|
||||
|
||||
# Download and unpack libusb-win32
|
||||
LIBUSBWIN32_VERSION=1.2.2.0
|
||||
mkdir -p $TMPDIR
|
||||
wget -O $TMPDIR/libusb-win32.zip "http://downloads.sourceforge.net/project/libusb-win32/libusb-win32-releases/$LIBUSBWIN32_VERSION/libusb-win32-bin-$LIBUSBWIN32_VERSION.zip"
|
||||
cd $TMPDIR
|
||||
unzip libusb-win32.zip
|
||||
INCLUDES=$TMPDIR/libusb-win32-bin-$LIBUSBWIN32_VERSION/include
|
||||
LIBS=$TMPDIR/libusb-win32-bin-$LIBUSBWIN32_VERSION/lib/gcc
|
||||
BINS=$TMPDIR/libusb-win32-bin-$LIBUSBWIN32_VERSION/bin/x86
|
||||
cd ..
|
||||
|
||||
# Create autoconf stuff if needed
|
||||
if [ ! -e configure ]
|
||||
then
|
||||
make -f Makefile.scm
|
||||
fi
|
||||
|
||||
# Build libusb4java
|
||||
./configure \
|
||||
--prefix=/ \
|
||||
--host=i586-mingw32msvc \
|
||||
--with-libusb-includes=$INCLUDES \
|
||||
--with-libusb-libs=$LIBS,$BINS
|
||||
make clean install-strip DESTDIR=$TMPDIR
|
||||
mkdir -p $DISTDIR
|
||||
cp -faL $TMPDIR/bin/libusb4java-0.dll $DISTDIR/libusb4java.dll
|
||||
cp -faL $BINS/libusb0_x86.dll $DISTDIR/libusb0.dll
|
||||
rm -rf $TMPDIR
|
||||
45
src/main/c/build/mingw-windows-x86_64.sh
Executable file
45
src/main/c/build/mingw-windows-x86_64.sh
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Cross-compiles libusb4java for 64 bit windows using mingw.
|
||||
# libusb-dev is needed.
|
||||
|
||||
set -e
|
||||
cd $(dirname $0)/..
|
||||
|
||||
OS=windows
|
||||
ARCH=x86_64
|
||||
TMPDIR=$(pwd)/tmp
|
||||
DISTDIR=$(pwd)/../assembly/${OS}-${ARCH}
|
||||
|
||||
# Clean up
|
||||
rm -rf $TMPDIR
|
||||
rm -rf $DISTDIR
|
||||
|
||||
# Download and unpack libusb-win32
|
||||
LIBUSBWIN32_VERSION=1.2.2.0
|
||||
mkdir -p $TMPDIR
|
||||
wget -O $TMPDIR/libusb-win32.zip "http://downloads.sourceforge.net/project/libusb-win32/libusb-win32-releases/$LIBUSBWIN32_VERSION/libusb-win32-bin-$LIBUSBWIN32_VERSION.zip"
|
||||
cd $TMPDIR
|
||||
unzip libusb-win32.zip
|
||||
INCLUDES=$TMPDIR/libusb-win32-bin-$LIBUSBWIN32_VERSION/include
|
||||
LIBS=$TMPDIR/libusb-win32-bin-$LIBUSBWIN32_VERSION/lib/gcc
|
||||
BINS=$TMPDIR/libusb-win32-bin-$LIBUSBWIN32_VERSION/bin/amd64
|
||||
cd ..
|
||||
|
||||
# Create autoconf stuff if needed
|
||||
if [ ! -e configure ]
|
||||
then
|
||||
make -f Makefile.scm
|
||||
fi
|
||||
|
||||
# Build libusb4java
|
||||
./configure \
|
||||
--prefix=/ \
|
||||
--host=amd64-mingw32msvc \
|
||||
--with-libusb-includes=$INCLUDES \
|
||||
--with-libusb-libs=$LIBS,$BINS
|
||||
make clean install-strip DESTDIR=$TMPDIR
|
||||
mkdir -p $DISTDIR
|
||||
cp -faL $TMPDIR/bin/libusb4java-0.dll $DISTDIR/libusb4java.dll
|
||||
cp -faL $BINS/libusb0.dll $DISTDIR/libusb0.dll
|
||||
rm -rf $TMPDIR
|
||||
Loading…
Reference in New Issue
Block a user