Merge branch 'master' into benchmark
[lttng-tools.git] / configure.ac
1 AC_INIT([lttng-tools],[2.0-pre14],[david.goulet@polymtl.ca],[],[http://lttng.org])
2 AC_CONFIG_AUX_DIR([config])
3 AC_CANONICAL_TARGET
4 AC_CANONICAL_HOST
5 AC_CONFIG_MACRO_DIR([config])
6 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9 AC_CONFIG_HEADERS([include/config.h])
10
11 AC_CHECK_HEADERS([ \
12 sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \
13 signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
14 getopt.h sys/ipc.h sys/shm.h popt.h grp.h \
15 ])
16
17 AC_ARG_WITH([consumerd32-bin],
18 AS_HELP_STRING([--with-consumerd32-bin],
19 [Location of the 32-bit consumerd executable (including the filename)]),
20 [CONSUMERD32_BIN="$withval"],
21 [CONSUMERD32_BIN=''])
22 AC_SUBST([CONSUMERD32_BIN])
23
24 AC_ARG_WITH([consumerd64-bin],
25 AS_HELP_STRING([--with-consumerd64-bin],
26 [Location of the 64-bit consumerd executable (including the filename)]),
27 [CONSUMERD64_BIN="$withval"],
28 [CONSUMERD64_BIN=''])
29 AC_SUBST([CONSUMERD64_BIN])
30
31 AC_ARG_WITH([consumerd32-libdir],
32 AS_HELP_STRING([--with-consumerd32-libdir],
33 [Directory containing the 32-bit consumerd libraries]),
34 [CONSUMERD32_LIBDIR="$withval"],
35 [CONSUMERD32_LIBDIR=''])
36 AC_SUBST([CONSUMERD32_LIBDIR])
37
38 AC_ARG_WITH([consumer64d-libdir],
39 AS_HELP_STRING([--with-consumerd64-libdir],
40 [Directory containing the 64-bit consumerd libraries]),
41 [CONSUMERD64_LIBDIR="$withval"],
42 [CONSUMERD64_LIBDIR=''])
43 AC_SUBST([CONSUMERD64_LIBDIR])
44
45 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], $CONSUMERD32_BIN, [Location of the 32-bit consumerd executable.])
46 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], $CONSUMERD64_BIN, [Location of the 64-bit consumerd executable])
47 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], $CONSUMERD32_LIBDIR, [Search for consumerd 32-bit libraries in this location.])
48 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], $CONSUMERD64_LIBDIR, [Search for consumerd 64-bit libraries in this location.])
49
50 # Check for pthread
51 AC_CHECK_LIB([pthread], [pthread_create], [],
52 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
53 )
54
55 # Check libpopt
56 AC_CHECK_LIB([popt], [poptGetContext], [],
57 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
58 )
59
60 # Needed for benchmark time
61 AC_CHECK_DECL([caa_get_cycles], [],
62 [AC_MSG_ERROR([liburcu liburcu_version or newer is needed])], [[#include <urcu/arch.h>]]
63 )
64
65 # URCU library version needed or newer
66 liburcu_version=">= 0.6.6"
67
68 # Check liburcu needed function calls
69 AC_CHECK_DECL([cds_list_add], [],
70 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
71 )
72 AC_CHECK_DECL([cds_wfq_init], [],
73 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
74 )
75 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
76 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
77 )
78 AC_CHECK_DECL([futex_async], [],
79 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
80 )
81 AC_CHECK_DECL([rcu_thread_offline], [],
82 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
83 )
84 AC_CHECK_DECL([rcu_thread_online], [],
85 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
86 )
87 AC_CHECK_DECL([caa_likely], [],
88 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
89 )
90
91 # Check liblttng-ust-ctl library
92 AC_ARG_ENABLE(lttng-ust,
93 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
94 lttng_ust_support=$enableval, lttng_ust_support=yes)
95
96 AS_IF([test "x$lttng_ust_support" = "xyes"], [
97 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
98 [AC_MSG_ERROR([Cannot find LTTng-UST. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])]
99 )
100 ])
101
102 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
103
104 AC_CHECK_FUNCS([sched_getcpu sysconf])
105
106 # Option to only build the consumer daemon and its libraries
107 AC_ARG_WITH([consumerd-only],
108 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
109 [consumerd_only=$withval],
110 [consumerd_only=no])
111 AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
112
113 # Epoll check. If not present, the build will fallback on poll() API
114 AX_HAVE_EPOLL(
115 [AX_CONFIG_FEATURE_ENABLE(epoll)],
116 [AX_CONFIG_FEATURE_DISABLE(epoll)]
117 )
118 AX_CONFIG_FEATURE(
119 [epoll], [This platform supports epoll(7)],
120 [HAVE_EPOLL], [This platform supports epoll(7).],
121 [enable_epoll="yes"], [enable_epoll="no"]
122 )
123 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
124
125 AC_PROG_CC
126 LT_INIT
127
128 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
129
130 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir)"
131
132 lttngincludedir="${includedir}/lttng"
133
134 AC_SUBST(lttngincludedir)
135 AC_SUBST(DEFAULT_INCLUDES)
136
137 AC_CONFIG_FILES([
138 Makefile
139 include/Makefile
140 benchmark/Makefile
141 libkernelctl/Makefile
142 liblttng-consumer/Makefile
143 liblttng-kconsumer/Makefile
144 liblttng-ustconsumer/Makefile
145 liblttngctl/Makefile
146 liblttng-sessiond-comm/Makefile
147 lttng-consumerd/Makefile
148 lttng-sessiond/Makefile
149 lttng/Makefile
150 tests/Makefile
151 doc/Makefile
152 ])
153
154 AC_OUTPUT
155
156 # Mini-report on what will be built
157 AS_ECHO("")
158
159 AS_ECHO_N("Lttng-UST support: ")
160 AS_IF([test "x$lttng_ust_support" = "xyes"], [AS_ECHO("Enabled")],
161 [AS_ECHO("Disabled")]
162 )
163
164 AS_IF([test "x$consumerd_only" = "xyes"],
165 [AS_ECHO("Only the consumerd daemon will be built.")],
166 [AS_ECHO("All binaries will be built.")]
167 )
168
169 AS_ECHO("")
170
This page took 0.033851 seconds and 5 git commands to generate.