diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index d4749d6d3..972011c80 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -38,6 +38,14 @@ jobs: cd hidapi-hidapi-${HIDAPI_VER} ./bootstrap echo "HIDAPI_SRC=$PWD" >> $GITHUB_ENV + - name: Prepare libftdi + env: + LIBFTDI_VER: 1.5 + run: | + mkdir -p $DL_DIR && cd $DL_DIR + wget "http://www.intra2net.com/en/developer/libftdi/download/libftdi1-${LIBFTDI_VER}.tar.bz2" + tar -xjf libftdi1-${LIBFTDI_VER}.tar.bz2 + echo "LIBFTDI_SRC=$PWD/libftdi1-${LIBFTDI_VER}" >> $GITHUB_ENV - name: Prepare capstone env: CAPSTONE_VER: 4.0.2 @@ -54,6 +62,7 @@ jobs: HOST: i686-w64-mingw32 LIBUSB1_CONFIG: --enable-shared --disable-static HIDAPI_CONFIG: --enable-shared --disable-static --disable-testgui + LIBFTDI_CONFIG: -DSTATICLIBS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF CAPSTONE_CONFIG: "CAPSTONE_BUILD_CORE_ONLY=yes CAPSTONE_STATIC=yes CAPSTONE_SHARED=no" CAPSTONE_CFLAGS: -I$(CAPSTONE_SRC)/include/capstone run: | diff --git a/contrib/cross-build.sh b/contrib/cross-build.sh index 610607e1c..856551d78 100755 --- a/contrib/cross-build.sh +++ b/contrib/cross-build.sh @@ -121,11 +121,17 @@ fi if [ -d $LIBFTDI_SRC ] ; then mkdir -p $LIBFTDI_BUILD_DIR cd $LIBFTDI_BUILD_DIR - # libftdi requires libusb1 static libraries, granted by: - # export LIBUSB1_CONFIG="--enable-static ..." + # note : libftdi versions < 1.5 requires libusb1 static + # hint use : # export LIBUSB1_CONFIG="--enable-static ..." + # not needed since libftdi-1.5 when LIBFTDI_CONFIG="-DSTATICLIBS=OFF ..." + + # fix .cmake file + ESCAPED_SYSROOT=$(printf '%s\n' "$SYSROOT" | sed -e 's/[\/&]/\\&/g') + sed -i -E "s/(SET\(CMAKE_FIND_ROOT_PATH\s+).+\)/\1${ESCAPED_SYSROOT})/" \ + ${LIBFTDI_SRC}/cmake/Toolchain-${HOST_TRIPLET}.cmake + cmake $LIBFTDI_CONFIG \ - -DLIBUSB_INCLUDE_DIR=${SYSROOT}${PREFIX}/include/libusb-1.0 \ - -DLIBUSB_LIBRARIES=${SYSROOT}${PREFIX}/lib/libusb-1.0.a \ + -DCMAKE_TOOLCHAIN_FILE=${LIBFTDI_SRC}/cmake/Toolchain-${HOST_TRIPLET}.cmake \ -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DPKG_CONFIG_EXECUTABLE=`which pkg-config` \ $LIBFTDI_SRC