1 AC_INIT([lttng-tools],[2.2.0-rc2],[dgoulet@efficios.com],[],[http://lttng.org])
2 AC_CONFIG_AUX_DIR([config])
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])])
10 version_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!"
12 AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "")
13 AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], "")
15 AC_CONFIG_HEADERS([include/config.h])
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,
25 AS_IF([test "x$libtool_fixup" = "xyes"],
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],
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
42 AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
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 \
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"],
56 AC_SUBST([BABELTRACE_BIN])
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"],
64 AC_SUBST([LTTV_GUI_BIN])
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"],
71 AC_SUBST([CONSUMERD32_BIN])
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"],
78 AC_SUBST([CONSUMERD64_BIN])
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])
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])
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"],
99 AC_SUBST([SESSIOND_BIN])
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.])
110 AC_CHECK_LIB([pthread], [pthread_create], [],
111 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
115 AC_CHECK_LIB([popt], [poptGetContext], [],
116 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
120 AC_CHECK_LIB([uuid], [uuid_generate],
122 AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBUUID], 1, [Has libuuid support.])
126 # libuuid not found, check for uuid_create in libc.
127 AC_CHECK_LIB([c], [uuid_create],
129 AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
133 AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.])
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"])
140 # URCU library version needed or newer
141 liburcu_version=">= 0.7.2"
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>]]
147 AC_CHECK_DECL([cds_wfq_init], [],
148 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
150 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
151 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
153 AC_CHECK_DECL([futex_async], [],
154 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
156 AC_CHECK_DECL([rcu_thread_offline], [],
157 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
159 AC_CHECK_DECL([rcu_thread_online], [],
160 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
162 AC_CHECK_DECL([caa_likely], [],
163 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
166 AC_ARG_WITH(lttng-ust-prefix,
167 AS_HELP_STRING([--with-lttng-ust-prefix=PATH],
168 [Specify the installation prefix of the lttng-ust library.
169 Headers must be in PATH/include; libraries in PATH/lib.]),
171 CPPFLAGS="$CPPFLAGS -I${withval}/include"
172 LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib"
175 # Check liblttng-ust-ctl library
176 AC_ARG_ENABLE(lttng-ust,
177 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
178 lttng_ust_support=$enableval, lttng_ust_support=yes)
180 AS_IF([test "x$lttng_ust_support" = "xyes"], [
181 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_set_filter],
183 AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support])
184 lttng_ust_ctl_found=yes
186 [AC_MSG_ERROR([Cannot find LTTng-UST >= 2.1.x. Use --with-lttng-ust-prefix=PREFIX to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])],
187 [-lurcu-common -lurcu-bp -lurcu-cds -lrt]
190 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
191 AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
194 AC_CHECK_LIB([dl], [dlopen],
199 #libdl not found, check for dlopen in libc.
200 AC_CHECK_LIB([c], [dlopen],
205 AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
208 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
209 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
212 AC_CHECK_LIB([c], [fmemopen],
214 AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.])
218 # Check for open_memstream
219 AC_CHECK_LIB([c], [open_memstream],
221 AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])
226 # SWIG version needed or newer:
229 AC_ARG_ENABLE([python-bindings],
230 [AC_HELP_STRING([--enable-python-bindings],
231 [compile Python bindings])],
232 [enable_python=yes], [enable_python=no])
234 AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes])
236 if test "x${enable_python:-yes}" = xyes; then
237 AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
240 AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
241 AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
242 AS_IF([test -z "$PYTHON_INCLUDE"], [
243 AS_IF([test -z "$PYTHON_CONFIG"], [
244 AC_PATH_PROGS([PYTHON_CONFIG],
245 [python$PYTHON_VERSION-config python-config],
248 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
250 AC_MSG_CHECKING([python include flags])
251 PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
252 AC_MSG_RESULT([$PYTHON_INCLUDE])
256 AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl
257 [if you want Python bindings.])
261 # Option to only build the consumer daemon and its libraries
262 AC_ARG_WITH([consumerd-only],
263 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
264 [consumerd_only=$withval],
266 AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
268 # Epoll check. If not present, the build will fallback on poll() API
270 [AX_CONFIG_FEATURE_ENABLE(epoll)],
271 [AX_CONFIG_FEATURE_DISABLE(epoll)]
274 [epoll], [This platform supports epoll(7)],
275 [HAVE_EPOLL], [This platform supports epoll(7).],
276 [enable_epoll="yes"], [enable_epoll="no"]
278 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
286 AC_DEFUN([AC_PROG_BISON], [AC_CHECK_PROGS(BISON, bison, bison)])
288 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
290 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h"
292 lttngincludedir="${includedir}/lttng"
294 AC_SUBST(lttngincludedir)
295 AC_SUBST(DEFAULT_INCLUDES)
297 lttnglibexecdir="${libdir}/lttng/libexec"
298 AC_SUBST(lttnglibexecdir)
306 extras/bindings/Makefile
307 extras/bindings/swig/Makefile
308 extras/bindings/swig/python/Makefile
311 src/common/kernel-ctl/Makefile
312 src/common/kernel-consumer/Makefile
313 src/common/ust-consumer/Makefile
314 src/common/hashtable/Makefile
315 src/common/sessiond-comm/Makefile
316 src/common/compat/Makefile
317 src/common/relayd/Makefile
318 src/common/testpoint/Makefile
320 src/lib/lttng-ctl/Makefile
321 src/lib/lttng-ctl/filter/Makefile
322 src/lib/lttng-ctl/lttng-ctl.pc
324 src/bin/lttng-consumerd/Makefile
325 src/bin/lttng-sessiond/Makefile
326 src/bin/lttng-relayd/Makefile
327 src/bin/lttng/Makefile
329 tests/regression/Makefile
330 tests/regression/kernel/Makefile
331 tests/regression/tools/Makefile
332 tests/regression/tools/streaming/Makefile
333 tests/regression/tools/filtering/Makefile
334 tests/regression/tools/health/Makefile
335 tests/regression/ust/Makefile
336 tests/regression/ust/nprocesses/Makefile
337 tests/regression/ust/high-throughput/Makefile
338 tests/regression/ust/low-throughput/Makefile
339 tests/regression/ust/before-after/Makefile
340 tests/regression/ust/buffers-uid/Makefile
341 tests/regression/ust/periodical-metadata-flush/Makefile
342 tests/regression/ust/multi-session/Makefile
343 tests/regression/ust/overlap/Makefile
344 tests/regression/ust/overlap/demo/Makefile
345 tests/regression/ust/linking/Makefile
346 tests/regression/ust/daemon/Makefile
347 tests/regression/ust/exit-fast/Makefile
348 tests/regression/ust/fork/Makefile
349 tests/regression/ust/libc-wrapper/Makefile
352 tests/utils/tap/Makefile
353 tests/utils/testapp/Makefile
354 tests/utils/testapp/gen-ust-events/Makefile
360 # Mini-report on what will be built
364 AS_ECHO("Version name: $version_name")
365 AS_ECHO("$version_description")
369 # Target architecture we're building for
370 target_arch=$host_cpu
373 if test $f = "-m32"; then
375 elif test $f = "-m64"; then
380 AS_ECHO_N("Target architecture: ")
381 AS_ECHO($target_arch)
383 # LTTng-UST enabled/disabled
384 AS_ECHO_N("Lttng-UST support: ")
385 AS_IF([test "x$lttng_ust_support" = "xyes"],[
391 #Python binding enabled/disabled
392 AS_ECHO_N("Python binding: ")
393 AS_IF([test "x${enable_python:-yes}" = xyes], [
399 # Do we build only the consumerd, or everything
400 AS_IF([test "x$consumerd_only" = "xyes"],[
401 AS_ECHO("Only the consumerd daemon will be built.")
403 AS_ECHO("All binaries will be built.")
406 # Print the bindir and libdir this `make install' will install into.
408 AS_ECHO_N("Binaries will be installed in: ")
409 AS_ECHO("`eval eval echo $bindir`")
410 AS_ECHO_N("Libraries will be installed in: ")
411 AS_ECHO("`eval eval echo $libdir`")
413 # If we build the sessiond, print the paths it will use
414 AS_IF([test "x$consumerd_only" = "xno"],[
416 AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ")
417 AS_IF([test "$SESSIOND_BIN" = ""],[
418 AS_ECHO_N("`eval eval echo $bindir`")
419 AS_ECHO("/lttng-sessiond")
421 AS_ECHO("$SESSIOND_BIN")
425 AS_ECHO("The sessiond daemon will look in the following directories: ")
426 AS_ECHO_N("32-bit consumerd executable at: ")
427 AS_IF([test "$CONSUMERD32_BIN" = ""],[
428 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
429 AS_ECHO("/lttng-consumerd")
431 AS_ECHO("$CONSUMERD32_BIN")
434 AS_ECHO_N("32-bit consumer libraries in: ")
435 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
436 AS_ECHO("`eval eval echo $libdir`")
438 AS_ECHO("$CONSUMERD32_LIBDIR")
441 AS_ECHO_N("64-bit consumerd executable at: ")
442 AS_IF([test "$CONSUMERD64_BIN" = ""],[
443 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
444 AS_ECHO("/lttng-consumerd")
446 AS_ECHO("$CONSUMERD64_BIN")
449 AS_ECHO_N("64-bit consumer libraries in: ")
450 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
451 AS_ECHO("`eval eval echo $libdir`")
453 AS_ECHO("$CONSUMERD64_LIBDIR")