2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([userspace-rcu], [0.2.4], [mathieu dot desnoyers at polymtl dot ca])
6 AC_CONFIG_AUX_DIR([config])
9 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
10 AC_CONFIG_SRCDIR([urcu.h])
13 AC_CONFIG_HEADERS([config.h urcu/config.h])
15 # Keep at the end to do not pollute installed header.
16 AH_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.])
17 AH_TEMPLATE([CONFIG_URCU_HAVE_FENCE], [Defined when on a system that has memory fence instructions.])
18 AH_TEMPLATE([CONFIG_URCU_HAVE_FUTEX], [Defined when on a system with futex support.])
19 AH_TEMPLATE([CONFIG_URCU_COMPAT_ARCH], [Compatibility mode for i386 which lacks
20 cmpxchg instruction.])
22 # Checks for programs.
27 # Checks for typedefs, structures, and compiler characteristics.
32 # Checks for library functions.
35 AC_CHECK_FUNCS([bzero gettimeofday munmap strtoul])
39 i386) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
40 i486) ARCHTYPE="x86";;
41 i586) ARCHTYPE="x86";;
42 i686) ARCHTYPE="x86";;
43 x86_64) ARCHTYPE="x86";;
44 powerpc) ARCHTYPE="ppc" ;;
45 ppc64) ARCHTYPE="ppc" ;;
46 powerpc64) ARCHTYPE="ppc" ;;
47 ppc) ARCHTYPE="ppc" ;;
48 s390) ARCHTYPE="s390" ;;
49 s390x) ARCHTYPE="s390" ;;
50 sparc) ARCHTYPE="sparc" ;;
51 *) ARCHTYPE="unknown";;
54 if test "$ARCHTYPE" = "unknown"; then
55 AC_MSG_ERROR([Unable to detect the architecture.])
61 #if test "x$ARCHTYPE" = "xx86" -a "x$target_cpu" != "xi386" -a "x$target_cpu" != "xi486" -a "x$target_cpu" != "xi586"; then
62 #For now, using lock; addl compatibility mode even for i686, because the
63 #Pentium III is seen as a i686, but lacks mfence instruction.
64 #Only using fence for x86_64.
65 if test "x$ARCHTYPE" = "xx86" -a "x$target_cpu" != "xi386" -a "x$target_cpu" != "xi486" -a "x$target_cpu" != "xi586" -a "x$target_cpu" != "xi686"; then
67 AC_DEFINE([CONFIG_URCU_HAVE_FENCE], [1])
72 AC_MSG_CHECKING([sys_futex()])
75 #include <sys/syscall.h>
79 #error "futexes not available"
84 AC_DEFINE([CONFIG_URCU_HAVE_FUTEX], [1])
94 AM_CONDITIONAL([COMPAT_FUTEX], [ test "x$compat_futex_test" = "x1" ])
96 AM_CONDITIONAL([GCC_API], [test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc])
98 AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" = xx86compat ])
101 if test "x$SUBARCHTYPE" = xx86compat; then
103 AC_DEFINE([CONFIG_URCU_COMPAT_ARCH], [1])
108 AC_ARG_ENABLE([smp-support], [ --disable-smp-support Disable SMP support. Warning: only use this
109 on uniprocessor systems. [[default=enabled]]], [def_smp_support=$enableval], [def_smp_support="yes"])
112 if test "$def_smp_support" = "no"; then
113 echo "SMP support disabled."
116 AC_DEFINE([CONFIG_URCU_SMP], [1])
118 echo "SMP support enabled."