aria2-static-builds/build-scripts/gnu-linux-config/aria2-i386-gnu-linux-cross-build-libs

108 lines
3.2 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/bash
# In this configuration, the following dependent libraries are compiled:
#
# * zlib
# * c-ares
# * expat
# * sqlite3
# * openSSL
# * libssh2
#IMPORTANT: Require install gcc-multilib g++-multilib libc6-dev-i386
2016-05-04 23:17:42 +02:00
#COMPILER AND PATH
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 ##
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
OPENSSL=https://www.openssl.org/source/openssl-1.1.1l.tar.gz
EXPAT=https://github.com/libexpat/libexpat/releases/download/R_2_4_1/expat-2.4.1.tar.bz2
SQLITE3=https://sqlite.org/2021/sqlite-autoconf-3360000.tar.gz
C_ARES=https://c-ares.haxx.se/download/c-ares-1.17.2.tar.gz
SSH2=https://www.libssh2.org/download/libssh2-1.9.0.tar.gz
## CONFIG ##
BUILD_DIRECTORY=/tmp/
## BUILD ##
cd $BUILD_DIRECTORY
2016-10-09 13:18:23 +02:00
export CFLAGS="-m32"
export CXXFLAGS="-m32"
export LDFLAGS="-m32"
#
# 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/
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
2016-10-09 13:18:23 +02:00
#
# expat build
cd ..
$DOWNLOADER $EXPAT
tar jxvf expat-2.4.1.tar.bz2
cd expat-2.4.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
make
make install
#
# c-ares build
cd ..
$DOWNLOADER $C_ARES
tar zxvf c-ares-1.17.2.tar.gz
cd c-ares-1.17.2/
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 ..
$DOWNLOADER $OPENSSL
tar zxvf openssl-1.1.1l.tar.gz
cd openssl-1.1.1l/
2016-02-18 21:43:18 +01:00
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
make
make install
#
# sqlite3
cd ..
$DOWNLOADER $SQLITE3
tar zxvf sqlite-autoconf-3360000.tar.gz
cd sqlite-autoconf-3360000/
2016-02-18 21:43:18 +01:00
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
make
make install
#
# libssh2
cd ..
$DOWNLOADER $SSH2
tar zxvf libssh2-1.9.0.tar.gz
cd libssh2-1.9.0/
rm -rf $PREFIX/lib/pkgconfig/libssh2.pc
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 --without-libgcrypt --with-openssl --without-wincng --prefix=$PREFIX --enable-static --disable-shared
make
2016-10-09 13:18:23 +02:00
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!"