Commit | Line | Data |
---|---|---|
1d1236d0 | 1 | AC_INIT([lttng-tools],[2.0.5],[dgoulet@efficios.com],[],[http://lttng.org]) |
fac6795d | 2 | AC_CONFIG_AUX_DIR([config]) |
6e2d116c DG |
3 | AC_CANONICAL_TARGET |
4 | AC_CANONICAL_HOST | |
fac6795d | 5 | AC_CONFIG_MACRO_DIR([config]) |
0403d7c9 | 6 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) |
c615ee2f | 7 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
fac6795d | 8 | |
0e4cbe7e DG |
9 | version_name="Annedd'ale" |
10 | version_description="New type of beer, 100% from Quebec, flavored with sapin beaumier needles, with a touch of hops." | |
11 | ||
12 | AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "") | |
13 | AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], "") | |
c6d4a597 | 14 | |
3bd1e081 MD |
15 | AC_CONFIG_HEADERS([include/config.h]) |
16 | ||
b5e7bec3 CB |
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 | ||
fac6795d DG |
42 | AC_CHECK_HEADERS([ \ |
43 | sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \ | |
44 | signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \ | |
45 | getopt.h sys/ipc.h sys/shm.h popt.h grp.h \ | |
46 | ]) | |
47 | ||
0c95f5b2 DG |
48 | # Babeltrace viewer check |
49 | AC_ARG_WITH([babeltrace-bin], | |
50 | AS_HELP_STRING([--with-babeltrace-bin], | |
51 | [Location of the babeltrace viewer executable (including the filename)]), | |
52 | [BABELTRACE_BIN="$withval"], | |
53 | [BABELTRACE_BIN='']) | |
54 | AC_SUBST([BABELTRACE_BIN]) | |
55 | ||
56 | # lttv-gui | |
57 | AC_ARG_WITH([lttv-gui-bin], | |
58 | AS_HELP_STRING([--with-lttv-gui-bin], | |
59 | [Location of the lttv GUI viewer executable (including the filename)]), | |
60 | [LTTV_GUI_BIN="$withval"], | |
61 | [LTTV_GUI_BIN='']) | |
62 | AC_SUBST([LTTV_GUI_BIN]) | |
63 | ||
fc7a59ce AM |
64 | AC_ARG_WITH([consumerd32-bin], |
65 | AS_HELP_STRING([--with-consumerd32-bin], | |
66 | [Location of the 32-bit consumerd executable (including the filename)]), | |
67 | [CONSUMERD32_BIN="$withval"], | |
68 | [CONSUMERD32_BIN='']) | |
69 | AC_SUBST([CONSUMERD32_BIN]) | |
ebaeda94 | 70 | |
fc7a59ce AM |
71 | AC_ARG_WITH([consumerd64-bin], |
72 | AS_HELP_STRING([--with-consumerd64-bin], | |
73 | [Location of the 64-bit consumerd executable (including the filename)]), | |
74 | [CONSUMERD64_BIN="$withval"], | |
75 | [CONSUMERD64_BIN='']) | |
76 | AC_SUBST([CONSUMERD64_BIN]) | |
ebaeda94 MD |
77 | |
78 | AC_ARG_WITH([consumerd32-libdir], | |
a4b279ba | 79 | AS_HELP_STRING([--with-consumerd32-libdir], |
fc7a59ce | 80 | [Directory containing the 32-bit consumerd libraries]), |
ebaeda94 MD |
81 | [CONSUMERD32_LIBDIR="$withval"], |
82 | [CONSUMERD32_LIBDIR='']) | |
83 | AC_SUBST([CONSUMERD32_LIBDIR]) | |
84 | ||
ec029701 | 85 | AC_ARG_WITH([consumerd64-libdir], |
a4b279ba | 86 | AS_HELP_STRING([--with-consumerd64-libdir], |
fc7a59ce | 87 | [Directory containing the 64-bit consumerd libraries]), |
ebaeda94 MD |
88 | [CONSUMERD64_LIBDIR="$withval"], |
89 | [CONSUMERD64_LIBDIR='']) | |
90 | AC_SUBST([CONSUMERD64_LIBDIR]) | |
91 | ||
fb6f1fa2 YB |
92 | AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.]) |
93 | AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable]) | |
94 | AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.]) | |
95 | AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.]) | |
0c95f5b2 DG |
96 | AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.]) |
97 | AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.]) | |
43cadc7e | 98 | |
fac6795d DG |
99 | # Check for pthread |
100 | AC_CHECK_LIB([pthread], [pthread_create], [], | |
101 | [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])] | |
102 | ) | |
103 | ||
104 | # Check libpopt | |
105 | AC_CHECK_LIB([popt], [poptGetContext], [], | |
106 | [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])] | |
107 | ) | |
108 | ||
6e59ae26 | 109 | # URCU library version needed or newer |
08a2aa63 | 110 | liburcu_version=">= 0.6.7" |
6e59ae26 | 111 | |
3ffccaed | 112 | # Check liburcu needed function calls |
fac6795d | 113 | AC_CHECK_DECL([cds_list_add], [], |
8e12081b | 114 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]] |
fac6795d | 115 | ) |
099e26bd | 116 | AC_CHECK_DECL([cds_wfq_init], [], |
8e12081b DG |
117 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]] |
118 | ) | |
487cf67c DG |
119 | AC_CHECK_DECL([cds_wfq_dequeue_blocking], [], |
120 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]] | |
121 | ) | |
8e12081b DG |
122 | AC_CHECK_DECL([futex_async], [], |
123 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]] | |
099e26bd | 124 | ) |
3ffccaed DG |
125 | AC_CHECK_DECL([rcu_thread_offline], [], |
126 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] | |
127 | ) | |
128 | AC_CHECK_DECL([rcu_thread_online], [], | |
129 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] | |
130 | ) | |
6e59ae26 DG |
131 | AC_CHECK_DECL([caa_likely], [], |
132 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] | |
133 | ) | |
134 | ||
74d0b642 MD |
135 | # Check liblttng-ust-ctl library |
136 | AC_ARG_ENABLE(lttng-ust, | |
6299f964 | 137 | AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]), |
0e636c80 | 138 | lttng_ust_support=$enableval, lttng_ust_support=yes) |
74d0b642 | 139 | |
6299f964 | 140 | AS_IF([test "x$lttng_ust_support" = "xyes"], [ |
1d586c7f CB |
141 | AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], |
142 | [ | |
143 | AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) | |
144 | lttng_ust_ctl_found=yes | |
145 | ], | |
146 | [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.])], | |
147 | [-lurcu-common -lurcu-bp -lurcu-cds] | |
74d0b642 | 148 | ) |
6299f964 | 149 | ]) |
1d586c7f | 150 | AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) |
f6a9efaa DG |
151 | AC_CHECK_FUNCS([sched_getcpu sysconf]) |
152 | ||
6816a5cb MD |
153 | # check for dlopen |
154 | AC_CHECK_LIB([dl], [dlopen], | |
155 | [ | |
156 | have_libdl=yes | |
157 | ], | |
158 | [ | |
159 | #libdl not found, check for dlopen in libc. | |
160 | AC_CHECK_LIB([c], [dlopen], | |
161 | [ | |
162 | have_libc_dl=yes | |
163 | ], | |
164 | [ | |
165 | AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.]) | |
166 | ]) | |
167 | ]) | |
168 | AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"]) | |
169 | AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"]) | |
170 | ||
55bed213 AM |
171 | # Option to only build the consumer daemon and its libraries |
172 | AC_ARG_WITH([consumerd-only], | |
173 | AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]), | |
174 | [consumerd_only=$withval], | |
175 | [consumerd_only=no]) | |
176 | AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) | |
177 | ||
3ffccaed | 178 | # Epoll check. If not present, the build will fallback on poll() API |
71615260 DG |
179 | AX_HAVE_EPOLL( |
180 | [AX_CONFIG_FEATURE_ENABLE(epoll)], | |
181 | [AX_CONFIG_FEATURE_DISABLE(epoll)] | |
182 | ) | |
71615260 DG |
183 | AX_CONFIG_FEATURE( |
184 | [epoll], [This platform supports epoll(7)], | |
185 | [HAVE_EPOLL], [This platform supports epoll(7).], | |
186 | [enable_epoll="yes"], [enable_epoll="no"] | |
187 | ) | |
71615260 DG |
188 | AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ]) |
189 | ||
08972169 | 190 | AC_SYS_LARGEFILE |
fac6795d | 191 | AC_PROG_CC |
3889a2d6 | 192 | LT_INIT |
fac6795d | 193 | |
6e2d116c DG |
194 | CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing" |
195 | ||
08972169 | 196 | DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h" |
6e2d116c DG |
197 | |
198 | lttngincludedir="${includedir}/lttng" | |
199 | ||
200 | AC_SUBST(lttngincludedir) | |
201 | AC_SUBST(DEFAULT_INCLUDES) | |
202 | ||
386418ba MD |
203 | lttnglibexecdir="${libdir}/lttng/libexec" |
204 | AC_SUBST(lttnglibexecdir) | |
205 | ||
fac6795d DG |
206 | AC_CONFIG_FILES([ |
207 | Makefile | |
10a8a223 | 208 | doc/Makefile |
6991b181 | 209 | doc/man/Makefile |
fac6795d | 210 | include/Makefile |
10a8a223 DG |
211 | src/Makefile |
212 | src/common/Makefile | |
213 | src/common/kernel-ctl/Makefile | |
214 | src/common/kernel-consumer/Makefile | |
215 | src/common/ust-consumer/Makefile | |
216 | src/common/hashtable/Makefile | |
217 | src/common/sessiond-comm/Makefile | |
d31efcff | 218 | src/common/compat/Makefile |
10a8a223 DG |
219 | src/lib/Makefile |
220 | src/lib/lttng-ctl/Makefile | |
221 | src/bin/Makefile | |
222 | src/bin/lttng-consumerd/Makefile | |
223 | src/bin/lttng-sessiond/Makefile | |
224 | src/bin/lttng/Makefile | |
fac6795d | 225 | tests/Makefile |
d3e8f6bb | 226 | tests/ust-nevents/Makefile |
b6ca8ef5 | 227 | tests/ust-nprocesses/Makefile |
fac6795d DG |
228 | ]) |
229 | ||
230 | AC_OUTPUT | |
6299f964 | 231 | |
994dd8a4 | 232 | # |
6299f964 | 233 | # Mini-report on what will be built |
994dd8a4 AM |
234 | # |
235 | AS_ECHO() | |
236 | ||
0e4cbe7e DG |
237 | AS_ECHO("Version name: $version_name") |
238 | AS_ECHO("$version_description") | |
239 | ||
240 | AS_ECHO() | |
241 | ||
994dd8a4 AM |
242 | # Target architecture we're building for |
243 | target_arch=$host_cpu | |
244 | [ | |
245 | for f in $CFLAGS; do | |
246 | if test $f = "-m32"; then | |
247 | target_arch="32-bit" | |
248 | elif test $f = "-m64"; then | |
249 | target_arch="64-bit" | |
250 | fi | |
251 | done | |
252 | ] | |
253 | AS_ECHO_N("Target architecture: ") | |
254 | AS_ECHO($target_arch) | |
255 | ||
256 | # LTTng-UST enabled/disabled | |
6299f964 | 257 | AS_ECHO_N("Lttng-UST support: ") |
994dd8a4 AM |
258 | AS_IF([test "x$lttng_ust_support" = "xyes"],[ |
259 | AS_ECHO("Enabled") | |
260 | ],[ | |
261 | AS_ECHO("Disabled") | |
262 | ]) | |
55bed213 | 263 | |
994dd8a4 AM |
264 | # Do we build only the consumerd, or everything |
265 | AS_IF([test "x$consumerd_only" = "xyes"],[ | |
266 | AS_ECHO("Only the consumerd daemon will be built.") | |
267 | ],[ | |
268 | AS_ECHO("All binaries will be built.") | |
269 | ]) | |
270 | ||
5fb528f1 AM |
271 | # Print the bindir and libdir this `make install' will install into. |
272 | AS_ECHO() | |
273 | AS_ECHO_N("Binaries will be installed in: ") | |
274 | AS_ECHO("`eval eval echo $bindir`") | |
275 | AS_ECHO_N("Libraries will be installed in: ") | |
276 | AS_ECHO("`eval eval echo $libdir`") | |
277 | ||
994dd8a4 AM |
278 | # If we build the sessiond, print the paths it will use |
279 | AS_IF([test "x$consumerd_only" = "xno"],[ | |
280 | AS_ECHO() | |
281 | AS_ECHO("The sessiond daemon will look in the following directories: ") | |
282 | AS_ECHO_N("32-bit consumerd executable at: ") | |
283 | AS_IF([test "$CONSUMERD32_BIN" = ""],[ | |
386418ba | 284 | AS_ECHO_N("`eval eval echo $lttnglibexecdir`") |
994dd8a4 AM |
285 | AS_ECHO("/lttng-consumerd") |
286 | ],[ | |
287 | AS_ECHO("$CONSUMERD32_BIN") | |
288 | ]) | |
289 | ||
290 | AS_ECHO_N("32-bit consumer libraries in: ") | |
291 | AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[ | |
292 | AS_ECHO("`eval eval echo $libdir`") | |
293 | ],[ | |
294 | AS_ECHO("$CONSUMERD32_LIBDIR") | |
295 | ]) | |
296 | ||
297 | AS_ECHO_N("64-bit consumerd executable at: ") | |
298 | AS_IF([test "$CONSUMERD64_BIN" = ""],[ | |
386418ba | 299 | AS_ECHO_N("`eval eval echo $lttnglibexecdir`") |
994dd8a4 AM |
300 | AS_ECHO("/lttng-consumerd") |
301 | ],[ | |
302 | AS_ECHO("$CONSUMERD64_BIN") | |
303 | ]) | |
304 | ||
305 | AS_ECHO_N("64-bit consumer libraries in: ") | |
306 | AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[ | |
307 | AS_ECHO("`eval eval echo $libdir`") | |
308 | ],[ | |
309 | AS_ECHO("$CONSUMERD64_LIBDIR") | |
310 | ]) | |
311 | ]) | |
6299f964 | 312 | |
994dd8a4 | 313 | AS_ECHO() |
6299f964 | 314 |