50 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-05-28 23:02:30 +02:00
#!/bin/bash
## and then borrowed and slightly modified from https://github.com/datkt/sodium/configure
## borrowed from https://github.com/sodium-friends/sodium-native/blob/master/configure
PREFIX="${PREFIX:-$PWD}"
KONAN="${KONAN:-$HOME/.konan}"
ARCH=${ARCH:-$(uname -m)}
2020-05-31 17:14:44 +02:00
echo $PREFIX
echo $KONAN
echo $ARCH
2020-05-28 23:02:30 +02:00
cd libsodium
./autogen.sh -s -f
if [ -z "$SYSROOT" ]; then
case $(uname -a) in
**Linux*x86_64**)
2020-05-31 17:14:44 +02:00
echo "Linux env"
2020-05-28 23:02:30 +02:00
GCC=${GCC:-gcc}
GCC=gcc
2020-05-31 17:14:44 +02:00
export CC=$(find $KONAN/dependencies -wholename *${ARCH/_/-}/bin/*$GCC | head -n1)
2020-05-28 23:02:30 +02:00
;;
2020-05-31 20:36:06 +02:00
**Linux*aarch64**)
echo "Linux ARM env"
GCC=${GCC:-gcc}
GCC=gcc
export CC=$(find $KONAN/dependencies -wholename *${ARCH/_/-}/bin/*$GCC | head -n1)
;;
2020-05-28 23:02:30 +02:00
**Darwin*x86_64**)
2020-05-31 17:14:44 +02:00
echo "Darwin env"
2020-05-28 23:02:30 +02:00
GCC=${GCC:-clang}
2020-05-31 17:14:44 +02:00
export CC=$(find $KONAN/dependencies -wholename *${ARCH/_/-}/bin/*$GCC | head -n1)
;;
**MSYS*x86_64**)
echo "Msys env"
GCC=clang.exe
export CC=$(find $KONAN/dependencies -wholename *${ARCH}*/bin/*$GCC | head -n1)
2020-05-28 23:02:30 +02:00
;;
2020-05-31 17:14:44 +02:00
2020-05-28 23:02:30 +02:00
esac
2020-05-31 17:14:44 +02:00
echo "CC"
echo $CC
2020-05-28 23:02:30 +02:00
fi
2020-05-31 20:36:06 +02:00
./configure --prefix=$PREFIX "$@"