f4a3cd89424023ce98657f641602616a13e735eb
[lttng-tools.git] / configure.ac
1 AC_INIT([lttng-tools],[2.3.0-rc1],[dgoulet@efficios.com],[],[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 version_name="Dominus Vobiscum"
10 version_description="A very succulent line-up of beers brewed at Microbrasserie Charlevoix. Elaborated starting from special malts and fermented with a Belgian yeast. These beers are refermented in bottle and will make you discover the richness of wheat, amber and triple styles."
11
12 AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "")
13 AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], "")
14
15 AC_CONFIG_HEADERS([include/config.h])
16
17 AC_PROG_GREP
18 # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321.
19 AC_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
25 AS_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
42 AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
43
44 AC_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
50 # Babeltrace viewer check
51 AC_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=''])
56 AC_SUBST([BABELTRACE_BIN])
57
58 # lttv-gui
59 AC_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=''])
64 AC_SUBST([LTTV_GUI_BIN])
65
66 AC_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=''])
71 AC_SUBST([CONSUMERD32_BIN])
72
73 AC_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=''])
78 AC_SUBST([CONSUMERD64_BIN])
79
80 AC_ARG_WITH([consumerd32-libdir],
81 AS_HELP_STRING([--with-consumerd32-libdir],
82 [Directory containing the 32-bit consumerd libraries]),
83 [CONSUMERD32_LIBDIR="$withval"],
84 [CONSUMERD32_LIBDIR=''])
85 AC_SUBST([CONSUMERD32_LIBDIR])
86
87 AC_ARG_WITH([consumerd64-libdir],
88 AS_HELP_STRING([--with-consumerd64-libdir],
89 [Directory containing the 64-bit consumerd libraries]),
90 [CONSUMERD64_LIBDIR="$withval"],
91 [CONSUMERD64_LIBDIR=''])
92 AC_SUBST([CONSUMERD64_LIBDIR])
93
94 AC_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=''])
99 AC_SUBST([SESSIOND_BIN])
100
101 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
102 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
103 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
104 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
105 AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
106 AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
107 AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.])
108
109 # Check for pthread
110 AC_CHECK_LIB([pthread], [pthread_create], [],
111 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
112 )
113
114 # Check libpopt
115 AC_CHECK_LIB([popt], [poptGetContext], [],
116 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
117 )
118
119 # Check for libuuid
120 AC_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 )
137 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
138 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
139
140 # URCU library version needed or newer
141 liburcu_version=">= 0.7.2"
142
143 # Check liburcu needed function calls
144 AC_CHECK_DECL([cds_list_add], [],
145 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
146 )
147 AC_CHECK_DECL([cds_wfq_init], [],
148 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
149 )
150 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
151 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
152 )
153 AC_CHECK_DECL([futex_async], [],
154 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
155 )
156 AC_CHECK_DECL([rcu_thread_offline], [],
157 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
158 )
159 AC_CHECK_DECL([rcu_thread_online], [],
160 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
161 )
162 AC_CHECK_DECL([caa_likely], [],
163 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
164 )
165 #Function added in urcu 0.7.0
166 AC_CHECK_DECL([cmm_smp_mb__before_uatomic_or], [],
167 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
168 )
169
170 AC_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
179 # Check liblttng-ust-ctl library
180 AC_ARG_ENABLE(lttng-ust,
181 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
182 lttng_ust_support=$enableval, lttng_ust_support=yes)
183
184 AS_IF([test "x$lttng_ust_support" = "xyes"], [
185 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_recv_channel_from_consumer],
186 [
187 AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support])
188 lttng_ust_ctl_found=yes
189 ],
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.])],
191 [-lurcu-common -lurcu-bp -lurcu-cds -lrt]
192 )
193 ])
194 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
195 AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
196
197 # check for dlopen
198 AC_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 ])
212 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
213 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
214
215 # Check for fmemopen
216 AC_CHECK_LIB([c], [fmemopen],
217 [
218 AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.])
219 ]
220 )
221
222 # Check for open_memstream
223 AC_CHECK_LIB([c], [open_memstream],
224 [
225 AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])
226 ]
227 )
228
229 # For Python
230 # SWIG version needed or newer:
231 swig_version=2.0.0
232
233 AC_ARG_ENABLE([python-bindings],
234 [AC_HELP_STRING([--enable-python-bindings],
235 [compile Python bindings])],
236 [enable_python=yes], [enable_python=no])
237
238 AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes])
239
240 if 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
259 else
260 AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl
261 [if you want Python bindings.])
262
263 fi
264
265 # Option to only build the consumer daemon and its libraries
266 AC_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])
270 AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
271
272 # Epoll check. If not present, the build will fallback on poll() API
273 AX_HAVE_EPOLL(
274 [AX_CONFIG_FEATURE_ENABLE(epoll)],
275 [AX_CONFIG_FEATURE_DISABLE(epoll)]
276 )
277 AX_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 )
282 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
283
284 AC_SYS_LARGEFILE
285 AC_PROG_CC
286 LT_INIT
287 AC_PROG_YACC
288 AC_PROG_LEX
289
290 if test ! -f "$srcdir/src/lib/lttng-ctl/filter/filter-parser.h"; then
291 if test x"$YACC" != "xbison -y"; then
292 AC_MSG_ERROR([[bison not found and is required when building from git.
293 Please install bison]])
294 fi
295 fi
296
297 if test ! -f "$srcdir/src/lib/lttng-ctl/filter/filter-lexer.c"; then
298 if test x"$LEX" != "xflex"; then
299 AC_MSG_ERROR([[flex not found and is required when building from git.
300 Please install flex]])
301 fi
302 fi
303
304 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
305
306 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h"
307
308 lttngincludedir="${includedir}/lttng"
309
310 AC_SUBST(lttngincludedir)
311 AC_SUBST(DEFAULT_INCLUDES)
312
313 lttnglibexecdir="${libdir}/lttng/libexec"
314 AC_SUBST(lttnglibexecdir)
315
316 AC_CONFIG_FILES([
317 Makefile
318 doc/Makefile
319 doc/man/Makefile
320 include/Makefile
321 extras/Makefile
322 extras/bindings/Makefile
323 extras/bindings/swig/Makefile
324 extras/bindings/swig/python/Makefile
325 src/Makefile
326 src/common/Makefile
327 src/common/kernel-ctl/Makefile
328 src/common/kernel-consumer/Makefile
329 src/common/ust-consumer/Makefile
330 src/common/hashtable/Makefile
331 src/common/sessiond-comm/Makefile
332 src/common/compat/Makefile
333 src/common/relayd/Makefile
334 src/common/testpoint/Makefile
335 src/lib/Makefile
336 src/lib/lttng-ctl/Makefile
337 src/lib/lttng-ctl/filter/Makefile
338 src/lib/lttng-ctl/lttng-ctl.pc
339 src/bin/Makefile
340 src/bin/lttng-consumerd/Makefile
341 src/bin/lttng-sessiond/Makefile
342 src/bin/lttng-relayd/Makefile
343 src/bin/lttng/Makefile
344 tests/Makefile
345 tests/regression/Makefile
346 tests/regression/kernel/Makefile
347 tests/regression/tools/Makefile
348 tests/regression/tools/streaming/Makefile
349 tests/regression/tools/filtering/Makefile
350 tests/regression/tools/health/Makefile
351 tests/regression/tools/tracefile-limits/Makefile
352 tests/regression/tools/snapshots/Makefile
353 tests/regression/ust/Makefile
354 tests/regression/ust/nprocesses/Makefile
355 tests/regression/ust/high-throughput/Makefile
356 tests/regression/ust/low-throughput/Makefile
357 tests/regression/ust/before-after/Makefile
358 tests/regression/ust/buffers-uid/Makefile
359 tests/regression/ust/periodical-metadata-flush/Makefile
360 tests/regression/ust/multi-session/Makefile
361 tests/regression/ust/overlap/Makefile
362 tests/regression/ust/overlap/demo/Makefile
363 tests/regression/ust/linking/Makefile
364 tests/regression/ust/daemon/Makefile
365 tests/regression/ust/exit-fast/Makefile
366 tests/regression/ust/fork/Makefile
367 tests/regression/ust/libc-wrapper/Makefile
368 tests/stress/Makefile
369 tests/unit/Makefile
370 tests/utils/Makefile
371 tests/utils/tap/Makefile
372 tests/utils/testapp/Makefile
373 tests/utils/testapp/gen-ust-events/Makefile
374 tests/utils/testapp/gen-ust-nevents/Makefile
375 ])
376
377 AC_OUTPUT
378
379 #
380 # Mini-report on what will be built
381 #
382 AS_ECHO()
383
384 AS_ECHO("Version name: $version_name")
385 AS_ECHO("$version_description")
386
387 AS_ECHO()
388
389 # Target architecture we're building for
390 target_arch=$host_cpu
391 [
392 for f in $CFLAGS; do
393 if test $f = "-m32"; then
394 target_arch="32-bit"
395 elif test $f = "-m64"; then
396 target_arch="64-bit"
397 fi
398 done
399 ]
400 AS_ECHO_N("Target architecture: ")
401 AS_ECHO($target_arch)
402
403 # LTTng-UST enabled/disabled
404 AS_ECHO_N("Lttng-UST support: ")
405 AS_IF([test "x$lttng_ust_support" = "xyes"],[
406 AS_ECHO("Enabled")
407 ],[
408 AS_ECHO("Disabled")
409 ])
410
411 #Python binding enabled/disabled
412 AS_ECHO_N("Python binding: ")
413 AS_IF([test "x${enable_python:-yes}" = xyes], [
414 AS_ECHO("Enabled")
415 ],[
416 AS_ECHO("Disabled")
417 ])
418
419 # Do we build only the consumerd, or everything
420 AS_IF([test "x$consumerd_only" = "xyes"],[
421 AS_ECHO("Only the consumerd daemon will be built.")
422 ],[
423 AS_ECHO("All binaries will be built.")
424 ])
425
426 # Print the bindir and libdir this `make install' will install into.
427 AS_ECHO()
428 AS_ECHO_N("Binaries will be installed in: ")
429 AS_ECHO("`eval eval echo $bindir`")
430 AS_ECHO_N("Libraries will be installed in: ")
431 AS_ECHO("`eval eval echo $libdir`")
432
433 # If we build the sessiond, print the paths it will use
434 AS_IF([test "x$consumerd_only" = "xno"],[
435 AS_ECHO()
436 AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ")
437 AS_IF([test "$SESSIOND_BIN" = ""],[
438 AS_ECHO_N("`eval eval echo $bindir`")
439 AS_ECHO("/lttng-sessiond")
440 ],[
441 AS_ECHO("$SESSIOND_BIN")
442 ])
443
444 AS_ECHO()
445 AS_ECHO("The sessiond daemon will look in the following directories: ")
446 AS_ECHO_N("32-bit consumerd executable at: ")
447 AS_IF([test "$CONSUMERD32_BIN" = ""],[
448 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
449 AS_ECHO("/lttng-consumerd")
450 ],[
451 AS_ECHO("$CONSUMERD32_BIN")
452 ])
453
454 AS_ECHO_N("32-bit consumer libraries in: ")
455 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
456 AS_ECHO("`eval eval echo $libdir`")
457 ],[
458 AS_ECHO("$CONSUMERD32_LIBDIR")
459 ])
460
461 AS_ECHO_N("64-bit consumerd executable at: ")
462 AS_IF([test "$CONSUMERD64_BIN" = ""],[
463 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
464 AS_ECHO("/lttng-consumerd")
465 ],[
466 AS_ECHO("$CONSUMERD64_BIN")
467 ])
468
469 AS_ECHO_N("64-bit consumer libraries in: ")
470 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
471 AS_ECHO("`eval eval echo $libdir`")
472 ],[
473 AS_ECHO("$CONSUMERD64_LIBDIR")
474 ])
475 ])
476
477 AS_ECHO()
478
This page took 0.039331 seconds and 4 git commands to generate.