Compat futex
[urcu.git] / configure.ac
CommitLineData
48d848c7
PMF
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4
7eaaf6cb 5AC_INIT([userspace-rcu], [0.2.3-alpha], [mathieu dot desnoyers at polymtl dot ca])
48d848c7 6AC_CONFIG_AUX_DIR([config])
7d413817
MD
7AC_CANONICAL_TARGET
8AC_CANONICAL_HOST
48d848c7
PMF
9AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
10AC_CONFIG_SRCDIR([urcu.h])
7d413817 11
49617de1
MD
12AH_TEMPLATE([CONFIG_URCU_SMP], [Enable SMP support. With SMP support enabled, uniprocessors are also supported. With SMP support disabled, UP systems work fine, but the behavior of SMP systems is undefined.])
13AH_TEMPLATE([CONFIG_URCU_HAVE_FENCE], [Defined when on a system that has memory fence instructions.])
14AH_TEMPLATE([CONFIG_URCU_HAVE_FUTEX], [Defined when on a system with futex support.])
c96a3726 15AC_CONFIG_HEADERS([urcu/config.h])
48d848c7
PMF
16
17# Checks for programs.
18AC_PROG_CC
19AC_PROG_MAKE_SET
20AC_PROG_LIBTOOL
21
22# Checks for typedefs, structures, and compiler characteristics.
23AC_C_INLINE
24AC_TYPE_PID_T
25AC_TYPE_SIZE_T
26
27# Checks for library functions.
28AC_FUNC_MALLOC
29AC_FUNC_MMAP
30AC_CHECK_FUNCS([bzero gettimeofday munmap strtoul])
31
32# Find arch type
7d413817
MD
33case $target_cpu in
34 i386) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
35 i486) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
36 i586) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
37 i686) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
48d848c7 38 x86_64) ARCHTYPE="x86";;
48d848c7
PMF
39 powerpc) ARCHTYPE="ppc" ;;
40 ppc64) ARCHTYPE="ppc" ;;
7d413817 41 powerpc64) ARCHTYPE="ppc" ;;
48d848c7
PMF
42 ppc) ARCHTYPE="ppc" ;;
43 s390) ARCHTYPE="s390" ;;
44 s390x) ARCHTYPE="s390" ;;
45 *) ARCHTYPE="unknown";;
46esac
47
48if test "$ARCHTYPE" = "unknown"; then
49 AC_MSG_ERROR([Unable to detect the architecture.])
50fi
51AC_SUBST(ARCHTYPE)
7d413817 52AC_SUBST(SUBARCHTYPE)
48d848c7 53
90586875 54[
79da867e 55if test "x$ARCHTYPE" = "xx86" -a "x$target_cpu" != "xi386" -a "x$target_cpu" != "xi486" -a "x$target_cpu" != "xi586"; then
90586875 56]
49617de1 57 AC_DEFINE([CONFIG_URCU_HAVE_FENCE], [1])
90586875
MD
58[
59fi
60]
61
49617de1 62AC_MSG_CHECKING([sys_futex()])
0854ccff
MD
63AC_TRY_COMPILE(
64[
65#include <sys/syscall.h>
66],
67[
68#ifndef __NR_futex
69#error "futexes not available"
70#endif
71],
72[
73 AC_MSG_RESULT([yes])
49617de1 74 AC_DEFINE([CONFIG_URCU_HAVE_FUTEX], [1])
0854ccff
MD
75 compat_futex_test=0
76]
77,
78[
79 AC_MSG_RESULT([no])
80 compat_futex_test=1
81]
82)
83
84AM_CONDITIONAL([COMPAT_FUTEX], [ test "x$compat_futex_test" = "x1" ])
85
40646e1e 86AM_CONDITIONAL([GCC_API], [test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc])
48d848c7 87
0854ccff 88AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" = xx86compat ])
7d413817
MD
89
90AC_ARG_ENABLE([smp-support], [ --disable-smp-support Disable SMP support. Warning: only use this
91 on uniprocessor systems. [[default=enabled]]], [def_smp_support=$enableval], [def_smp_support="yes"])
92
93[
94if test "$def_smp_support" = "no"; then
95 echo "SMP support disabled."
96else
97]
49617de1 98 AC_DEFINE([CONFIG_URCU_SMP], [1])
7d413817
MD
99[
100 echo "SMP support enabled."
101fi
102]
48d848c7
PMF
103
104AC_CONFIG_FILES([
105 Makefile
106 tests/Makefile
107])
108AC_OUTPUT
This page took 0.036846 seconds and 4 git commands to generate.