LuPPC/scripts/dependencies.sh

61 lines
1.1 KiB
Bash
Raw Normal View History

2016-02-13 03:28:47 +11:00
#!/bin/bash
#TOOL=arm-musl-linuxeabihf
2016-02-24 08:05:42 +11:00
TOOL=x86_64-linux-musl
OPENSSL_TARGET=linux-generic64
2016-02-13 03:28:47 +11:00
OUT=$TOOL
2016-02-24 08:05:42 +11:00
# TODO: more targets / host target
2016-02-13 03:28:47 +11:00
if [ $# -lt 1 ]
then
2016-02-24 08:05:42 +11:00
echo "Usage : $0 [all|arm32|x86_64|i486]"
2016-02-13 03:28:47 +11:00
exit
fi
case "$1" in
2016-02-24 08:05:42 +11:00
all )
TARGETS=(arm32 i486 x86_64)
for i in ${TARGETS[@]}; do
./$0 $i
done
;;
arm32 )
2016-02-13 03:28:47 +11:00
TOOL=arm-linux-musleabihf
OUT=$TOOL
OPENSSL_TARGET=linux-generic32
;;
2016-02-24 08:05:42 +11:00
i486 )
TOOL=i486-linux-musl
2016-02-13 03:28:47 +11:00
OUT=$TOOL
2016-02-24 08:05:42 +11:00
OPENSSL_TARGET=linux-generic32
2016-02-13 03:28:47 +11:00
;;
2016-02-24 08:05:42 +11:00
x86_64 )
TOOL=x86_64-linux-musl
OUT=$TOOL
2016-02-13 03:28:47 +11:00
OPENSSL_TARGET=linux-generic64
;;
2016-02-24 08:05:42 +11:00
2016-02-13 03:28:47 +11:00
*) echo "Invalid target!" ; exit 1
;;
esac
mkdir -p dependencies
2016-02-13 07:06:56 +11:00
mkdir -p dependencies/include
mkdir -p dependencies/include-$OUT
2016-02-13 03:28:47 +11:00
rm -rf dependencies/lib-$OUT
mkdir -p dependencies/lib-$OUT
cd dependencies
2016-02-13 07:55:26 +11:00
git clone https://github.com/libressl-portable/portable.git libressl
cd libressl
./autogen.sh
./configure --host=$TOOL
make clean
make -j8
2016-02-13 03:28:47 +11:00
2016-02-13 07:06:56 +11:00
mkdir -p ../include/openssl
mkdir -p ../include-$OUT/openssl
2016-02-13 07:55:26 +11:00
cp -rfv crypto/.libs/libcrypto.a ../lib-$OUT
cp -rfv ssl/.libs/libssl.a ../lib-$OUT
2016-02-13 07:06:56 +11:00
cp -rfv include/openssl/* ../include-$OUT/openssl