1 dnl ------------------------------------------------ 2 dnl Initialization and Versioning 3 dnl ------------------------------------------------ 4 5 AC_INIT(libnestegg,[0.1git]) 6 7 AC_CANONICAL_HOST 8 AC_CANONICAL_TARGET 9 10 AC_CONFIG_MACRO_DIR([m4]) 11 12 AM_CONFIG_HEADER([config.h]) 13 AC_CONFIG_SRCDIR([src/nestegg.c]) 14 AM_INIT_AUTOMAKE 15 16 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 17 18 dnl Library versioning 19 dnl CURRENT, REVISION, AGE 20 dnl - library source changed -> increment REVISION 21 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0 22 dnl - interfaces added -> increment AGE 23 dnl - interfaces removed -> AGE = 0 24 25 NESTEGG_CURRENT=0 26 NESTEGG_REVISION=0 27 NESTEGG_AGE=1 28 AC_SUBST(NESTEGG_CURRENT) 29 AC_SUBST(NESTEGG_REVISION) 30 AC_SUBST(NESTEGG_AGE) 31 32 33 dnl -------------------------------------------------- 34 dnl Check for programs 35 dnl -------------------------------------------------- 36 37 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2" 38 dnl if $CFLAGS is blank 39 cflags_save="$CFLAGS" 40 AC_PROG_CC 41 AC_PROG_CPP 42 CFLAGS="$cflags_save" 43 44 AM_PROG_CC_C_O 45 AC_LIBTOOL_WIN32_DLL 46 AM_PROG_LIBTOOL 47 48 dnl Check for doxygen 49 AC_ARG_ENABLE([doc], 50 AS_HELP_STRING([--enable-doc], [Build API documentation]), 51 [ac_enable_doc=$enableval], [ac_enable_doc=auto]) 52 53 if 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 59 else 60 HAVE_DOXYGEN=false 61 fi 62 AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN) 63 if test $HAVE_DOXYGEN = "false"; then 64 AC_MSG_WARN([*** doxygen not found, API documentation will not be built]) 65 fi 66 67 # Generate portable stdint.h replacement 68 AX_CREATE_STDINT_H(include/nestegg/nestegg-stdint.h) 69 70 # Test whenever ld supports -version-script 71 AC_PROG_LD 72 AC_PROG_LD_GNU 73 AC_MSG_CHECKING([how to control symbol export]) 74 75 dnl -------------------------------------------------- 76 dnl Do substitutions 77 dnl -------------------------------------------------- 78 79 AC_SUBST(DEBUG) 80 AC_SUBST(PROFILE) 81 82 AC_OUTPUT([ 83 Makefile 84 docs/Makefile 85 docs/Doxyfile 86 nestegg.pc 87 nestegg-uninstalled.pc 88 ]) 89 90 AS_AC_EXPAND(LIBDIR, ${libdir}) 91 AS_AC_EXPAND(INCLUDEDIR, ${includedir}) 92 AS_AC_EXPAND(BINDIR, ${bindir}) 93 AS_AC_EXPAND(DOCDIR, ${docdir}) 94 95 if test $HAVE_DOXYGEN = "false"; then 96 doc_build="no" 97 else 98 doc_build="yes" 99 fi 100 101 AC_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