Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Before run this script install the following dependecies:
- # sudo apt-get install build-essential git cmake lib32z1 lib32ncurses5 lib32bz2-1.0 libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386
- # sudo apt-get build-dep sqlite3 libsqlite3-dev # SQLCipher
- #
- # Donload the BB10 SDK from:
- # http://developer.blackberry.com/native/download/linux/
- # And install it in the same directory where this script is by running:
- # $ chmod +x momentics*
- # $ ./momentics*
- # $ cd bbndk
- # $ chmod +x sdkinstall
- # $ ./sdkinstall --install 10.2.0.1155
- DEV_DIR=$PWD
- SRC_DIR="$DEV_DIR"/git/libscrypt
- BBSDK_DIR="$DEV_DIR"/bbndk
- QNX_HOST="$BBSDK_DIR"/host_10_2_0_15/linux/x86
- LOG() {
- echo -e "\033[1;32m$1\033[0m"
- }
- CHECK_ERROR() {
- if [ $? -ne 0 ] ; then
- returnCode=$?
- echo -e "\033[1;31m$1\033[0m"
- exit $returnCode
- fi
- }
- cd "$SRC_DIR"
- make clean
- LOG "[+] SETTING BB10 CROSS-COMPILE ENVIRONMENT VARIABLES"
- source "$BBSDK_DIR"/bbndk-env_10_2_0_339.sh
- export RANLIB="${QNX_HOST}/usr/bin/ntox86-ranlib "
- export PATH="${QNX_HOST}/usr/bin":$PATH
- export CPP="${QNX_HOST}/usr/bin/qcc -V4.6.3,gcc_ntox86 -E "
- export CC="${QNX_HOST}/usr/bin/qcc -V4.6.3,gcc_ntox86 "
- export LD="${QNX_HOST}/usr/bin/ntox86-ld"
- export CPPFLAGS="-D__PLAYBOOK__ -D__QNXNTO__ "
- export CFLAGS=" -g -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-strong "
- export LDFLAGS="-L${BBSDK_DIR}/target_10_2_0_1055/qnx6/x86/lib -Wl,-z,relro -Wl,-z,now -pie,-soname,libscrypt.so.0 -Wl,--version-script=libscrypt.version"
- LOG "[+] BUILDING..."
- make -j4
- CHECK_ERROR "ERROR BUILDING"
- LOG "DONE"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement