diff options
author | Tim Newsome <tim@sifive.com> | 2022-10-31 10:34:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-31 10:34:03 -0700 |
commit | cdadb2040b88cc2d1067d71a4dd0b79cfcbb1d77 (patch) | |
tree | 1fc923218e8a462ad7251fa4d1b77da806a6f2bc | |
parent | fad123a16b260abbcdd4856ab08757a2881a8c1c (diff) | |
download | riscv-openocd-cdadb2040b88cc2d1067d71a4dd0b79cfcbb1d77.zip riscv-openocd-cdadb2040b88cc2d1067d71a4dd0b79cfcbb1d77.tar.gz riscv-openocd-cdadb2040b88cc2d1067d71a4dd0b79cfcbb1d77.tar.bz2 |
github/workflow: enable libftdi based adapters (#755)
Change-Id: I74b07b21573294dd7d9d3caf41c5755622c77149
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7008
Tested-by: jenkins
Reviewed-by: Xiaofan Chen <xiaofanc@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Co-authored-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
-rw-r--r-- | .github/workflows/snapshot.yml | 9 | ||||
-rwxr-xr-x | contrib/cross-build.sh | 14 |
2 files changed, 19 insertions, 4 deletions
diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index d4749d6..972011c 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 610607e..856551d 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 <toolchain>.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 |