cd $SOURCE_DIRECTORY/mozilla* &&

FIREFOX_HOME="$INSTALL_ROOT/usr/lib/firefox" &&
export  MOZ_PHOENIX=1 &&

#
# Only strip if the user wants us to
#
if  echo  $LDFLAGS  |  grep  -q  --  '-s';  then
  OPTS="$OPTS  --enable-strip"
fi  &&

#
# No fast optimization for Mozilla, bit us so many times...
#
CFLAGS="${CFLAGS//-O3/-O2}"      &&
CXXFLAGS="${CXXFLAGS//-O3/-O2}"  &&

#
# -ffast-math breaks plugins
#
CFLAGS="${CFLAGS//-ffast-math/}"      &&
CXXFLAGS="${CXXFLAGS//-ffast-math/}"  &&

if [[ "$FIREFOX_CVS" == "y" ]]; then
autoconf-2.13
fi &&

# necko-wifi is part of xulrunner if enabled, but firefox
# compile fails without wireless_tools without this option
echo ac_add_options --disable-necko-wifi >> .mozconfig  &&

make_single  &&
make -f client.mk build &&
make_normal
