### Mook - mozconfig
### ... with a yet another layer of indirection :)

# If you're looking to reuse this... well, don't :p
# Just to this instead:
# . $(TOPSRCDIR)/browser/config/mozconfig

# defining what we want
# use either "true" or "" only. (that is, false = leave blank)
# and... no space anywhere :(

OPT_VENKMAN=
OPT_INSPECTOR=true
OPT_STATIC=true
OPT_DEBUG=
# SVG: use GDI or LIBART
OPT_SVG=
 
### the rest should be automatic


# stupid Perl fix
export PERLIO=crlf

export MOZ_PHOENIX=1
mk_add_options MOZ_PHOENIX=1

ac_add_options --disable-profilesharing
ac_add_options --disable-installer

# not defining MOZ_OFFICIAL since we're not :)

# stuff we don't want

# disable: core apps
ac_add_options --disable-composer
ac_add_options --disable-mailnews

#disable: added functionality
if [ ! $OPT_DEBUG ]; then
	ac_add_options --disable-debug
fi
ac_add_options --disable-ldap
ac_add_options --disable-tests
ac_add_options --disable-accessibility
ac_add_options --disable-activex
ac_add_options --disable-activex-scripting
ac_add_options --enable-plaintext-editor-only

# kill gopher
ac_add_options --enable-necko-protocols=default,-gopher

# stuff we do want

ac_add_options --enable-crypto
ac_add_options --enable-optimize="/Oxs /G7 /opt:nowin98"

if [ $OPT_STATIC ]; then
	ac_add_options --enable-static
	ac_add_options --disable-shared
fi


# Optional Packages

OPT_EXTENSIONS=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,typeaheadfind,webservices

if [ $OPT_VENKMAN ]; then
	OPT_EXTENSIONS=$OPT_EXTENSIONS,venkman
else
	ac_add_options --disable-jsd
fi

if [ $OPT_INSPECTOR ]; then
	OPT_EXTENSIONS=$OPT_EXTENSIONS,inspector
fi

if [ "$OPT_SVG" = "GDI" ]; then
	ac_add_options -enable-svg
	ac_add_options --enable-svg-renderer-gdiplus
elif [ "$OPT_SVG" = "LIBART" ]; then
    ac_add_options --enable-svg
    ac_add_options --enable-svg-renderer-libart
    mk_add_options MOZ_INTERNAL_LIBART_LGPL=1
    MOZ_INTERNAL_LIBART_LGPL=1
fi

ac_add_options --enable-extensions=$OPT_EXTENSIONS
