10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 21:03:56 +01:00
quantum_package/scripts/install_zlib.sh

39 lines
731 B
Bash
Raw Normal View History

2015-01-12 19:14:00 +01:00
#!/bin/bash
#
# Installs zlib for ocaml cryptokit
# Mon Jan 12 18:52:48 CET 2015
ZLIB="zlib-1.2.8"
ZLIB_URL="http://zlib.net/${ZLIB}.tar.gz"
# Check the QPACKAGE_ROOT directory
if [[ -z ${QPACKAGE_ROOT} ]]
then
echo "The QPACKAGE_ROOT environment variable is not set."
echo "Please reload the quantum_package.rc file."
exit 1
fi
cd ${QPACKAGE_ROOT}
2015-01-12 19:14:00 +01:00
cat > /tmp/main.c << EOF
int main () {}
EOF
gcc /tmp/main.c -lz
if [[ $? -eq 0 ]]
then
2015-03-25 17:03:28 +01:00
rm /tmp/main.c "a.out"
2015-01-12 19:14:00 +01:00
exit 0
fi
rm /tmp/main.c
${QPACKAGE_ROOT}/scripts/fetch_from_web.py ${ZLIB_URL} ZLIB.tar.gz
tar -zxf ZLIB.tar.gz && rm ZLIB.tar.gz ||exit 1
cd ${ZLIB} || exit 1
./configure && make
make install prefix=$QPACKAGE_ROOT
cd ${QPACKAGE_ROOT}
rm -rf -- ${ZLIB}