2016-08-07 17:45:46 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# In this configuration, the following dependent libraries are compiled:
|
|
|
|
#
|
|
|
|
# * zlib
|
|
|
|
# * c-ares
|
|
|
|
# * expat
|
|
|
|
# * sqlite3
|
|
|
|
# * openSSL
|
|
|
|
# * libssh2
|
|
|
|
|
|
|
|
#CHECK TOOL FOR DOWNLOAD
|
|
|
|
aria2c --help > /dev/null
|
|
|
|
if [ "$?" -eq 0 ] ; then
|
|
|
|
DOWNLOADER="aria2c --check-certificate=false"
|
|
|
|
else
|
|
|
|
DOWNLOADER="wget -c"
|
|
|
|
fi
|
|
|
|
|
|
|
|
## DEPENDENCES ##
|
2017-05-14 17:03:33 +02:00
|
|
|
ZLIB=http://sourceforge.net/projects/libpng/files/zlib/1.2.11/zlib-1.2.11.tar.gz
|
2019-10-10 18:47:45 +02:00
|
|
|
OPENSSL=http://www.openssl.org/source/openssl-1.0.2t.tar.gz
|
2019-10-10 18:52:21 +02:00
|
|
|
EXPAT=https://github.com/libexpat/libexpat/releases/download/R_2_2_6/expat-2.2.6.tar.bz2
|
2019-10-10 19:20:45 +02:00
|
|
|
SQLITE3=https://sqlite.org/2019/sqlite-autoconf-3300000.tar.gz
|
2019-10-10 18:59:08 +02:00
|
|
|
C_ARES=http://c-ares.haxx.se/download/c-ares-1.15.0.tar.gz
|
2016-08-07 17:45:46 +02:00
|
|
|
SSH2=https://www.libssh2.org/download/libssh2-1.7.0.tar.gz
|
|
|
|
|
|
|
|
## CONFIG ##
|
|
|
|
ARCH="armhf"
|
|
|
|
HOST="arm-linux-gnueabihf"
|
|
|
|
PREFIX="/opt/aria2-arm-rbpi/build_libs"
|
|
|
|
LOCAL_DIR="/opt/aria2-arm-rbpi/build_libs"
|
|
|
|
|
|
|
|
TOOL_BIN_DIR="/opt/aria2-arm-rbpi/tools/arm-bcm2708/gcc-linaro-$HOST-raspbian/bin"
|
|
|
|
PATH=${TOOL_BIN_DIR}:$PATH
|
|
|
|
|
|
|
|
CFLAGS="-march=armv7-a -mtune=cortex-a9"
|
|
|
|
DEST="/opt/aria2-arm-rbpi/build_libs"
|
|
|
|
CC=$HOST-gcc
|
|
|
|
CXX=$HOST-g++
|
|
|
|
LDFLAGS="-L$DEST/lib"
|
|
|
|
CPPFLAGS="-I$DEST/include"
|
|
|
|
CXXFLAGS=$CFLAGS
|
|
|
|
MAKE="make -j`nproc`"
|
|
|
|
CONFIGURE="./configure --prefix=${LOCAL_DIR} --host=$HOST"
|
|
|
|
BUILD_DIRECTORY=/tmp/
|
|
|
|
|
|
|
|
## BUILD ##
|
|
|
|
cd $BUILD_DIRECTORY
|
|
|
|
#
|
|
|
|
# zlib build
|
|
|
|
$DOWNLOADER $ZLIB
|
2017-05-14 17:03:33 +02:00
|
|
|
tar zxvf zlib-1.2.11.tar.gz
|
|
|
|
cd zlib-1.2.11/
|
2016-08-07 17:45:46 +02:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC=$HOST-gcc STRIP=$HOST-strip RANLIB=$HOST-ranlib CXX=$HOST-g++ AR=$HOST-ar LD=$HOST-ld ./configure --prefix=$PREFIX --static
|
|
|
|
make
|
|
|
|
make install
|
2016-10-09 13:18:23 +02:00
|
|
|
#
|
2016-08-07 17:45:46 +02:00
|
|
|
# expat build
|
|
|
|
cd ..
|
|
|
|
$DOWNLOADER $EXPAT
|
2019-10-10 18:52:21 +02:00
|
|
|
tar jxvf expat-2.2.6.tar.bz2
|
|
|
|
cd expat-2.2.6/
|
2016-08-07 17:45:46 +02:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC=$HOST-gcc CXX=$HOST-g++ ./configure --host=$HOST --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` --prefix=$PREFIX --enable-static=yes --enable-shared=no
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# c-ares build
|
|
|
|
cd ..
|
|
|
|
$DOWNLOADER $C_ARES
|
2019-10-10 18:59:08 +02:00
|
|
|
tar zxvf c-ares-1.15.0.tar.gz
|
|
|
|
cd c-ares-1.15.0/
|
2016-08-07 17:45:46 +02:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC=$HOST-gcc CXX=$HOST-g++ ./configure --host=$HOST --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` --prefix=$PREFIX --enable-static --disable-shared
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# Openssl build
|
|
|
|
cd ..
|
|
|
|
$DOWNLOADER $OPENSSL
|
2019-10-10 18:47:45 +02:00
|
|
|
tar zxvf openssl-1.0.2t.tar.gz
|
|
|
|
cd openssl-1.0.2t/
|
2016-08-07 17:45:46 +02:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC=$HOST-gcc CXX=$HOST-g++ ./Configure linux-armv4 $CFLAGS --prefix=$PREFIX shared zlib zlib-dynamic -D_GNU_SOURCE -D_BSD_SOURCE --with-zlib-lib=$LOCAL_DIR/lib --with-zlib-include=$LOCAL_DIR/include
|
|
|
|
make CC=$CC
|
|
|
|
make CC=$CC install INSTALLTOP=$DEST OPENSSLDIR=$DEST/ssl
|
|
|
|
#
|
|
|
|
# sqlite3
|
|
|
|
cd ..
|
|
|
|
$DOWNLOADER $SQLITE3
|
2019-10-10 18:57:44 +02:00
|
|
|
tar zxvf sqlite-autoconf-33000000.tar.gz
|
2019-10-10 19:27:37 +02:00
|
|
|
cd sqlite-autoconf-3300000/
|
2016-08-07 17:45:46 +02:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC=$HOST-gcc CXX=$HOST-g++ ./configure --host=$HOST --prefix=$PREFIX --enable-static --enable-shared --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE`
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# libssh2
|
|
|
|
cd ..
|
|
|
|
$DOWNLOADER $SSH2
|
|
|
|
tar zxvf libssh2-1.7.0.tar.gz
|
|
|
|
cd libssh2-1.7.0/
|
|
|
|
rm -rf $PREFIX/lib/pkgconfig/libssh2.pc
|
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --host=$HOST --without-libgcrypt --with-openssl --without-wincng --prefix=$PREFIX --enable-static --disable-shared
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
#cleaning
|
|
|
|
cd ..
|
|
|
|
rm -rf c-ares*
|
|
|
|
rm -rf sqlite-autoconf*
|
|
|
|
rm -rf zlib-*
|
|
|
|
rm -rf expat-*
|
|
|
|
rm -rf openssl-*
|
|
|
|
rm -rf libssh2-*
|
|
|
|
#
|
|
|
|
echo "finished!"
|