Merge branch 'release/0.0'
[allocwithin] / configure.ac
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..f305990
--- /dev/null
@@ -0,0 +1,63 @@
+# $Id$
+
+AC_PREREQ([2.68])
+AC_INIT([region-bounded dynamic allocator],
+        [0.0],
+        [Justin Wind <justin.wind@gmail.com>],
+        [liballocwithin])
+AM_INIT_AUTOMAKE([foreign color-tests])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_SRCDIR(allocwithin.c)
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LN_S
+LT_INIT
+
+AC_ARG_ENABLE([debug-output],
+              AS_HELP_STRING([--enable-debug-output],
+                             [enable extra debugging output, default: no]),
+              [AS_IF([test "x${enableval}" != "xno"],
+                     AC_DEFINE([PRINT_DEBUG],[1],[Define to enable extra debugging output.]))])
+
+AC_MSG_CHECKING(for __attribute__)
+  AC_CACHE_VAL(ac_cv___attribute__,
+               [AC_COMPILE_IFELSE(
+                   [AC_LANG_PROGRAM([[#include <stdlib.h>]], [[int foo __attribute__ ((unused));]])],
+                   [ac_cv___attribute__=yes],
+                   [ac_cv___attribute__=no])])
+  if test "$ac_cv___attribute__" = "yes"; then
+    AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
+  fi
+  AC_MSG_RESULT($ac_cv___attribute__)
+
+AC_MSG_CHECKING([if __attribute__ format works on function pointers])
+  AC_CACHE_VAL(ac_cv___attribute__fp,
+               [AC_COMPILE_IFELSE(
+                   [AC_LANG_PROGRAM([[#include <stdlib.h>]], [[static void (*foo)(char *fmt, ...) __attribute__((format(printf, 1, 2)));]])],
+                   [ac_cv___attribute__fp=yes],
+                   [ac_cv___attribute__fp=no])])
+  if test "$ac_cv___attribute__fp" = "yes"; then
+    AC_DEFINE(HAVE___ATTRIBUTE__FP, 1, [define if your compiler supports __attribute__ format on function pointer variables])
+  fi
+  AC_MSG_RESULT($ac_cv___attribute__fp)
+
+m4_include(m4/ax_pthread.m4)
+AX_PTHREAD
+LIBS="$PTHREAD_LIBS $LIBS"
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+CC="$PTHREAD_CC"
+
+AC_CHECK_LIB(pthread, pthread_create)
+
+AC_CHECK_HEADERS([signal.h])
+
+AC_TYPE_SIZE_T
+
+AC_SUBST([AM_CXXFLAGS])
+AC_SUBST([AM_LDFLAGS])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT