From 1a4c07b9610086e9ec0bd72f2b3577f98c3b1eaf Mon Sep 17 00:00:00 2001 From: Ugljesa Jovanovic Date: Thu, 28 May 2020 23:02:30 +0200 Subject: [PATCH] Add configure and make script --- .gitignore | 4 ++-- sodiumWrapper/configure | 27 +++++++++++++++++++++++++++ sodiumWrapper/makeForKonan.sh | 3 +++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100755 sodiumWrapper/configure create mode 100755 sodiumWrapper/makeForKonan.sh diff --git a/.gitignore b/.gitignore index c9e9986..f48b68c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,5 @@ build/ /package.json /multiplatform-crypto/src/jsMain/npm/node_modules /multiplatform-crypto/src/jsMain/npm/package-lock.json -./sodiumWrapper/include -./sodiumWrapper/lib +/sodiumWrapper/include/ +/sodiumWrapper/lib/ diff --git a/sodiumWrapper/configure b/sodiumWrapper/configure new file mode 100755 index 0000000..5a59adf --- /dev/null +++ b/sodiumWrapper/configure @@ -0,0 +1,27 @@ +#!/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)} + +cd libsodium + +./autogen.sh -s -f + +if [ -z "$SYSROOT" ]; then + case $(uname -a) in + **Linux*x86_64**) + GCC=${GCC:-gcc} + GCC=gcc + ;; + + **Darwin*x86_64**) + GCC=${GCC:-clang} + ;; + esac + + export CC=$(find $KONAN/dependencies -wholename *${ARCH/_/-}/bin/*$GCC | head -n1) +fi + +./configure --prefix=$PREFIX "$@" diff --git a/sodiumWrapper/makeForKonan.sh b/sodiumWrapper/makeForKonan.sh new file mode 100755 index 0000000..194543c --- /dev/null +++ b/sodiumWrapper/makeForKonan.sh @@ -0,0 +1,3 @@ +./configure +make -j32 -C libsodium +make -j32 -C libsodium install