1dnl ------------------------------------------------ 2dnl Initialization and Versioning 3dnl ------------------------------------------------ 4 5AC_INIT(libnestegg,[0.1git]) 6 7AC_CANONICAL_HOST 8AC_CANONICAL_TARGET 9 10AC_CONFIG_MACRO_DIR([m4]) 11 12AM_CONFIG_HEADER([config.h]) 13AC_CONFIG_SRCDIR([src/nestegg.c]) 14AM_INIT_AUTOMAKE 15 16m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 17 18dnl Library versioning 19dnl CURRENT, REVISION, AGE 20dnl - library source changed -> increment REVISION 21dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0 22dnl - interfaces added -> increment AGE 23dnl - interfaces removed -> AGE = 0 24 25NESTEGG_CURRENT=0 26NESTEGG_REVISION=0 27NESTEGG_AGE=1 28AC_SUBST(NESTEGG_CURRENT) 29AC_SUBST(NESTEGG_REVISION) 30AC_SUBST(NESTEGG_AGE) 31 32 33dnl -------------------------------------------------- 34dnl Check for programs 35dnl -------------------------------------------------- 36 37dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2" 38dnl if $CFLAGS is blank 39cflags_save="$CFLAGS" 40AC_PROG_CC 41AC_PROG_CPP 42CFLAGS="$cflags_save" 43 44AM_PROG_CC_C_O 45AC_LIBTOOL_WIN32_DLL 46AM_PROG_LIBTOOL 47 48dnl Check for doxygen 49AC_ARG_ENABLE([doc], 50 AS_HELP_STRING([--enable-doc], [Build API documentation]), 51 [ac_enable_doc=$enableval], [ac_enable_doc=auto]) 52 53if test "x$ac_enable_doc" != "xno"; then 54 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false) 55 56 if test "x$HAVE_DOXYGEN" = "xfalse" -a "x$ac_enable_doc" = "xyes"; then 57 AC_MSG_ERROR([*** API documentation explicitly requested but Doxygen not found]) 58 fi 59else 60 HAVE_DOXYGEN=false 61fi 62AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN) 63if test $HAVE_DOXYGEN = "false"; then 64 AC_MSG_WARN([*** doxygen not found, API documentation will not be built]) 65fi 66 67# Generate portable stdint.h replacement 68AX_CREATE_STDINT_H(include/nestegg/nestegg-stdint.h) 69 70# Test whenever ld supports -version-script 71AC_PROG_LD 72AC_PROG_LD_GNU 73AC_MSG_CHECKING([how to control symbol export]) 74 75dnl -------------------------------------------------- 76dnl Do substitutions 77dnl -------------------------------------------------- 78 79AC_SUBST(DEBUG) 80AC_SUBST(PROFILE) 81 82AC_OUTPUT([ 83 Makefile 84 docs/Makefile 85 docs/Doxyfile 86 nestegg.pc 87 nestegg-uninstalled.pc 88]) 89 90AS_AC_EXPAND(LIBDIR, ${libdir}) 91AS_AC_EXPAND(INCLUDEDIR, ${includedir}) 92AS_AC_EXPAND(BINDIR, ${bindir}) 93AS_AC_EXPAND(DOCDIR, ${docdir}) 94 95if test $HAVE_DOXYGEN = "false"; then 96 doc_build="no" 97else 98 doc_build="yes" 99fi 100 101AC_MSG_RESULT([ 102------------------------------------------------------------------------ 103 $PACKAGE $VERSION: Automatic configuration OK. 104 105 General configuration: 106 107 API Documentation: .......... ${doc_build} 108 109 Installation paths: 110 111 libnestegg: .................. ${LIBDIR} 112 C header files: .............. ${INCLUDEDIR}/nestegg 113 Documentation: ............... ${DOCDIR} 114 115 Building: 116 117 Type 'make' to compile $PACKAGE. 118 119 Type 'make install' to install $PACKAGE. 120 121 Example programs will be built but not installed. 122------------------------------------------------------------------------ 123]) 124 125