| 1 |
# Process this file with autoconf to produce a configure script. |
| 2 |
AC_PREREQ(2.59) ## specificy version of autoconf |
| 3 |
AC_INIT(seqlibtest, 1.0, [email protected]) |
| 4 |
AM_INIT_AUTOMAKE(foreign) |
| 5 |
AC_CONFIG_SRCDIR([seq_test.cpp]) |
| 6 |
AC_CONFIG_HEADER([config.h]) |
| 7 |
AM_MAINTAINER_MODE([disable]) |
| 8 |
##m4_include([m4/m4_ax_openmp.m4]) |
| 9 |
|
| 10 |
# Checks for programs. |
| 11 |
AC_PROG_CXX ## test for cpp compiler |
| 12 |
AC_PROG_CC ## test for C compiler |
| 13 |
AC_PROG_RANLIB ## required if libraries are built in package |
| 14 |
|
| 15 |
# Check for headers |
| 16 |
AC_LANG([C++]) |
| 17 |
AC_CHECK_HEADER([zlib.h]) |
| 18 |
|
| 19 |
# Check for libraries |
| 20 |
AC_SEARCH_LIBS([gzopen],[z],,[AC_MSG_ERROR([libz not found, please install zlib (http://www.zlib.net/)])]) |
| 21 |
AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [clock_getttime found])], ) |
| 22 |
|
| 23 |
AC_ARG_WITH(boost, AS_HELP_STRING([--with-boost=PATH], |
| 24 |
[specify directory containing the boost library)])) |
| 25 |
if test "$with_boost" -a -d "$with_boost"; then |
| 26 |
boost_include="-I$with_boost/include" |
| 27 |
AC_CHECK_FILE("$with_boost/stage/lib", STAGE_PATH=1, STAGE_PATH=0) |
| 28 |
if test ${STAGE_PATH} = 1; then |
| 29 |
boost_lib="-L$with_boost/stage/lib" |
| 30 |
else |
| 31 |
boost_lib="-L$with_boost/lib" |
| 32 |
fi |
| 33 |
AC_SUBST(boost_lib) |
| 34 |
fi |
| 35 |
|
| 36 |
# Only fail on warnings when the --enable-development flag is passed into configure |
| 37 |
AC_ARG_ENABLE(development, AS_HELP_STRING([--enable-development], |
| 38 |
[Turn on development options, like failing compilation on warnings])) |
| 39 |
if test "$enable_development"; then |
| 40 |
fail_on_warning="-Werror" |
| 41 |
fi |
| 42 |
|
| 43 |
# Set compiler flags. |
| 44 |
AC_SUBST(AM_CXXFLAGS, "-g $fail_on_warning -Wno-unknown-pragmas -DHAVE_C11=1 -std=c++11") |
| 45 |
AC_SUBST(CXXFLAGS, "$CXXFLAGS") |
| 46 |
AC_SUBST(CFLAGS, "$CFLAGS") |
| 47 |
AC_SUBST(CPPFLAGS, "$CPPFLAGS $boost_include") |
| 48 |
AC_SUBST(LDFLAGS, "$LDFLAGS") |
| 49 |
|
| 50 |
AC_SUBST(LIBS, "$LIBS $boost_lib") |
| 51 |
|
| 52 |
# Make sure the boost headers can be found |
| 53 |
AC_CHECK_HEADERS([boost/test/unit_test.hpp],,[AC_MSG_ERROR([The Boost library must be installed for unit testing. Specify its path with the --with-boost=PATH option])]) |
| 54 |
|
| 55 |
AC_CONFIG_FILES([Makefile]) |
| 56 |
|
| 57 |
AC_OUTPUT |