diff --git a/_old/build-darwin.sh b/_old/build-darwin.sh deleted file mode 100644 index 4c7542c..0000000 --- a/_old/build-darwin.sh +++ /dev/null @@ -1,176 +0,0 @@ -############################################## -# libusb and libftdi builder for Linux mac -# (C) BQ. March-2016 -# Written by Juan Gonzalez (Obijuan) -############################################## - -VERSION=1 -UPSTREAM=upstream -PACK_DIR=packages -ARCH=darwin -BUILD_DIR=build_$ARCH -PACKNAME=tools-usb-ftdi-$ARCH-$VERSION -TARBALL=$PACKNAME.tar.bz2 - - -# -- lIBUSB -LIBUSB_GIT_REPO=https://github.com/libusb/libusb/releases/download/v1.0.20 -LIBUSB_FILENAME=libusb-1.0.20 -LIBUSB_FILENAME_TAR=$LIBUSB_FILENAME.tar.bz2 - -# -- LIBFTDI -LIBFTDI_REPO=https://www.intra2net.com/en/developer/libftdi/download -LIBFTDI_FILENAME=libftdi1-1.2 -LIBFTDI_FILENAME_TAR=$LIBFTDI_FILENAME.tar.bz2 - -# -- DEBUG -COMPILE_LIBUSB=1 -COMPILE_LISTDEVS=1 -COMPILE_LIBFTDI=1 -COMPILE_FIND_ALL=1 - -# --------------------- LIBUSB ---------------------------------------- - -# Store current dir -WORK=$PWD -PREFIX=$WORK/$BUILD_DIR - -# -- TARGET: CLEAN. Remove the build dir and the generated packages -# -- then exit -if [ "$1" == "clean" ]; then - echo "-----> CLEAN" - - # -- Remove the build dir - rm -rf $WORK/$BUILD_DIR - - # -- Remove the packages dir - rm -rf $WORK/$PACK_DIR - - exit -fi - -# Install dependencies -echo "Instalando DEPENDENCIAS:" -brew install wget libtool autoconf cmake libusb libftdi - -# Create the upstream folder -mkdir -p $UPSTREAM - -# Create the packages directory -mkdir -p $PACK_DIR -mkdir -p $PACK_DIR/$BUILD_DIR -mkdir -p $PACK_DIR/$BUILD_DIR/bin - -# Create the build dir -mkdir -p $BUILD_DIR ; - -#-- Download the src tarball, if it has not been done yet -cd $UPSTREAM -test -e $LIBUSB_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBUSB source package' && \ - wget $LIBUSB_GIT_REPO/$LIBUSB_FILENAME_TAR) - -#-- Extract the src files, if it has not been done yet -test -e $LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBUSB package' && \ - tar vjxf $LIBUSB_FILENAME_TAR) - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBUSB upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBUSB_FILENAME $BUILD_DIR) - -# -- Create the lib and include files -cd $BUILD_DIR -mkdir -p lib -mkdir -p include - -# ---------------------------- Building the LIBUSB library -if [ $COMPILE_LIBUSB == "1" ]; then - - cd $LIBUSB_FILENAME - - # Prepare for building - # No udev used - ./configure --prefix=$PREFIX USE_UDEV=0 - - # Compile! - make - - # -- Copy the dev files into $BUILD_DIR/include $BUILD_DIR/lbs - make install - - if [ $COMPILE_LISTDEVS == "1" ]; then - - #-- Compile the listdevs-example - cd examples - gcc -o listdevs listdevs.c -I $WORK/$BUILD_DIR/include/libusb-1.0/ \ - -L $WORK/$BUILD_DIR/lib -lusb-1.0 - - # -- Copy the executable into the packages/bin dir - cp listdevs $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ------------------------ LIBFTDI -------------------------------------- - -#-- Download the src tarball, if it has not been done yet -cd $WORK/$UPSTREAM -test -e $LIBFTDI_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBFTDI source package' && \ - wget $LIBFTDI_REPO/$LIBFTDI_FILENAME_TAR) - - -#-- Extract the src files, if it has not been done yet -test -e $LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBFTDI package' && \ - tar vjxf $LIBFTDI_FILENAME_TAR) - - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBFTDI upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBFTDI_FILENAME $BUILD_DIR) - -# ---------------------------- Building the LIBFTDI library - -if [ $COMPILE_LIBFTDI == "1" ]; then - - cd $BUILD_DIR/$LIBFTDI_FILENAME - - mkdir -p build - cd build - - # -- Configure the compilation - cmake -DCMAKE_INSTALL_PREFIX=$PREFIX .. - - # -- Let's compile - make - - # -- Installation - make install - - if [ $COMPILE_FIND_ALL == "1" ]; then - - # -- Compile the find_all example - cd ../examples - gcc -o find_all find_all.c -I $PREFIX/include/libftdi1/ \ - -L $PREFIX/lib -lftdi1 -lusb-1.0 - - # -- Copy the executable into the packages/bin dir - cp find_all $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ---------------------------------- Create the package -cd $WORK/$PACK_DIR/$BUILD_DIR -tar vjcf $TARBALL bin -mv $TARBALL .. diff --git a/_old/build-linux_aarch64.sh b/_old/build-linux_aarch64.sh deleted file mode 100644 index c7a13a3..0000000 --- a/_old/build-linux_aarch64.sh +++ /dev/null @@ -1,198 +0,0 @@ -####################################################################### -# libusb and libftdi builder for Ubuntu tablet (linux_aarch64) -# (C) BQ. March-2016 -# Written by Juan Gonzalez (Obijuan) -####################################################################### - -VERSION=1 -UPSTREAM=upstream -PACK_DIR=packages -ARCH=linux_aarch64 -BUILD_DIR=build_$ARCH -PACKNAME=tools-usb-ftdi-$ARCH-$VERSION -TARBALL=$PACKNAME.tar.bz2 -BUILD=x86-unknown-linux-gnu -HOST=aarch64-linux-gnu -TARGET=aarch64-linux-gnu -BUILD_DATA=build-data - - -# -- lIBUSB -LIBUSB_GIT_REPO=https://github.com/libusb/libusb/releases/download/v1.0.20 -LIBUSB_FILENAME=libusb-1.0.20 -LIBUSB_FILENAME_TAR=$LIBUSB_FILENAME.tar.bz2 - -# -- LIBFTDI -LIBFTDI_REPO=https://www.intra2net.com/en/developer/libftdi/download -LIBFTDI_FILENAME=libftdi1-1.2 -LIBFTDI_FILENAME_TAR=$LIBFTDI_FILENAME.tar.bz2 - -# -- DEBUG -COMPILE_LIBUSB=1 -COMPILE_LISTDEVS=1 -COMPILE_LIBFTDI=1 -COMPILE_FIND_ALL=1 - -# --------------------- LIBUSB ---------------------------------------- - -# Store current dir -WORK=$PWD -PREFIX=$WORK/$BUILD_DIR - -# -- TARGET: CLEAN. Remove the build dir and the generated packages -# -- then exit -if [ "$1" == "clean" ]; then - echo "-----> CLEAN" - - # -- Remove the build dir - rm -rf $WORK/$BUILD_DIR - - # -- Remove the packages dir - rm -rf $WORK/$PACK_DIR - - exit -fi - -# Install dependencies -echo "Instalando DEPENDENCIAS:" -sudo apt-get install libtool autoconf gcc-aarch64-linux-gnu \ - g++-aarch64-linux-gnu - -# Create the upstream folder -mkdir -p $UPSTREAM - -# Create the packages directory -mkdir -p $PACK_DIR -mkdir -p $PACK_DIR/$BUILD_DIR -mkdir -p $PACK_DIR/$BUILD_DIR/bin - -# Create the build dir -mkdir -p $BUILD_DIR - -#-- Download the src tarball, if it has not been done yet -cd $UPSTREAM -test -e $LIBUSB_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBUSB source package' && \ - wget $LIBUSB_GIT_REPO/$LIBUSB_FILENAME_TAR) - -#-- Extract the src files, if it has not been done yet -test -e $LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBUSB package' && \ - tar vjxf $LIBUSB_FILENAME_TAR) - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBUSB upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBUSB_FILENAME $BUILD_DIR) - -#-- Apply the patch to the libusb -cp $WORK/$BUILD_DATA/configure.ac.libusb $BUILD_DIR/$LIBUSB_FILENAME/configure.ac - -# -- Create the lib and include files -cd $BUILD_DIR -mkdir -p lib -mkdir -p include - -# ---------------------------- Building the LIBUSB library -if [ $COMPILE_LIBUSB == "1" ]; then - - cd $LIBUSB_FILENAME - - #-- Generate the new configure from configure.ac patched - autoconf - - # Prepare for building - # No udev used - ./configure --prefix=$PREFIX --build=$BUILD --host=$HOST \ - --target=$TARGET - - # Compile! - make - - # -- Copy the dev files into $BUILD_DIR/include $BUILD_DIR/lbs - make install - - if [ $COMPILE_LISTDEVS == "1" ]; then - - #-- Compile the listdevs-example - cd examples - $HOST-gcc -o listdevs listdevs.c -I $WORK/$BUILD_DIR/include/libusb-1.0/ \ - -L $WORK/$BUILD_DIR/lib -L /usr/aarch64-linux-gnu/lib/ \ - -static -lusb-1.0 -lpthread - - # -- Copy the executable into the packages/bin dir - cp listdevs $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ------------------------ LIBFTDI -------------------------------------- - -#-- Download the src tarball, if it has not been done yet -cd $WORK/$UPSTREAM -test -e $LIBFTDI_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBFTDI source package' && \ - wget $LIBFTDI_REPO/$LIBFTDI_FILENAME_TAR) - - -#-- Extract the src files, if it has not been done yet -test -e $LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBFTDI package' && \ - tar vjxf $LIBFTDI_FILENAME_TAR) - - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBFTDI upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBFTDI_FILENAME $BUILD_DIR) - - -cp $WORK/$BUILD_DATA/$ARCH/toolchain-$ARCH.cmake.libftdi \ - $WORK/$BUILD_DIR/$LIBFTDI_FILENAME/toolchain-$ARCH.cmake - -# ---------------------------- Building the LIBFTDI library - -if [ $COMPILE_LIBFTDI == "1" ]; then - - cd $BUILD_DIR/$LIBFTDI_FILENAME - - mkdir -p build - cd build - - # -- Configure the compilation - cmake -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DCMAKE_TOOLCHAIN_FILE=toolchain-$ARCH.cmake \ - -DLIBUSB_LIBRARIES=$WORK/$BUILD_DIR/lib/libusb-1.0.so \ - -DLIBFTDI_LIBRARY_DIRS=$WORK/$BUILD_DIR/lib \ - -DLIBUSB_INCLUDE_DIR=$WORK/$BUILD_DIR/include/libusb-1.0 .. - - # -- Let's compile - make - - # -- Installation - make install - - if [ $COMPILE_FIND_ALL == "1" ]; then - - # -- Compile the find_all example - cd ../examples - $HOST-gcc -o find_all find_all.c -I $PREFIX/include/libftdi1/ \ - -L $PREFIX/lib -L /usr/arm-linux-gnueabihf/lib/ \ - -static -lftdi1 -lusb-1.0 -lpthread - - # -- Copy the executable into the packages/bin dir - cp find_all $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ---------------------------------- Create the package -cd $WORK/$PACK_DIR/$BUILD_DIR -tar vjcf $TARBALL bin -mv $TARBALL .. diff --git a/_old/build-linux_armv7l.sh b/_old/build-linux_armv7l.sh deleted file mode 100644 index 303db6c..0000000 --- a/_old/build-linux_armv7l.sh +++ /dev/null @@ -1,198 +0,0 @@ -####################################################################### -# libusb and libftdi builder for Ubuntu phone (armhf) and raspberry -# (C) BQ. March-2016 -# Written by Juan Gonzalez (Obijuan) -####################################################################### - -VERSION=1 -UPSTREAM=upstream -PACK_DIR=packages -ARCH=linux_armv7l -BUILD_DIR=build_$ARCH -PACKNAME=tools-usb-ftdi-$ARCH-$VERSION -TARBALL=$PACKNAME.tar.bz2 -BUILD=x86-unknown-linux-gnu -HOST=arm-linux-gnueabihf -TARGET=arm-linux-gnueabihf -BUILD_DATA=build-data - - -# -- lIBUSB -LIBUSB_GIT_REPO=https://github.com/libusb/libusb/releases/download/v1.0.20 -LIBUSB_FILENAME=libusb-1.0.20 -LIBUSB_FILENAME_TAR=$LIBUSB_FILENAME.tar.bz2 - -# -- LIBFTDI -LIBFTDI_REPO=https://www.intra2net.com/en/developer/libftdi/download -LIBFTDI_FILENAME=libftdi1-1.2 -LIBFTDI_FILENAME_TAR=$LIBFTDI_FILENAME.tar.bz2 - -# -- DEBUG -COMPILE_LIBUSB=1 -COMPILE_LISTDEVS=1 -COMPILE_LIBFTDI=1 -COMPILE_FIND_ALL=1 - -# --------------------- LIBUSB ---------------------------------------- - -# Store current dir -WORK=$PWD -PREFIX=$WORK/$BUILD_DIR - -# -- TARGET: CLEAN. Remove the build dir and the generated packages -# -- then exit -if [ "$1" == "clean" ]; then - echo "-----> CLEAN" - - # -- Remove the build dir - rm -rf $WORK/$BUILD_DIR - - # -- Remove the packages dir - rm -rf $WORK/$PACK_DIR - - exit -fi - -# Install dependencies -echo "Instalando DEPENDENCIAS:" -sudo apt-get install libtool autoconf gcc-arm-linux-gnueabihf \ - g++-arm-linux-gnueabihf libc6-dev-armhf-cross - -# Create the upstream folder -mkdir -p $UPSTREAM - -# Create the packages directory -mkdir -p $PACK_DIR -mkdir -p $PACK_DIR/$BUILD_DIR -mkdir -p $PACK_DIR/$BUILD_DIR/bin - -# Create the build dir -mkdir -p $BUILD_DIR - -#-- Download the src tarball, if it has not been done yet -cd $UPSTREAM -test -e $LIBUSB_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBUSB source package' && \ - wget $LIBUSB_GIT_REPO/$LIBUSB_FILENAME_TAR) - -#-- Extract the src files, if it has not been done yet -test -e $LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBUSB package' && \ - tar vjxf $LIBUSB_FILENAME_TAR) - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBUSB upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBUSB_FILENAME $BUILD_DIR) - -#-- Apply the patch to the libusb -cp $WORK/$BUILD_DATA/configure.ac.libusb $BUILD_DIR/$LIBUSB_FILENAME/configure.ac - -# -- Create the lib and include files -cd $BUILD_DIR -mkdir -p lib -mkdir -p include - -# ---------------------------- Building the LIBUSB library -if [ $COMPILE_LIBUSB == "1" ]; then - - cd $LIBUSB_FILENAME - - #-- Generate the new configure from configure.ac patched - autoconf - - # Prepare for building - # No udev used - ./configure --prefix=$PREFIX --build=$BUILD --host=$HOST \ - --target=$TARGET - - # Compile! - make - - # -- Copy the dev files into $BUILD_DIR/include $BUILD_DIR/lbs - make install - - if [ $COMPILE_LISTDEVS == "1" ]; then - - #-- Compile the listdevs-example - cd examples - $HOST-gcc -o listdevs listdevs.c -I $WORK/$BUILD_DIR/include/libusb-1.0/ \ - -L $WORK/$BUILD_DIR/lib -L /usr/arm-linux-gnueabihf/lib/ \ - -static -lusb-1.0 -lpthread - - # -- Copy the executable into the packages/bin dir - cp listdevs $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ------------------------ LIBFTDI -------------------------------------- - -#-- Download the src tarball, if it has not been done yet -cd $WORK/$UPSTREAM -test -e $LIBFTDI_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBFTDI source package' && \ - wget $LIBFTDI_REPO/$LIBFTDI_FILENAME_TAR) - - -#-- Extract the src files, if it has not been done yet -test -e $LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBFTDI package' && \ - tar vjxf $LIBFTDI_FILENAME_TAR) - - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBFTDI upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBFTDI_FILENAME $BUILD_DIR) - - -cp $WORK/$BUILD_DATA/$ARCH/toolchain-armhf.cmake.libftdi \ - $WORK/$BUILD_DIR/$LIBFTDI_FILENAME/toolchain-armhf.cmake - -# ---------------------------- Building the LIBFTDI library - -if [ $COMPILE_LIBFTDI == "1" ]; then - - cd $BUILD_DIR/$LIBFTDI_FILENAME - - mkdir -p build - cd build - - # -- Configure the compilation - cmake -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DCMAKE_TOOLCHAIN_FILE=toolchain-armhf.cmake \ - -DLIBUSB_LIBRARIES=$WORK/$BUILD_DIR/lib/libusb-1.0.so \ - -DLIBFTDI_LIBRARY_DIRS=$WORK/$BUILD_DIR/lib \ - -DLIBUSB_INCLUDE_DIR=$WORK/$BUILD_DIR/include/libusb-1.0 .. - - # -- Let's compile - make - - # -- Installation - make install - - if [ $COMPILE_FIND_ALL == "1" ]; then - - # -- Compile the find_all example - cd ../examples - $HOST-gcc -o find_all find_all.c -I $PREFIX/include/libftdi1/ \ - -L $PREFIX/lib -L /usr/arm-linux-gnueabihf/lib/ \ - -static -lftdi1 -lusb-1.0 -lpthread - - # -- Copy the executable into the packages/bin dir - cp find_all $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ---------------------------------- Create the package -cd $WORK/$PACK_DIR/$BUILD_DIR -tar vjcf $TARBALL bin -mv $TARBALL .. diff --git a/_old/build-linux_i686.sh b/_old/build-linux_i686.sh deleted file mode 100644 index c653829..0000000 --- a/_old/build-linux_i686.sh +++ /dev/null @@ -1,192 +0,0 @@ -############################################## -# libusb builder for Linux 32 bits -# (C) BQ. March-2016 -# Written by Juan Gonzalez (Obijuan) -############################################## - -VERSION=1 -UPSTREAM=upstream -PACK_DIR=packages -ARCH=linux_i686 -BUILD_DIR=build_$ARCH -PACKNAME=tools-usb-ftdi-$ARCH-$VERSION -TARBALL=$PACKNAME.tar.bz2 -HOST=i686-linux-gnu -BUILD_DATA=build-data - - -# -- lIBUSB -LIBUSB_GIT_REPO=https://github.com/libusb/libusb/releases/download/v1.0.20 -LIBUSB_FILENAME=libusb-1.0.20 -LIBUSB_FILENAME_TAR=$LIBUSB_FILENAME.tar.bz2 - -# -- LIBFTDI -LIBFTDI_REPO=https://www.intra2net.com/en/developer/libftdi/download -LIBFTDI_FILENAME=libftdi1-1.2 -LIBFTDI_FILENAME_TAR=$LIBFTDI_FILENAME.tar.bz2 - -# -- DEBUG -COMPILE_LIBUSB=1 -COMPILE_LISTDEVS=1 -COMPILE_LIBFTDI=1 -COMPILE_FIND_ALL=1 - -# --------------------- LIBUSB ---------------------------------------- - -# Store current dir -WORK=$PWD -PREFIX=$WORK/$BUILD_DIR - -# -- TARGET: CLEAN. Remove the build dir and the generated packages -# -- then exit -if [ "$1" == "clean" ]; then - echo "-----> CLEAN" - - # -- Remove the build dir - rm -rf $WORK/$BUILD_DIR - - # -- Remove the packages dir - rm -rf $WORK/$PACK_DIR - - exit -fi - -# Install dependencies -echo "Instalando DEPENDENCIAS:" -sudo apt-get install libtool autoconf gcc-multilib g++-multilib - -# Create the upstream folder -mkdir -p $UPSTREAM - -# Create the packages directory -mkdir -p $PACK_DIR -mkdir -p $PACK_DIR/$BUILD_DIR -mkdir -p $PACK_DIR/$BUILD_DIR/bin - -# Create the build dir -mkdir -p $BUILD_DIR ; - -#-- Download the src tarball, if it has not been done yet -cd $UPSTREAM -test -e $LIBUSB_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBUSB source package' && \ - wget $LIBUSB_GIT_REPO/$LIBUSB_FILENAME_TAR) - -#-- Extract the src files, if it has not been done yet -test -e $LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBUSB package' && \ - tar vjxf $LIBUSB_FILENAME_TAR) - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBUSB upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBUSB_FILENAME $BUILD_DIR) - -#-- Apply the patch to the libusb -cp $WORK/$BUILD_DATA/configure.ac.libusb $BUILD_DIR/$LIBUSB_FILENAME/configure.ac - -# -- Create the lib and include files -cd $BUILD_DIR -mkdir -p lib -mkdir -p include - -# ---------------------------- Building the LIBUSB library -if [ $COMPILE_LIBUSB == "1" ]; then - - cd $LIBUSB_FILENAME - - #-- Remove the default configure script - rm -f configure - - #-- Generate the new configure from configure.ac patched - autoconf - - # Prepare for building - # No udev used - ./configure --prefix=$PREFIX --host=$HOST "CFLAGS=-m32" \ - "CXXFLAGS=-m32" "LDFLAGS=-m32" - - # Compile! - make - - # -- Copy the dev files into $BUILD_DIR/include $BUILD_DIR/lbs - make install - - if [ $COMPILE_LISTDEVS == "1" ]; then - - #-- Compile the listdevs-example - cd examples - gcc -m32 -o listdevs listdevs.c -I $WORK/$BUILD_DIR/include/libusb-1.0/ \ - -L $WORK/$BUILD_DIR/lib -static -lusb-1.0 -lpthread - - # -- Copy the executable into the packages/bin dir - cp listdevs $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ------------------------ LIBFTDI -------------------------------------- - -#-- Download the src tarball, if it has not been done yet -cd $WORK/$UPSTREAM -test -e $LIBFTDI_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBFTDI source package' && \ - wget $LIBFTDI_REPO/$LIBFTDI_FILENAME_TAR) - - -#-- Extract the src files, if it has not been done yet -test -e $LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBFTDI package' && \ - tar vjxf $LIBFTDI_FILENAME_TAR) - - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBFTDI upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBFTDI_FILENAME $BUILD_DIR) - -# ---------------------------- Building the LIBFTDI library - -if [ $COMPILE_LIBFTDI == "1" ]; then - - cd $BUILD_DIR/$LIBFTDI_FILENAME - - mkdir -p build - cd build - - # -- Configure the compilation - cmake -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DCMAKE_C_COMPILER_ARG1="-m32" \ - -DLIBUSB_LIBRARIES=$WORK/$BUILD_DIR/lib/libusb-1.0.so \ - -DLIBFTDI_LIBRARY_DIRS=$WORK/$BUILD_DIR/lib \ - -DLIBUSB_INCLUDE_DIR=$WORK/$BUILD_DIR/include/libusb-1.0 .. - - # -- Let's compile - make - - # -- Installation - make install - - if [ $COMPILE_FIND_ALL == "1" ]; then - - # -- Compile the find_all example - cd ../examples - gcc -m32 -o find_all find_all.c -I $PREFIX/include/libftdi1/ \ - -L $PREFIX/lib -static -lftdi1 -lusb-1.0 -lpthread - - # -- Copy the executable into the packages/bin dir - cp find_all $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ---------------------------------- Create the package -cd $WORK/$PACK_DIR/$BUILD_DIR -tar vjcf $TARBALL bin -mv $TARBALL .. diff --git a/_old/build-linux_x86_64.sh b/_old/build-linux_x86_64.sh deleted file mode 100644 index 92e14d5..0000000 --- a/_old/build-linux_x86_64.sh +++ /dev/null @@ -1,189 +0,0 @@ -############################################## -# libusb builder for Linux 64 bits -# (C) BQ. March-2016 -# Written by Juan Gonzalez (Obijuan) -############################################## - -VERSION=1 -UPSTREAM=upstream -PACK_DIR=packages -ARCH=linux_x86_64 -BUILD_DIR=build_$ARCH -PACKNAME=tools-usb-ftdi-$ARCH-$VERSION -TARBALL=$PACKNAME.tar.bz2 -BUILD_DATA=build-data - - -# -- lIBUSB -LIBUSB_GIT_REPO=https://github.com/libusb/libusb/releases/download/v1.0.20 -LIBUSB_FILENAME=libusb-1.0.20 -LIBUSB_FILENAME_TAR=$LIBUSB_FILENAME.tar.bz2 - -# -- LIBFTDI -LIBFTDI_REPO=https://www.intra2net.com/en/developer/libftdi/download -LIBFTDI_FILENAME=libftdi1-1.2 -LIBFTDI_FILENAME_TAR=$LIBFTDI_FILENAME.tar.bz2 - -# -- DEBUG -COMPILE_LIBUSB=1 -COMPILE_LISTDEVS=1 -COMPILE_LIBFTDI=1 -COMPILE_FIND_ALL=1 - -# --------------------- LIBUSB ---------------------------------------- - -# Store current dir -WORK=$PWD -PREFIX=$WORK/$BUILD_DIR - -# -- TARGET: CLEAN. Remove the build dir and the generated packages -# -- then exit -if [ "$1" == "clean" ]; then - echo "-----> CLEAN" - - # -- Remove the build dir - rm -rf $WORK/$BUILD_DIR - - # -- Remove the packages dir - rm -rf $WORK/$PACK_DIR - - exit -fi - -# Install dependencies -echo "Instalando DEPENDENCIAS:" -sudo apt-get install libtool autoconf - -# Create the upstream folder -mkdir -p $UPSTREAM - -# Create the packages directory -mkdir -p $PACK_DIR -mkdir -p $PACK_DIR/$BUILD_DIR -mkdir -p $PACK_DIR/$BUILD_DIR/bin - -# Create the build dir -mkdir -p $BUILD_DIR ; - -#-- Download the src tarball, if it has not been done yet -cd $UPSTREAM -test -e $LIBUSB_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBUSB source package' && \ - wget $LIBUSB_GIT_REPO/$LIBUSB_FILENAME_TAR) - -#-- Extract the src files, if it has not been done yet -test -e $LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBUSB package' && \ - tar vjxf $LIBUSB_FILENAME_TAR) - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBUSB upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBUSB_FILENAME $BUILD_DIR) - -#-- Apply the patch to the libusb -echo "-----------------------> Copy configure.ac" -cp $WORK/$BUILD_DATA/configure.ac.libusb $WORK/$BUILD_DIR/$LIBUSB_FILENAME/configure.ac - -# -- Create the lib and include files -cd $BUILD_DIR -mkdir -p lib -mkdir -p include - -# ---------------------------- Building the LIBUSB library -if [ $COMPILE_LIBUSB == "1" ]; then - - cd $LIBUSB_FILENAME - - #-- Remove the default configure script - rm -f configure - - #-- Generate the new configure from configure.ac patched - autoconf - - # Prepare for building - ./configure --prefix=$PREFIX - - # Compile! - make - - # -- Copy the dev files into $BUILD_DIR/include $BUILD_DIR/lbs - make install - - if [ $COMPILE_LISTDEVS == "1" ]; then - - #-- Compile the listdevs-example - cd examples - gcc -o listdevs listdevs.c -I $WORK/$BUILD_DIR/include/libusb-1.0/ \ - -L $WORK/$BUILD_DIR/lib -static -lusb-1.0 -lpthread - - # -- Copy the executable into the packages/bin dir - cp listdevs $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ------------------------ LIBFTDI -------------------------------------- - -#-- Download the src tarball, if it has not been done yet -cd $WORK/$UPSTREAM -test -e $LIBFTDI_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBFTDI source package' && \ - wget $LIBFTDI_REPO/$LIBFTDI_FILENAME_TAR) - - -#-- Extract the src files, if it has not been done yet -test -e $LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBFTDI package' && \ - tar vjxf $LIBFTDI_FILENAME_TAR) - - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBFTDI upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBFTDI_FILENAME $BUILD_DIR) - -# ---------------------------- Building the LIBFTDI library - -if [ $COMPILE_LIBFTDI == "1" ]; then - - cd $BUILD_DIR/$LIBFTDI_FILENAME - - mkdir -p build - cd build - - # -- Configure the compilation - cmake -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DLIBUSB_LIBRARIES=$WORK/$BUILD_DIR/lib/libusb-1.0.so \ - -DLIBFTDI_LIBRARY_DIRS=$WORK/$BUILD_DIR/lib \ - -DLIBUSB_INCLUDE_DIR=$WORK/$BUILD_DIR/include/libusb-1.0 .. - - # -- Let's compile - make - - # -- Installation - make install - - if [ $COMPILE_FIND_ALL == "1" ]; then - - # -- Compile the find_all example - cd ../examples - gcc -o find_all find_all.c -I $PREFIX/include/libftdi1/ \ - -L $PREFIX/lib -static -lftdi1 -lusb-1.0 -lpthread - - # -- Copy the executable into the packages/bin dir - cp find_all $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ---------------------------------- Create the package -cd $WORK/$PACK_DIR/$BUILD_DIR -tar vjcf $TARBALL bin -mv $TARBALL .. diff --git a/_old/build-windows_i386.sh b/_old/build-windows_i386.sh deleted file mode 100644 index a987bdc..0000000 --- a/_old/build-windows_i386.sh +++ /dev/null @@ -1,188 +0,0 @@ -############################################## -# libusb builder for Windows 32 bits -# (C) BQ. March-2016 -# Written by Juan Gonzalez (Obijuan) -############################################## - -VERSION=1 -UPSTREAM=upstream -PACK_DIR=packages -ARCH=windows_i386 -BUILD_DIR=build_$ARCH -PACKNAME=tools-usb-ftdi-$ARCH-$VERSION -TARBALL=$PACKNAME.zip -BUILD=x86-unknown-linux-gnu -HOST=i686-w64-mingw32 -TARGET=i686-w64-mingw32 -BUILD_DATA=build-data - - -# -- lIBUSB -LIBUSB_GIT_REPO=https://github.com/libusb/libusb/releases/download/v1.0.20 -LIBUSB_FILENAME=libusb-1.0.20 -LIBUSB_FILENAME_TAR=$LIBUSB_FILENAME.tar.bz2 - -# -- LIBFTDI -LIBFTDI_REPO=https://www.intra2net.com/en/developer/libftdi/download -LIBFTDI_FILENAME=libftdi1-1.2 -LIBFTDI_FILENAME_TAR=$LIBFTDI_FILENAME.tar.bz2 - -# -- DEBUG -COMPILE_LIBUSB=1 -COMPILE_LISTDEVS=1 -COMPILE_LIBFTDI=1 -COMPILE_FIND_ALL=1 - -# --------------------- LIBUSB ---------------------------------------- - -# Store current dir -WORK=$PWD -PREFIX=$WORK/$BUILD_DIR - -# -- TARGET: CLEAN. Remove the build dir and the generated packages -# -- then exit -if [ "$1" == "clean" ]; then - echo "-----> CLEAN" - - # -- Remove the build dir - rm -rf $WORK/$BUILD_DIR - - # -- Remove the packages dir - rm -rf $WORK/$PACK_DIR - - exit -fi - -# Install dependencies -echo "Instalando DEPENDENCIAS:" -sudo apt-get install libtool autoconf gcc-multilib g++-multilib - -# Create the upstream folder -mkdir -p $UPSTREAM - -# Create the packages directory -mkdir -p $PACK_DIR -mkdir -p $PACK_DIR/$BUILD_DIR -mkdir -p $PACK_DIR/$BUILD_DIR/bin - -# Create the build dir -mkdir -p $BUILD_DIR ; - -# Create a link from the user home to the build_dir -ln -s $WORK/$BUILD_DIR $HOME/.$ARCH - -#-- Download the src tarball, if it has not been done yet -cd $UPSTREAM -test -e $LIBUSB_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBUSB source package' && \ - wget $LIBUSB_GIT_REPO/$LIBUSB_FILENAME_TAR) - -#-- Extract the src files, if it has not been done yet -test -e $LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBUSB package' && \ - tar vjxf $LIBUSB_FILENAME_TAR) - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBUSB_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBUSB upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBUSB_FILENAME $BUILD_DIR) - -# -- Create the lib and include files -cd $BUILD_DIR -mkdir -p lib -mkdir -p include - -# ---------------------------- Building the LIBUSB library -if [ $COMPILE_LIBUSB == "1" ]; then - - cd $LIBUSB_FILENAME - - # Prepare for building - # No udev used - ./configure --prefix=$PREFIX USE_UDEV=0 \ - --build=$BUILD --host=$HOST --target=$TARGET - - # Compile! - make - - # -- Copy the dev files into $BUILD_DIR/include $BUILD_DIR/lbs - make install - - if [ $COMPILE_LISTDEVS == "1" ]; then - - #-- Compile the listdevs-example - cd examples - $HOST-gcc -o listdevs.exe listdevs.c -I $WORK/$BUILD_DIR/include/libusb-1.0/ \ - -L $WORK/$BUILD_DIR/lib -static -lusb-1.0 - - # -- Copy the executable into the packages/bin dir - cp listdevs.exe $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ------------------------ LIBFTDI -------------------------------------- - -#-- Download the src tarball, if it has not been done yet -cd $WORK/$UPSTREAM -test -e $LIBFTDI_FILENAME_TAR || - (echo ' ' && \ - echo '--> DOWNLOADING LIBFTDI source package' && \ - wget $LIBFTDI_REPO/$LIBFTDI_FILENAME_TAR) - - -#-- Extract the src files, if it has not been done yet -test -e $LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> UNCOMPRESSING LIBFTDI package' && \ - tar vjxf $LIBFTDI_FILENAME_TAR) - - -#-- Copy the upstream libusb into the build dir -cd $WORK -test -d $BUILD_DIR/$LIBFTDI_FILENAME || - (echo ' ' && \ - echo '--> COPYING LIBFTDI upstream into build_dir' && \ - cp -r $UPSTREAM/$LIBFTDI_FILENAME $BUILD_DIR) - -cp $WORK/$BUILD_DATA/$ARCH/toolchain-mingw32.cmake.libftdi \ - $WORK/$BUILD_DIR/$LIBFTDI_FILENAME/toolchain-mingw32.cmake - -# ---------------------------- Building the LIBFTDI library - -if [ $COMPILE_LIBFTDI == "1" ]; then - - cd $BUILD_DIR/$LIBFTDI_FILENAME - - mkdir -p build - cd build - - # -- Configure the compilation - cmake -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DCMAKE_TOOLCHAIN_FILE=toolchain-mingw32.cmake .. - - # -- Let's compile - make - - # -- Installation - make install - - if [ $COMPILE_FIND_ALL == "1" ]; then - - # -- Compile the find_all example - cd ../examples - $HOST-gcc -o find_all.exe find_all.c -I $PREFIX/include/libftdi1/ \ - -L $PREFIX/lib -static -lftdi1 -lusb-1.0 - - # -- Copy the executable into the packages/bin dir - cp find_all.exe $WORK/$PACK_DIR/$BUILD_DIR/bin - fi -fi - -# ---------------------------------- Create the package -cd $WORK/$PACK_DIR/$BUILD_DIR -zip -r $TARBALL * -mv $TARBALL .. diff --git a/build.sh b/build.sh index c66302f..4c9273d 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ VERSION=1.0.0 # -- Target architectures -ARCHS=( darwin ) +ARCHS=( ) # ARCHS=( linux_x86_64 linux_i686 linux_armv7l linux_aarch64 windows ) # ARCHS=( darwin )