if test -e "$topsrcdir/mozilla/build/macosx/universal/mozconfig"; then
  oldtopsrcdir=$topsrcdir
  export topsrcdir=$topsrcdir/mozilla
fi

. $topsrcdir/build/macosx/universal/mozconfig

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

ac_add_options --enable-application=mail
ac_add_options --enable-update-channel=beta
ac_add_options --enable-update-packaging
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-tests
ac_add_options --with-branding=mail/branding/unofficial

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

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

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

#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"
