build/macosx/local-mozconfig.common
author Jorg K <jorgk@jorgk.com>
Fri, 08 Dec 2017 23:49:34 +0100
changeset 29736 d39b5cd2fc784c443471d90d9e903e3a569bf5b3
parent 29088 706e5fdd301201b23e96be9826b7e5b953d11776
child 29760 02fd46566f884ab908321e95b2bbb9d3f75535fe
permissions -rw-r--r--
Keep build files in sync (Port bug 1424323: remove MOZ_AUTOMATION_UPLOAD_SYMBOLS from in-tree mozconfigs). r=tomprince(via IRC)

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

if [ "x$IS_NIGHTLY" = "xyes" ]; then
  # Some nightlies (eg: Mulet) don't want these set.
  MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1}
fi
. "$topsrcdir/build/mozconfig.common"

if [ -d $TOOLTOOL_DIR/clang ]; then
    true
elif [ -d "$topsrcdir/clang" ]; then
    # mozilla-central based build
    TOOLTOOL_DIR=$topsrcdir
elif [ -d "$topsrcdir/../clang" ]; then
    TOOLTOOL_DIR=$topsrcdir/..
else
    echo "Don't know where we are; can't find clang. topsrcdir: $topsrcdir"
fi

if [ -d $TOOLTOOL_DIR/MacOSX10.10.sdk ]; then
    export CROSS_SYSROOT=$TOOLTOOL_DIR/MacOSX10.10.sdk
    CROSS_PRIVATE_FRAMEWORKS=$CROSS_SYSROOT/System/Library/PrivateFrameworks
    FLAGS="-isysroot $CROSS_SYSROOT"
    ldflags="-Wl,-syslibroot,$CROSS_SYSROOT "
    export BINDGEN_CFLAGS="$FLAGS"
    ac_add_options --with-macos-private-frameworks=$CROSS_PRIVATE_FRAMEWORKS
    # Since we are manually providing an SDK, don't check for xcode being installed.
    # See https://bugzilla.mozilla.org/show_bug.cgi?id=1366564
    ac_add_options --disable-xcode-checks
else
    FLAGS=""
fi

if [ -d $TOOLTOOL_DIR ]; then
    export CC="$TOOLTOOL_DIR/clang/bin/clang $FLAGS"
    export CXX="$TOOLTOOL_DIR/clang/bin/clang++ $FLAGS"
    export CPP="$TOOLTOOL_DIR/clang/bin/clang $FLAGS -E"
    export LLVMCONFIG=$TOOLTOOL_DIR/clang/bin/llvm-config
    export DSYMUTIL=$TOOLTOOL_DIR/clang/bin/llvm-dsymutil
    # Use an updated linker.
    ldflags="$ldflags -B$TOOLTOOL_DIR/cctools/bin "
    export AR=$TOOLTOOL_DIR/cctools/bin/ar
    export RANLIB=$TOOLTOOL_DIR/cctools/bin/ranlib
fi

# Ensure the updated linker doesn't generate things our older build tools
# don't understand.
ldflags="$ldflags -Wl,-no_data_in_code_info"
export LDFLAGS="$ldflags"

# If not set use the system default clang
if [ -z "$CC" ]; then
    export CC=clang
fi

# If not set use the system default clang++
if [ -z "$CXX" ]; then
    export CXX=clang++
fi

export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE=/builds/crash-stats-api.token