2015-10-05 20:30:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# In this configuration, the following dependent libraries are compiled:
|
|
|
|
#
|
|
|
|
# * zlib
|
|
|
|
# * c-ares
|
|
|
|
# * expat
|
|
|
|
# * sqlite3
|
|
|
|
# * openSSL
|
|
|
|
# * libssh2
|
|
|
|
|
2016-05-04 23:17:42 +02:00
|
|
|
#IMPORTANT: Require install gcc-mingw-w64-i686 g++-mingw-w64-i686
|
|
|
|
|
2016-05-04 23:37:45 +02:00
|
|
|
#CHECK TOOL FOR DOWNLOAD
|
|
|
|
aria2c --help > /dev/null
|
|
|
|
if [ "$?" -eq 0 ] ; then
|
|
|
|
DOWNLOADER="aria2c --check-certificate=false"
|
|
|
|
else
|
|
|
|
DOWNLOADER="wget -c"
|
|
|
|
fi
|
|
|
|
|
2015-10-05 20:30:26 +02:00
|
|
|
## 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
|
2017-11-10 10:04:22 +01:00
|
|
|
OPENSSL=http://www.openssl.org/source/openssl-1.0.2m.tar.gz
|
2016-07-09 15:30:05 +02:00
|
|
|
EXPAT=https://sourceforge.net/projects/expat/files/expat/2.2.0/expat-2.2.0.tar.bz2
|
2017-05-14 17:05:27 +02:00
|
|
|
SQLITE3=http://www.sqlite.org/2017/sqlite-autoconf-3180000.tar.gz
|
2017-11-10 10:06:37 +01:00
|
|
|
C_ARES=http://c-ares.haxx.se/download/c-ares-1.13.0.tar.gz
|
2016-05-04 23:21:41 +02:00
|
|
|
SSH2=https://www.libssh2.org/download/libssh2-1.7.0.tar.gz
|
2015-10-05 20:30:26 +02:00
|
|
|
|
|
|
|
## CONFIG ##
|
|
|
|
BUILD_DIRECTORY=/tmp/
|
|
|
|
HOST=i686-w64-mingw32
|
|
|
|
PREFIX=/usr/i686-w64-mingw32
|
|
|
|
|
|
|
|
## BUILD ##
|
|
|
|
cd $BUILD_DIRECTORY
|
|
|
|
#
|
|
|
|
# zlib build
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $ZLIB
|
2017-05-14 17:03:33 +02:00
|
|
|
tar zxvf zlib-1.2.11.tar.gz
|
|
|
|
cd zlib-1.2.11/
|
2015-10-05 20:30:26 +02:00
|
|
|
CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --static
|
|
|
|
make
|
|
|
|
make install
|
2016-10-09 13:18:23 +02:00
|
|
|
#
|
2015-10-05 20:30:26 +02:00
|
|
|
# expat build
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $EXPAT
|
2016-07-09 15:30:05 +02:00
|
|
|
tar jxvf expat-2.2.0.tar.bz2
|
|
|
|
cd expat-2.2.0/
|
2016-03-14 17:01:56 +01:00
|
|
|
CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --enable-shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# c-ares build
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $C_ARES
|
2017-11-10 10:06:37 +01:00
|
|
|
tar zxvf c-ares-1.13.0.tar.gz
|
|
|
|
cd c-ares-1.13.0/
|
2015-10-05 20:30:26 +02:00
|
|
|
CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --disable-shared
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# Openssl build
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $OPENSSL
|
2017-11-10 10:04:22 +01:00
|
|
|
tar zxvf openssl-1.0.2m.tar.gz
|
|
|
|
cd openssl-1.0.2m/
|
2016-02-18 21:43:18 +01:00
|
|
|
./Configure mingw --cross-compile-prefix=$HOST- --prefix=$PREFIX shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# sqlite3
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $SQLITE3
|
2017-05-14 17:05:27 +02:00
|
|
|
tar zxvf sqlite-autoconf-3180000.tar.gz
|
|
|
|
cd sqlite-autoconf-3180000/
|
2016-02-18 21:43:18 +01:00
|
|
|
CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --prefix=$PREFIX --host=$HOST --enable-static --enable-shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# libssh2
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $SSH2
|
2016-02-24 20:36:11 +01:00
|
|
|
tar zxvf libssh2-1.7.0.tar.gz
|
|
|
|
cd libssh2-1.7.0/
|
2015-10-17 16:55:37 +02:00
|
|
|
rm -rf $PREFIX/lib/pkgconfig/libssh2.pc
|
|
|
|
CC=$HOST-gcc CXX=$HOST-g++ AR=$HOST-ar RANLIB=$HOST-ranlib ./configure --without-libgcrypt --with-openssl --without-wincng --prefix=$PREFIX --host=$HOST --enable-static --disable-shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
2016-10-09 13:18:23 +02:00
|
|
|
make install
|
2015-10-05 20:30:26 +02:00
|
|
|
#
|
|
|
|
#cleaning
|
|
|
|
cd ..
|
|
|
|
rm -rf c-ares*
|
|
|
|
rm -rf sqlite-autoconf*
|
|
|
|
rm -rf zlib-*
|
|
|
|
rm -rf expat-*
|
2015-10-17 16:55:37 +02:00
|
|
|
rm -rf openssl-*
|
2015-10-05 20:30:26 +02:00
|
|
|
rm -rf libssh2-*
|
2015-10-17 16:55:37 +02:00
|
|
|
|
2015-10-05 20:30:26 +02:00
|
|
|
#
|
|
|
|
echo "finished!"
|