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 RANLIB=${RANLIB-"pnacl-ranlib"}
export PNACL_FINALIZE=${PNACL_FINALIZE-"pnacl-finalize"} export PNACL_FINALIZE=${PNACL_FINALIZE-"pnacl-finalize"}
export PNACL_TRANSLATE=${PNACL_TRANSLATE-"pnacl-translate"} export PNACL_TRANSLATE=${PNACL_TRANSLATE-"pnacl-translate"}
export CFLAGS="-O3 -fomit-frame-pointer"
mkdir -p $PREFIX || exit 1 mkdir -p $PREFIX || exit 1

View File

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