libcruft-util/configure.ac

118 lines
3.1 KiB
Plaintext
Raw Normal View History

2011-05-23 17:18:52 +10:00
AC_INIT([libgim], [0.1.0], [danny@nerdcruft.net])
## Explicitly set an empty CXXFLAGS if not present to prevent AC_PROG_CXX from
## generating a default -O2. This allows us to manually select -O0 when
## debugging is enabled.
: ${CXXFLAGS=""}
2011-05-23 17:18:52 +10:00
###############################################################################
## Build environment discovery
2011-05-23 17:18:52 +10:00
AC_CONFIG_AUX_DIR([build-aux])
AC_REQUIRE_AUX_FILE([tap-driver.sh])
2011-05-23 17:18:52 +10:00
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS
AC_CANONICAL_HOST
2011-05-23 17:18:52 +10:00
AC_LANG([C++])
2011-05-23 17:18:52 +10:00
NC_CXX
NC_PLATFORM
NC_OPTIMISATION
NC_WARNINGS
NC_DEBUGGING
LT_INIT
AM_INIT_AUTOMAKE([1.14 dist-bzip2 dist-xz foreign subdir-objects])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h])
2011-05-23 17:18:52 +10:00
###############################################################################
2011-06-21 23:36:51 +10:00
## Architecture features
2011-06-21 23:36:51 +10:00
AC_C_BIGENDIAN
###############################################################################
## Useful headers or platform features
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
###############################################################################
## Platform features
2011-05-23 17:18:52 +10:00
2015-03-24 02:43:21 +11:00
AC_DEFINE([_XOPEN_SOURCE], [700], [use POSIX 2008])
AC_FUNC_MMAP
2013-02-26 17:50:56 +11:00
AC_CHECK_FUNC([strndup], [
2013-08-05 16:45:25 +10:00
AC_DEFINE([HAVE_STRNDUP], [], [strndup appears to be present])
2013-02-26 17:50:56 +11:00
])
AC_CHECK_HEADER([execinfo.h], [break])
AM_CONDITIONAL([HAVE_EXECINFO], [test x$ac_cv_header_execinfo_h = "xyes"])
2011-11-04 17:28:04 +11:00
AC_SEARCH_LIBS([clock_gettime], [rt])
AS_IF([test "x$ac_cv_search_clock_gettime" == "x-*"], [
AX_APPEND_LINK_FLAGS([$ac_cv_search_clock_gettime], [], [-Werror])
])
###############################################################################
## Debug features
###############################################################################
2011-05-23 17:18:52 +10:00
## Documentation
###############################################################################
2011-05-23 17:18:52 +10:00
## Required packages
CHECK_RAGEL([ip.cpp])
2011-05-23 17:18:52 +10:00
2013-07-30 16:17:47 +10:00
AX_BOOST_BASE([1.53], [], [AC_MSG_ERROR([Boost version >= 1.53 required])])
2011-09-25 14:25:24 +10:00
# boost-system isn't a hard requirement, it's only really used to fulfill
# some other dependency I've since forgotten about...
AX_BOOST_SYSTEM
AX_BOOST_THREAD
AS_IF([test "x$ax_cv_boost_thread" != "xyes"], [
AC_MSG_ERROR("boost-thread is a hard requirement")
])
AX_BOOST_FILESYSTEM
2013-07-30 16:26:11 +10:00
AS_IF([test "x$ax_cv_boost_filesystem" != "xyes"], [
AC_MSG_ERROR("boost-filesystem is a hard requirement")
])
###############################################################################
2011-05-23 17:18:52 +10:00
## Optional packages
2013-07-13 15:28:29 +10:00
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.0])
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS)
2011-05-23 17:18:52 +10:00
AC_CHECK_TOOL([ADDR2LINE], [addr2line], [:])
AS_IF([test "x$ADDR2LINE" != "x:"], [AC_DEFINE_UNQUOTED([ADDR2LINE], ["$ADDR2LINE"], [addr2line tool name])])
###############################################################################
## Performance and build optimisations
###############################################################################
## Output
2011-05-23 17:18:52 +10:00
2013-07-30 16:17:47 +10:00
# inclusion of config.h has to go after compilation tests otherwise we risk
# failure on a clean build
AX_APPEND_FLAG([-include config.h])
AC_CONFIG_FILES([
2011-05-23 17:18:52 +10:00
Doxyfile
Makefile
])
2015-04-13 16:45:56 +10:00
AC_CONFIG_FILES([test/json-parse], [chmod a+x test/json-parse])
AC_CONFIG_FILES([test/json-schema], [chmod a+x test/json-schema])
AC_OUTPUT