# mozconfig.common only exists in mozilla-central
if test -e "$topsrcdir/mozilla/build/macosx/universal/mozconfig.common" || test -e "$topsrcdir/build/macosx/universal/mozconfig.common"; then

  export MOZ_PKG_VERSION=mac

  # No specific options needed here.

else

  # Treat this as a 1.9.2 mozconfig.
  # Although this should be a universal mozconfig, it is way too hard
  # to get a single buildbot to do this right, so just do an normal i386 build
  # for now.
  #if test -e "$topsrcdir/mozilla/build/macosx/universal/mozconfig"; then
  #  . $topsrcdir/mozilla/build/macosx/universal/mozconfig
  #else
  #  . $topsrcdir/build/macosx/universal/mozconfig
  #fi

  # 1.9.2 specific options.
  ac_add_options --enable-static
  ac_add_options --disable-shared

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

# XXX: Can't do that when building universal, it uses CC="gcc -arch ppc" internally
# XXX: and doing this would stomp on it
#CC=gcc
#CXX=g++

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

if [ -f $topsrcdir/mozconfig-extra ] ; then
  . $topsrcdir/mozconfig-extra
fi
if [ -f $topsrcdir/mozconfig-extra-macosx ] ; then
  . $topsrcdir/mozconfig-extra-macosx
fi

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