1 AC_INIT([lttng-tools],[2.0-pre19],[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 AC_ARG_WITH([consumerd32-bin],
18 AS_HELP_STRING([--with-consumerd32-bin],
19 [Location of the 32-bit consumerd executable (including the filename)]),
20 [CONSUMERD32_BIN="$withval"],
22 AC_SUBST([CONSUMERD32_BIN])
24 AC_ARG_WITH([consumerd64-bin],
25 AS_HELP_STRING([--with-consumerd64-bin],
26 [Location of the 64-bit consumerd executable (including the filename)]),
27 [CONSUMERD64_BIN="$withval"],
29 AC_SUBST([CONSUMERD64_BIN])
31 AC_ARG_WITH([consumerd32-libdir],
32 AS_HELP_STRING([--with-consumerd32-libdir],
33 [Directory containing the 32-bit consumerd libraries]),
34 [CONSUMERD32_LIBDIR="$withval"],
35 [CONSUMERD32_LIBDIR=''])
36 AC_SUBST([CONSUMERD32_LIBDIR])
38 AC_ARG_WITH([consumer64d-libdir],
39 AS_HELP_STRING([--with-consumerd64-libdir],
40 [Directory containing the 64-bit consumerd libraries]),
41 [CONSUMERD64_LIBDIR="$withval"],
42 [CONSUMERD64_LIBDIR=''])
43 AC_SUBST([CONSUMERD64_LIBDIR])
45 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
46 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
47 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
48 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
51 AC_CHECK_LIB([pthread], [pthread_create], [],
52 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
56 AC_CHECK_LIB([popt], [poptGetContext], [],
57 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
60 # URCU library version needed or newer
61 liburcu_version=">= 0.6.7"
63 # Check liburcu needed function calls
64 AC_CHECK_DECL([cds_list_add], [],
65 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
67 AC_CHECK_DECL([cds_wfq_init], [],
68 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
70 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
71 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
73 AC_CHECK_DECL([futex_async], [],
74 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
76 AC_CHECK_DECL([rcu_thread_offline], [],
77 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
79 AC_CHECK_DECL([rcu_thread_online], [],
80 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
82 AC_CHECK_DECL([caa_likely], [],
83 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
86 # Check liblttng-ust-ctl library
87 AC_ARG_ENABLE(lttng-ust,
88 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
89 lttng_ust_support=$enableval, lttng_ust_support=yes)
91 AS_IF([test "x$lttng_ust_support" = "xyes"], [
92 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
93 [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.])]
97 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
99 AC_CHECK_FUNCS([sched_getcpu sysconf])
101 # Option to only build the consumer daemon and its libraries
102 AC_ARG_WITH([consumerd-only],
103 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
104 [consumerd_only=$withval],
106 AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
108 # Epoll check. If not present, the build will fallback on poll() API
110 [AX_CONFIG_FEATURE_ENABLE(epoll)],
111 [AX_CONFIG_FEATURE_DISABLE(epoll)]
114 [epoll], [This platform supports epoll(7)],
115 [HAVE_EPOLL], [This platform supports epoll(7).],
116 [enable_epoll="yes"], [enable_epoll="no"]
118 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
123 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
125 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include"
127 lttngincludedir="${includedir}/lttng"
129 AC_SUBST(lttngincludedir)
130 AC_SUBST(DEFAULT_INCLUDES)
138 src/common/kernel-ctl/Makefile
139 src/common/kernel-consumer/Makefile
140 src/common/ust-consumer/Makefile
141 src/common/hashtable/Makefile
142 src/common/sessiond-comm/Makefile
144 src/lib/lttng-ctl/Makefile
146 src/bin/lttng-consumerd/Makefile
147 src/bin/lttng-sessiond/Makefile
148 src/bin/lttng/Makefile
150 tests/ust-nevents/Makefile
151 tests/ust-nprocesses/Makefile
157 # Mini-report on what will be built
161 # Target architecture we're building for
162 target_arch=$host_cpu
165 if test $f = "-m32"; then
167 elif test $f = "-m64"; then
172 AS_ECHO_N("Target architecture: ")
173 AS_ECHO($target_arch)
175 # LTTng-UST enabled/disabled
176 AS_ECHO_N("Lttng-UST support: ")
177 AS_IF([test "x$lttng_ust_support" = "xyes"],[
183 # Do we build only the consumerd, or everything
184 AS_IF([test "x$consumerd_only" = "xyes"],[
185 AS_ECHO("Only the consumerd daemon will be built.")
187 AS_ECHO("All binaries will be built.")
190 # Print the bindir and libdir this `make install' will install into.
192 AS_ECHO_N("Binaries will be installed in: ")
193 AS_ECHO("`eval eval echo $bindir`")
194 AS_ECHO_N("Libraries will be installed in: ")
195 AS_ECHO("`eval eval echo $libdir`")
197 # If we build the sessiond, print the paths it will use
198 AS_IF([test "x$consumerd_only" = "xno"],[
200 AS_ECHO("The sessiond daemon will look in the following directories: ")
201 AS_ECHO_N("32-bit consumerd executable at: ")
202 AS_IF([test "$CONSUMERD32_BIN" = ""],[
203 AS_ECHO_N("`eval eval echo $bindir`")
204 AS_ECHO("/lttng-consumerd")
206 AS_ECHO("$CONSUMERD32_BIN")
209 AS_ECHO_N("32-bit consumer libraries in: ")
210 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
211 AS_ECHO("`eval eval echo $libdir`")
213 AS_ECHO("$CONSUMERD32_LIBDIR")
216 AS_ECHO_N("64-bit consumerd executable at: ")
217 AS_IF([test "$CONSUMERD64_BIN" = ""],[
218 AS_ECHO_N("`eval eval echo $bindir`")
219 AS_ECHO("/lttng-consumerd")
221 AS_ECHO("$CONSUMERD64_BIN")
224 AS_ECHO_N("64-bit consumer libraries in: ")
225 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
226 AS_ECHO("`eval eval echo $libdir`")
228 AS_ECHO("$CONSUMERD64_LIBDIR")