3 ## This file is part of the sigrok-util project.
5 ## Copyright (C) 2013 Uwe Hermann <uwe@hermann-uwe.de>
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 # The path where your MXE directory is located.
27 # The path where the cross-compiled packages will be installed.
30 # The path where to download files to and where to build packages.
31 BUILDDIR=./sr_mingw_build
33 # You usually don't need to change anything below this line.
35 # -----------------------------------------------------------------------------
37 # We need to find tools in the toolchain and in the install directory.
38 export PATH=$PREFIX/bin:$MXE/usr/bin:$PATH
40 P="$PREFIX/lib/pkgconfig"
41 P2="$MXE/usr/i686-pc-mingw32/lib/pkgconfig"
42 C="--host=i686-pc-mingw32 --prefix=$PREFIX"
43 CM="-DCMAKE_TOOLCHAIN_FILE=$MXE/usr/i686-pc-mingw32/share/cmake/mxe-conf.cmake"
44 L="--disable-shared --enable-static"
46 # Remove build directory contents (if any) and create a new build dir.
51 # -----------------------------------------------------------------------------
54 # Cross-compiling Python is highly non-trivial, so we avoid it for now.
55 # The download below is a repackaged tarball of the official Python 3.2.3 MSI
56 # installer for Windows: http://python.org/ftp/python/3.2.3/python-3.2.3.msi
57 # The MSI file has been installed on a Windows box and then the c:\Python32
58 # files have been stored in the Python32.tar.gz tarball.
60 wget http://www.sigrok.org/tmp/Python32.tar.gz -O $PREFIX/Python32.tar.gz
61 tar xzf $PREFIX/Python32.tar.gz -C $PREFIX
63 # Create a dummy python3.pc file so that pkg-config finds Python 3.
64 mkdir -p $PREFIX/lib/pkgconfig
65 cat >$PREFIX/lib/pkgconfig/python3.pc <<EOF
67 exec_prefix=\${prefix}
68 libdir=\${exec_prefix}/lib
69 includedir=\${prefix}/include
71 Description: Python library
73 Libs: -L$PREFIX/Python32/libs -lpython32
74 Cflags: -I$PREFIX/Python32/include
77 # Download the Python 3.2.3 MSI installer (needed for NSIS runs).
78 wget -c http://python.org/ftp/python/3.2.3/python-3.2.3.msi \
79 -O $PREFIX/python-3.2.3.msi
82 git clone git://sigrok.org/libserialport
85 PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L && make install
89 git clone git://sigrok.org/libsigrok
91 patch -p1 < ../../libsigrok_firmwaredir.patch
93 PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L && make install
97 git clone git://sigrok.org/libsigrokdecode
100 PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L && make install
104 git clone git://sigrok.org/sigrok-firmware
107 # Nothing gets cross-compiled here, we just need 'make install' basically.
108 ./configure --prefix=$PREFIX
112 # sigrok-firmware-fx2lafw
113 git clone git://sigrok.org/sigrok-firmware-fx2lafw
114 cd sigrok-firmware-fx2lafw
116 # We're building the fx2lafw firmware on the host, no need to cross-compile.
117 ./configure --prefix=$PREFIX
123 git clone git://sigrok.org/sigrok-cli
125 patch -p1 < ../../sigrok_cli_decodersdir.patch
127 PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 ./configure $C && make install
128 makensis -DHOME=$HOME contrib/sigrok-cli_cross.nsi
132 git clone git://sigrok.org/pulseview
134 patch -p1 < ../../pulseview_linkfix.patch
135 patch -p1 < ../../pulseview_decodersdir.patch
136 PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 cmake $CM -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y -DENABLE_DECODE=y . && make install VERBOSE=1
137 makensis -DHOME=$HOME contrib/pulseview_cross.nsi