dnl

AC_REVISION($Revision: 1.12 $)
AC_INIT(Makefile.am)

GLOBUS_INIT

AM_PROG_LIBTOOL

dnl Initialize the automake rules the last argument
AM_INIT_AUTOMAKE($GPT_NAME, $GPT_VERSION)

dnl Don't create a pkg-config file for program-only packages
pkgconffile=""


LAC_DOXYGEN("../", "*.dox")
LAC_DOXYGEN_EXAMPLE_DIR("../")

xml_catalog_path="notset"
AC_ARG_WITH(
    xml-catalog,
    AC_HELP_STRING(
        [--with-xml-catalog-path=PATH],
        [Look for XML catalog in PATH]),
    [xml_catalog_path="$withval"],
    [xml_catalog_path="notset"])

AC_PATH_PROG(XSLTPROC, "xsltproc")
AC_PATH_PROG(XMLLINT, "xmllint")

if test "x$xml_catalog_path" != x"notset"; then
    if test ! -f "$xml_catalog_path"; then
        AC_MSG_ERROR([Invalid XML catalog path])
    else
        XML_CATALOG_PATH=$xml_catalog_path
        AC_SUBST(XML_CATALOG_PATH)
    fi
fi

GLOBUS_TOOLKIT_VERSION="`globus-version`"
if test "x$GLOBUS_TOOLKIT_VERSION" = "x"; then
    GLOBUS_TOOLKIT_VERSION="UNKNOWN"
fi
AC_SUBST(GLOBUS_TOOLKIT_VERSION)

AM_PATH_XML2([2.6.11],
    [ac_cv_have_libxml2=yes],
    [ac_cv_have_libxml2=no
    AC_MSG_WARN([Unable to locate a usable libxml2])
    AC_MSG_WARN([Teragrid gateway user extension will not be usable])
    AC_MSG_WARN([To remedy, please install libxml2 using your operating system's package management tools or from http://www.xmlsoft.org/downloads.html])])

if test "$ac_cv_have_libxml2" = "yes"; then
    AC_DEFINE(HAVE_LIBXML2)
fi

AM_CONDITIONAL([GENERATE_MANPAGES], [test "$xml_catalog_path" != "notset"])
AC_DEFINE_UNQUOTED(GLOBUS_FLAVOR_NAME, "$GLOBUS_FLAVOR_NAME")

GLOBUS_FINALIZE

AC_OUTPUT(
	pkgdata/Makefile
	pkgdata/pkg_data_src.gpt
	scripts/Makefile
        seg/Makefile
	doxygen/Makefile
	doxygen/Doxyfile
	doxygen/Doxyfile-internal
        globus-personal-gatekeeper
        globus-gram-job-manager.conf
        Makefile
        version.h
)
