From a8bd6a397b4198946071f03ca74fa45befc8ee46 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 2 Aug 2015 14:17:22 +0200 Subject: [PATCH] Add a nativeclient build script --- dist-build/Makefile.am | 3 ++- dist-build/nativeclient.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 dist-build/nativeclient.sh diff --git a/dist-build/Makefile.am b/dist-build/Makefile.am index db5b83a9..c67fbad6 100644 --- a/dist-build/Makefile.am +++ b/dist-build/Makefile.am @@ -11,4 +11,5 @@ EXTRA_DIST = \ emscripten.sh \ ios.sh \ msys2-win32.sh \ - msys2-win64.sh + msys2-win64.sh \ + nativeclient.sh diff --git a/dist-build/nativeclient.sh b/dist-build/nativeclient.sh new file mode 100755 index 00000000..0d990cd2 --- /dev/null +++ b/dist-build/nativeclient.sh @@ -0,0 +1,28 @@ +#! /bin/sh + +export NACL_SDK_ROOT=${NACL_SDK_ROOT-"/opt/nacl_sdk/pepper_45"} +export NACL_TOOLCHAIN=${NACL_TOOLCHAIN-"${NACL_SDK_ROOT}/toolchain/mac_pnacl"} +export NACL_BIN=${NACL_BIN-"${NACL_TOOLCHAIN}/bin"} +export PREFIX="$(pwd)/libsodium-nativeclient" +export PATH="${NACL_BIN}:$PATH" +export AR=${AR-"pnacl-ar"} +export AS=${AS-"pnacl-as"} +export CC=${CC-"pnacl-clang"} +export LD=${LD-"pnacl-ld"} +export NM=${NM-"pnacl-nm"} +export RANLIB=${RANLIB-"pnacl-ranlib"} +export PNACL_FINALIZE=${PNACL_FINALIZE-"pnacl-finalize"} +export PNACL_TRANSLATE=${PNACL_TRANSLATE-"pnacl-translate"} + +mkdir -p $PREFIX || exit 1 + +make distclean > /dev/null + +./configure --enable-minimal \ + --host=nacl \ + --prefix="$PREFIX" || exit 1 + +make -j3 check && make -j3 install || exit 1 + +# Cleanup +make distclean > /dev/null