1. Daniel K. O.
  2. KODE

Source

KODE / configure.ac

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.68])
AC_INIT([kode], [0.1], [danielosmari@users.sourceforge.net])
AC_CONFIG_SRCDIR([include/kode/kode.hpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
LT_INIT

# Checks for programs.
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11(noext)
AC_LANG([C++])


# we build documentation through Doxygen
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -z "$DOXYGEN";
   then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
fi


# Checks for libraries.
HAVE_OGRE=no
PKG_CHECK_MODULES(OGRE,
                  OGRE,
                  HAVE_OGRE=yes,
                  [AC_MSG_NOTICE([OGRE not found, will not build the OGRE-based samples])])
if test $HAVE_OGRE = yes
then
    OGRE_PLUGIN_DIR=`pkg-config --variable=plugindir OGRE`
    AC_SUBST(OGRE_PLUGIN_DIR)
fi
HAVE_OIS=no
PKG_CHECK_MODULES(OIS,
                  OIS,
                  HAVE_OIS=yes,
                  [AC_MSG_NOTICE([OIS not found, will not build the OGRE-based samples])])

AM_CONDITIONAL([USE_OGRE], [test $HAVE_OGRE = yes -a $HAVE_OIS = yes])


HAVE_ODE=no
PKG_CHECK_MODULES(ODE,
                  ode,
                  HAVE_ODE=yes,
                  [AC_MSG_NOTICE([ODE not found, will not build the ODE-based samples])])
AM_CONDITIONAL([USE_ODE], [test $HAVE_ODE = yes])


PKG_CHECK_MODULES(EIGEN, eigen3, [AC_DEFINE([HAVE_EIGEN], [1], [define if Eigen3 is available])],
                  [AC_MSG_NOTICE([EIGEN not found, constraint solver will be slow])])


BUILD_TESTS=yes
AC_ARG_ENABLE([tests],
        [AS_HELP_STRING([--disable-tests], [avoid unit tests during `make check' (default is enabled)])],
        BUILD_TESTS=$enableval)
HAVE_BOOST=no
AX_BOOST_BASE([1.53], [HAVE_BOOST=yes], [HAVE_BOOST=no])
if test $HAVE_BOOST = yes
then
        AX_BOOST_SYSTEM
        AX_BOOST_UNIT_TEST_FRAMEWORK
fi

if test $HAVE_BOOST = no
then
    BUILD_TESTS=no
fi
AM_CONDITIONAL([BUILD_TESTS], [test $BUILD_TESTS = yes])


USE_DOUBLE=no
KODE_PRECISION=KODE_SINGLE
AC_ARG_ENABLE(double-precision,
        [AS_HELP_STRING([--enable-double],[build using double precision (default is disabled)])],
        USE_DOUBLE=$enableval)
if test $USE_DOUBLE = yes
then
    KODE_PRECISION=KODE_DOUBLE
fi
AC_SUBST(KODE_PRECISION)
AM_CONDITIONAL([DOUBLE_PRECISION], [test $USE_DOUBLE = yes])
CPPFLAGS="$CPPFLAGS -D$KODE_PRECISION"

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T

# Checks for library functions.


AC_CONFIG_FILES([Makefile
                 docs/Doxyfile
                 docs/Makefile
                 externals/Makefile
                 externals/libccd/Makefile
                 include/Makefile
                 include/kode/Makefile
                 include/kode/collision/Makefile
                 include/kode/collision/tests/Makefile
                 include/kode/joints/Makefile
                 include/kode/solvers/Makefile
                 kode.pc
                 samples/Makefile
                 samples/ODE/Makefile
                 samples/KODEOgre/Makefile
                 samples/KODEOgre/include/Makefile
                 samples/KODEOgre/src/Makefile
                 samples/KODEOgre/plugins.cfg
                 src/Makefile
                 src/collision/Makefile
                 src/collision/tests/Makefile
                 src/joints/Makefile
                 src/solvers/Makefile
                 tests/Makefile])
AC_OUTPUT