dnl Process this file with autoconf to produce a configure script.

AC_INIT(unicode, 0.10, [courier-maildrop@lists.sourceforge.net])

>confdefs.h  # Kill PACKAGE_ macros

AC_CONFIG_SRCDIR(mkiso8859.pl)

LPATH="$PATH:/usr/local/bin"

AM_CONFIG_HEADER(unicode_config.h)
AM_INIT_AUTOMAKE([foreign no-define])
dnl Checks for programs.

AC_PROG_MAKE_SET
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CC
AC_PATH_PROGS(PERL, perl5 perl, perl, $LPATH)

if test "$PERL" = "perl"
then
	AC_MSG_ERROR(Perl not found.)
fi

dnl Checks for libraries.

dnl Checks for header files.

AC_CHECK_HEADERS(stddef.h wchar.h)

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.

AC_ARG_ENABLE(mimecharset,
	[  --enable-mimecharset=charset   Default MIME charset to set on new messages],
	UNICODECHARSET="$enableval", UNICODECHARSET="us-ascii")

AC_ARG_ENABLE(unicode,
[  --disable-unicode              Disable all of unicode except iso-8859-1
  --enable-unicode=chset,chset   Comma-sep list of unicode charsets to use],
	unicode="$enableval",

	# Disable all unicode support by default, except the maintainer :-)

	unicode="no"
	if test -f ${srcdir}/UnicodeData.txt
	then
		unicode=""
	fi)

AC_SUBST(unicode)
AC_DEFINE_UNQUOTED(UNICODECHARSET,"$UNICODECHARSET",
	[ Default unicode charset ])

AM_CONDITIONAL(UPDATE_UNICODE, test -f ${srcdir}/UnicodeData.txt)

AC_ARG_ENABLE(unicode-test, [],
	unicode_xtest="$enableval",
	unicode_xtest="no")

AC_SUBST(unicode_xtest)

if test "$GCC" = "yes"
then
	CFLAGS="$CFLAGS -Wall"
fi

AC_OUTPUT(Makefile)
