Cleanup: remove redundant assignment
[lttng-tools.git] / configure.ac
CommitLineData
8991668e 1AC_INIT([lttng-tools],[2.2.0],[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
500c2393
DG
9version_name="Cuda"
10version_description="Brewed at the Benelux microbrewery, this IPA has huge floral, citric and resinous hop aroma, simply an amazing nose. The flavor is very fresh with a light caramel malting touch completing a strong body. Huge amounts of hops, lots of grapefruit, lemon and oranges. This is an outstanding IPA!"
0e4cbe7e
DG
11
12AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "")
13AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], "")
c6d4a597 14
3bd1e081
MD
15AC_CONFIG_HEADERS([include/config.h])
16
6bd5984c
CB
17AC_PROG_GREP
18# libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321.
19AC_ARG_ENABLE(libtool-linkdep-fixup,
20 AS_HELP_STRING([--disable-libtool-linkdep-fixup],
21 [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]),
22 libtool_fixup=$enableval,
23 libtool_fixup=yes)
24
25AS_IF([test "x$libtool_fixup" = "xyes"],
26 [
27 libtool_m4="$srcdir/config/libtool.m4"
28 libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)"
29 AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4])
30 libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4)
31 AS_IF([test $libtool_flag_pattern_count -ne 0],
32 [
33 AC_MSG_RESULT([$libtool_flag_pattern_count])
34 AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown])
35 sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4
36 ],
37 [
38 AC_MSG_RESULT([none])
39 ])
40 ])
41
347e0f14
CB
42AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
43
fac6795d
DG
44AC_CHECK_HEADERS([ \
45 sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \
46 signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
47 getopt.h sys/ipc.h sys/shm.h popt.h grp.h \
48])
49
0c95f5b2
DG
50# Babeltrace viewer check
51AC_ARG_WITH([babeltrace-bin],
52 AS_HELP_STRING([--with-babeltrace-bin],
53 [Location of the babeltrace viewer executable (including the filename)]),
54 [BABELTRACE_BIN="$withval"],
55 [BABELTRACE_BIN=''])
56AC_SUBST([BABELTRACE_BIN])
57
58# lttv-gui
59AC_ARG_WITH([lttv-gui-bin],
60 AS_HELP_STRING([--with-lttv-gui-bin],
61 [Location of the lttv GUI viewer executable (including the filename)]),
62 [LTTV_GUI_BIN="$withval"],
63 [LTTV_GUI_BIN=''])
64AC_SUBST([LTTV_GUI_BIN])
65
fc7a59ce
AM
66AC_ARG_WITH([consumerd32-bin],
67 AS_HELP_STRING([--with-consumerd32-bin],
68 [Location of the 32-bit consumerd executable (including the filename)]),
69 [CONSUMERD32_BIN="$withval"],
70 [CONSUMERD32_BIN=''])
71AC_SUBST([CONSUMERD32_BIN])
ebaeda94 72
fc7a59ce
AM
73AC_ARG_WITH([consumerd64-bin],
74 AS_HELP_STRING([--with-consumerd64-bin],
75 [Location of the 64-bit consumerd executable (including the filename)]),
76 [CONSUMERD64_BIN="$withval"],
77 [CONSUMERD64_BIN=''])
78AC_SUBST([CONSUMERD64_BIN])
ebaeda94
MD
79
80AC_ARG_WITH([consumerd32-libdir],
a4b279ba 81 AS_HELP_STRING([--with-consumerd32-libdir],
fc7a59ce 82 [Directory containing the 32-bit consumerd libraries]),
ebaeda94
MD
83 [CONSUMERD32_LIBDIR="$withval"],
84 [CONSUMERD32_LIBDIR=''])
85AC_SUBST([CONSUMERD32_LIBDIR])
86
ec029701 87AC_ARG_WITH([consumerd64-libdir],
a4b279ba 88 AS_HELP_STRING([--with-consumerd64-libdir],
fc7a59ce 89 [Directory containing the 64-bit consumerd libraries]),
ebaeda94
MD
90 [CONSUMERD64_LIBDIR="$withval"],
91 [CONSUMERD64_LIBDIR=''])
92AC_SUBST([CONSUMERD64_LIBDIR])
93
b8ec3da8
SM
94AC_ARG_WITH([sessiond-bin],
95 AS_HELP_STRING([--with-sessiond-bin],
96 [Location of the sessiond executable (including the filename)]),
97 [SESSIOND_BIN="$withval"],
98 [SESSIOND_BIN=''])
99AC_SUBST([SESSIOND_BIN])
100
fb6f1fa2
YB
101AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
102AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
103AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
104AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
0c95f5b2
DG
105AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
106AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
b8ec3da8 107AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.])
43cadc7e 108
fac6795d
DG
109# Check for pthread
110AC_CHECK_LIB([pthread], [pthread_create], [],
111 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
112)
113
114# Check libpopt
115AC_CHECK_LIB([popt], [poptGetContext], [],
116 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
117)
118
ffe60014
DG
119# Check for libuuid
120AC_CHECK_LIB([uuid], [uuid_generate],
121[
122 AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBUUID], 1, [Has libuuid support.])
123 have_libuuid=yes
124],
125[
126 # libuuid not found, check for uuid_create in libc.
127 AC_CHECK_LIB([c], [uuid_create],
128 [
129 AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
130 have_libc_uuid=yes
131 ],
132 [
133 AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.])
134 ])
135]
136)
137AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
138AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
139
6e59ae26 140# URCU library version needed or newer
d086eb77 141liburcu_version=">= 0.7.2"
6e59ae26 142
3ffccaed 143# Check liburcu needed function calls
fac6795d 144AC_CHECK_DECL([cds_list_add], [],
8e12081b 145 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
fac6795d 146)
099e26bd 147AC_CHECK_DECL([cds_wfq_init], [],
8e12081b
DG
148 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
149)
487cf67c
DG
150AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
151 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
152)
8e12081b
DG
153AC_CHECK_DECL([futex_async], [],
154 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
099e26bd 155)
3ffccaed
DG
156AC_CHECK_DECL([rcu_thread_offline], [],
157 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
158)
159AC_CHECK_DECL([rcu_thread_online], [],
160 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
161)
6e59ae26
DG
162AC_CHECK_DECL([caa_likely], [],
163 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
164)
e6b66098
YB
165#Function added in urcu 0.7.0
166AC_CHECK_DECL([cmm_smp_mb__before_uatomic_or], [],
167 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
168)
6e59ae26 169
b91dd016
SS
170AC_ARG_WITH(lttng-ust-prefix,
171 AS_HELP_STRING([--with-lttng-ust-prefix=PATH],
172 [Specify the installation prefix of the lttng-ust library.
173 Headers must be in PATH/include; libraries in PATH/lib.]),
174 [
175 CPPFLAGS="$CPPFLAGS -I${withval}/include"
176 LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib"
177 ])
178
74d0b642
MD
179# Check liblttng-ust-ctl library
180AC_ARG_ENABLE(lttng-ust,
6299f964 181 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
0e636c80 182 lttng_ust_support=$enableval, lttng_ust_support=yes)
74d0b642 183
6299f964 184AS_IF([test "x$lttng_ust_support" = "xyes"], [
b33f11e2 185 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_recv_channel_from_consumer],
082d0908
CB
186 [
187 AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support])
188 lttng_ust_ctl_found=yes
189 ],
b33f11e2 190 [AC_MSG_ERROR([Cannot find LTTng-UST >= 2.2.x. Use --with-lttng-ust-prefix=PREFIX to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])],
b827d67e 191 [-lurcu-common -lurcu-bp -lurcu-cds -lrt]
74d0b642 192 )
6299f964 193])
082d0908 194AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
281047b8 195AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
f6a9efaa 196
6816a5cb
MD
197# check for dlopen
198AC_CHECK_LIB([dl], [dlopen],
199[
200 have_libdl=yes
201],
202[
203 #libdl not found, check for dlopen in libc.
204 AC_CHECK_LIB([c], [dlopen],
205 [
206 have_libc_dl=yes
207 ],
208 [
209 AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
210 ])
211])
212AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
213AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
214
53a80697
MD
215# Check for fmemopen
216AC_CHECK_LIB([c], [fmemopen],
217[
218 AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.])
219]
220)
221
222# Check for open_memstream
223AC_CHECK_LIB([c], [open_memstream],
224[
225 AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])
226]
227)
228
36907cb5
DS
229# For Python
230# SWIG version needed or newer:
231swig_version=2.0.0
232
233AC_ARG_ENABLE([python-bindings],
234 [AC_HELP_STRING([--enable-python-bindings],
235 [compile Python bindings])],
236 [enable_python=yes], [enable_python=no])
237
238AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes])
239
240if test "x${enable_python:-yes}" = xyes; then
241 AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
242 AM_PATH_PYTHON
243
244 AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
245 AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
246 AS_IF([test -z "$PYTHON_INCLUDE"], [
247 AS_IF([test -z "$PYTHON_CONFIG"], [
248 AC_PATH_PROGS([PYTHON_CONFIG],
249 [python$PYTHON_VERSION-config python-config],
250 [no],
251 [`dirname $PYTHON`])
252 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
253 ])
254 AC_MSG_CHECKING([python include flags])
255 PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
256 AC_MSG_RESULT([$PYTHON_INCLUDE])
257 ])
258
259else
260 AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl
261[if you want Python bindings.])
262
263fi
264
55bed213
AM
265# Option to only build the consumer daemon and its libraries
266AC_ARG_WITH([consumerd-only],
267 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
268 [consumerd_only=$withval],
269 [consumerd_only=no])
270AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
271
3ffccaed 272# Epoll check. If not present, the build will fallback on poll() API
71615260
DG
273AX_HAVE_EPOLL(
274 [AX_CONFIG_FEATURE_ENABLE(epoll)],
275 [AX_CONFIG_FEATURE_DISABLE(epoll)]
276)
71615260
DG
277AX_CONFIG_FEATURE(
278 [epoll], [This platform supports epoll(7)],
279 [HAVE_EPOLL], [This platform supports epoll(7).],
280 [enable_epoll="yes"], [enable_epoll="no"]
281)
71615260
DG
282AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
283
c72b7d96 284AC_SYS_LARGEFILE
fac6795d 285AC_PROG_CC
3889a2d6 286LT_INIT
953192ba
MD
287AC_PROG_YACC
288AC_PROG_LEX
289
290AC_DEFUN([AC_PROG_BISON], [AC_CHECK_PROGS(BISON, bison, bison)])
fac6795d 291
6e2d116c
DG
292CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
293
c72b7d96 294DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h"
6e2d116c
DG
295
296lttngincludedir="${includedir}/lttng"
297
298AC_SUBST(lttngincludedir)
299AC_SUBST(DEFAULT_INCLUDES)
300
386418ba
MD
301lttnglibexecdir="${libdir}/lttng/libexec"
302AC_SUBST(lttnglibexecdir)
303
fac6795d
DG
304AC_CONFIG_FILES([
305 Makefile
10a8a223 306 doc/Makefile
6991b181 307 doc/man/Makefile
fac6795d 308 include/Makefile
36907cb5
DS
309 extras/Makefile
310 extras/bindings/Makefile
311 extras/bindings/swig/Makefile
312 extras/bindings/swig/python/Makefile
10a8a223
DG
313 src/Makefile
314 src/common/Makefile
315 src/common/kernel-ctl/Makefile
316 src/common/kernel-consumer/Makefile
317 src/common/ust-consumer/Makefile
318 src/common/hashtable/Makefile
319 src/common/sessiond-comm/Makefile
d31efcff 320 src/common/compat/Makefile
00e2e675 321 src/common/relayd/Makefile
6242251b 322 src/common/testpoint/Makefile
10a8a223
DG
323 src/lib/Makefile
324 src/lib/lttng-ctl/Makefile
d00c599e 325 src/lib/lttng-ctl/filter/Makefile
2c452d45 326 src/lib/lttng-ctl/lttng-ctl.pc
10a8a223
DG
327 src/bin/Makefile
328 src/bin/lttng-consumerd/Makefile
329 src/bin/lttng-sessiond/Makefile
b8aa1682 330 src/bin/lttng-relayd/Makefile
10a8a223 331 src/bin/lttng/Makefile
fac6795d 332 tests/Makefile
9ac429ef
CB
333 tests/regression/Makefile
334 tests/regression/kernel/Makefile
335 tests/regression/tools/Makefile
336 tests/regression/tools/streaming/Makefile
337 tests/regression/tools/filtering/Makefile
338 tests/regression/tools/health/Makefile
d946d662 339 tests/regression/tools/tracefile-limits/Makefile
07b86b52 340 tests/regression/tools/snapshots/Makefile
9ac429ef
CB
341 tests/regression/ust/Makefile
342 tests/regression/ust/nprocesses/Makefile
343 tests/regression/ust/high-throughput/Makefile
344 tests/regression/ust/low-throughput/Makefile
345 tests/regression/ust/before-after/Makefile
7972aab2 346 tests/regression/ust/buffers-uid/Makefile
a788a3ed 347 tests/regression/ust/periodical-metadata-flush/Makefile
9ac429ef
CB
348 tests/regression/ust/multi-session/Makefile
349 tests/regression/ust/overlap/Makefile
350 tests/regression/ust/overlap/demo/Makefile
91c75285 351 tests/regression/ust/linking/Makefile
43c28d50 352 tests/regression/ust/daemon/Makefile
ee28adfb 353 tests/regression/ust/exit-fast/Makefile
37bd6c8e 354 tests/regression/ust/fork/Makefile
5836cdc2 355 tests/regression/ust/libc-wrapper/Makefile
605ac758 356 tests/stress/Makefile
81d029da 357 tests/unit/Makefile
86a96e6c
CB
358 tests/utils/Makefile
359 tests/utils/tap/Makefile
7e0cc23b
CB
360 tests/utils/testapp/Makefile
361 tests/utils/testapp/gen-ust-events/Makefile
fac6795d
DG
362])
363
364AC_OUTPUT
6299f964 365
994dd8a4 366#
6299f964 367# Mini-report on what will be built
994dd8a4
AM
368#
369AS_ECHO()
370
0e4cbe7e
DG
371AS_ECHO("Version name: $version_name")
372AS_ECHO("$version_description")
373
374AS_ECHO()
375
994dd8a4 376# Target architecture we're building for
2d90c6c8 377target_arch=$host_cpu
994dd8a4
AM
378[
379for f in $CFLAGS; do
380 if test $f = "-m32"; then
381 target_arch="32-bit"
382 elif test $f = "-m64"; then
383 target_arch="64-bit"
384 fi
385done
386]
387AS_ECHO_N("Target architecture: ")
388AS_ECHO($target_arch)
389
390# LTTng-UST enabled/disabled
6299f964 391AS_ECHO_N("Lttng-UST support: ")
994dd8a4
AM
392AS_IF([test "x$lttng_ust_support" = "xyes"],[
393 AS_ECHO("Enabled")
394],[
395 AS_ECHO("Disabled")
396])
55bed213 397
36907cb5
DS
398#Python binding enabled/disabled
399AS_ECHO_N("Python binding: ")
400AS_IF([test "x${enable_python:-yes}" = xyes], [
401 AS_ECHO("Enabled")
402],[
403 AS_ECHO("Disabled")
404])
405
994dd8a4
AM
406# Do we build only the consumerd, or everything
407AS_IF([test "x$consumerd_only" = "xyes"],[
408 AS_ECHO("Only the consumerd daemon will be built.")
409],[
410 AS_ECHO("All binaries will be built.")
411])
412
5fb528f1
AM
413# Print the bindir and libdir this `make install' will install into.
414AS_ECHO()
415AS_ECHO_N("Binaries will be installed in: ")
416AS_ECHO("`eval eval echo $bindir`")
417AS_ECHO_N("Libraries will be installed in: ")
418AS_ECHO("`eval eval echo $libdir`")
419
994dd8a4
AM
420# If we build the sessiond, print the paths it will use
421AS_IF([test "x$consumerd_only" = "xno"],[
b8ec3da8
SM
422 AS_ECHO()
423 AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ")
424 AS_IF([test "$SESSIOND_BIN" = ""],[
425 AS_ECHO_N("`eval eval echo $bindir`")
426 AS_ECHO("/lttng-sessiond")
427 ],[
428 AS_ECHO("$SESSIOND_BIN")
429 ])
430
994dd8a4
AM
431 AS_ECHO()
432 AS_ECHO("The sessiond daemon will look in the following directories: ")
433 AS_ECHO_N("32-bit consumerd executable at: ")
434 AS_IF([test "$CONSUMERD32_BIN" = ""],[
386418ba 435 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
994dd8a4
AM
436 AS_ECHO("/lttng-consumerd")
437 ],[
438 AS_ECHO("$CONSUMERD32_BIN")
439 ])
440
441 AS_ECHO_N("32-bit consumer libraries in: ")
442 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
443 AS_ECHO("`eval eval echo $libdir`")
444 ],[
445 AS_ECHO("$CONSUMERD32_LIBDIR")
446 ])
447
448 AS_ECHO_N("64-bit consumerd executable at: ")
449 AS_IF([test "$CONSUMERD64_BIN" = ""],[
386418ba 450 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
994dd8a4
AM
451 AS_ECHO("/lttng-consumerd")
452 ],[
453 AS_ECHO("$CONSUMERD64_BIN")
454 ])
455
456 AS_ECHO_N("64-bit consumer libraries in: ")
457 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
458 AS_ECHO("`eval eval echo $libdir`")
459 ],[
460 AS_ECHO("$CONSUMERD64_LIBDIR")
461 ])
462])
6299f964 463
994dd8a4 464AS_ECHO()
6299f964 465
This page took 0.051458 seconds and 4 git commands to generate.