110 lines
3.4 KiB
Plaintext
110 lines
3.4 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
# In this configuration, the following dependent libraries are compiled:
|
||
|
#
|
||
|
# * zlib
|
||
|
# * c-ares
|
||
|
# * expat
|
||
|
# * sqlite3
|
||
|
# * openSSL
|
||
|
# * libgcrypt
|
||
|
# * libssh2
|
||
|
|
||
|
#IMPORTANT: Require install gcc-multilib g++-multilib libc6-dev-i386
|
||
|
#COMPILER AND PATH
|
||
|
PREFIX=/opt/aria2-i386/build_libs
|
||
|
C_COMPILER="gcc"
|
||
|
CXX_COMPILER="g++"
|
||
|
|
||
|
## 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.2d.tar.gz
|
||
|
EXPAT=http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz
|
||
|
SQLITE3=https://www.sqlite.org/2015/sqlite-autoconf-3081101.tar.gz
|
||
|
C_ARES=http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz
|
||
|
SSH2=http://www.libssh2.org/download/libssh2-1.6.0.tar.gz
|
||
|
GCRYPT=ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.3.tar.gz
|
||
|
|
||
|
## CONFIG ##
|
||
|
BUILD_DIRECTORY=/tmp/
|
||
|
|
||
|
## BUILD ##
|
||
|
cd $BUILD_DIRECTORY
|
||
|
export CFLAGS="-m32"
|
||
|
export CXXFLAGS="-m32"
|
||
|
export LDFLAGS="-m32"
|
||
|
#
|
||
|
# zlib build
|
||
|
wget -c $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
|
||
|
make
|
||
|
make install
|
||
|
#
|
||
|
# expat build
|
||
|
cd ..
|
||
|
wget -c $EXPAT
|
||
|
tar zxvf expat-2.1.0.tar.gz
|
||
|
cd expat-2.1.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
|
||
|
make
|
||
|
make install
|
||
|
#
|
||
|
# c-ares build
|
||
|
cd ..
|
||
|
wget -c $C_ARES
|
||
|
tar zxvf c-ares-1.10.0.tar.gz
|
||
|
cd c-ares-1.10.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
|
||
|
make
|
||
|
make install
|
||
|
#
|
||
|
# Openssl build
|
||
|
cd ..
|
||
|
wget -c $OPENSSL
|
||
|
tar zxvf openssl-1.0.2d.tar.gz
|
||
|
cd openssl-1.0.2d/
|
||
|
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
|
||
|
make
|
||
|
make install
|
||
|
#
|
||
|
# sqlite3
|
||
|
cd ..
|
||
|
wget -c $SQLITE3
|
||
|
tar zxvf sqlite-autoconf-3081101.tar.gz
|
||
|
cd sqlite-autoconf-3081101/
|
||
|
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
|
||
|
make
|
||
|
make install
|
||
|
#
|
||
|
# libgcrypt
|
||
|
cd ..
|
||
|
wget -c $GCRYPT
|
||
|
tar zxvf libgcrypt-1.6.3.tar.gz
|
||
|
cd libgcrypt-1.6.3/
|
||
|
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 --host=i386-unknown-linux-gnu --prefix=$PREFIX --enable-static --disable-shared
|
||
|
make
|
||
|
make install
|
||
|
#
|
||
|
# libssh2
|
||
|
cd ..
|
||
|
wget -c $SSH2
|
||
|
tar zxvf libssh2-1.6.0.tar.gz
|
||
|
cd libssh2-1.6.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 --with-libgcrypt -without-openssl --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-*
|
||
|
rm -rf libgcrypt-*
|
||
|
#
|
||
|
echo "finished!"
|