]> sigrok.org Git - sigrok-util.git/blobdiff - cross-compile/mingw/sigrok-cross-mingw
sigrok-cross-mingw: Abort on error.
[sigrok-util.git] / cross-compile / mingw / sigrok-cross-mingw
index 813424926e73bc8ea89e2592269c3019d8c28149..b35a0040b5ae3511a8856aa48efbe3edb0bcc5d8 100755 (executable)
@@ -19,6 +19,8 @@
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
+set -e
+
 # The path where your MXE directory is located.
 MXE=$HOME/mxe-git
 
@@ -32,6 +34,12 @@ BUILDDIR=./sr_mingw_build
 
 # -----------------------------------------------------------------------------
 
+SF_MIRROR=switch.dl.sourceforge.net
+
+VER_LIBUSBX=1.0.17
+
+# -----------------------------------------------------------------------------
+
 # We need to find tools in the toolchain and in the install directory.
 export PATH=$PREFIX/bin:$MXE/usr/bin:$PATH
 
@@ -79,6 +87,20 @@ chmod 755 $PREFIX/bin/python3-config
 wget -c http://python.org/ftp/python/3.2.3/python-3.2.3.msi \
      -O $PREFIX/python-3.2.3.msi
 
+# libusbx
+wget http://$SF_MIRROR/project/libusbx/releases/$VER_LIBUSBX/source/libusbx-$VER_LIBUSBX.tar.bz2
+tar xfj libusbx-$VER_LIBUSBX.tar.bz2
+cd libusbx-$VER_LIBUSBX
+PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L && make install
+cd ..
+
+# libserialport
+git clone git://sigrok.org/libserialport
+cd libserialport
+./autogen.sh
+PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L && make install
+cd ..
+
 # libsigrok
 git clone git://sigrok.org/libsigrok
 cd libsigrok
@@ -98,31 +120,14 @@ git clone git://sigrok.org/sigrok-cli
 cd sigrok-cli
 ./autogen.sh
 PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 ./configure $C && make install
-makensis contrib/sigrok-cli_cross.nsi
+makensis -DHOME=$HOME contrib/sigrok-cli_cross.nsi
 cd ..
 
-## TODO: Doesn't fully work, yet.
-## # sigrok-qt
-## git clone git://sigrok.org/sigrok-qt
-## cd sigrok-qt
-## PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 qmake -spec win32-g++
-## make
-## # TODO: make install
-## cd ..
-
-# # sigrok-gtk
-# git clone git://sigrok.org/sigrok-gtk
-# cd sigrok-gtk
-# ./autogen.sh
-# PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 ./configure $C && make install
-# cd ..
-
 # PulseView
 git clone git://sigrok.org/pulseview
 cd pulseview
-# Temporary workaround: append (not prepend) "-llzma -llcms2" to the linker.
-sed -i '247a \\tlist(APPEND PULSEVIEW_LINK_LIBS "-llzma -llcms2") # Quick hack' CMakeLists.txt
+patch -p1 < ../../pulseview.patch
 PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 cmake $CM -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y . && make install VERBOSE=1
-makensis contrib/pulseview_cross.nsi
+makensis -DHOME=$HOME contrib/pulseview_cross.nsi
 cd ..