spmc_queue: Fix leaked refernce counts
[libnbds.git] / configure.ac
blob3f1d3bec61a075d33080d1c7b4b0b843cb807d98
1 # libnbds
3 # Copyright (C) 2013 PaweÅ‚ Dziepak
5 AC_PREREQ(2.5)
6 AC_INIT(nbds, [1.0], [pdziepak@quarnos.org])
8 AC_LANG([C])
10 AC_CONFIG_MACRO_DIR([m4])
12 AC_CONFIG_SRCDIR([src])
14 AM_INIT_AUTOMAKE
15 AC_CONFIG_HEADERS([config.h])
17 # Checks for programs.
18 AC_PROG_CC
19 AC_PROG_INSTALL
20 AC_PROG_LN_S
22 AC_PROG_LIBTOOL
24 # Checks for libraries.
25 AX_PTHREAD(, AC_MSG_ERROR([pthreads not found.]))
27 # Checks for header files.
28 AC_HEADER_STDC
29 AC_C_CONST
31 # Checks for typedefs, structures, and compiler characteristics.
33 # Checks for library functions.
34 AC_CHECK_FUNC([posix_memalign], ,
35         AC_MSG_ERROR([posix_memalign() not supported]))
37 AC_CACHE_CHECK([whether the target supports __sync_synchronize],
38                [cf_cv_have_sync_synchronize],
39                [
40                         AC_LINK_IFELSE([
41                                 AC_LANG_PROGRAM([[
42                                 ]],[[
43                                         __sync_synchronize();
44                                 ]])],
45                                 [cf_cv_have_sync_synchronize=yes],
46                                 [cf_cv_have_sync_synchronize=no])
47                 ])
48 if test "X${cf_cv_have_sync_synchronize}" != "Xyes"; then
49         AC_MSG_ERROR([__sync_synchronize() not supported])
52 AC_CACHE_CHECK([whether the target supports __sync_bool_compare_and_swap],
53                [cf_cv_have_sync_bool_compare_and_swap],
54                [
55                         AC_LINK_IFELSE([
56                                 AC_LANG_PROGRAM([[
57                                 ]],[[
58                                         int val = 0;
59                                         __sync_bool_compare_and_swap(&val, 0, 1);
60                                 ]])],
61                                 [cf_cv_have_sync_bool_compare_and_swap=yes],
62                                 [cf_cv_have_sync_bool_compare_and_swap=no])
63                 ])
64 if test "X${cf_cv_have_sync_bool_compare_and_swap}" != "Xyes"; then
65         AC_MSG_ERROR([__sync_bool_compare_and_swap() not supported])
69 AC_CONFIG_FILES([
70         Makefile
71         src/Makefile
72         test/Makefile
75 AC_OUTPUT