1 AC_INIT([lttng-tools],[2.0.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])])
9 AC_CONFIG_HEADERS([include/config.h])
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 \
17 # Babeltrace viewer check
18 AC_ARG_WITH([babeltrace-bin],
19 AS_HELP_STRING([--with-babeltrace-bin],
20 [Location of the babeltrace viewer executable (including the filename)]),
21 [BABELTRACE_BIN="$withval"],
23 AC_SUBST([BABELTRACE_BIN])
26 AC_ARG_WITH([lttv-gui-bin],
27 AS_HELP_STRING([--with-lttv-gui-bin],
28 [Location of the lttv GUI viewer executable (including the filename)]),
29 [LTTV_GUI_BIN="$withval"],
31 AC_SUBST([LTTV_GUI_BIN])
33 AC_ARG_WITH([consumerd32-bin],
34 AS_HELP_STRING([--with-consumerd32-bin],
35 [Location of the 32-bit consumerd executable (including the filename)]),
36 [CONSUMERD32_BIN="$withval"],
38 AC_SUBST([CONSUMERD32_BIN])
40 AC_ARG_WITH([consumerd64-bin],
41 AS_HELP_STRING([--with-consumerd64-bin],
42 [Location of the 64-bit consumerd executable (including the filename)]),
43 [CONSUMERD64_BIN="$withval"],
45 AC_SUBST([CONSUMERD64_BIN])
47 AC_ARG_WITH([consumerd32-libdir],
48 AS_HELP_STRING([--with-consumerd32-libdir],
49 [Directory containing the 32-bit consumerd libraries]),
50 [CONSUMERD32_LIBDIR="$withval"],
51 [CONSUMERD32_LIBDIR=''])
52 AC_SUBST([CONSUMERD32_LIBDIR])
54 AC_ARG_WITH([consumerd64-libdir],
55 AS_HELP_STRING([--with-consumerd64-libdir],
56 [Directory containing the 64-bit consumerd libraries]),
57 [CONSUMERD64_LIBDIR="$withval"],
58 [CONSUMERD64_LIBDIR=''])
59 AC_SUBST([CONSUMERD64_LIBDIR])
61 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
62 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
63 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
64 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
65 AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
66 AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
69 AC_CHECK_LIB([pthread], [pthread_create], [],
70 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
74 AC_CHECK_LIB([popt], [poptGetContext], [],
75 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
78 # URCU library version needed or newer
79 liburcu_version=">= 0.6.7"
81 # Check liburcu needed function calls
82 AC_CHECK_DECL([cds_list_add], [],
83 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
85 AC_CHECK_DECL([cds_wfq_init], [],
86 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
88 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
89 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
91 AC_CHECK_DECL([futex_async], [],
92 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
94 AC_CHECK_DECL([rcu_thread_offline], [],
95 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
97 AC_CHECK_DECL([rcu_thread_online], [],
98 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
100 AC_CHECK_DECL([caa_likely], [],
101 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
104 # Check liblttng-ust-ctl library
105 AC_ARG_ENABLE(lttng-ust,
106 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
107 lttng_ust_support=$enableval, lttng_ust_support=yes)
109 AS_IF([test "x$lttng_ust_support" = "xyes"], [
110 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
111 [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.])]
115 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
117 AC_CHECK_FUNCS([sched_getcpu sysconf])
120 AC_CHECK_LIB([dl], [dlopen],
125 #libdl not found, check for dlopen in libc.
126 AC_CHECK_LIB([c], [dlopen],
131 AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
134 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
135 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
137 # Option to only build the consumer daemon and its libraries
138 AC_ARG_WITH([consumerd-only],
139 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
140 [consumerd_only=$withval],
142 AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
144 # Epoll check. If not present, the build will fallback on poll() API
146 [AX_CONFIG_FEATURE_ENABLE(epoll)],
147 [AX_CONFIG_FEATURE_DISABLE(epoll)]
150 [epoll], [This platform supports epoll(7)],
151 [HAVE_EPOLL], [This platform supports epoll(7).],
152 [enable_epoll="yes"], [enable_epoll="no"]
154 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
159 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
161 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include"
163 lttngincludedir="${includedir}/lttng"
165 AC_SUBST(lttngincludedir)
166 AC_SUBST(DEFAULT_INCLUDES)
175 src/common/kernel-ctl/Makefile
176 src/common/kernel-consumer/Makefile
177 src/common/ust-consumer/Makefile
178 src/common/hashtable/Makefile
179 src/common/sessiond-comm/Makefile
181 src/lib/lttng-ctl/Makefile
183 src/bin/lttng-consumerd/Makefile
184 src/bin/lttng-sessiond/Makefile
185 src/bin/lttng/Makefile
187 tests/ust-nevents/Makefile
188 tests/ust-nprocesses/Makefile
194 # Mini-report on what will be built
198 # Target architecture we're building for
199 target_arch=$host_cpu
202 if test $f = "-m32"; then
204 elif test $f = "-m64"; then
209 AS_ECHO_N("Target architecture: ")
210 AS_ECHO($target_arch)
212 # LTTng-UST enabled/disabled
213 AS_ECHO_N("Lttng-UST support: ")
214 AS_IF([test "x$lttng_ust_support" = "xyes"],[
220 # Do we build only the consumerd, or everything
221 AS_IF([test "x$consumerd_only" = "xyes"],[
222 AS_ECHO("Only the consumerd daemon will be built.")
224 AS_ECHO("All binaries will be built.")
227 # Print the bindir and libdir this `make install' will install into.
229 AS_ECHO_N("Binaries will be installed in: ")
230 AS_ECHO("`eval eval echo $bindir`")
231 AS_ECHO_N("Libraries will be installed in: ")
232 AS_ECHO("`eval eval echo $libdir`")
234 # If we build the sessiond, print the paths it will use
235 AS_IF([test "x$consumerd_only" = "xno"],[
237 AS_ECHO("The sessiond daemon will look in the following directories: ")
238 AS_ECHO_N("32-bit consumerd executable at: ")
239 AS_IF([test "$CONSUMERD32_BIN" = ""],[
240 AS_ECHO_N("`eval eval echo $bindir`")
241 AS_ECHO("/lttng-consumerd")
243 AS_ECHO("$CONSUMERD32_BIN")
246 AS_ECHO_N("32-bit consumer libraries in: ")
247 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
248 AS_ECHO("`eval eval echo $libdir`")
250 AS_ECHO("$CONSUMERD32_LIBDIR")
253 AS_ECHO_N("64-bit consumerd executable at: ")
254 AS_IF([test "$CONSUMERD64_BIN" = ""],[
255 AS_ECHO_N("`eval eval echo $bindir`")
256 AS_ECHO("/lttng-consumerd")
258 AS_ECHO("$CONSUMERD64_BIN")
261 AS_ECHO_N("64-bit consumer libraries in: ")
262 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
263 AS_ECHO("`eval eval echo $libdir`")
265 AS_ECHO("$CONSUMERD64_LIBDIR")