1 AC_INIT([lttng-tools],[2.0.0-rc4],[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_DEFINE_UNQUOTED([VERSION_NAME], "TBD", "")
10 AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], "TBD", "")
12 AC_CONFIG_HEADERS([include/config.h])
15 sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \
16 signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
17 getopt.h sys/ipc.h sys/shm.h popt.h grp.h \
20 # Babeltrace viewer check
21 AC_ARG_WITH([babeltrace-bin],
22 AS_HELP_STRING([--with-babeltrace-bin],
23 [Location of the babeltrace viewer executable (including the filename)]),
24 [BABELTRACE_BIN="$withval"],
26 AC_SUBST([BABELTRACE_BIN])
29 AC_ARG_WITH([lttv-gui-bin],
30 AS_HELP_STRING([--with-lttv-gui-bin],
31 [Location of the lttv GUI viewer executable (including the filename)]),
32 [LTTV_GUI_BIN="$withval"],
34 AC_SUBST([LTTV_GUI_BIN])
36 AC_ARG_WITH([consumerd32-bin],
37 AS_HELP_STRING([--with-consumerd32-bin],
38 [Location of the 32-bit consumerd executable (including the filename)]),
39 [CONSUMERD32_BIN="$withval"],
41 AC_SUBST([CONSUMERD32_BIN])
43 AC_ARG_WITH([consumerd64-bin],
44 AS_HELP_STRING([--with-consumerd64-bin],
45 [Location of the 64-bit consumerd executable (including the filename)]),
46 [CONSUMERD64_BIN="$withval"],
48 AC_SUBST([CONSUMERD64_BIN])
50 AC_ARG_WITH([consumerd32-libdir],
51 AS_HELP_STRING([--with-consumerd32-libdir],
52 [Directory containing the 32-bit consumerd libraries]),
53 [CONSUMERD32_LIBDIR="$withval"],
54 [CONSUMERD32_LIBDIR=''])
55 AC_SUBST([CONSUMERD32_LIBDIR])
57 AC_ARG_WITH([consumerd64-libdir],
58 AS_HELP_STRING([--with-consumerd64-libdir],
59 [Directory containing the 64-bit consumerd libraries]),
60 [CONSUMERD64_LIBDIR="$withval"],
61 [CONSUMERD64_LIBDIR=''])
62 AC_SUBST([CONSUMERD64_LIBDIR])
64 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
65 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
66 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
67 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
68 AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
69 AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
72 AC_CHECK_LIB([pthread], [pthread_create], [],
73 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
77 AC_CHECK_LIB([popt], [poptGetContext], [],
78 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
81 # URCU library version needed or newer
82 liburcu_version=">= 0.6.7"
84 # Check liburcu needed function calls
85 AC_CHECK_DECL([cds_list_add], [],
86 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
88 AC_CHECK_DECL([cds_wfq_init], [],
89 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
91 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
92 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
94 AC_CHECK_DECL([futex_async], [],
95 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
97 AC_CHECK_DECL([rcu_thread_offline], [],
98 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
100 AC_CHECK_DECL([rcu_thread_online], [],
101 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
103 AC_CHECK_DECL([caa_likely], [],
104 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
107 # Check liblttng-ust-ctl library
108 AC_ARG_ENABLE(lttng-ust,
109 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
110 lttng_ust_support=$enableval, lttng_ust_support=yes)
112 AS_IF([test "x$lttng_ust_support" = "xyes"], [
113 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
114 [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.])]
118 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
120 AC_CHECK_FUNCS([sched_getcpu sysconf])
123 AC_CHECK_LIB([dl], [dlopen],
128 #libdl not found, check for dlopen in libc.
129 AC_CHECK_LIB([c], [dlopen],
134 AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
137 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
138 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
140 # Option to only build the consumer daemon and its libraries
141 AC_ARG_WITH([consumerd-only],
142 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
143 [consumerd_only=$withval],
145 AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
147 # Epoll check. If not present, the build will fallback on poll() API
149 [AX_CONFIG_FEATURE_ENABLE(epoll)],
150 [AX_CONFIG_FEATURE_DISABLE(epoll)]
153 [epoll], [This platform supports epoll(7)],
154 [HAVE_EPOLL], [This platform supports epoll(7).],
155 [enable_epoll="yes"], [enable_epoll="no"]
157 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
162 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
164 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include"
166 lttngincludedir="${includedir}/lttng"
168 AC_SUBST(lttngincludedir)
169 AC_SUBST(DEFAULT_INCLUDES)
171 lttnglibexecdir="${libdir}/lttng/libexec"
172 AC_SUBST(lttnglibexecdir)
181 src/common/kernel-ctl/Makefile
182 src/common/kernel-consumer/Makefile
183 src/common/ust-consumer/Makefile
184 src/common/hashtable/Makefile
185 src/common/sessiond-comm/Makefile
186 src/common/compat/Makefile
188 src/lib/lttng-ctl/Makefile
190 src/bin/lttng-consumerd/Makefile
191 src/bin/lttng-sessiond/Makefile
192 src/bin/lttng/Makefile
194 tests/ust-nevents/Makefile
195 tests/ust-nprocesses/Makefile
201 # Mini-report on what will be built
205 # Target architecture we're building for
206 target_arch=$host_cpu
209 if test $f = "-m32"; then
211 elif test $f = "-m64"; then
216 AS_ECHO_N("Target architecture: ")
217 AS_ECHO($target_arch)
219 # LTTng-UST enabled/disabled
220 AS_ECHO_N("Lttng-UST support: ")
221 AS_IF([test "x$lttng_ust_support" = "xyes"],[
227 # Do we build only the consumerd, or everything
228 AS_IF([test "x$consumerd_only" = "xyes"],[
229 AS_ECHO("Only the consumerd daemon will be built.")
231 AS_ECHO("All binaries will be built.")
234 # Print the bindir and libdir this `make install' will install into.
236 AS_ECHO_N("Binaries will be installed in: ")
237 AS_ECHO("`eval eval echo $bindir`")
238 AS_ECHO_N("Libraries will be installed in: ")
239 AS_ECHO("`eval eval echo $libdir`")
241 # If we build the sessiond, print the paths it will use
242 AS_IF([test "x$consumerd_only" = "xno"],[
244 AS_ECHO("The sessiond daemon will look in the following directories: ")
245 AS_ECHO_N("32-bit consumerd executable at: ")
246 AS_IF([test "$CONSUMERD32_BIN" = ""],[
247 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
248 AS_ECHO("/lttng-consumerd")
250 AS_ECHO("$CONSUMERD32_BIN")
253 AS_ECHO_N("32-bit consumer libraries in: ")
254 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
255 AS_ECHO("`eval eval echo $libdir`")
257 AS_ECHO("$CONSUMERD32_LIBDIR")
260 AS_ECHO_N("64-bit consumerd executable at: ")
261 AS_IF([test "$CONSUMERD64_BIN" = ""],[
262 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
263 AS_ECHO("/lttng-consumerd")
265 AS_ECHO("$CONSUMERD64_BIN")
268 AS_ECHO_N("64-bit consumer libraries in: ")
269 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
270 AS_ECHO("`eval eval echo $libdir`")
272 AS_ECHO("$CONSUMERD64_LIBDIR")