if test -e "$topsrcdir/mozilla/build/macosx/universal/mozconfig.common"; then
  # We need some hackery to deal with the mozilla/ build system calling this
  # mozconfig.
  oldtopsrcdir=$topsrcdir
  export topsrcdir=$topsrcdir/mozilla
fi

mk_add_options MOZ_BUILD_PROJECTS="ppc i386"
. $topsrcdir/build/macosx/universal/mozconfig.common
export MOZ_PKG_VERSION=mac

if test -n $oldtopsrcdir; then
  export topsrcdir=$oldtopsrcdir
fi

ac_add_options --enable-application=mail
ac_add_options --enable-update-channel=nightly
ac_add_options --enable-update-packaging
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-tests
ac_add_options --enable-codesighs
ac_add_options --disable-install-strip

export CFLAGS="-gdwarf-2"
export CXXFLAGS="-gdwarf-2"

# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1

# For NSS symbols
export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-debug-symbols="-gdwarf-2"

#Use ccache
ac_add_options --with-ccache=/opt/local/bin/ccache
# Enable parallel compiling
CONCURRENCY=$(( `sysctl hw.logicalcpu | awk {'print $2'}`  + 2 ))
mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
