Skip to content

Instantly share code, notes, and snippets.

@dhuseby
Last active December 24, 2015 10:29
Show Gist options
  • Save dhuseby/6784770 to your computer and use it in GitHub Desktop.
Save dhuseby/6784770 to your computer and use it in GitHub Desktop.
# figure out where B2G root is
export B2G_DIR=${B2G_DIR:-$(cd $(dirname $0); pwd)}
# options
export B2G_DEBUG=${B2G_DEBUG:-0}
export B2G_NOOPT=${B2G_NOOPT:-0}
export NOFTU=${NOFTU:-1}
export MOZ_PROFILING=${MOZ_PROFILING:-0}
export CC=gcc-4.6
export CXX=g++-4.6
export BACKUP_ROOT=${BACKUP_ROOT:-/opt/Backups}
export CUSTOM_GECKO=${CUSTOM_GECKO:-}
export USE_DISTCC=${USE_DISTCC:-}
export BRANCH=${BRANCH:-master}
# enable distcc if specified
if [ "${USE_DISTCC}" == "1" ]; then
export CC=`which ${CC}`
export CXX=`which ${CXX}`
export CCACHE_PREFIX="distcc"
export CCACHE_DIR="/mnt/ccache"
fi
# are we building a custom gecko?
if [ "${CUSTOM_GECKO}" != "" ]; then
export GECKO_PATH=${CUSTOM_GECKO}
export GECKO_OBJDIR=${CUSTOM_GECKO}/objdir-gecko
else
export GECKO_PATH=${B2G_DIR}/gecko
export GECKO_OBJDIR=${B2G_DIR}/objdir-gecko
fi
# figure out the objdir path
if [ "${B2G_DEBUG}" != "0" ]; then
export GECKO_OBJDIR=${GECKO_OBJDIR}-debug
# make sure profiling is turned off when debug is turned on
export MOZ_PROFILING=0
fi
if [ "${B2G_NOOPT}" != "0" ]; then
export GECKO_OBJDIR=${GECKO_OBJDIR}-noopt
fi
if [ "${MOZ_PROFILING}" != "0" ]; then
export GECKO_OBJDIR=${GECKO_OBJDIR}-prof
fi
if [ "${GECKO_PATH/*mozilla-inbound*/mozilla-inbound}" = "mozilla-inbound" ]; then
export GECKO_OBJDIR=${GECKO_OBJDIR}-m-i
fi
if [ "${GECKO_PATH/*mozilla-central*/mozilla-central}" = "mozilla-central" ]; then
export GECKO_OBJDIR=${GECKO_OBJDIR}-m-c
fi
if [ "${GECKO_PATH/*b2g-inbound*/b2g-inbound}" = "b2g-inbound" ]; then
export GECKO_OBJDIR=${GECKO_OBJDIR}-b2g-i
fi
if [ -n "${BRANCH}" ]; then
export GECKO_OBJDIR=${GECKO_OBJDIR}-${BRANCH}
fi
# set up the android fs dir based on the b2g root dir name
HWDEVICE=${B2G_DIR#*-*}
if [ "${HWDEVICE}" != "${B2G_DIR}" ]; then
export ANDROIDFS_ROOT=${BACKUP_ROOT}/${HWDEVICE}
else
echo "Could not automatically detect the location of ANDROIDFS_ROOT."
exit -1
fi
echo "Build Config:"
echo " CC = ${CC}"
echo " CXX = ${CXX}"
echo " BRANCH = ${BRANCH}"
echo " B2G_DIR = ${B2G_DIR}"
echo " GECKO_PATH = ${GECKO_PATH}"
echo " GECKO_OBJDIR = ${GECKO_OBJDIR}"
echo " ANDROIDFS_ROOT = ${ANDROIDFS_ROOT}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment