dnl dnl XML Catalog Manager (xmlcatmgr) dnl Copyright (c) 2004 Julio M. Merino Vidal. All rights reserved. dnl dnl ----------------------------------------------------------------------- dnl Initialize GNU Autoconf and GNU Automake dnl ----------------------------------------------------------------------- AC_INIT(XML Catalog Manager, 2.2, jmmv@users.sourceforge.net, xmlcatmgr) AC_PREREQ(2.59) AC_COPYRIGHT([Copyright (c) 2004 Julio M. Merino Vidal.]) AC_CONFIG_AUX_DIR(admin) AC_CONFIG_HEADERS(config.h) AC_CONFIG_MACRO_DIR(admin) AC_CONFIG_SRCDIR(src/main.c) AM_INIT_AUTOMAKE(1.9 check-news no-define subdir-objects -Wall) AC_DEFINE(COPYRIGHT_STRING, ["Copyright (c) 2003, 2004 Julio M. Merino Vidal."], [Complete copyright string that applies to the whole program]) dnl ----------------------------------------------------------------------- dnl Check for the C compiler and additional features dnl ----------------------------------------------------------------------- AC_LANG(C) AC_PROG_CC AM_PROG_CC_C_O AC_CHECK_HEADERS(sys/cdefs.h assert.h ctype.h err.h fcntl.h unistd.h) found=no AC_CHECK_HEADERS(stdarg.h varargs.h sys/varargs.h, found=yes; break) if test ${found} = no; then AC_MSG_ERROR([cannot find a header file for varying arguments]) fi AC_HEADER_STDBOOL AC_CHECK_FUNCS(lockf getprogname setprogname warn warnx) dnl ----------------------------------------------------------------------- dnl Set up the developer mode dnl ----------------------------------------------------------------------- AC_ARG_ENABLE(developer, AS_HELP_STRING(--enable-developer, [enable developer features]),, enable_developer=no) if test ${enable_developer} = yes; then for f in -g -Wall -Wstrict-prototypes -Wmissing-prototypes \ -Wpointer-arith -Wreturn-type -Wswitch -Wcast-qual \ -Wwrite-strings do AC_MSG_CHECKING(whether ${CC} supports ${f}) saved_cflags="${CFLAGS}" CFLAGS="${CFLAGS} ${f}" AC_COMPILE_IFELSE([int main(void) { return 0; }], AC_MSG_RESULT(yes), AC_MSG_RESULT(no) CFLAGS="${saved_cflags}") done else CPPFLAGS="${CPPFLAGS} -DNDEBUG" fi dnl ----------------------------------------------------------------------- dnl Installation of documentation dnl ----------------------------------------------------------------------- AC_ARG_ENABLE(docs, AS_HELP_STRING(--disable-docs, [do not install documentation files]),, enable_docs=yes) if test ${enable_docs} != no; then AC_DEFINE(INSTALL_DOCS, 1, [Define to 1 if you are installing the documentation files]) fi AM_CONDITIONAL(INSTALL_DOCS, test ${enable_docs} != no) dnl ----------------------------------------------------------------------- dnl Set up default catalogs dnl ----------------------------------------------------------------------- AC_ARG_VAR(DEFAULT_CATALOG_SGML, [Default SGML catalog; sysconfdir/sgml/catalog if not specified]) test -z "${DEFAULT_CATALOG_SGML}" && \ DEFAULT_CATALOG_SGML=${sysconfdir}/sgml/catalog AC_MSG_NOTICE(using ${DEFAULT_CATALOG_SGML} as the system-wide SGML catalog) AC_ARG_VAR(DEFAULT_CATALOG_XML, [Default XML catalog; sysconfdir/xml/catalog if not specified]) test -z "${DEFAULT_CATALOG_XML}" && \ DEFAULT_CATALOG_XML=${sysconfdir}/xml/catalog AC_MSG_NOTICE(using ${DEFAULT_CATALOG_XML} as the system-wide XML catalog) dnl ----------------------------------------------------------------------- dnl Set up custom installation directories dnl ----------------------------------------------------------------------- AC_SUBST(DIR_DOC, ${datadir}/doc/${PACKAGE}) dnl ----------------------------------------------------------------------- dnl Finally, generate output dnl ----------------------------------------------------------------------- AC_OUTPUT(Makefile)