move config.h to urcu/config.h and install it
[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
MD
11
12AH_TEMPLATE([CONFIG_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.])
90586875
MD
13AH_TEMPLATE([CONFIG_HAVE_FENCE], [Defined when on a system that has memory fence
14instructions.])
0854ccff 15AH_TEMPLATE([CONFIG_HAVE_FUTEX], [Defined when on a system with futex support.])
c96a3726 16AC_CONFIG_HEADERS([urcu/config.h])
48d848c7
PMF
17
18# Checks for programs.
19AC_PROG_CC
20AC_PROG_MAKE_SET
21AC_PROG_LIBTOOL
22
23# Checks for typedefs, structures, and compiler characteristics.
24AC_C_INLINE
25AC_TYPE_PID_T
26AC_TYPE_SIZE_T
27
28# Checks for library functions.
29AC_FUNC_MALLOC
30AC_FUNC_MMAP
31AC_CHECK_FUNCS([bzero gettimeofday munmap strtoul])
32
33# Find arch type
7d413817
MD
34case $target_cpu in
35 i386) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
36 i486) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
37 i586) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
38 i686) ARCHTYPE="x86"; SUBARCHTYPE="x86compat" ;;
48d848c7 39 x86_64) ARCHTYPE="x86";;
48d848c7
PMF
40 powerpc) ARCHTYPE="ppc" ;;
41 ppc64) ARCHTYPE="ppc" ;;
7d413817 42 powerpc64) ARCHTYPE="ppc" ;;
48d848c7
PMF
43 ppc) ARCHTYPE="ppc" ;;
44 s390) ARCHTYPE="s390" ;;
45 s390x) ARCHTYPE="s390" ;;
46 *) ARCHTYPE="unknown";;
47esac
48
49if test "$ARCHTYPE" = "unknown"; then
50 AC_MSG_ERROR([Unable to detect the architecture.])
51fi
52AC_SUBST(ARCHTYPE)
7d413817 53AC_SUBST(SUBARCHTYPE)
48d848c7 54
90586875 55[
79da867e 56if test "x$ARCHTYPE" = "xx86" -a "x$target_cpu" != "xi386" -a "x$target_cpu" != "xi486" -a "x$target_cpu" != "xi586"; then
90586875
MD
57]
58 AC_DEFINE([CONFIG_HAVE_FENCE], [1])
59[
60fi
61]
62
0854ccff
MD
63AC_MSG_CHECKING([presence of sys_futex()])
64AC_TRY_COMPILE(
65[
66#include <sys/syscall.h>
67],
68[
69#ifndef __NR_futex
70#error "futexes not available"
71#endif
72],
73[
74 AC_MSG_RESULT([yes])
75 AC_DEFINE([CONFIG_HAVE_FUTEX], [1])
76 compat_futex_test=0
77]
78,
79[
80 AC_MSG_RESULT([no])
81 compat_futex_test=1
82]
83)
84
85AM_CONDITIONAL([COMPAT_FUTEX], [ test "x$compat_futex_test" = "x1" ])
86
40646e1e 87AM_CONDITIONAL([GCC_API], [test "x$ARCHTYPE" != xx86 -a "x$ARCHTYPE" != xppc])
48d848c7 88
0854ccff 89AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" = xx86compat ])
7d413817
MD
90
91AC_ARG_ENABLE([smp-support], [ --disable-smp-support Disable SMP support. Warning: only use this
92 on uniprocessor systems. [[default=enabled]]], [def_smp_support=$enableval], [def_smp_support="yes"])
93
94[
95if test "$def_smp_support" = "no"; then
96 echo "SMP support disabled."
97else
98]
99 AC_DEFINE([CONFIG_SMP], [1])
100[
101 echo "SMP support enabled."
102fi
103]
48d848c7
PMF
104
105AC_CONFIG_FILES([
106 Makefile
107 tests/Makefile
108])
109AC_OUTPUT
This page took 0.03656 seconds and 4 git commands to generate.