1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

Add dist-build/nativeclient-x86-64.sh

This commit is contained in:
Frank Denis 2016-04-29 21:55:06 +02:00
parent 858b8e8c5e
commit 3499cbfbe5
3 changed files with 34 additions and 12 deletions

View File

@ -0,0 +1,18 @@
#! /bin/sh
export NACL_SDK_ROOT=${NACL_SDK_ROOT-"/opt/nacl_sdk/pepper_49"}
export NACL_TOOLCHAIN=${NACL_TOOLCHAIN-"${NACL_SDK_ROOT}/toolchain/mac_x86_glibc"}
export NACL_BIN=${NACL_BIN-"${NACL_TOOLCHAIN}/bin"}
export PREFIX="$(pwd)/libsodium-nativeclient-x86-64"
export PATH="${NACL_BIN}:$PATH"
export CFLAGS="-O3 -fomit-frame-pointer"
mkdir -p $PREFIX || exit 1
make distclean > /dev/null
./configure --enable-minimal \
--host=x86_64-nacl \
--prefix="$PREFIX" || exit 1
make -j3 check && make -j3 install || exit 1

View File

@ -13,6 +13,7 @@ export NM=${NM-"pnacl-nm"}
export RANLIB=${RANLIB-"pnacl-ranlib"}
export PNACL_FINALIZE=${PNACL_FINALIZE-"pnacl-finalize"}
export PNACL_TRANSLATE=${PNACL_TRANSLATE-"pnacl-translate"}
export CFLAGS="-O3 -fomit-frame-pointer"
mkdir -p $PREFIX || exit 1

View File

@ -1,16 +1,19 @@
#! /bin/sh
if [ -z "$NACL_SDK_ROOT" -o -z "$PNACL_TRANSLATE" -o -z "$PNACL_FINALIZE" ]; then
echo "One or more variables need to be set:
\$NACL_SDK_ROOT=$NACL_SDK_ROOT
\$PNACL_TRANSLATE=$PNACL_TRANSLATE
\$PNACL_FINALIZE=$PNACL_FINALIZE"
exit 1
if [ -z "$NACL_SDK_ROOT" ]; then
echo "The following variable needs to be set:
\$NACL_SDK_ROOT=$NACL_SDK_ROOT" >&2
exit 1
fi
if [ ! -f "$1.nexe" ]; then
$PNACL_FINALIZE "$1" -o "$1.final"
$PNACL_TRANSLATE -arch $(uname -m) "$1.final" -o "$1.nexe"
if [ -z "$PNACL_FINALIZE" -o -z "$PNACL_TRANSLATE" ]; then
exe="$1"
else
exe="$1.nexe"
if [ ! -f "$exe" ]; then
$PNACL_FINALIZE "$1" -o "$1.final"
$PNACL_TRANSLATE -arch $(uname -m) "$1.final" -o "$exe"
fi
fi
which python >/dev/null 2>&1 || \
@ -18,8 +21,8 @@ which python >/dev/null 2>&1 || \
SEL_LDR=$(find "$NACL_SDK_ROOT" -name sel_ldr.py | head -n 1)
if [ -z "$SEL_LDR" ]; then
echo "Couldn't find sel_ldr.py under $NACL_SDK_ROOT"
exit 1
echo "Couldn't find sel_ldr.py under $NACL_SDK_ROOT" >&2
exit 1
fi
exec python "$SEL_LDR" "$1.nexe"
exec python "$SEL_LDR" "$exe"