# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(Molecuilder, 1.0, heber@ins.uni-bonn.de, molecuilder) AC_CONFIG_AUX_DIR(config) AC_CONFIG_SRCDIR([src/builder.cpp]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE(dist-bzip2) # Checks for programs. AC_PROG_CXX AC_PROG_CC AM_MISSING_PROG([DOXYGEN], [doxygen]) # Checks for libraries. AC_CHECK_LIB(m, sqrt, ,AC_MSG_ERROR([compatible libc math library not found])) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([sys/time.h]) AC_HEADER_STDBOOL AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([floor pow sqrt strchr]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_C_RESTRICT AC_TYPE_SIZE_T # Checks for library functions. # check for GNU Scientific Library AC_CHECK_LIB(m,main) AC_CHECK_LIB(blas,main) AC_CHECK_LIB(gsl,main) # debugging info AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Output debugging information, argument is yes or debugging level (default is no).]), [enable_debug=$enableval], [enable_debug=no]) if ! test x"$enable_debug" = xno; then if test x"${enable_debug}" = xyes; then CFLAGS="-g3" CXXFLAGS="-g3" else CFLAGS="-g${enable_debug}" CXXFLAGS="-g${enable_debug}" fi AC_DEFINE(HAVE_DEBUG,1, ["Output debugging info"]) AC_SUBST(HAVE_DEBUG) fi # optimization level AC_ARG_ENABLE([optimization],AS_HELP_STRING([--enable-optimization],[Optimization level of compiler. Argument is yes or debugging level. (default is 2)]), [enable_optimization=$enableval], [enable_optimization=yes]) if test ! x"$enable_optimization" = xno; then if test x"$enable_debug" = xno; then if test x"${enable_optimization}" = xyes; then CFLAGS="-O2" CXXFLAGS="-O2" else CFLAGS="-O${enable_optimization}" CXXFLAGS="-O${enable_optimization}" fi # else # AC_MSG_WARN(["Already specified --enable-debug!"]) fi fi # add replacement/saturation hydrogen or not AC_ARG_ENABLE([hydrogen],AS_HELP_STRING([--enable-hydrogen],[Adding saturation hydrogen (default is yes)]), [enable_hydrogen=$enableval], [enable_hydrogen=yes]) if test x"$enable_hydrogen" = xyes; then AC_DEFINE(ADDHYDROGEN,1, ["Adding saturation hydrogen"]) AC_SUBST(ADDHYDROGEN) fi # Check for "extern inline", using a modified version # of the test for AC_C_INLINE from acspecific.mt AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline, [ac_cv_c_extern_inline=no AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x); extern $ac_cv_c_inline double foo(double x) { return x+1.0; }; double foo (double x) { return x + 1.0; };], [ foo(1.0) ], [ac_cv_c_extern_inline="yes"]) ]) if test "$ac_cv_c_inline" != no ; then AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"]) AC_SUBST(HAVE_INLINE) fi # test suite AC_CONFIG_TESTDIR(tests) AC_CONFIG_FILES([tests/atlocal tests/Makefile]) AC_CONFIG_FILES([tests/molecuilder], [chmod +x tests/molecuilder]) AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile]) AC_OUTPUT