AC_INIT(test-libglade.c)
AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE(libglade, 0.15)
AM_MAINTAINER_MODE

dnl get the GNOME macros
AM_ACLOCAL_INCLUDE(macros)

AC_ARG_ENABLE(debug, [  --enable-debug             enable debugging output],,
  [enable_debug=no])

if test "x$enable_debug" != xno; then
  AC_DEFINE(DEBUG)
fi

AC_PROG_CC
AC_ISC_POSIX
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))

AC_ARG_PROGRAM

AC_PROG_LIBTOOL

AM_PATH_GTK(1.2.0)

AC_PATH_PROG(XML_CONFIG,xml-config,no)
if test x$XML_CONFIG = xno; then
  AC_MSG_ERROR(Couldn't find xml-config)
fi
XML_LIBS=`xml-config --libs`
XML_CFLAGS=`xml-config --cflags`
AC_SUBST(XML_LIBS)
AC_SUBST(XML_CFLAGS)

dnl Check to make sure that we have libxml >= 1.7.2 installed
old_LIBS="$LIBS"
LIBS="$XML_LIBS $LIBS"
AC_CHECK_FUNC(xmlSAXUserParseFile,,
AC_MSG_ERROR([*** libxml >= 1.7.2 is required to compile libglade]))
LIBS="$old_LIBS"


have_gnome=false
GNOME_INIT_HOOK([
	have_gnome=true
	AC_DEFINE(ENABLE_GNOME)
])
AM_CONDITIONAL(GNOME_SUPPORT, $have_gnome)

AC_ARG_ENABLE(bonobo, [  --enable-bonobo            enable bonobo support],,
  [enable_bonobo=no])
have_bonobo=false
if test x$enable_bonobo != xno; then
  AM_PATH_BONOBO(0.27, have_bonobo=true)
fi
AM_CONDITIONAL(BONOBO_SUPPORT, $have_bonobo)


GNOME_COMPILE_WARNINGS

AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)

dnl gettext stuff ... there is no message catalog for libglade -- libglade
dnl provides translation for the XML files it reads in.
ALL_LINGUAS=""
AM_GNOME_GETTEXT

AC_OUTPUT([Makefile
libglade.spec
macros/Makefile
intl/Makefile
po/Makefile.in
glade/Makefile
doc/Makefile
libglade-config
libgladeConf.sh
libglade.pc
libglade-gnome.pc
libglade-bonobo.pc])
