AC_INIT(mrbayes, 3.2, http://www.mrbayes.net) AC_CONFIG_SRCDIR(mb.c) AC_CONFIG_HEADER(config.h) AC_PROG_CC AC_HEADER_STDC AC_CHECK_LIB([m], [exp]) AC_PROG_INSTALL NOMPICC="No compiler for mpi has been found. If this is incorrect, please adjust your path and rerun configure." AC_ARG_ENABLE(mpi, [ --enable-mpi=[no/yes] compile the parallel version of mrbayes [default="no"]],,enable_mpi="no") if test "x$enable_mpi" == "xyes"; then AC_CHECK_PROG(mpicc,mpicc,yes,no) if test "x$mpicc" == "xno"; then AC_MSG_ERROR($NOMPICC); fi AC_DEFINE(MPI_ENABLED) fi AC_ARG_ENABLE(fastlog, [ --enable-fastlog=[no/yes] enable fast log operations [default="no"]],,enable_fastlog="no") if test "x$enable_fastlog" == "xyes"; then AC_DEFINE(FAST_VERSION) fi dnl check OS dnl case $host in dnl i386-*-gnu*) dnl bla;; dnl esac AC_DEFINE(UNIX_VERSION) dnl use c for custom tests AC_LANG_C dnl check readline AC_CHECK_LIB([readline], [readline]) if test $ac_cv_lib_readline_readline = yes; then LDFLAGS="${LDFLAGS} -lreadline" AC_MSG_CHECKING(for rl_completion_matches function) AC_LINK_IFELSE( [ #include #include #include char *f(const char *a, int f) { return "a"; } int main() { char *text="a"; extern char *f(const char *, int); char **matches = rl_completion_matches (text, f); return 0; } ], AC_MSG_RESULT(yes) AC_DEFINE(COMPLETIONMATCHES), AC_MSG_RESULT(no) ) fi dnl check for 64 bit AC_MSG_CHECKING(for 32 or 64 bits cpu) AC_RUN_IFELSE( [ int main() { return sizeof(long)==4?1:0; } ], AC_MSG_RESULT(64) AC_DEFINE(_64BIT), AC_MSG_RESULT(32) ) dnl finish if test "x$enable_mpi" == "xyes"; then CC=mpicc fi AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] compile with debug support [default="no"]],,enable_debug="no") if test "x$enable_debug" == "xyes"; then CFLAGS="-ggdb" else CFLAGS="-O3 -ffast-math -Wall -DNDEBUG" fi AC_CONFIG_FILES([Makefile]) AC_OUTPUT