AC_DEFUN([KL_BOOST],[ dnl see http://autoconf-archive.cryp.to/ax_boost.html KL_CHECK_LIB([boost]) test -d $boost_PATH && with_boost=$boost_PATH AX_BOOST_BASE(1.34) CPPFLAGS="$CPPFLAGS $boost_CPPFLAGS" LDFLAGS="$LDFLAGS $boost_LDFLAGS" AC_CHECK_HEADERS([$1], [], [ AC_ERROR("Could not find required boost headers. Please specify --with-boost!") ]) ]) dnl AC_DEFUN([KL_BOOST_SELECT],[dnl boost_model=$1 test -z "$boost_model" && boost_model=threaded test -d "$boost_PATH" || AC_ERROR("Don't know where is boost!") AC_ARG_WITH(boost-model, [ --with-boost-model=th threaded - use *-mt.a libs nonthreaded - use regular gccXX.a libs (default threaded) ], [ echo "Selected boost model: ${with_boost_model}" boost_model=${with_boost_model} ] ) case $boost_model in nonthreaded) boostlibname='*-gcc??.a';; threaded) boostlibname='*-mt.a';; esac cd $boost_PATH/lib for f in `find . -name "$boostlibname" -type f -print` do echo ln -s $f ${f%%-*}.a ln -s $f ${f%%-*}.a >/dev/null 2>&1 done cd - >/dev/null 2>&1 ]) dnl AC_DEFUN([KL_DEVEL_OPTIONS],[dnl dnl -- Build: debug -------------------------------------------------------------- AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging (default on) ], [ case "${enableval}" in no) DEBUG="-O2 -DNDEBUG" debug=false ;; *) DEBUG="-O0 -ggdb -D_GLIBCXX_DEBUG" debug=true GLIBCPP_FORCE_NEW=1;export GLIBCPP_FORCE_NEW; GLIBCXX_FORCE_NEW=1;export GLIBCXX_FORCE_NEW; MALLOC_OPTIONS="AJ"; export MALLOC_OPTIONS; AC_DEFINE(DEBUG, 1 ,[enable debugging]) ;; esac ], [ DEBUG="-O0 -ggdb -DDEBUG"; debug=true; ] ) CFLAGS="$CFLAGS $DEBUG" CXXFLAGS="$CXXFLAGS $DEBUG" AC_SUBST(DEBUG) AM_CONDITIONAL(DEBUG, test x$debug = xtrue) dnl -- Build: trace --------------------------------------------------------------- AC_ARG_ENABLE(trace, [ --enable-trace Turn on tracing (default on) ], [ case "${enableval}" in yes) TRACE="-DENABLE_TRACE";trace=true;; *) TRACE=""; trace=false;; esac ],[TRACE="-DENABLE_TRACE";trace=true;]) CFLAGS="$CFLAGS $TRACE" CXXFLAGS="$CXXFLAGS $TRACE" AC_SUBST(TRACE) AM_CONDITIONAL(TRACE, test x$trace = xtrue) dnl -- Compilation: distcc -------------------------------------------------------- AC_ARG_WITH(distcc, [ --with-distcc="h1 h2" Explicit list of hosts running distccd on common toolchain ], [ echo "Will distribute compilation on hosts: ${with_distcc}" AC_CHECK_PROG(DISTCC, distcc, distcc) DISTCC_HOSTS="$(echo ${with_distcc}|tr ',' ' ')" export DISTCC_HOSTS enable_distcc=true distcc=true ] ) AC_ARG_ENABLE(distcc, [ --enable-distcc Enable distribute compiler usage (default off) ], [ case "${enableval}" in no)DISTCC=""; distcc=false;; *) AC_CHECK_PROG(DISTCC, distcc, distcc) test -n "$DISTCC" || AC_MSG_ERROR("You enabled DISTCC but there's no binary in the PATH") test -n "$DISTCC_HOSTS" || AC_MSG_ERROR("You enabled DISTCC but \$DISTCC_HOSTS env is empty") distcc=true;; esac ],[DISTCC="";distcc=false;]) dnl -- Compilation: ccache -------------------------------------------------------- AC_CHECK_PROG(CCACHE, ccache, ccache) AC_ARG_ENABLE(ccache, [ --enable-ccache Enable compiler cache (default on) ], [if test "${enableval}" = "no"; then CCACHE="" fi ],[]) if $distcc then CC="$CCACHE $DISTCC `which $CC`" CXX="$CCACHE $DISTCC `which $CXX`" else CC="$CCACHE $CC" CXX="$CCACHE $CXX" fi dnl -- Compilation: tcmalloc ------------------------------------------------------ AC_ARG_ENABLE(tcmalloc, [ --enable-tcmalloc Enable PerfTools/tcmalloc (default off) ], [ if test "${enableval}" = "no"; then tcmal=false TCMAL="" else tcmal=true TCMAL="-ltcmalloc" fi ], [TCMAL=""; tcmal=false;]) AC_SUBST(TCMAL) ]) dnl