1dnl 2dnl XML Catalog Manager (xmlcatmgr) 3dnl Copyright (c) 2004 Julio M. Merino Vidal. All rights reserved. 4dnl 5 6dnl ----------------------------------------------------------------------- 7dnl Initialize GNU Autoconf and GNU Automake 8dnl ----------------------------------------------------------------------- 9 10AC_INIT(XML Catalog Manager, 2.2, jmmv@users.sourceforge.net, xmlcatmgr) 11AC_PREREQ(2.59) 12AC_COPYRIGHT([Copyright (c) 2004 Julio M. Merino Vidal.]) 13AC_CONFIG_AUX_DIR(admin) 14AC_CONFIG_HEADERS(config.h) 15AC_CONFIG_MACRO_DIR(admin) 16AC_CONFIG_SRCDIR(src/main.c) 17 18AM_INIT_AUTOMAKE(1.9 check-news no-define subdir-objects -Wall) 19 20AC_DEFINE(COPYRIGHT_STRING, 21 ["Copyright (c) 2003, 2004 Julio M. Merino Vidal."], 22 [Complete copyright string that applies to the whole program]) 23 24dnl ----------------------------------------------------------------------- 25dnl Check for the C compiler and additional features 26dnl ----------------------------------------------------------------------- 27 28AC_LANG(C) 29AC_PROG_CC 30AM_PROG_CC_C_O 31 32AC_CHECK_HEADERS(sys/cdefs.h assert.h ctype.h err.h fcntl.h unistd.h) 33 34found=no 35AC_CHECK_HEADERS(stdarg.h varargs.h sys/varargs.h, found=yes; break) 36if test ${found} = no; then 37 AC_MSG_ERROR([cannot find a header file for varying arguments]) 38fi 39 40AC_HEADER_STDBOOL 41 42AC_CHECK_FUNCS(lockf getprogname setprogname warn warnx) 43 44dnl ----------------------------------------------------------------------- 45dnl Set up the developer mode 46dnl ----------------------------------------------------------------------- 47 48AC_ARG_ENABLE(developer, 49 AS_HELP_STRING(--enable-developer, 50 [enable developer features]),, 51 enable_developer=no) 52if test ${enable_developer} = yes; then 53 for f in -g -Wall -Wstrict-prototypes -Wmissing-prototypes \ 54 -Wpointer-arith -Wreturn-type -Wswitch -Wcast-qual \ 55 -Wwrite-strings 56 do 57 AC_MSG_CHECKING(whether ${CC} supports ${f}) 58 saved_cflags="${CFLAGS}" 59 CFLAGS="${CFLAGS} ${f}" 60 AC_COMPILE_IFELSE([int main(void) { return 0; }], 61 AC_MSG_RESULT(yes), 62 AC_MSG_RESULT(no) 63 CFLAGS="${saved_cflags}") 64 done 65else 66 CPPFLAGS="${CPPFLAGS} -DNDEBUG" 67fi 68 69dnl ----------------------------------------------------------------------- 70dnl Installation of documentation 71dnl ----------------------------------------------------------------------- 72 73AC_ARG_ENABLE(docs, 74 AS_HELP_STRING(--disable-docs, 75 [do not install documentation files]),, 76 enable_docs=yes) 77if test ${enable_docs} != no; then 78 AC_DEFINE(INSTALL_DOCS, 1, 79 [Define to 1 if you are installing the documentation files]) 80fi 81AM_CONDITIONAL(INSTALL_DOCS, test ${enable_docs} != no) 82 83dnl ----------------------------------------------------------------------- 84dnl Set up default catalogs 85dnl ----------------------------------------------------------------------- 86 87AC_ARG_VAR(DEFAULT_CATALOG_SGML, 88 [Default SGML catalog; sysconfdir/sgml/catalog if not specified]) 89test -z "${DEFAULT_CATALOG_SGML}" && \ 90 DEFAULT_CATALOG_SGML=${sysconfdir}/sgml/catalog 91AC_MSG_NOTICE(using ${DEFAULT_CATALOG_SGML} as the system-wide SGML catalog) 92 93AC_ARG_VAR(DEFAULT_CATALOG_XML, 94 [Default XML catalog; sysconfdir/xml/catalog if not specified]) 95test -z "${DEFAULT_CATALOG_XML}" && \ 96 DEFAULT_CATALOG_XML=${sysconfdir}/xml/catalog 97AC_MSG_NOTICE(using ${DEFAULT_CATALOG_XML} as the system-wide XML catalog) 98 99dnl ----------------------------------------------------------------------- 100dnl Set up custom installation directories 101dnl ----------------------------------------------------------------------- 102 103AC_SUBST(DIR_DOC, ${datadir}/doc/${PACKAGE}) 104 105dnl ----------------------------------------------------------------------- 106dnl Finally, generate output 107dnl ----------------------------------------------------------------------- 108 109AC_OUTPUT(Makefile) 110