Merge branch 'release/0.0'
[allocwithin] / configure.ac
1 # $Id$
2
3 AC_PREREQ([2.68])
4 AC_INIT([region-bounded dynamic allocator],
5 [0.0],
6 [Justin Wind <justin.wind@gmail.com>],
7 [liballocwithin])
8 AM_INIT_AUTOMAKE([foreign color-tests])
9 AC_CONFIG_HEADERS([config.h])
10 AC_CONFIG_SRCDIR(allocwithin.c)
11 AC_CONFIG_MACRO_DIR([m4])
12
13 AC_PROG_CC
14 AM_PROG_CC_C_O
15 AC_PROG_INSTALL
16 AC_PROG_LN_S
17 LT_INIT
18
19 AC_ARG_ENABLE([debug-output],
20 AS_HELP_STRING([--enable-debug-output],
21 [enable extra debugging output, default: no]),
22 [AS_IF([test "x${enableval}" != "xno"],
23 AC_DEFINE([PRINT_DEBUG],[1],[Define to enable extra debugging output.]))])
24
25 AC_MSG_CHECKING(for __attribute__)
26 AC_CACHE_VAL(ac_cv___attribute__,
27 [AC_COMPILE_IFELSE(
28 [AC_LANG_PROGRAM([[#include <stdlib.h>]], [[int foo __attribute__ ((unused));]])],
29 [ac_cv___attribute__=yes],
30 [ac_cv___attribute__=no])])
31 if test "$ac_cv___attribute__" = "yes"; then
32 AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
33 fi
34 AC_MSG_RESULT($ac_cv___attribute__)
35
36 AC_MSG_CHECKING([if __attribute__ format works on function pointers])
37 AC_CACHE_VAL(ac_cv___attribute__fp,
38 [AC_COMPILE_IFELSE(
39 [AC_LANG_PROGRAM([[#include <stdlib.h>]], [[static void (*foo)(char *fmt, ...) __attribute__((format(printf, 1, 2)));]])],
40 [ac_cv___attribute__fp=yes],
41 [ac_cv___attribute__fp=no])])
42 if test "$ac_cv___attribute__fp" = "yes"; then
43 AC_DEFINE(HAVE___ATTRIBUTE__FP, 1, [define if your compiler supports __attribute__ format on function pointer variables])
44 fi
45 AC_MSG_RESULT($ac_cv___attribute__fp)
46
47 m4_include(m4/ax_pthread.m4)
48 AX_PTHREAD
49 LIBS="$PTHREAD_LIBS $LIBS"
50 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
51 CC="$PTHREAD_CC"
52
53 AC_CHECK_LIB(pthread, pthread_create)
54
55 AC_CHECK_HEADERS([signal.h])
56
57 AC_TYPE_SIZE_T
58
59 AC_SUBST([AM_CXXFLAGS])
60 AC_SUBST([AM_LDFLAGS])
61
62 AC_CONFIG_FILES([Makefile])
63 AC_OUTPUT