From 8f70d740a05a074f4d374a453a5ef1b8056ba63b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Tue, 28 Feb 2017 11:44:20 +0100 Subject: [PATCH 01/20] Update manifest.json --- README.md | 2 ++ manifest.json | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fe2eae..966d3ef 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Tools-system +[![Build Status](https://travis-ci.org/FPGAwars/tools-system.svg?branch=v1.1.0)](https://travis-ci.org/FPGAwars/tools-system) + ## Introduction Static binaries of the **lsftdi** and **lsusb** tools. Packaged for [Apio](https://github.com/FPGAwars/apio). diff --git a/manifest.json b/manifest.json index 6a268c5..27ad9df 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,47 @@ { "tools-system": [ - + { + "url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-darwin-1.1.0.tar.gz", + "sha1": "62fdb6b2714da062375cc745c4b7bdfd182a5695", + "version": "1.1.0", + "system": ["darwin", "darwin_x86_64", "darwin_i386"] + }, + { + "url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-linux_aarch64-1.1.0.tar.gz", + "sha1": "a213e907956cffd6ac13713f7e9ae215af7d36c9", + "version": "1.1.0", + "system": ["linux_aarch64"] + }, + { + "url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-linux_armv7l-1.1.0.tar.gz", + "sha1": "eaa9592cb27887320342ed80bfec12498e7f4554", + "version": "1.1.0", + "system": ["linux_armv7l"] + }, + { + "url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-linux_i686-1.1.0.tar.gz", + "sha1": "e671d02590a0fe8c4e6867ac9ce115314c8d9249", + "version": "1.1.0", + "system": ["linux_i686"] + }, + { + "url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-linux_x86_64-1.1.0.tar.gz", + "sha1": "0f229a7d2952dd86390d1faa5e1268af8a773a17", + "version": "1.1.0", + "system": ["linux_x86_64"] + }, + { + "url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-windows_amd64-1.1.0.tar.gz", + "sha1": "a397ecb4b73ef06b370ad8f36c4482a110d5cec1", + "version": "1.1.0", + "system": ["windows_amd64"] + } + { + "url": "https://github.com/FPGAwars/tools-system/releases/download/v1.1.0/tools-system-windows_x86-1.1.0.tar.gz", + "sha1": "84d2695b3872e9128c4a318b837dcd16d525d04c", + "version": "1.1.0", + "system": ["windows", "windows_x86"] + } ] } From a638869846569bc2d7d2e349d97be69291b563ff Mon Sep 17 00:00:00 2001 From: charliva Date: Wed, 8 May 2019 18:49:34 +0200 Subject: [PATCH 02/20] Upgrade to ftdi 1.4 and libusb 1.0.22 --- build.sh | 3 +++ scripts/compile_lsftdi.sh | 4 ++-- scripts/compile_lsusb.sh | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index c609ecf..4df3b19 100755 --- a/build.sh +++ b/build.sh @@ -3,6 +3,9 @@ # System tools builder # ################################## +# Set english language for propper pattern matching +export LC_ALL=C + # Generate tools-system-arch-ver.tar.gz from source code # sources: https://github.com/FPGAwars/tools-system diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index 8847a10..1bd34ef 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -1,11 +1,11 @@ # -- Compile lsftdi script -VER=1.2 +VER=1.4 LIBFTDI1=libftdi1-$VER TAR_LIBFTDI1=$LIBFTDI1.tar.bz2 REL_LIBFTDI1=https://www.intra2net.com/en/developer/libftdi/download/$TAR_LIBFTDI1 -VER=1.0.20 +VER=1.0.22 LIBUSB=libusb-$VER # -- Setup diff --git a/scripts/compile_lsusb.sh b/scripts/compile_lsusb.sh index 1ad7662..756f1fc 100644 --- a/scripts/compile_lsusb.sh +++ b/scripts/compile_lsusb.sh @@ -1,6 +1,6 @@ # -- Compile lsusb script -VER=1.0.20 +VER=1.0.22 LIBUSB=libusb-$VER TAR_LIBUSB=$LIBUSB.tar.bz2 REL_LIBUSB=https://github.com/libusb/libusb/releases/download/v$VER/$TAR_LIBUSB From 17dadd9b64bd9959be5c65017184f2ee25a3f278 Mon Sep 17 00:00:00 2001 From: charliva Date: Wed, 8 May 2019 19:31:50 +0200 Subject: [PATCH 03/20] Fixed bug for windows exe compilation --- scripts/compile_lsftdi.sh | 4 ++-- scripts/compile_lsusb.sh | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index 1bd34ef..e5f39e4 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -49,8 +49,8 @@ cd .. # -- Test the generated executables if [ $ARCH != "darwin" ]; then - test_bin examples/lsftdi + test_bin examples/lsftdi$EXE fi # -- Copy the executable into the packages/bin dir -cp examples/lsftdi $PACKAGE_DIR/$NAME/bin/lsftdi$EXE +cp examples/lsftdi$EXE $PACKAGE_DIR/$NAME/bin/lsftdi$EXE diff --git a/scripts/compile_lsusb.sh b/scripts/compile_lsusb.sh index 756f1fc..95b97f9 100644 --- a/scripts/compile_lsusb.sh +++ b/scripts/compile_lsusb.sh @@ -25,7 +25,10 @@ PREFIX=$BUILD_DIR/$LIBUSB/release #-- Build libusb if [ $ARCH != "darwin" ]; then + echo "****** --prefix=$PREFIX --host=$HOST --enable-udev=no $CONFIG_FLAGS" + ./configure --prefix=$PREFIX --host=$HOST --enable-udev=no $CONFIG_FLAGS + echo "****** make -j$J" make -j$J make install fi @@ -35,14 +38,16 @@ cd examples if [ $ARCH == "darwin" ]; then $CC -o lsusb listdevs.c -lusb-1.0 -I../libusb else + + echo "**** $CC -o lsusb listdevs.c -static -lusb-1.0 -lpthread -L$PREFIX/lib -I$PREFIX/include/libusb-1.0" $CC -o lsusb listdevs.c -static -lusb-1.0 -lpthread -L$PREFIX/lib -I$PREFIX/include/libusb-1.0 fi cd .. # -- Test the generated executables if [ $ARCH != "darwin" ]; then - test_bin examples/lsusb + test_bin examples/lsusb$EXE fi # -- Copy the executable into the packages/bin dir -cp examples/lsusb $PACKAGE_DIR/$NAME/bin/lsusb$EXE +cp examples/lsusb$EXE $PACKAGE_DIR/$NAME/bin/lsusb$EXE From c4671a0c9c5adbf9abe8d9a16eae80b509fcddfc Mon Sep 17 00:00:00 2001 From: charliva Date: Thu, 9 May 2019 01:59:27 +0200 Subject: [PATCH 04/20] - Support for libconfuse 3.2.2 on libftdi 1.4 - New binary for eeprom management ftdi_eeprom --- build-data/includes/ftdi_eeprom_version.h | 10 +++++ build.sh | 9 +++++ scripts/build_setup.sh | 1 + scripts/compile_lconfuse.sh | 49 +++++++++++++++++++++++ scripts/compile_lsftdi.sh | 20 +++++++-- scripts/compile_lsusb.sh | 6 --- 6 files changed, 86 insertions(+), 9 deletions(-) create mode 100644 build-data/includes/ftdi_eeprom_version.h create mode 100644 scripts/compile_lconfuse.sh diff --git a/build-data/includes/ftdi_eeprom_version.h b/build-data/includes/ftdi_eeprom_version.h new file mode 100644 index 0000000..bbcffe0 --- /dev/null +++ b/build-data/includes/ftdi_eeprom_version.h @@ -0,0 +1,10 @@ +#ifndef _FTDI_EEPROM_VERSION_H +#define _FTDI_EEPROM_VERSION_H + +#define EEPROM_MAJOR_VERSION 0 +#define EEPROM_MINOR_VERSION 17 +#define EEPROM_VERSION_STRING "0.17" + +#endif + + diff --git a/build.sh b/build.sh index 4df3b19..348be9a 100755 --- a/build.sh +++ b/build.sh @@ -21,6 +21,7 @@ NAME=tools-system # -- Debug flags INSTALL_DEPS=1 COMPILE_LSUSB=1 +COMPILE_LCONFUSE=1 COMPILE_LSFTDI=1 CREATE_PACKAGE=1 @@ -107,6 +108,14 @@ if [ $COMPILE_LSUSB == "1" ]; then fi +# --------- Compile lconfuse ------------------------------------------ +if [ $COMPILE_LCONFUSE == "1" ]; then + + print ">> Compile lconfuse" + . $WORK_DIR/scripts/compile_lconfuse.sh + +fi + # --------- Compile lsftdi ----------------------------------------- if [ $COMPILE_LSFTDI == "1" ]; then diff --git a/scripts/build_setup.sh b/scripts/build_setup.sh index caee26c..60f6cf7 100644 --- a/scripts/build_setup.sh +++ b/scripts/build_setup.sh @@ -3,6 +3,7 @@ if [ $ARCH == "linux_x86_64" ]; then CC="gcc" HOST="x86_64-linux-gnu" + fi if [ $ARCH == "linux_i686" ]; then diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh new file mode 100644 index 0000000..c1ad767 --- /dev/null +++ b/scripts/compile_lconfuse.sh @@ -0,0 +1,49 @@ +# -- Compile lsusb script + +VER=3.2.2 +LIBCONFUSE=confuse-$VER +TAR_LIBCONFUSE=$LIBCONFUSE.tar.gz +REL_LIBCONFUSE=https://github.com/martinh/libconfuse/releases/download/v$VER/$TAR_LIBCONFUSE + +# -- Setup +. $WORK_DIR/scripts/build_setup.sh + +cd $UPSTREAM_DIR + +# -- Check and download the release +test -e $TAR_LIBCONFUSE || wget $REL_LIBCONFUSE + +# -- Unpack the release +tar zxf $TAR_LIBCONFUSE + +# -- Copy the upstream sources into the build directory +test -e +rsync -a $LIBCONFUSE $BUILD_DIR --exclude .git + + +cd $BUILD_DIR/$LIBCONFUSE + +PREFIX=$BUILD_DIR/$LIBCONFUSE/release + +#-- Build libusb +if [ $ARCH != "darwin" ]; then + + ./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS + + make + make install +fi + +#-- Build simple +cd examples +if [ $ARCH == "darwin" ]; then + $CC -o simple simple.c -lconfuse -I../libconfuse +else + $CC -o simple simple.c -static -lconfuse -L$PREFIX/lib -I$PREFIX/include +fi +cd .. + +# -- Test the generated executables +if [ $ARCH != "darwin" ]; then + test_bin examples/simple$EXE +fi diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index e5f39e4..add89fd 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -26,6 +26,8 @@ cd $BUILD_DIR/$LIBFTDI1 PREFIX=$BUILD_DIR/$LIBFTDI1/release LIBUSB_PREFIX=$BUILD_DIR/$LIBUSB/release +LIBCONFUSE_VER=3.2.2 +LIBCONFUSE=confuse-$LIBCONFUSE_VER #-- Build libftdi if [ $ARCH != "darwin" ]; then @@ -41,16 +43,28 @@ fi #-- Build lsftdi cd examples if [ $ARCH == "darwin" ]; then - $CC -o lsftdi find_all.c -lftdi1 -lusb-1.0 -I../src + $CC -o lsftdi find_all.c -lftdi1 -lusb-1.0 -I../src else - $CC -o lsftdi find_all.c -static -lftdi1 -lusb-1.0 -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$PREFIX/include/libftdi1 + $CC -o lsftdi find_all.c -static -lftdi1 -lusb-1.0 -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$PREFIX/include/libftdi1 + $CC -o ../release/bin/ftdi_eeprom ../ftdi_eeprom/main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include fi cd .. # -- Test the generated executables if [ $ARCH != "darwin" ]; then - test_bin examples/lsftdi$EXE + + test_bin examples/lsftdi$EXE + test_bin release/bin/ftdi_eeprom$EXE + + if [ $ARCH != "windows_x86" ] && [ $ARCH != "windows_amd64" ]; then + test_bin release/bin/libftdi1-config + fi fi # -- Copy the executable into the packages/bin dir cp examples/lsftdi$EXE $PACKAGE_DIR/$NAME/bin/lsftdi$EXE +cp release/bin/ftdi_eeprom$EXE $PACKAGE_DIR/$NAME/bin/ftdi_eeprom$EXE + +if [ $ARCH != "windows_x86" ] && [ $ARCH != "windows_amd64" ]; then + cp release/bin/libftdi1-config $PACKAGE_DIR/$NAME/bin/libftdi1-config +fi diff --git a/scripts/compile_lsusb.sh b/scripts/compile_lsusb.sh index 95b97f9..1dee837 100644 --- a/scripts/compile_lsusb.sh +++ b/scripts/compile_lsusb.sh @@ -1,5 +1,4 @@ # -- Compile lsusb script - VER=1.0.22 LIBUSB=libusb-$VER TAR_LIBUSB=$LIBUSB.tar.bz2 @@ -25,10 +24,7 @@ PREFIX=$BUILD_DIR/$LIBUSB/release #-- Build libusb if [ $ARCH != "darwin" ]; then - echo "****** --prefix=$PREFIX --host=$HOST --enable-udev=no $CONFIG_FLAGS" - ./configure --prefix=$PREFIX --host=$HOST --enable-udev=no $CONFIG_FLAGS - echo "****** make -j$J" make -j$J make install fi @@ -38,8 +34,6 @@ cd examples if [ $ARCH == "darwin" ]; then $CC -o lsusb listdevs.c -lusb-1.0 -I../libusb else - - echo "**** $CC -o lsusb listdevs.c -static -lusb-1.0 -lpthread -L$PREFIX/lib -I$PREFIX/include/libusb-1.0" $CC -o lsusb listdevs.c -static -lusb-1.0 -lpthread -L$PREFIX/lib -I$PREFIX/include/libusb-1.0 fi cd .. From 714b7cfd83ea05b4d2a1b8171670759135722067 Mon Sep 17 00:00:00 2001 From: charliva Date: Thu, 9 May 2019 02:12:25 +0200 Subject: [PATCH 05/20] Fix for macosx linconfuse package --- scripts/compile_lconfuse.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh index c1ad767..4e93cff 100644 --- a/scripts/compile_lconfuse.sh +++ b/scripts/compile_lconfuse.sh @@ -17,7 +17,6 @@ test -e $TAR_LIBCONFUSE || wget $REL_LIBCONFUSE tar zxf $TAR_LIBCONFUSE # -- Copy the upstream sources into the build directory -test -e rsync -a $LIBCONFUSE $BUILD_DIR --exclude .git @@ -25,14 +24,10 @@ cd $BUILD_DIR/$LIBCONFUSE PREFIX=$BUILD_DIR/$LIBCONFUSE/release -#-- Build libusb -if [ $ARCH != "darwin" ]; then - - ./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS - - make - make install -fi +#-- Build libconfuse +./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS +make +make install #-- Build simple cd examples From 7d8b68d395dd4f586675964cff08cee302ebeeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Venegas=20Arrab=C3=A9?= <6904865+cavearr@users.noreply.github.com> Date: Thu, 9 May 2019 02:18:10 +0200 Subject: [PATCH 06/20] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 966d3ef..d33d472 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,15 @@ NOTE: *libftdi* and *libusb* libraries are generated for each architecture. In o [The project documentation is located in the wiki](https://github.com/FPGAwars/tools-system/wiki). + ## Authors * [Juan González-Gómez (Obijuan)](https://github.com/Obijuan) * [Jesús Arroyo Torrens](https://github.com/Jesus89) +## Contributors +* [Carlos Venegas Arrabe (cavearr)](https://github.com/cavearr) + ## License Licensed under [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). From ba64a14fd0e8a506a777b6d5ddfd10740ae7c624 Mon Sep 17 00:00:00 2001 From: charliva Date: Thu, 9 May 2019 02:22:38 +0200 Subject: [PATCH 07/20] Fix for macosx compatibility --- scripts/compile_lconfuse.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh index 4e93cff..26f4b34 100644 --- a/scripts/compile_lconfuse.sh +++ b/scripts/compile_lconfuse.sh @@ -31,11 +31,11 @@ make install #-- Build simple cd examples -if [ $ARCH == "darwin" ]; then - $CC -o simple simple.c -lconfuse -I../libconfuse -else +#if [ $ARCH == "darwin" ]; then +# $CC -o simple simple.c -lconfuse -I../libconfuse +#else $CC -o simple simple.c -static -lconfuse -L$PREFIX/lib -I$PREFIX/include -fi +#fi cd .. # -- Test the generated executables From 17cbaccc7f1202b87c1f012d9a2f99d617c2a3ee Mon Sep 17 00:00:00 2001 From: charliva Date: Thu, 9 May 2019 02:35:46 +0200 Subject: [PATCH 08/20] Fixed problem with static linking at MacOSX --- scripts/compile_lconfuse.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh index 26f4b34..441c4c8 100644 --- a/scripts/compile_lconfuse.sh +++ b/scripts/compile_lconfuse.sh @@ -31,11 +31,11 @@ make install #-- Build simple cd examples -#if [ $ARCH == "darwin" ]; then -# $CC -o simple simple.c -lconfuse -I../libconfuse -#else +if [ $ARCH == "darwin" ]; then + $CC -o simple simple.c -lconfuse -L$PREFIX/lib -I$PREFIX/include +else $CC -o simple simple.c -static -lconfuse -L$PREFIX/lib -I$PREFIX/include -#fi +fi cd .. # -- Test the generated executables From 8d05c2a460c37e6037acd7b1a45625b45f23b579 Mon Sep 17 00:00:00 2001 From: charliva Date: Thu, 9 May 2019 02:44:26 +0200 Subject: [PATCH 09/20] Avoid config binary on MacOSX --- scripts/compile_lsftdi.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index add89fd..e80ddaf 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -44,6 +44,8 @@ fi cd examples if [ $ARCH == "darwin" ]; then $CC -o lsftdi find_all.c -lftdi1 -lusb-1.0 -I../src + $CC -o ../release/bin/ftdi_eeprom ../ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthreadi -I../src -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include + else $CC -o lsftdi find_all.c -static -lftdi1 -lusb-1.0 -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$PREFIX/include/libftdi1 $CC -o ../release/bin/ftdi_eeprom ../ftdi_eeprom/main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include @@ -65,6 +67,6 @@ fi cp examples/lsftdi$EXE $PACKAGE_DIR/$NAME/bin/lsftdi$EXE cp release/bin/ftdi_eeprom$EXE $PACKAGE_DIR/$NAME/bin/ftdi_eeprom$EXE -if [ $ARCH != "windows_x86" ] && [ $ARCH != "windows_amd64" ]; then +if [ $ARCH != "windows_x86" ] && [ $ARCH != "windows_amd64" ] && [ $ARCH != "darwin" ]; then cp release/bin/libftdi1-config $PACKAGE_DIR/$NAME/bin/libftdi1-config fi From 26a4f74a3ba9a05493f5bf1ef9e7a5c6ad424eb3 Mon Sep 17 00:00:00 2001 From: charliva Date: Thu, 9 May 2019 03:22:51 +0200 Subject: [PATCH 10/20] Macosx fix --- scripts/compile_lsftdi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index e80ddaf..3b11d9b 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -44,7 +44,7 @@ fi cd examples if [ $ARCH == "darwin" ]; then $CC -o lsftdi find_all.c -lftdi1 -lusb-1.0 -I../src - $CC -o ../release/bin/ftdi_eeprom ../ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthreadi -I../src -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include + $CC -o ../release/bin/ftdi_eeprom ../ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -I../src -I$LIBUSB_PREFIX/include/libusb-1.0 -I../../../../build-data/includes -L$PREFIX/lib -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include else $CC -o lsftdi find_all.c -static -lftdi1 -lusb-1.0 -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$PREFIX/include/libftdi1 From ddd63577a358c8f19242ed1b99185f9dc4085db1 Mon Sep 17 00:00:00 2001 From: clos Date: Thu, 9 May 2019 00:12:44 -0700 Subject: [PATCH 11/20] Support for macosx build with libconfuse for libftdi eeprom management capabilities --- build.sh | 2 +- scripts/compile_lconfuse.sh | 15 +++++++++------ scripts/compile_lsftdi.sh | 14 +++++++++++--- scripts/install_dependencies.sh | 3 ++- test/test_bin.sh | 7 +++++-- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/build.sh b/build.sh index 348be9a..99f3bc8 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,7 @@ mkdir -p $UPSTREAM_DIR # -- Test script function function test_bin { - $WORK_DIR/test/test_bin.sh $1 + $WORK_DIR/test/test_bin.sh $1 $2 if [ $? != "0" ]; then exit 1 fi diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh index 441c4c8..5e0acf3 100644 --- a/scripts/compile_lconfuse.sh +++ b/scripts/compile_lconfuse.sh @@ -9,7 +9,6 @@ REL_LIBCONFUSE=https://github.com/martinh/libconfuse/releases/download/v$VER/$TA . $WORK_DIR/scripts/build_setup.sh cd $UPSTREAM_DIR - # -- Check and download the release test -e $TAR_LIBCONFUSE || wget $REL_LIBCONFUSE @@ -24,15 +23,17 @@ cd $BUILD_DIR/$LIBCONFUSE PREFIX=$BUILD_DIR/$LIBCONFUSE/release -#-- Build libconfuse -./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS -make -make install +if [ $ARCH != "darwin" ]; then + #-- Build libconfuse + ./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS + make + make install +fi #-- Build simple cd examples if [ $ARCH == "darwin" ]; then - $CC -o simple simple.c -lconfuse -L$PREFIX/lib -I$PREFIX/include + $CC -o simple simple.c -lconfuse -I../src else $CC -o simple simple.c -static -lconfuse -L$PREFIX/lib -I$PREFIX/include fi @@ -41,4 +42,6 @@ cd .. # -- Test the generated executables if [ $ARCH != "darwin" ]; then test_bin examples/simple$EXE +else + test_bin examples/simple NO_CHECK_STATIC fi diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index e80ddaf..1bce6db 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -44,8 +44,7 @@ fi cd examples if [ $ARCH == "darwin" ]; then $CC -o lsftdi find_all.c -lftdi1 -lusb-1.0 -I../src - $CC -o ../release/bin/ftdi_eeprom ../ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthreadi -I../src -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include - + $CC -o ../ftdi_eeprom/ftdi_eeprom ../ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../src -I../../../../build-data/includes -I$BUILD_DIR/$LIBUSB/libusb -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBCONFUSE/src else $CC -o lsftdi find_all.c -static -lftdi1 -lusb-1.0 -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$PREFIX/include/libftdi1 $CC -o ../release/bin/ftdi_eeprom ../ftdi_eeprom/main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include @@ -61,11 +60,20 @@ if [ $ARCH != "darwin" ]; then if [ $ARCH != "windows_x86" ] && [ $ARCH != "windows_amd64" ]; then test_bin release/bin/libftdi1-config fi +else + test_bin examples/lsftdi NO_CHECK_STATIC + test_bin ftdi_eeprom/ftdi_eeprom NO_CHECK_STATIC + fi + # -- Copy the executable into the packages/bin dir cp examples/lsftdi$EXE $PACKAGE_DIR/$NAME/bin/lsftdi$EXE -cp release/bin/ftdi_eeprom$EXE $PACKAGE_DIR/$NAME/bin/ftdi_eeprom$EXE +if [ $ARCH == "darwin" ]; then + cp ftdi_eeprom/ftdi_eeprom $PACKAGE_DIR/$NAME/bin/ftdi_eeprom +else + cp release/bin/ftdi_eeprom$EXE $PACKAGE_DIR/$NAME/bin/ftdi_eeprom$EXE +fi if [ $ARCH != "windows_x86" ] && [ $ARCH != "windows_amd64" ] && [ $ARCH != "darwin" ]; then cp release/bin/libftdi1-config $PACKAGE_DIR/$NAME/bin/libftdi1-config diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh index cb79432..aec6d79 100644 --- a/scripts/install_dependencies.sh +++ b/scripts/install_dependencies.sh @@ -30,7 +30,8 @@ if [ ${ARCH:0:7} == "windows" ]; then fi if [ $ARCH == "darwin" ]; then - DEPS="pkg-config libusb libftdi wget" + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null + DEPS="pkg-config libusb libftdi wget confuse" brew update brew install --force $DEPS brew unlink $DEPS && brew link --force $DEPS diff --git a/test/test_bin.sh b/test/test_bin.sh index d229bac..f48180f 100755 --- a/test/test_bin.sh +++ b/test/test_bin.sh @@ -4,6 +4,8 @@ FILE=$1 + + echo "" >&2 echo "Testing $FILE file" >&2 echo "------------------------------" >&2 @@ -37,8 +39,9 @@ echo "------------------------------" >&2 test1 $FILE test2 $FILE -test3 $FILE - +if [ -z $2 ]; then + test3 $FILE +fi echo "------------------------------" >&2 echo "All tests [PASSED]" >&2 echo "" >&2 From 2284f41aaca8c94b7f6bea20d4581eb6985d544d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 12 May 2019 17:52:11 +0200 Subject: [PATCH 12/20] Separate ftdi_eeprom build --- README.md | 1 - build-data/includes/ftdi_eeprom_version.h | 2 -- scripts/build_setup.sh | 1 - scripts/compile_lsftdi.sh | 12 +++++++----- test/test_bin.sh | 2 -- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d33d472..217d0b7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,6 @@ NOTE: *libftdi* and *libusb* libraries are generated for each architecture. In o [The project documentation is located in the wiki](https://github.com/FPGAwars/tools-system/wiki). - ## Authors * [Juan González-Gómez (Obijuan)](https://github.com/Obijuan) diff --git a/build-data/includes/ftdi_eeprom_version.h b/build-data/includes/ftdi_eeprom_version.h index bbcffe0..6fd854d 100644 --- a/build-data/includes/ftdi_eeprom_version.h +++ b/build-data/includes/ftdi_eeprom_version.h @@ -6,5 +6,3 @@ #define EEPROM_VERSION_STRING "0.17" #endif - - diff --git a/scripts/build_setup.sh b/scripts/build_setup.sh index 60f6cf7..caee26c 100644 --- a/scripts/build_setup.sh +++ b/scripts/build_setup.sh @@ -3,7 +3,6 @@ if [ $ARCH == "linux_x86_64" ]; then CC="gcc" HOST="x86_64-linux-gnu" - fi if [ $ARCH == "linux_i686" ]; then diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index 1bce6db..cdf5311 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -44,16 +44,20 @@ fi cd examples if [ $ARCH == "darwin" ]; then $CC -o lsftdi find_all.c -lftdi1 -lusb-1.0 -I../src - $CC -o ../ftdi_eeprom/ftdi_eeprom ../ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../src -I../../../../build-data/includes -I$BUILD_DIR/$LIBUSB/libusb -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBCONFUSE/src else $CC -o lsftdi find_all.c -static -lftdi1 -lusb-1.0 -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$PREFIX/include/libftdi1 - $CC -o ../release/bin/ftdi_eeprom ../ftdi_eeprom/main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include fi cd .. +#-- Build ftdi_eeprom +if [ $ARCH == "darwin" ]; then + $CC -o ftdi_eeprom/ftdi_eeprom ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../src -I../../../build-data/includes -I$BUILD_DIR/$LIBUSB/libusb -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBCONFUSE/src +else + $CC -o release/bin/ftdi_eeprom ftdi_eeprom/main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include +fi + # -- Test the generated executables if [ $ARCH != "darwin" ]; then - test_bin examples/lsftdi$EXE test_bin release/bin/ftdi_eeprom$EXE @@ -63,10 +67,8 @@ if [ $ARCH != "darwin" ]; then else test_bin examples/lsftdi NO_CHECK_STATIC test_bin ftdi_eeprom/ftdi_eeprom NO_CHECK_STATIC - fi - # -- Copy the executable into the packages/bin dir cp examples/lsftdi$EXE $PACKAGE_DIR/$NAME/bin/lsftdi$EXE if [ $ARCH == "darwin" ]; then diff --git a/test/test_bin.sh b/test/test_bin.sh index f48180f..fb84cc2 100755 --- a/test/test_bin.sh +++ b/test/test_bin.sh @@ -4,8 +4,6 @@ FILE=$1 - - echo "" >&2 echo "Testing $FILE file" >&2 echo "------------------------------" >&2 From eb52f88193ac2de3ea4969b589834b7b31abc443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 12 May 2019 17:59:57 +0200 Subject: [PATCH 13/20] Refactor test_bin script --- build.sh | 4 ++-- clean.sh | 8 -------- scripts/compile_lconfuse.sh | 4 ++-- scripts/compile_lsftdi.sh | 4 ++-- test/test_bin.sh | 17 +++++++++-------- 5 files changed, 15 insertions(+), 22 deletions(-) diff --git a/build.sh b/build.sh index 99f3bc8..cabb102 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,7 @@ mkdir -p $UPSTREAM_DIR # -- Test script function function test_bin { - $WORK_DIR/test/test_bin.sh $1 $2 + $WORK_DIR/test/test_bin.sh $1 if [ $? != "0" ]; then exit 1 fi @@ -108,7 +108,7 @@ if [ $COMPILE_LSUSB == "1" ]; then fi -# --------- Compile lconfuse ------------------------------------------ +# --------- Compile lconfuse --------------------------------------- if [ $COMPILE_LCONFUSE == "1" ]; then print ">> Compile lconfuse" diff --git a/clean.sh b/clean.sh index ea70247..8332e15 100755 --- a/clean.sh +++ b/clean.sh @@ -14,14 +14,6 @@ BUILDS_DIR=$WORK_DIR/_builds # -- Folder for storing the generated packages PACKAGES_DIR=$WORK_DIR/_packages -# -- Test script function -function test_bin { - $WORK_DIR/test/test_bin.sh $1 - if [ $? != "0" ]; then - exit 1 - fi -} - # -- Check ARCH if [[ $# > 1 ]]; then echo "" diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh index 5e0acf3..3792bf8 100644 --- a/scripts/compile_lconfuse.sh +++ b/scripts/compile_lconfuse.sh @@ -18,7 +18,7 @@ tar zxf $TAR_LIBCONFUSE # -- Copy the upstream sources into the build directory rsync -a $LIBCONFUSE $BUILD_DIR --exclude .git - + cd $BUILD_DIR/$LIBCONFUSE PREFIX=$BUILD_DIR/$LIBCONFUSE/release @@ -43,5 +43,5 @@ cd .. if [ $ARCH != "darwin" ]; then test_bin examples/simple$EXE else - test_bin examples/simple NO_CHECK_STATIC + test_bin examples/simple fi diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index cdf5311..2708ffe 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -65,8 +65,8 @@ if [ $ARCH != "darwin" ]; then test_bin release/bin/libftdi1-config fi else - test_bin examples/lsftdi NO_CHECK_STATIC - test_bin ftdi_eeprom/ftdi_eeprom NO_CHECK_STATIC + test_bin examples/lsftdi + test_bin ftdi_eeprom/ftdi_eeprom fi # -- Copy the executable into the packages/bin dir diff --git a/test/test_bin.sh b/test/test_bin.sh index fb84cc2..a03cadf 100755 --- a/test/test_bin.sh +++ b/test/test_bin.sh @@ -8,7 +8,7 @@ echo "" >&2 echo "Testing $FILE file" >&2 echo "------------------------------" >&2 -function test0 { +function test_base { if "${@:2}" then echo "$1" >&2 @@ -18,15 +18,15 @@ function test0 { fi } -function test1 { +function test_exists { test0 "- 1. File exists" test -e $1 } -function test2 { +function test_exec { test0 "- 2. File is executable" test -x $1 } -function test3 { +function test_static { output=$(ldd $1 | grep "not a dynamic executable") test0 "- 3. File is static" test -n "$output" } @@ -35,11 +35,12 @@ file $FILE echo "------------------------------" >&2 -test1 $FILE -test2 $FILE -if [ -z $2 ]; then - test3 $FILE +test_exists $FILE +test_exec $FILE +if [ $ARCH != "darwin" ]; then + test_static $FILE fi + echo "------------------------------" >&2 echo "All tests [PASSED]" >&2 echo "" >&2 From 03323064aead61ffde7028f3a1c44cf43b42cae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 12 May 2019 18:27:31 +0200 Subject: [PATCH 14/20] Do not copy libftdi1-config file --- scripts/compile_lconfuse.sh | 5 ++--- scripts/compile_lsftdi.sh | 16 ++++------------ scripts/compile_lsusb.sh | 1 + 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh index 3792bf8..3f72616 100644 --- a/scripts/compile_lconfuse.sh +++ b/scripts/compile_lconfuse.sh @@ -18,13 +18,12 @@ tar zxf $TAR_LIBCONFUSE # -- Copy the upstream sources into the build directory rsync -a $LIBCONFUSE $BUILD_DIR --exclude .git - cd $BUILD_DIR/$LIBCONFUSE PREFIX=$BUILD_DIR/$LIBCONFUSE/release +#-- Build libconfuse if [ $ARCH != "darwin" ]; then - #-- Build libconfuse ./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS make make install @@ -35,7 +34,7 @@ cd examples if [ $ARCH == "darwin" ]; then $CC -o simple simple.c -lconfuse -I../src else - $CC -o simple simple.c -static -lconfuse -L$PREFIX/lib -I$PREFIX/include + $CC -o simple simple.c -static -lconfuse -L$PREFIX/lib -I$PREFIX/include fi cd .. diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index 2708ffe..c816bcb 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -43,27 +43,23 @@ fi #-- Build lsftdi cd examples if [ $ARCH == "darwin" ]; then - $CC -o lsftdi find_all.c -lftdi1 -lusb-1.0 -I../src + $CC -o lsftdi find_all.c -lftdi1 -lusb-1.0 -I../src else - $CC -o lsftdi find_all.c -static -lftdi1 -lusb-1.0 -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$PREFIX/include/libftdi1 + $CC -o lsftdi find_all.c -static -lftdi1 -lusb-1.0 -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$PREFIX/include/libftdi1 fi cd .. #-- Build ftdi_eeprom if [ $ARCH == "darwin" ]; then - $CC -o ftdi_eeprom/ftdi_eeprom ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../src -I../../../build-data/includes -I$BUILD_DIR/$LIBUSB/libusb -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBCONFUSE/src + $CC -o ftdi_eeprom/ftdi_eeprom ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../src -I../../../build-data/includes -I$BUILD_DIR/$LIBUSB/libusb -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBCONFUSE/src else - $CC -o release/bin/ftdi_eeprom ftdi_eeprom/main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include + $CC -o release/bin/ftdi_eeprom ftdi_eeprom/main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include fi # -- Test the generated executables if [ $ARCH != "darwin" ]; then test_bin examples/lsftdi$EXE test_bin release/bin/ftdi_eeprom$EXE - - if [ $ARCH != "windows_x86" ] && [ $ARCH != "windows_amd64" ]; then - test_bin release/bin/libftdi1-config - fi else test_bin examples/lsftdi test_bin ftdi_eeprom/ftdi_eeprom @@ -76,7 +72,3 @@ if [ $ARCH == "darwin" ]; then else cp release/bin/ftdi_eeprom$EXE $PACKAGE_DIR/$NAME/bin/ftdi_eeprom$EXE fi - -if [ $ARCH != "windows_x86" ] && [ $ARCH != "windows_amd64" ] && [ $ARCH != "darwin" ]; then - cp release/bin/libftdi1-config $PACKAGE_DIR/$NAME/bin/libftdi1-config -fi diff --git a/scripts/compile_lsusb.sh b/scripts/compile_lsusb.sh index 1dee837..129f36b 100644 --- a/scripts/compile_lsusb.sh +++ b/scripts/compile_lsusb.sh @@ -1,4 +1,5 @@ # -- Compile lsusb script + VER=1.0.22 LIBUSB=libusb-$VER TAR_LIBUSB=$LIBUSB.tar.bz2 From 2574d6c8b770e3867ac743f65dc740a44d644e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 12 May 2019 18:38:00 +0200 Subject: [PATCH 15/20] Minor fix --- scripts/compile_lconfuse.sh | 8 ++++---- test/test_bin.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh index 3f72616..106626f 100644 --- a/scripts/compile_lconfuse.sh +++ b/scripts/compile_lconfuse.sh @@ -1,4 +1,4 @@ -# -- Compile lsusb script +# -- Compile libconfuse script VER=3.2.2 LIBCONFUSE=confuse-$VER @@ -24,9 +24,9 @@ PREFIX=$BUILD_DIR/$LIBCONFUSE/release #-- Build libconfuse if [ $ARCH != "darwin" ]; then - ./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS - make - make install + ./configure --prefix=$PREFIX --host=$HOST $CONFIG_FLAGS + make + make install fi #-- Build simple diff --git a/test/test_bin.sh b/test/test_bin.sh index a03cadf..d3b5537 100755 --- a/test/test_bin.sh +++ b/test/test_bin.sh @@ -19,16 +19,16 @@ function test_base { } function test_exists { - test0 "- 1. File exists" test -e $1 + test_base "- 1. File exists" test -e $1 } function test_exec { - test0 "- 2. File is executable" test -x $1 + test_base "- 2. File is executable" test -x $1 } function test_static { output=$(ldd $1 | grep "not a dynamic executable") - test0 "- 3. File is static" test -n "$output" + test_base "- 3. File is static" test -n "$output" } file $FILE From d6b3b2b4c7792fe577455076706d01b06d9e4d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 12 May 2019 18:51:19 +0200 Subject: [PATCH 16/20] Fix binary ext management --- scripts/compile_lconfuse.sh | 6 +----- scripts/compile_lsftdi.sh | 23 ++++++++--------------- scripts/compile_lsusb.sh | 4 ++-- test/test_bin.sh | 2 +- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/scripts/compile_lconfuse.sh b/scripts/compile_lconfuse.sh index 106626f..b63a57b 100644 --- a/scripts/compile_lconfuse.sh +++ b/scripts/compile_lconfuse.sh @@ -39,8 +39,4 @@ fi cd .. # -- Test the generated executables -if [ $ARCH != "darwin" ]; then - test_bin examples/simple$EXE -else - test_bin examples/simple -fi +test_bin examples/simple diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index c816bcb..c9b62e0 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -50,25 +50,18 @@ fi cd .. #-- Build ftdi_eeprom +cd ftdi_eeprom if [ $ARCH == "darwin" ]; then - $CC -o ftdi_eeprom/ftdi_eeprom ftdi_eeprom/main.c -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../src -I../../../build-data/includes -I$BUILD_DIR/$LIBUSB/libusb -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBCONFUSE/src + $CC -o ftdi_eeprom main.c -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../src -I../../../../build-data/includes -I$BUILD_DIR/$LIBUSB/libusb -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBCONFUSE/src else - $CC -o release/bin/ftdi_eeprom ftdi_eeprom/main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include + $CC -o ftdi_eeprom main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include fi +cd .. # -- Test the generated executables -if [ $ARCH != "darwin" ]; then - test_bin examples/lsftdi$EXE - test_bin release/bin/ftdi_eeprom$EXE -else - test_bin examples/lsftdi - test_bin ftdi_eeprom/ftdi_eeprom -fi +test_bin examples/lsftdi +test_bin ftdi_eeprom/ftdi_eeprom # -- Copy the executable into the packages/bin dir -cp examples/lsftdi$EXE $PACKAGE_DIR/$NAME/bin/lsftdi$EXE -if [ $ARCH == "darwin" ]; then - cp ftdi_eeprom/ftdi_eeprom $PACKAGE_DIR/$NAME/bin/ftdi_eeprom -else - cp release/bin/ftdi_eeprom$EXE $PACKAGE_DIR/$NAME/bin/ftdi_eeprom$EXE -fi +cp examples/lsftdi $PACKAGE_DIR/$NAME/bin/lsftdi$EXE +cp ftdi_eeprom/ftdi_eeprom $PACKAGE_DIR/$NAME/bin/ftdi_eeprom$EXE diff --git a/scripts/compile_lsusb.sh b/scripts/compile_lsusb.sh index 129f36b..756f1fc 100644 --- a/scripts/compile_lsusb.sh +++ b/scripts/compile_lsusb.sh @@ -41,8 +41,8 @@ cd .. # -- Test the generated executables if [ $ARCH != "darwin" ]; then - test_bin examples/lsusb$EXE + test_bin examples/lsusb fi # -- Copy the executable into the packages/bin dir -cp examples/lsusb$EXE $PACKAGE_DIR/$NAME/bin/lsusb$EXE +cp examples/lsusb $PACKAGE_DIR/$NAME/bin/lsusb$EXE diff --git a/test/test_bin.sh b/test/test_bin.sh index d3b5537..aff17e2 100755 --- a/test/test_bin.sh +++ b/test/test_bin.sh @@ -37,7 +37,7 @@ echo "------------------------------" >&2 test_exists $FILE test_exec $FILE -if [ $ARCH != "darwin" ]; then +if [[ $ARCH != "darwin" ]]; then test_static $FILE fi From a5f9fb7a02c37ab8d5f77f3f321cd556812260d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 12 May 2019 18:56:14 +0200 Subject: [PATCH 17/20] Update version v1.1.1-beta --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index cabb102..57341da 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ export LC_ALL=C # Generate tools-system-arch-ver.tar.gz from source code # sources: https://github.com/FPGAwars/tools-system -VERSION=1.1.0 +VERSION=1.1.1-beta # -- Target architectures ARCH=$1 From 06727657da6fd4d31ec03bd8992aa1fe68cc5da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 12 May 2019 20:22:16 +0200 Subject: [PATCH 18/20] Fix test_bin execution --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 57341da..ba945b4 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,7 @@ mkdir -p $UPSTREAM_DIR # -- Test script function function test_bin { - $WORK_DIR/test/test_bin.sh $1 + . $WORK_DIR/test/test_bin.sh $1 if [ $? != "0" ]; then exit 1 fi From 5296ec37891e6ee23f3f61aabb35178f37dfa0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Sun, 12 May 2019 20:23:27 +0200 Subject: [PATCH 19/20] Update ftdi_eeprom build script --- scripts/compile_lsftdi.sh | 10 ++++++---- scripts/install_dependencies.sh | 9 +++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/compile_lsftdi.sh b/scripts/compile_lsftdi.sh index c9b62e0..5aa5112 100644 --- a/scripts/compile_lsftdi.sh +++ b/scripts/compile_lsftdi.sh @@ -8,6 +8,9 @@ REL_LIBFTDI1=https://www.intra2net.com/en/developer/libftdi/download/$TAR_LIBFTD VER=1.0.22 LIBUSB=libusb-$VER +VER=3.2.2 +LIBCONFUSE=confuse-$VER + # -- Setup . $WORK_DIR/scripts/build_setup.sh @@ -26,8 +29,7 @@ cd $BUILD_DIR/$LIBFTDI1 PREFIX=$BUILD_DIR/$LIBFTDI1/release LIBUSB_PREFIX=$BUILD_DIR/$LIBUSB/release -LIBCONFUSE_VER=3.2.2 -LIBCONFUSE=confuse-$LIBCONFUSE_VER +LIBCONFUSE_PREFIX=$BUILD_DIR/$LIBCONFUSE/release #-- Build libftdi if [ $ARCH != "darwin" ]; then @@ -52,9 +54,9 @@ cd .. #-- Build ftdi_eeprom cd ftdi_eeprom if [ $ARCH == "darwin" ]; then - $CC -o ftdi_eeprom main.c -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../src -I../../../../build-data/includes -I$BUILD_DIR/$LIBUSB/libusb -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBCONFUSE/src + $CC -o ftdi_eeprom main.c -lftdi1 -lusb-1.0 -lconfuse -I../src -I$WORK_DIR/build-data/includes -I$PREFIX/include/libftdi1 -I$BUILD_DIR/$LIBUSB/libusb -I$BUILD_DIR/$LIBCONFUSE/src else - $CC -o ftdi_eeprom main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -I../../../../build-data/includes -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -I$LIBUSB_PREFIX/include/libusb-1.0 -I$PREFIX/include/libftdi1 -L$BUILD_DIR/$LIBCONFUSE/release/lib -I$BUILD_DIR/$LIBCONFUSE/release/include + $CC -o ftdi_eeprom main.c -static -lftdi1 -lusb-1.0 -lconfuse -lpthread -L$PREFIX/lib -L$LIBUSB_PREFIX/lib -L$LIBCONFUSE_PREFIX/lib -I$WORK_DIR/build-data/includes -I$PREFIX/include/libftdi1 -I$LIBUSB_PREFIX/include/libusb-1.0 -I$LIBCONFUSE_PREFIX/include fi cd .. diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh index aec6d79..3655362 100644 --- a/scripts/install_dependencies.sh +++ b/scripts/install_dependencies.sh @@ -30,9 +30,14 @@ if [ ${ARCH:0:7} == "windows" ]; then fi if [ $ARCH == "darwin" ]; then - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null + which -s brew + if [[ $? != 0 ]] ; then + # Install Homebrew + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + else + brew update + fi DEPS="pkg-config libusb libftdi wget confuse" - brew update brew install --force $DEPS brew unlink $DEPS && brew link --force $DEPS fi From 3917b6a39dbc8a0b477bf6a71c7d828c3e317328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Arroyo=20Torrens?= Date: Mon, 13 May 2019 00:06:20 +0200 Subject: [PATCH 20/20] Update travis --- .travis.yml | 49 ++++++++++++++++++--------------------- scripts/travis_trigger.sh | 4 ++-- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6cc069..516141a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,41 +1,36 @@ sudo: required dist: trusty - language: cpp - matrix: include: - - os: linux - env: TARGET=linux_x86_64 - - os: linux - env: TARGET=linux_i686 - - os: linux - env: TARGET=linux_armv7l - - os: linux - env: TARGET=linux_aarch64 - - os: linux - env: TARGET=windows_x86 - - os: linux - env: TARGET=windows_amd64 - - os: osx - env: TARGET=darwin - + - os: linux + env: TARGET=linux_x86_64 + - os: linux + env: TARGET=linux_i686 + - os: linux + env: TARGET=linux_armv7l + - os: linux + env: TARGET=linux_aarch64 + - os: linux + env: TARGET=windows_x86 + - os: linux + env: TARGET=windows_amd64 + - os: osx + env: TARGET=darwin before_script: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -y -qq; fi - +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -y -qq; fi script: - - bash build.sh $TARGET - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then md5 _packages/**/*.tar.gz; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then md5sum _packages/**/*.tar.gz; fi - +- bash build.sh $TARGET +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then md5 _packages/**/*.tar.gz; fi +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then md5sum _packages/**/*.tar.gz; fi deploy: provider: releases api_key: - secure: P3t3txMvsfFXymL/Z6AVsNTygLytSL2F/GNdLpvB3ULwz0qvVzwW0ep0DZIbUxgTbOR341zUpGlKYMaS0EvUAt3TrIATa4nI9CYKavRT8CKrAUyBg2OAN9+gVmBzOEgGvgGkTjzd1OUHn0YjYjYwV2qKXHwUi21q9rXjwc20qB+lVNWkdPe3sOZhI7yUmh3WcU1jGtehQFYlz40i6rS+ivAKC8FN4wfBW2OJVCZ67q9P+FUbpXccD5n3A/09DGhaatWqD7ULwBkl75Rmk4L51LeWKJvOGB3Af2uLqAQ18gkmBpydccqmErfldOKuuhnMgDzkLKfWg7jbvCBIqaFhPIOo4p6nBAnGrQFklwv7obwEtSbqnupP0REj8p+igMMANZYtVVweSrhw1fqHOFhNHC8abmVzOaos6rh1e9Nm2b4O0QCRIt1Wxc5iJy8Bfo4C8FBiSAHvgyKi1ZgPgnU1IfEw0Z94XYbxlOunXyh3YA5FcLUrCAfFAszGita0Bl9wOJn7bMB0nZhhpxLcms6iT0FH7na7tPl72MmjNEwLmns3/HyzUxTofUnsGuw669n73xvO/wQRqQgzUT8EW6m/25+kRWd8kWo5vUYOyVpci/QpVpJ5xytbWK99UYXfwMTBhh07Q3Wdpl7uDVzs25GHYezHXBxlAYbt5flYsI9tprk= - file: - - _packages/**/*.tar.gz + secure: EV42P/zhcX5I4huLkQ8SCjtANtvM+w+MZVGj6rIcW35MJaMqcjQg8QWoR3x9Ae6ueKmpbaq4NSzMAkAMvqd6CYNO/Qz/7MpouvbUwu0H1fdvBFA9N1bY2iww9SovnzubpBkPvd7/kmkYC2P0TUCH8IZOBXCnnNQZRiQPKdNDK09rsooo6cbMBNKHMdpPJht+NrRzk43YdOV0gYJd+raaX9E+bQyVe+5GIvIJa1Tdv1CT3jNuAmgZoWV9kfd6eglWE8b+1+p4jbcElaasOTqOMkvq+3FpOplwpEvwwrWspBK44M+TCPc3s8hGDLfJ8QcR18JV2UazlWAYy3p/IiXnyoL24vGJJWs2exTTDEMLnUczK9Mn7ZAXqZ3h0PYu45lSWdFymQjT4/AflJIpvGdzblE8iQCrJfxnzj/53WKWC6CWEG2wKxfIWn0ULAcceDLH1hWK3rFRqpvVRIqSRi+JPVbdiudds5mQGOI8+XYBDHDVTqv2l8rXE3vKZYy/p43JZb+xh+6GiJek3EpDOaOgofasQN2v3XUCjandI/DmZ4V+6CUJTSr+tuWGy/ew79+ZH3/U+JEMSKmVE0dNEzSkvP/1AEENnbi7kH6oGUfddMk02NffRc+x1BhY0VvZSUPAC5WhSCY61UtdGnYGv7wqKUESBhWPUyZOfpXOE/8rhEE= + file: _packages/**/*.tar.gz file_glob: true skip_cleanup: true on: + repo: FPGAwars/tools-system all_branches: true diff --git a/scripts/travis_trigger.sh b/scripts/travis_trigger.sh index 8d928f9..a9d592c 100755 --- a/scripts/travis_trigger.sh +++ b/scripts/travis_trigger.sh @@ -1,10 +1,10 @@ #!/bin/sh -#echo "> travis login --org" +#echo "> travis login" #travis login --org echo "> travis token" -travis token +travis token --org echo "\n> Enter the token: " read TOKEN