dnl -*-M4-*-

AC_INIT()

AC_PROG_CC
AC_PROG_INSTALL

AM_PATH_PYTHON
AM_INIT_PYEXEC_MOD

locale_dir="/usr/share/locale"
AC_ARG_WITH(locale-dir, [  --with-locale-dir=DIR   specify where to install translations], [locale_dir="$withval"],)
AC_SUBST(locale_dir)

install_sulfur="yes"
AC_ARG_ENABLE(sulfur,   [  --disable-sulfur        don't automatically install Sulfur],
 [if test "$enableval" = no; then
  install_sulfur="no" ;
fi],)

install_binaries="yes"
compile_python="yes"
AC_ARG_ENABLE(debian,   [  --enable-debian         enable Debian packaging stuff],
  [compile_python="no"
   install_sulfur="no"
   install_binaries="no"],)
AC_SUBST(compile_python)
AC_SUBST(install_sulfur)
AC_SUBST(install_binaries)

AC_MSG_CHECKING([whether to enable NLS])
AC_ARG_ENABLE(nls,     [  --disable-nls            disable Native Language Support],
  USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)

msgmerge=""
msgfmt=""
xgettext=""

if test "$USE_NLS" = "yes"; then
  AC_PATH_PROG(msgmerge, msgmerge, "")
  AC_PATH_PROG(msgfmt, msgfmt, "")
  AC_PATH_PROG(xgettext, xgettext, "")

  if test "$msgmerge" = "" -o "$msgfmt" = "" -o "$xgettext" = ""; then
    AC_MSG_WARN([could not find gettext support programs; NLS disabled.])
    USE_NLS="no"
  fi
fi

AC_SUBST(USE_NLS)
AC_SUBST(msgmerge)
AC_SUBST(msgfmt)
AC_SUBST(xgettext)


AC_OUTPUT(__init__.py Makefile glue/Makefile i18n/Makefile)
