diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2018-12-02 17:17:35 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2018-12-02 17:17:35 +0100 |
commit | e313a5415241cd2b0a81ae4ac55a53b36ab153ff (patch) | |
tree | ed51e9a2d1b6dd48f1351d31bd52becab08a6afc | |
parent | 8c11a4e50df3c31a60500c04fed899e3773e9a17 (diff) |
build: use system libsodium by default
If libsodium is installed (i.e. pkg-config --variable=includedir
libsodium returns a non-empty path), assume libsodium is installed and
use it instead of libnacl.
To use libnacl, set NACL_INC_DIR, NACL_LIBDIR and NACL_LIB accordingly.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rwxr-xr-x | configure | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -190,7 +190,7 @@ check_bison() check_nacl() { - echo -n "[*] Checking nacl ... " + echo -n "[*] Checking nacl/sodium ... " cat > $TMPDIR/nacltest.c << EOF #include "crypto_hash_sha512.h" @@ -204,7 +204,13 @@ int main(void) { } EOF if [ -z $NACL_INC_DIR ] ; then - NACL_INC_DIR="$SYSROOT/usr/include/nacl" + NACL_INC_DIR=$(pkg-config --variable=includedir libsodium) + if [ -z $NACL_INC_DIR ] ; then + NACL_INC_DIR="$SYSROOT/usr/include/nacl" + else + NACL_INC_DIR="$NACL_INC_DIR/sodium" + NACL_LIB="sodium" + fi fi if [ -z $NACL_LIB_DIR ] ; then |