build.sh
author Franziskus Kiefer <franziskuskiefer@gmail.com>
Fri, 30 Sep 2016 08:32:32 +0200
changeset 12718 0c845c900217050b8ee6e054655ea130d24480a4
parent 12709 0891cd3881db564673c1027a2b6b0e48b3cad7e3
child 12734 25bbb8bdd46086979558331d5030adeab4d4129e
permissions -rwxr-xr-x
Bug 1306319 - Fix layer violations, r=kaie,ueno try: -b do -p linux,linux64-gyp -u all -t all -e all

#!/bin/bash

CWD="$PWD/$(dirname $0)"
OBJ_DIR="$(make platform)"
DIST_DIR="$CWD/../dist/$OBJ_DIR"

# do NSPR things
NSS_GYP=1 make install_nspr

if [ -z "${USE_64}" ]; then
    GYP_PARAMS="-Dtarget_arch=ia32"
fi

# generate NSS build files only if asked for it
if [ -n "${NSS_GYP_GEN}" -o ! -d out/Debug ]; then
    PKG_CONFIG_PATH="$CWD/../nspr/$OBJ_DIR/config" gyp -f ninja $GYP_PARAMS --depth=. nss.gyp
fi
# build NSS
# TODO: only doing this for debug build for now
ninja -C out/Debug/
if [ $? != 0 ]; then
    exit 1
fi

# sign libs
# TODO: this is done every time at the moment.
cd out/Debug/
LD_LIBRARY_PATH=$DIST_DIR/lib/ ./shlibsign -v -i lib/libfreebl3.so
LD_LIBRARY_PATH=$DIST_DIR/lib/ ./shlibsign -v -i lib/libfreeblpriv3.so
LD_LIBRARY_PATH=$DIST_DIR/lib/ ./shlibsign -v -i lib/libnssdbm3.so
LD_LIBRARY_PATH=$DIST_DIR/lib/ ./shlibsign -v -i lib/libsoftokn3.so

# copy files over to the right directory
cp * "$DIST_DIR/bin/"
cp lib/* "$DIST_DIR/lib/"
find . -name "*.a" | xargs cp -t "$DIST_DIR/lib/"