1
Fork 0
turbonss/configure.ac

84 lines
2.6 KiB
Plaintext
Raw Normal View History

2004-12-23 15:16:30 +02:00
dnl Process this file with autoconf to produce a configure script.
2014-06-06 23:47:37 +03:00
AC_INIT([cmph], [2.0.1])
AC_CONFIG_SRCDIR([Makefile.am])
2014-06-06 23:47:37 +03:00
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
2010-09-10 01:51:03 +03:00
AC_CONFIG_MACRO_DIR([m4])
2004-12-23 15:16:30 +02:00
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
LT_INIT
2005-01-19 14:40:22 +02:00
AC_SYS_EXTRA_LARGEFILE
if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then
ac_cv_sys_largefile_CFLAGS=""
fi
if test "x$ac_cv_sys_largefile_LDFLAGS" = "xno" ; then
ac_cv_sys_largefile_LDFLAGS=""
fi
if test "x$ac_cv_sys_largefile_LIBS" = "xno" ; then
ac_cv_sys_largefile_LIBS=""
fi
2012-05-28 07:39:36 +03:00
CFLAGS="$ac_cv_sys_largefile_CFLAGS $CFLAGS"
2012-04-15 06:03:00 +03:00
LDFLAGS="$ac_cv_sys_largefile_LDFLAGS $LDFLAGS"
2005-01-19 14:40:22 +02:00
LIBS="$LIBS $ac_cv_sys_largefile_LIBS"
2004-12-23 15:16:30 +02:00
dnl Checks for headers
AC_CHECK_HEADERS([getopt.h math.h])
dnl Checks for libraries.
LT_LIB_M
2004-12-23 15:16:30 +02:00
LDFLAGS="$LIBM $LDFLAGS"
#CFLAGS="-Wall -g"
2004-12-23 15:16:30 +02:00
AC_PROG_CXX
2012-06-09 06:58:52 +03:00
CXXFLAGS="-Wall -Wno-unused-function -DNDEBUG -O3 -fomit-frame-pointer $CXXFLAGS"
AC_ENABLE_CXXMPH
if test x$cxxmph = xtrue; then
2011-11-05 14:27:24 +02:00
AC_COMPILE_STDCXX_0X
if test x$ac_cv_cxx_compile_cxx0x_native = "xno"; then
2014-06-06 23:44:33 +03:00
if test x$ac_cv_cxx_compile_cxx11_cxx = "xyes"; then
2014-03-24 03:51:31 +02:00
CXXFLAGS="$CXXFLAGS -std=c++11"
2014-06-06 23:44:33 +03:00
elif test x$ac_cv_cxx_compile_cxx0x_cxx = "xyes"; then
CXXFLAGS="$CXXFLAGS -std=c++0x"
2011-11-05 14:27:24 +02:00
elif test x$ac_cv_cxx_compile_cxx0x_gxx = "xyes"; then
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
else
AC_MSG_ERROR("cxxmph demands a working c++0x compiler.")
fi
fi
AC_SUBST([CXXMPH], "cxxmph")
fi
AM_CONDITIONAL([USE_CXXMPH], [test "$cxxmph" = true])
2004-12-23 15:16:30 +02:00
AC_ENABLE_BENCHMARKS
if test x$benchmarks = xtrue; then
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([hopscotch_map.h])
AC_LANG_POP([C++])
fi
AM_CONDITIONAL([USE_BENCHMARKS], [test "$benchmarks" = true])
# Unit tests based on the check library. Disabled by default.
# We do not use pkg-config because it is inconvenient for all developers to
# have check library installed.
AC_ARG_ENABLE(check, AS_HELP_STRING(
[--enable-check],
[Build unit tests depending on check library (default: disabled)]))
AS_IF([test "x$enable_check" = "xyes"],
[ AC_CHECK_LIB([check], [tcase_create])
AS_IF([test "$ac_cv_lib_check_tcase_create" = yes], [CHECK_LIBS="-lcheck"],
[AC_MSG_ERROR("Failed to find check library (http://check.sf.net).")])
AC_CHECK_HEADER(check.h,[],
[AC_MSG_ERROR("Failed to find check library header (http://check.sf.net).")])
])
AM_CONDITIONAL([USE_LIBCHECK], [test "$ac_cv_lib_check_tcase_create" = yes])
2012-06-02 02:06:21 +03:00
AC_SUBST(CHECK_LIBS)
AC_SUBST(CHECK_CFLAGS)
2005-01-19 14:40:22 +02:00
AC_CHECK_SPOON
2012-06-08 17:02:07 +03:00
AC_CONFIG_FILES([Makefile src/Makefile cxxmph/Makefile tests/Makefile examples/Makefile man/Makefile cmph.pc cxxmph.pc])
AC_OUTPUT