
AC_INIT(Thai-HOWTO,1.9.8.2)

hyphdir="$(pwd)/fop/hyph"
fontregdir="$(pwd)/fop/font"
fontdatdir="$(pwd)/fop/font"

AC_CHECK_PROG(javavm,java,yes)
if test "x$javavm" = "x"; then
    AC_MSG_ERROR([You need java runtime environment set in path])
fi

AC_ARG_WITH(ndwxsldir,
	[  --with-ndwxsldir=DIR    directory contain Norman Walsh Docbook XSL ]
	[                  [/usr/share/sgml/docbook/xsl-stylesheets]  ],
	[ndwxsldir="$withval"], [ndwxsldir=/usr/share/sgml/docbook/xsl-stylesheets])
AC_ARG_WITH(htmlencoding,
	[  --with-htmlencoding=ENCODING   encoding (charset) to use with HTML/XHTML output [UTF-8] ],
	[htmlencoding="$withval"], [htmlencoding=UTF-8])
AC_ARG_WITH(htmlheadcharset,
	[  --with-htmlheadcharset=CHARSET encoding (charset) to use with HTML header output ]
	[                         [ same as htmlencoding ] (for some charset to aliases) ],
	[htmlheadcharset="$withval"], [htmlheadcharset="$htmlencoding"])

AC_SUBST(ndwxsldir)
AC_SUBST(hyphdir)
AC_SUBST(fontregdir)
AC_SUBST(fontdatdir)
AC_SUBST(htmlencoding)
AC_SUBST(htmlheadcharset)

if test ! -d $ndw_docbook_xsl; then
    AC_MSG_ERROR($ndw_docbook_xsl not found, you may need to specfied --with-ndwxsldir=DIR)
fi

AC_OUTPUT(
	Makefile
	fop/conf/fopconfig.xml
	sf_docbook-html.xsl
	sf_docbook-xhtml.xsl
	sf_docbook-html-chunk.xsl
	sf_docbook-xhtml-chunk.xsl
	sf_docbook-print.xsl
	sf_docbook-common-chunk.xsl
)
