Update version to 2.0-pre19
[lttng-tools.git] / configure.ac
CommitLineData
87db5b86 1AC_INIT([lttng-tools],[2.0-pre19],[dgoulet@efficios.com],[],[http://lttng.org])
fac6795d 2AC_CONFIG_AUX_DIR([config])
6e2d116c
DG
3AC_CANONICAL_TARGET
4AC_CANONICAL_HOST
fac6795d 5AC_CONFIG_MACRO_DIR([config])
0403d7c9 6AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
c615ee2f 7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
fac6795d 8
3bd1e081
MD
9AC_CONFIG_HEADERS([include/config.h])
10
fac6795d
DG
11AC_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
fc7a59ce
AM
17AC_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=''])
22AC_SUBST([CONSUMERD32_BIN])
ebaeda94 23
fc7a59ce
AM
24AC_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=''])
29AC_SUBST([CONSUMERD64_BIN])
ebaeda94
MD
30
31AC_ARG_WITH([consumerd32-libdir],
a4b279ba 32 AS_HELP_STRING([--with-consumerd32-libdir],
fc7a59ce 33 [Directory containing the 32-bit consumerd libraries]),
ebaeda94
MD
34 [CONSUMERD32_LIBDIR="$withval"],
35 [CONSUMERD32_LIBDIR=''])
36AC_SUBST([CONSUMERD32_LIBDIR])
37
38AC_ARG_WITH([consumer64d-libdir],
a4b279ba 39 AS_HELP_STRING([--with-consumerd64-libdir],
fc7a59ce 40 [Directory containing the 64-bit consumerd libraries]),
ebaeda94
MD
41 [CONSUMERD64_LIBDIR="$withval"],
42 [CONSUMERD64_LIBDIR=''])
43AC_SUBST([CONSUMERD64_LIBDIR])
44
fb6f1fa2
YB
45AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
46AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
47AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
48AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
43cadc7e 49
fac6795d
DG
50# Check for pthread
51AC_CHECK_LIB([pthread], [pthread_create], [],
52 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
53)
54
55# Check libpopt
56AC_CHECK_LIB([popt], [poptGetContext], [],
57 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
58)
59
6e59ae26 60# URCU library version needed or newer
08a2aa63 61liburcu_version=">= 0.6.7"
6e59ae26 62
3ffccaed 63# Check liburcu needed function calls
fac6795d 64AC_CHECK_DECL([cds_list_add], [],
8e12081b 65 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
fac6795d 66)
099e26bd 67AC_CHECK_DECL([cds_wfq_init], [],
8e12081b
DG
68 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
69)
487cf67c
DG
70AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
71 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
72)
8e12081b
DG
73AC_CHECK_DECL([futex_async], [],
74 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
099e26bd 75)
3ffccaed
DG
76AC_CHECK_DECL([rcu_thread_offline], [],
77 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
78)
79AC_CHECK_DECL([rcu_thread_online], [],
80 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
81)
6e59ae26
DG
82AC_CHECK_DECL([caa_likely], [],
83 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
84)
85
74d0b642
MD
86# Check liblttng-ust-ctl library
87AC_ARG_ENABLE(lttng-ust,
6299f964 88 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
0e636c80 89 lttng_ust_support=$enableval, lttng_ust_support=yes)
74d0b642 90
6299f964 91AS_IF([test "x$lttng_ust_support" = "xyes"], [
74d0b642
MD
92 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
93 [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.])]
94 )
6299f964 95])
74d0b642
MD
96
97AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
099e26bd 98
f6a9efaa
DG
99AC_CHECK_FUNCS([sched_getcpu sysconf])
100
55bed213
AM
101# Option to only build the consumer daemon and its libraries
102AC_ARG_WITH([consumerd-only],
103 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
104 [consumerd_only=$withval],
105 [consumerd_only=no])
106AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
107
3ffccaed 108# Epoll check. If not present, the build will fallback on poll() API
71615260
DG
109AX_HAVE_EPOLL(
110 [AX_CONFIG_FEATURE_ENABLE(epoll)],
111 [AX_CONFIG_FEATURE_DISABLE(epoll)]
112)
71615260
DG
113AX_CONFIG_FEATURE(
114 [epoll], [This platform supports epoll(7)],
115 [HAVE_EPOLL], [This platform supports epoll(7).],
116 [enable_epoll="yes"], [enable_epoll="no"]
117)
71615260
DG
118AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
119
fac6795d 120AC_PROG_CC
3889a2d6 121LT_INIT
fac6795d 122
6e2d116c
DG
123CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
124
10a8a223 125DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include"
6e2d116c
DG
126
127lttngincludedir="${includedir}/lttng"
128
129AC_SUBST(lttngincludedir)
130AC_SUBST(DEFAULT_INCLUDES)
131
fac6795d
DG
132AC_CONFIG_FILES([
133 Makefile
10a8a223 134 doc/Makefile
fac6795d 135 include/Makefile
10a8a223
DG
136 src/Makefile
137 src/common/Makefile
138 src/common/kernel-ctl/Makefile
139 src/common/kernel-consumer/Makefile
140 src/common/ust-consumer/Makefile
141 src/common/hashtable/Makefile
142 src/common/sessiond-comm/Makefile
143 src/lib/Makefile
144 src/lib/lttng-ctl/Makefile
145 src/bin/Makefile
146 src/bin/lttng-consumerd/Makefile
147 src/bin/lttng-sessiond/Makefile
148 src/bin/lttng/Makefile
fac6795d 149 tests/Makefile
d3e8f6bb 150 tests/ust-nevents/Makefile
b6ca8ef5 151 tests/ust-nprocesses/Makefile
fac6795d
DG
152])
153
154AC_OUTPUT
6299f964 155
994dd8a4 156#
6299f964 157# Mini-report on what will be built
994dd8a4
AM
158#
159AS_ECHO()
160
161# Target architecture we're building for
162target_arch=$host_cpu
163[
164for f in $CFLAGS; do
165 if test $f = "-m32"; then
166 target_arch="32-bit"
167 elif test $f = "-m64"; then
168 target_arch="64-bit"
169 fi
170done
171]
172AS_ECHO_N("Target architecture: ")
173AS_ECHO($target_arch)
174
175# LTTng-UST enabled/disabled
6299f964 176AS_ECHO_N("Lttng-UST support: ")
994dd8a4
AM
177AS_IF([test "x$lttng_ust_support" = "xyes"],[
178 AS_ECHO("Enabled")
179],[
180 AS_ECHO("Disabled")
181])
55bed213 182
994dd8a4
AM
183# Do we build only the consumerd, or everything
184AS_IF([test "x$consumerd_only" = "xyes"],[
185 AS_ECHO("Only the consumerd daemon will be built.")
186],[
187 AS_ECHO("All binaries will be built.")
188])
189
5fb528f1
AM
190# Print the bindir and libdir this `make install' will install into.
191AS_ECHO()
192AS_ECHO_N("Binaries will be installed in: ")
193AS_ECHO("`eval eval echo $bindir`")
194AS_ECHO_N("Libraries will be installed in: ")
195AS_ECHO("`eval eval echo $libdir`")
196
994dd8a4
AM
197# If we build the sessiond, print the paths it will use
198AS_IF([test "x$consumerd_only" = "xno"],[
199 AS_ECHO()
200 AS_ECHO("The sessiond daemon will look in the following directories: ")
201 AS_ECHO_N("32-bit consumerd executable at: ")
202 AS_IF([test "$CONSUMERD32_BIN" = ""],[
203 AS_ECHO_N("`eval eval echo $bindir`")
204 AS_ECHO("/lttng-consumerd")
205 ],[
206 AS_ECHO("$CONSUMERD32_BIN")
207 ])
208
209 AS_ECHO_N("32-bit consumer libraries in: ")
210 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
211 AS_ECHO("`eval eval echo $libdir`")
212 ],[
213 AS_ECHO("$CONSUMERD32_LIBDIR")
214 ])
215
216 AS_ECHO_N("64-bit consumerd executable at: ")
217 AS_IF([test "$CONSUMERD64_BIN" = ""],[
218 AS_ECHO_N("`eval eval echo $bindir`")
219 AS_ECHO("/lttng-consumerd")
220 ],[
221 AS_ECHO("$CONSUMERD64_BIN")
222 ])
223
224 AS_ECHO_N("64-bit consumer libraries in: ")
225 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
226 AS_ECHO("`eval eval echo $libdir`")
227 ],[
228 AS_ECHO("$CONSUMERD64_LIBDIR")
229 ])
230])
6299f964 231
994dd8a4 232AS_ECHO()
6299f964 233
This page took 0.034983 seconds and 4 git commands to generate.