]> sigrok.org Git - sigrok-util.git/blobdiff - cross-compile/mingw/sigrok-cross-mingw
sigrok-cross-mingw: i686-pc-mingw32.static -> i686-w64-mingw32.static.
[sigrok-util.git] / cross-compile / mingw / sigrok-cross-mingw
index 5a807cbeea28dd7b536a8deb8d88a545ce4cb491..6bf521c5804c163b382055fe90791d4ae942f9f1 100755 (executable)
@@ -43,17 +43,23 @@ VER_ZADIG=v2.0.1.160
 SF_MIRROR=switch.dl.sourceforge.net
 
 WGET="wget --quiet"
+GIT_CLONE="git clone --depth=1"
 
 # -----------------------------------------------------------------------------
 
 # We need to find tools in the toolchain.
 export PATH=$MXE/usr/bin:$PATH
 
+TOOLCHAIN_TRIPLET="i686-w64-mingw32.static"
+
 P="$PREFIX/lib/pkgconfig"
-P2="$MXE/usr/i686-pc-mingw32/lib/pkgconfig"
-C="--host=i686-pc-mingw32 --prefix=$PREFIX"
-CM="-DCMAKE_TOOLCHAIN_FILE=$MXE/usr/i686-pc-mingw32/share/cmake/mxe-conf.cmake"
+P2="$MXE/usr/$TOOLCHAIN_TRIPLET/lib/pkgconfig"
+C="--host=$TOOLCHAIN_TRIPLET --prefix=$PREFIX"
+CM="-DCMAKE_TOOLCHAIN_FILE=$MXE/usr/$TOOLCHAIN_TRIPLET/share/cmake/mxe-conf.cmake"
 L="--disable-shared --enable-static"
+DDK="$MXE/usr/$TOOLCHAIN_TRIPLET/include/ddk"
+
+export PKG_CONFIG_PATH_i686_w64_mingw32_static="$P:$P2"
 
 # Remove build directory contents (if any) and create a new build dir.
 rm -rf $BUILDDIR
@@ -109,36 +115,36 @@ $WGET -c http://$SF_MIRROR/project/libwdi/zadig/zadig_xp_$VER_ZADIG.7z
 cp -f zadig.exe zadig_xp.exe $PREFIX
 
 # libserialport
-git clone git://sigrok.org/libserialport
+$GIT_CLONE git://sigrok.org/libserialport
 cd libserialport
 ./autogen.sh
-PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L
+CFLAGS="-I$DDK" ./configure $C $L
 make $PARALLEL V=1
 make install
 cd ..
 
 # libsigrok
-git clone git://sigrok.org/libsigrok
+$GIT_CLONE git://sigrok.org/libsigrok
 cd libsigrok
 patch -p1 < ../../libsigrok_firmwaredir.patch
 ./autogen.sh
-PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L
+./configure $C $L
 make $PARALLEL V=1
 make install
 cd ..
 
 # libsigrokdecode
-git clone git://sigrok.org/libsigrokdecode
+$GIT_CLONE git://sigrok.org/libsigrokdecode
 cd libsigrokdecode
 ./autogen.sh
 patch -p1 < ../../srd_decodersdir.patch
-PKG_CONFIG_PATH_i686_pc_mingw32=$P ./configure $C $L
+./configure $C $L
 make $PARALLEL V=1
 make install
 cd ..
 
 # sigrok-firmware
-git clone git://sigrok.org/sigrok-firmware
+$GIT_CLONE git://sigrok.org/sigrok-firmware
 cd sigrok-firmware
 ./autogen.sh
 # Nothing gets cross-compiled here, we just need 'make install' basically.
@@ -147,7 +153,7 @@ make install
 cd ..
 
 # sigrok-firmware-fx2lafw
-git clone git://sigrok.org/sigrok-firmware-fx2lafw
+$GIT_CLONE git://sigrok.org/sigrok-firmware-fx2lafw
 cd sigrok-firmware-fx2lafw
 ./autogen.sh
 # We're building the fx2lafw firmware on the host, no need to cross-compile.
@@ -157,25 +163,25 @@ make install
 cd ..
 
 # sigrok-dumps
-git clone git://sigrok.org/sigrok-dumps
+$GIT_CLONE git://sigrok.org/sigrok-dumps
 cd sigrok-dumps
 make install DESTDIR=$PREFIX/share/sigrok-dumps
 cd ..
 
 # sigrok-cli
-git clone git://sigrok.org/sigrok-cli
+$GIT_CLONE git://sigrok.org/sigrok-cli
 cd sigrok-cli
 ./autogen.sh
-PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 ./configure $C
+./configure $C
 make $PARALLEL V=1
 make install
 makensis -DHOME=$HOME contrib/sigrok-cli_cross.nsi
 cd ..
 
 # PulseView
-git clone git://sigrok.org/pulseview
+$GIT_CLONE git://sigrok.org/pulseview
 cd pulseview
-PKG_CONFIG_PATH_i686_pc_mingw32=$P:$P2 cmake $CM -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y .
+cmake $CM -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y .
 make $PARALLEL VERBOSE=1
 make install
 makensis -DHOME=$HOME contrib/pulseview_cross.nsi