diff --git a/dist-build/nativeclient-x86-64.sh b/dist-build/nativeclient-x86-64.sh new file mode 100755 index 00000000..2eed4a54 --- /dev/null +++ b/dist-build/nativeclient-x86-64.sh @@ -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 diff --git a/dist-build/nativeclient.sh b/dist-build/nativeclient.sh index 70c78f5b..1f2a7d4e 100755 --- a/dist-build/nativeclient.sh +++ b/dist-build/nativeclient.sh @@ -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 diff --git a/test/default/nacl-test-wrapper.sh b/test/default/nacl-test-wrapper.sh index 52f44cfc..fc4af65f 100755 --- a/test/default/nacl-test-wrapper.sh +++ b/test/default/nacl-test-wrapper.sh @@ -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"