# # Configure script for Posadis # AC_INIT() version=0.60.5 #version=`date +%y%m%d` AM_INIT_AUTOMAKE(posadis, $version, no-define) AM_CONFIG_HEADER(posadis-config.h) AC_PROG_CC AC_PROG_CXX CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" AC_PREFIX_DEFAULT(/usr) if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix ac_configure_args="$ac_configure_args --prefix $prefix" fi AC_ENABLE_SHARED(yes) AC_ENABLE_STATIC(no) AC_LIBLTDL_INSTALLABLE AC_SUBST(LTDLINCL) AC_SUBST(LIBLTDL) AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL AC_DEFINE_UNQUOTED(POS6_VERSION,"$version") AC_DEFINE_UNQUOTED(PLUGINDIR,"${prefix}/lib/posadis") LIBDIR=${prefix}/lib/posadis AC_SUBST(LIBDIR) dnl Debug support ------------------------------------------------------------ CXXFLAGS=-O3 AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging], [ case "${enableval}" in yes) debug=yes; CXXFLAGS="-ggdb3 -Wall -DDEBUG -D_DEBUG_ -D_REENTRANT -funsigned-char" ;; no) debug=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac ] ) dnl Ccmalloc support --------------------------------------------------------- AC_ARG_ENABLE(ccmalloc, [ --enable-ccmalloc Turn on ccmalloc memory profiler], [ case "${enableval}" in yes) ccmalloc=true CXX="ccmalloc g++" ;; no) ccmalloc=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-ccmalloc) ;; esac],[ccmalloc=false]) AM_CONDITIONAL(WITH_CCMALLOC, test x$ccmalloc = xtrue) dnl Fam support -------------------------------------------------------------- want_fam=yes AC_ARG_ENABLE(fam, [ --enable-fam Build the fam module], [ case "${enableval}" in yes) want_fam=yes ;; no) want_fam=no ;; *) AC_MSG_ERROR(Bad value ${enableval} in --enable-fam!) esac ] ) if test x$want_fam = xyes; then AC_CHECK_HEADERS(fam.h) if test x"$ac_cv_header_fam_h" = xno ; then AC_MSG_WARN(FAM not found. Not building the "fam" module.) have_fam=no else have_fam=yes fi else have_fam=no fi AM_CONDITIONAL(have_fam, test x$have_fam = xyes) dnl Poslib detection --------------------------------------------------------- AC_PATH_PROG(POSLIB_CONFIG, poslib-config, no) if test x$POSLIB_CONFIG != xno ; then AC_MSG_CHECKING(for Poslib version) poslib_version=`poslib-config --version` AC_MSG_RESULT($poslib_version) AC_MSG_CHECKING(for Poslib cflags) poslib_cxxflags=`poslib-config --cflags` poslib_srvcxxflags=`poslib-config --cflags --server` AC_MSG_RESULT(client: "$poslib_cxxflags" server: "$poslib_srvcxxflags") AC_MSG_CHECKING(for Poslib ldflags) poslib_ldflags=`poslib-config --libs` poslib_srvldflags=`poslib-config --libs --server` AC_MSG_RESULT(client: "$poslib_ldflags" server: "$poslib_srvldflags") AC_SUBST(poslib_version) AC_SUBST(poslib_cxxflags) AC_SUBST(poslib_srvcxxflags) AC_SUBST(poslib_ldflags) AC_SUBST(poslib_srvldflags) else AC_MSG_ERROR(Poslib config script not found! Poslib is required!) fi AC_CHECK_HEADERS(nameser.h) AC_MSG_CHECKING(for resolv.h) AC_TRY_COMPILE([ #ifdef HAVE_NAMESER_H #include #endif #include #include #include #include #include ],[int x = _res.retry; ], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_RESOLV_H, 1, [Defines whether resolv.h works]) ],[AC_MSG_RESULT(no)]) all_libraries="$all_libraries $USER_LDFLAGS" all_includes="$all_includes $USER_INCLUDES" AC_SUBST(all_includes) AC_SUBST(all_libraries) AC_SUBST(AUTODIRS) dnl in this space add everything you want to check for dnl examples are specific headers, libraries, etc. dnl perform program name transformation AC_ARG_PROGRAM dnl add here all your Makefiles. These will be created by configure AC_OUTPUT(Makefile pos6/Makefile pos6/revmap/Makefile pos6/localhost/Makefile pos6/fam/Makefile tools/Makefile posadis-config )