##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
# You usually don't need to change anything below this line.
# -----------------------------------------------------------------------------
# You usually don't need to change anything below this line.
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# We need to find tools in the toolchain.
export PATH=$MXE/usr/bin:$PATH
# -----------------------------------------------------------------------------
# We need to find tools in the toolchain.
export PATH=$MXE/usr/bin:$PATH
- export PKG_CONFIG_PATH_x86_64_w64_mingw32_static="$P:$P2"
+ export PKG_CONFIG_PATH_x86_64_w64_mingw32_static_posix="$P:$P2"
+fi
+
+if [ $DEBUG = 1 ]; then
+ # CFLAGS/CXXFLAGS contains "-g" per default for autotools projects.
+ CM="$CM -DCMAKE_BUILD_TYPE=Debug"
-# - https://www.python.org/ftp/python/3.2.3/python-3.2.3.msi
-# - https://www.python.org/ftp/python/3.2.3/python-3.2.3.amd64.msi
-# The MSI file has been installed on a Windows box and then c:\Python32\libs
-# and c:\Python32\include have been stored in the Python32_*.tar.gz tarball.
-$WGET http://www.sigrok.org/tmp/Python32_$TARGET.tar.gz -O $PREFIX/Python32.tar.gz
-tar xzf $PREFIX/Python32.tar.gz -C $PREFIX
+# - https://www.python.org/ftp/python/3.4.4/python-3.4.4.msi
+# - https://www.python.org/ftp/python/3.4.4/python-3.4.4.amd64.msi
+# The MSI file has been installed on a Windows box and then c:\Python34\libs
+# and c:\Python34\include have been stored in the Python34_*.tar.gz tarball.
+$WGET http://www.sigrok.org/tmp/Python34_$TARGET.tar.gz -O $PREFIX/Python34.tar.gz
+tar xzf $PREFIX/Python34.tar.gz -C $PREFIX
-# The file python32.dll (NOT the same as python3.dll) is copied from an
-# installed Python 3.2.3 (see above) from c:\Windows\system32\python32.dll.
-# The file python32.zip contains all files from the 'DLLs', 'Lib', and 'libs'
-# subdirectories from an installed Python on Windows (c:\python32), i.e. some
+# The file python34.dll (NOT the same as python3.dll) is copied from an
+# installed Python 3.4.4 (see above) from c:\Windows\system32\python34.dll.
+# The file python34.zip contains all files from the 'DLLs', 'Lib', and 'libs'
+# subdirectories from an installed Python on Windows (c:\python34), i.e. some
-$WGET http://www.sigrok.org/tmp/python32_$TARGET.dll -O $PREFIX/python32.dll
-$WGET http://www.sigrok.org/tmp/python32_$TARGET.zip -O $PREFIX/python32.zip
+$WGET http://www.sigrok.org/tmp/python34_$TARGET.dll -O $PREFIX/python34.dll
+$WGET http://www.sigrok.org/tmp/python34_$TARGET.zip -O $PREFIX/python34.zip
-$WGET -c http://$SF_MIRROR/project/libwdi/zadig/zadig_$VER_ZADIG.7z
-$WGET -c http://$SF_MIRROR/project/libwdi/zadig/zadig_xp_$VER_ZADIG.7z
-7zr e zadig_$VER_ZADIG.7z
-7zr e zadig_xp_$VER_ZADIG.7z
-cp -f zadig.exe zadig_xp.exe $PREFIX
+$WGET http://zadig.akeo.ie/downloads/zadig.exe -O $PREFIX/zadig.exe
+$WGET http://zadig.akeo.ie/downloads/zadig_xp.exe -O $PREFIX/zadig_xp.exe
+
+# libusb
+$GIT_CLONE git://github.com/dickens/libusb -b event-abstraction-v4
+cd libusb
+patch -p1 < ../../libusb_raw_io.patch
+./bootstrap.sh
+./configure $C $L
+make -j1 $V
+make install $V
+cd ..
cd sigrok-firmware
./autogen.sh
# Nothing gets cross-compiled here, we just need 'make install' basically.
./configure --prefix=$PREFIX
cd sigrok-firmware
./autogen.sh
# Nothing gets cross-compiled here, we just need 'make install' basically.
./configure --prefix=$PREFIX
cd sigrok-firmware-fx2lafw
./autogen.sh
# We're building the fx2lafw firmware on the host, no need to cross-compile.
./configure --prefix=$PREFIX
cd sigrok-firmware-fx2lafw
./autogen.sh
# We're building the fx2lafw firmware on the host, no need to cross-compile.
./configure --prefix=$PREFIX
-cmake $CM -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y .
-make $PARALLEL VERBOSE=1
-make install
+cp ../../FileAssociation.nsh contrib
+if [ $DEBUG = 1 ]; then
+ # Allow a "DOS box" to open on Windows, it'll contain logging output.
+ patch -p1 < ../../pv_mwindows.patch
+fi
+$CMAKE -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y -DENABLE_TESTS=y .
+make $PARALLEL $V
+if [ $DEBUG = 1 ]; then
+ make install $V
+else
+ make install/strip $V
+fi