From 64a9c2528d615618beed37cfc9a9a71296ae6429 Mon Sep 17 00:00:00 2001 From: q3aql Date: Wed, 4 May 2016 23:37:45 +0200 Subject: [PATCH] Use 'aria2c' if is available to download dependencies --- .../aria2-i386-gnu-linux-cross-build-libs | 20 +++++++++++++------ .../aria2-x86_64-gnu-linux-build-libs | 20 +++++++++++++------ .../aria2-i686-w64-mingw-build-libs | 20 +++++++++++++------ .../aria2-x86_64-w64-mingw-build-libs | 20 +++++++++++++------ 4 files changed, 56 insertions(+), 24 deletions(-) diff --git a/build-scripts/gnu-linux-config/aria2-i386-gnu-linux-cross-build-libs b/build-scripts/gnu-linux-config/aria2-i386-gnu-linux-cross-build-libs index f57d371..a74befc 100755 --- a/build-scripts/gnu-linux-config/aria2-i386-gnu-linux-cross-build-libs +++ b/build-scripts/gnu-linux-config/aria2-i386-gnu-linux-cross-build-libs @@ -16,6 +16,14 @@ PREFIX=/opt/aria2-i386/build_libs C_COMPILER="gcc" CXX_COMPILER="g++" +#CHECK TOOL FOR DOWNLOAD + aria2c --help > /dev/null + if [ "$?" -eq 0 ] ; then + DOWNLOADER="aria2c --check-certificate=false" + else + DOWNLOADER="wget -c" + fi + ## DEPENDENCES ## ZLIB=http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz OPENSSL=http://www.openssl.org/source/openssl-1.0.2h.tar.gz @@ -34,7 +42,7 @@ export CXXFLAGS="-m32" export LDFLAGS="-m32" # # zlib build - wget -c $ZLIB + $DOWNLOADER $ZLIB tar zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8/ CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER -m32" CXX="$CXX_COMPILER -m32" ./configure --prefix=$PREFIX --static @@ -43,7 +51,7 @@ export LDFLAGS="-m32" # # expat build cd .. - wget -c $EXPAT + $DOWNLOADER $EXPAT tar jxvf expat-2.1.1.tar.bz2 cd expat-2.1.1/ CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER -m32" CXX="$CXX_COMPILER -m32" ./configure --prefix=$PREFIX --enable-static --enable-shared @@ -52,7 +60,7 @@ export LDFLAGS="-m32" # # c-ares build cd .. - wget -c $C_ARES + $DOWNLOADER $C_ARES tar zxvf c-ares-1.11.0.tar.gz cd c-ares-1.11.0/ CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER -m32" CXX="$CXX_COMPILER -m32" ./configure --prefix=$PREFIX --enable-static --disable-shared @@ -61,7 +69,7 @@ export LDFLAGS="-m32" # # Openssl build cd .. - wget -c $OPENSSL + $DOWNLOADER $OPENSSL tar zxvf openssl-1.0.2h.tar.gz cd openssl-1.0.2h/ CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER -m32" CXX="$CXX_COMPILER -m32" ./Configure --prefix=$PREFIX linux-elf shared @@ -70,7 +78,7 @@ export LDFLAGS="-m32" # # sqlite3 cd .. - wget -c $SQLITE3 + $DOWNLOADER $SQLITE3 tar zxvf sqlite-autoconf-3120200.tar.gz cd sqlite-autoconf-3120200/ CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER -m32" CXX="$CXX_COMPILER -m32" ./configure --prefix=$PREFIX --enable-static --enable-shared @@ -79,7 +87,7 @@ export LDFLAGS="-m32" # # libssh2 cd .. - wget -c $SSH2 + $DOWNLOADER $SSH2 tar zxvf libssh2-1.7.0.tar.gz cd libssh2-1.7.0/ rm -rf $PREFIX/lib/pkgconfig/libssh2.pc diff --git a/build-scripts/gnu-linux-config/aria2-x86_64-gnu-linux-build-libs b/build-scripts/gnu-linux-config/aria2-x86_64-gnu-linux-build-libs index b5dba01..c687076 100755 --- a/build-scripts/gnu-linux-config/aria2-x86_64-gnu-linux-build-libs +++ b/build-scripts/gnu-linux-config/aria2-x86_64-gnu-linux-build-libs @@ -14,6 +14,14 @@ PREFIX=/opt/aria2/build_libs C_COMPILER="gcc" CXX_COMPILER="g++" +#CHECK TOOL FOR DOWNLOAD + aria2c --help > /dev/null + if [ "$?" -eq 0 ] ; then + DOWNLOADER="aria2c --check-certificate=false" + else + DOWNLOADER="wget -c" + fi + ## DEPENDENCES ## ZLIB=http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz OPENSSL=http://www.openssl.org/source/openssl-1.0.2h.tar.gz @@ -29,7 +37,7 @@ BUILD_DIRECTORY=/tmp/ cd $BUILD_DIRECTORY # # zlib build - wget -c $ZLIB + $DOWNLOADER $ZLIB tar zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8/ PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --prefix=$PREFIX --static @@ -38,7 +46,7 @@ cd $BUILD_DIRECTORY # # expat build cd .. - wget -c $EXPAT + $DOWNLOADER $EXPAT tar jxvf expat-2.1.1.tar.bz2 cd expat-2.1.1/ PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --prefix=$PREFIX --enable-static --enable-shared @@ -47,7 +55,7 @@ cd $BUILD_DIRECTORY # # c-ares build cd .. - wget -c $C_ARES + $DOWNLOADER $C_ARES tar zxvf c-ares-1.11.0.tar.gz cd c-ares-1.11.0/ PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --prefix=$PREFIX --enable-static --disable-shared @@ -56,7 +64,7 @@ cd $BUILD_DIRECTORY # # Openssl build cd .. - wget -c $OPENSSL + $DOWNLOADER $OPENSSL tar zxvf openssl-1.0.2h.tar.gz cd openssl-1.0.2h/ PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./Configure --prefix=$PREFIX linux-x86_64 shared @@ -65,7 +73,7 @@ cd $BUILD_DIRECTORY # # sqlite3 cd .. - wget -c $SQLITE3 + $DOWNLOADER $SQLITE3 tar zxvf sqlite-autoconf-3120200.tar.gz cd sqlite-autoconf-3120200/ PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --prefix=$PREFIX --enable-static --enable-shared @@ -74,7 +82,7 @@ cd $BUILD_DIRECTORY # # libssh2 cd .. - wget -c $SSH2 + $DOWNLOADER $SSH2 tar zxvf libssh2-1.7.0.tar.gz cd libssh2-1.7.0/ rm -rf $PREFIX/lib/pkgconfig/libssh2.pc diff --git a/build-scripts/mingw-config/aria2-i686-w64-mingw-build-libs b/build-scripts/mingw-config/aria2-i686-w64-mingw-build-libs index d83221c..37d3bec 100755 --- a/build-scripts/mingw-config/aria2-i686-w64-mingw-build-libs +++ b/build-scripts/mingw-config/aria2-i686-w64-mingw-build-libs @@ -11,6 +11,14 @@ #IMPORTANT: Require install gcc-mingw-w64-i686 g++-mingw-w64-i686 +#CHECK TOOL FOR DOWNLOAD + aria2c --help > /dev/null + if [ "$?" -eq 0 ] ; then + DOWNLOADER="aria2c --check-certificate=false" + else + DOWNLOADER="wget -c" + fi + ## DEPENDENCES ## ZLIB=http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz OPENSSL=http://www.openssl.org/source/openssl-1.0.2h.tar.gz @@ -28,7 +36,7 @@ PREFIX=/usr/i686-w64-mingw32 cd $BUILD_DIRECTORY # # zlib build - wget -c $ZLIB + $DOWNLOADER $ZLIB tar zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --static @@ -37,7 +45,7 @@ cd $BUILD_DIRECTORY # # expat build cd .. - wget -c $EXPAT + $DOWNLOADER $EXPAT tar jxvf expat-2.1.1.tar.bz2 cd expat-2.1.1/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --enable-shared @@ -46,7 +54,7 @@ cd $BUILD_DIRECTORY # # c-ares build cd .. - wget -c $C_ARES + $DOWNLOADER $C_ARES tar zxvf c-ares-1.11.0.tar.gz cd c-ares-1.11.0/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --disable-shared @@ -55,7 +63,7 @@ cd $BUILD_DIRECTORY # # Openssl build cd .. - wget -c $OPENSSL + $DOWNLOADER $OPENSSL tar zxvf openssl-1.0.2h.tar.gz cd openssl-1.0.2h/ ./Configure mingw --cross-compile-prefix=$HOST- --prefix=$PREFIX shared @@ -64,7 +72,7 @@ cd $BUILD_DIRECTORY # # sqlite3 cd .. - wget -c $SQLITE3 + $DOWNLOADER $SQLITE3 tar zxvf sqlite-autoconf-3120200.tar.gz cd sqlite-autoconf-3120200/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --enable-shared @@ -73,7 +81,7 @@ cd $BUILD_DIRECTORY # # libssh2 cd .. - wget -c $SSH2 + $DOWNLOADER $SSH2 tar zxvf libssh2-1.7.0.tar.gz cd libssh2-1.7.0/ rm -rf $PREFIX/lib/pkgconfig/libssh2.pc diff --git a/build-scripts/mingw-config/aria2-x86_64-w64-mingw-build-libs b/build-scripts/mingw-config/aria2-x86_64-w64-mingw-build-libs index 84f9b71..3ea86df 100755 --- a/build-scripts/mingw-config/aria2-x86_64-w64-mingw-build-libs +++ b/build-scripts/mingw-config/aria2-x86_64-w64-mingw-build-libs @@ -11,6 +11,14 @@ #IMPORTANT: Require install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 +#CHECK TOOL FOR DOWNLOAD + aria2c --help > /dev/null + if [ "$?" -eq 0 ] ; then + DOWNLOADER="aria2c --check-certificate=false" + else + DOWNLOADER="wget -c" + fi + ## DEPENDENCES ## ZLIB=http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz OPENSSL=http://www.openssl.org/source/openssl-1.0.2h.tar.gz @@ -28,7 +36,7 @@ PREFIX=/usr/x86_64-w64-mingw32 cd $BUILD_DIRECTORY # # zlib build - wget -c $ZLIB + $DOWNLOADER $ZLIB tar zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --static @@ -37,7 +45,7 @@ cd $BUILD_DIRECTORY # # expat build cd .. - wget -c $EXPAT + $DOWNLOADER $EXPAT tar jxvf expat-2.1.1.tar.bz2 cd expat-2.1.1/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --enable-shared @@ -46,7 +54,7 @@ cd $BUILD_DIRECTORY # # c-ares build cd .. - wget -c $C_ARES + $DOWNLOADER $C_ARES tar zxvf c-ares-1.11.0.tar.gz cd c-ares-1.11.0/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --disable-shared @@ -55,7 +63,7 @@ cd $BUILD_DIRECTORY # # Openssl build cd .. - wget -c $OPENSSL + $DOWNLOADER $OPENSSL tar zxvf openssl-1.0.2h.tar.gz cd openssl-1.0.2h/ ./Configure mingw64 --cross-compile-prefix=$HOST- --prefix=$PREFIX shared @@ -64,7 +72,7 @@ cd $BUILD_DIRECTORY # # sqlite3 cd .. - wget -c $SQLITE3 + $DOWNLOADER $SQLITE3 tar zxvf sqlite-autoconf-3120200.tar.gz cd sqlite-autoconf-3120200/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --enable-shared @@ -73,7 +81,7 @@ cd $BUILD_DIRECTORY # # libssh2 cd .. - wget -c $SSH2 + $DOWNLOADER $SSH2 tar zxvf libssh2-1.7.0.tar.gz cd libssh2-1.7.0/ rm -rf $PREFIX/lib/pkgconfig/libssh2.pc