Add dist-build/nativeclient-x86-64.sh
This commit is contained in:
parent
858b8e8c5e
commit
3499cbfbe5
18
dist-build/nativeclient-x86-64.sh
Executable file
18
dist-build/nativeclient-x86-64.sh
Executable 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
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
|
||||||
\$PNACL_FINALIZE=$PNACL_FINALIZE"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$1.nexe" ]; then
|
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_FINALIZE "$1" -o "$1.final"
|
||||||
$PNACL_TRANSLATE -arch $(uname -m) "$1.final" -o "$1.nexe"
|
$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"
|
||||||
|
Loading…
Reference in New Issue
Block a user