Commit | Line | Data |
---|---|---|
b495b935 | 1 | AC_INIT([lttng-tools],[2.0.0-rc3],[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 | |
3bd1e081 MD |
9 | AC_CONFIG_HEADERS([include/config.h]) |
10 | ||
fac6795d DG |
11 | AC_CHECK_HEADERS([ \ |
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 \ | |
15 | ]) | |
16 | ||
0c95f5b2 DG |
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"], | |
22 | [BABELTRACE_BIN='']) | |
23 | AC_SUBST([BABELTRACE_BIN]) | |
24 | ||
25 | # lttv-gui | |
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"], | |
30 | [LTTV_GUI_BIN='']) | |
31 | AC_SUBST([LTTV_GUI_BIN]) | |
32 | ||
fc7a59ce AM |
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"], | |
37 | [CONSUMERD32_BIN='']) | |
38 | AC_SUBST([CONSUMERD32_BIN]) | |
ebaeda94 | 39 | |
fc7a59ce AM |
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"], | |
44 | [CONSUMERD64_BIN='']) | |
45 | AC_SUBST([CONSUMERD64_BIN]) | |
ebaeda94 MD |
46 | |
47 | AC_ARG_WITH([consumerd32-libdir], | |
a4b279ba | 48 | AS_HELP_STRING([--with-consumerd32-libdir], |
fc7a59ce | 49 | [Directory containing the 32-bit consumerd libraries]), |
ebaeda94 MD |
50 | [CONSUMERD32_LIBDIR="$withval"], |
51 | [CONSUMERD32_LIBDIR='']) | |
52 | AC_SUBST([CONSUMERD32_LIBDIR]) | |
53 | ||
ec029701 | 54 | AC_ARG_WITH([consumerd64-libdir], |
a4b279ba | 55 | AS_HELP_STRING([--with-consumerd64-libdir], |
fc7a59ce | 56 | [Directory containing the 64-bit consumerd libraries]), |
ebaeda94 MD |
57 | [CONSUMERD64_LIBDIR="$withval"], |
58 | [CONSUMERD64_LIBDIR='']) | |
59 | AC_SUBST([CONSUMERD64_LIBDIR]) | |
60 | ||
fb6f1fa2 YB |
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.]) | |
0c95f5b2 DG |
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.]) | |
43cadc7e | 67 | |
fac6795d DG |
68 | # Check for pthread |
69 | AC_CHECK_LIB([pthread], [pthread_create], [], | |
70 | [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])] | |
71 | ) | |
72 | ||
73 | # Check libpopt | |
74 | AC_CHECK_LIB([popt], [poptGetContext], [], | |
75 | [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])] | |
76 | ) | |
77 | ||
6e59ae26 | 78 | # URCU library version needed or newer |
08a2aa63 | 79 | liburcu_version=">= 0.6.7" |
6e59ae26 | 80 | |
3ffccaed | 81 | # Check liburcu needed function calls |
fac6795d | 82 | AC_CHECK_DECL([cds_list_add], [], |
8e12081b | 83 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]] |
fac6795d | 84 | ) |
099e26bd | 85 | AC_CHECK_DECL([cds_wfq_init], [], |
8e12081b DG |
86 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]] |
87 | ) | |
487cf67c DG |
88 | AC_CHECK_DECL([cds_wfq_dequeue_blocking], [], |
89 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]] | |
90 | ) | |
8e12081b DG |
91 | AC_CHECK_DECL([futex_async], [], |
92 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]] | |
099e26bd | 93 | ) |
3ffccaed DG |
94 | AC_CHECK_DECL([rcu_thread_offline], [], |
95 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] | |
96 | ) | |
97 | AC_CHECK_DECL([rcu_thread_online], [], | |
98 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] | |
99 | ) | |
6e59ae26 DG |
100 | AC_CHECK_DECL([caa_likely], [], |
101 | [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]] | |
102 | ) | |
103 | ||
74d0b642 MD |
104 | # Check liblttng-ust-ctl library |
105 | AC_ARG_ENABLE(lttng-ust, | |
6299f964 | 106 | AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]), |
0e636c80 | 107 | lttng_ust_support=$enableval, lttng_ust_support=yes) |
74d0b642 | 108 | |
6299f964 | 109 | AS_IF([test "x$lttng_ust_support" = "xyes"], [ |
74d0b642 MD |
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.])] | |
112 | ) | |
6299f964 | 113 | ]) |
74d0b642 MD |
114 | |
115 | AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ]) | |
099e26bd | 116 | |
f6a9efaa DG |
117 | AC_CHECK_FUNCS([sched_getcpu sysconf]) |
118 | ||
6816a5cb MD |
119 | # check for dlopen |
120 | AC_CHECK_LIB([dl], [dlopen], | |
121 | [ | |
122 | have_libdl=yes | |
123 | ], | |
124 | [ | |
125 | #libdl not found, check for dlopen in libc. | |
126 | AC_CHECK_LIB([c], [dlopen], | |
127 | [ | |
128 | have_libc_dl=yes | |
129 | ], | |
130 | [ | |
131 | AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.]) | |
132 | ]) | |
133 | ]) | |
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"]) | |
136 | ||
55bed213 AM |
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], | |
141 | [consumerd_only=no]) | |
142 | AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) | |
143 | ||
3ffccaed | 144 | # Epoll check. If not present, the build will fallback on poll() API |
71615260 DG |
145 | AX_HAVE_EPOLL( |
146 | [AX_CONFIG_FEATURE_ENABLE(epoll)], | |
147 | [AX_CONFIG_FEATURE_DISABLE(epoll)] | |
148 | ) | |
71615260 DG |
149 | AX_CONFIG_FEATURE( |
150 | [epoll], [This platform supports epoll(7)], | |
151 | [HAVE_EPOLL], [This platform supports epoll(7).], | |
152 | [enable_epoll="yes"], [enable_epoll="no"] | |
153 | ) | |
71615260 DG |
154 | AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ]) |
155 | ||
fac6795d | 156 | AC_PROG_CC |
3889a2d6 | 157 | LT_INIT |
fac6795d | 158 | |
6e2d116c DG |
159 | CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing" |
160 | ||
10a8a223 | 161 | DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include" |
6e2d116c DG |
162 | |
163 | lttngincludedir="${includedir}/lttng" | |
164 | ||
165 | AC_SUBST(lttngincludedir) | |
166 | AC_SUBST(DEFAULT_INCLUDES) | |
167 | ||
386418ba MD |
168 | lttnglibexecdir="${libdir}/lttng/libexec" |
169 | AC_SUBST(lttnglibexecdir) | |
170 | ||
fac6795d DG |
171 | AC_CONFIG_FILES([ |
172 | Makefile | |
10a8a223 | 173 | doc/Makefile |
6991b181 | 174 | doc/man/Makefile |
fac6795d | 175 | include/Makefile |
10a8a223 DG |
176 | src/Makefile |
177 | src/common/Makefile | |
178 | src/common/kernel-ctl/Makefile | |
179 | src/common/kernel-consumer/Makefile | |
180 | src/common/ust-consumer/Makefile | |
181 | src/common/hashtable/Makefile | |
182 | src/common/sessiond-comm/Makefile | |
d31efcff | 183 | src/common/compat/Makefile |
10a8a223 DG |
184 | src/lib/Makefile |
185 | src/lib/lttng-ctl/Makefile | |
186 | src/bin/Makefile | |
187 | src/bin/lttng-consumerd/Makefile | |
188 | src/bin/lttng-sessiond/Makefile | |
189 | src/bin/lttng/Makefile | |
fac6795d | 190 | tests/Makefile |
d3e8f6bb | 191 | tests/ust-nevents/Makefile |
b6ca8ef5 | 192 | tests/ust-nprocesses/Makefile |
fac6795d DG |
193 | ]) |
194 | ||
195 | AC_OUTPUT | |
6299f964 | 196 | |
994dd8a4 | 197 | # |
6299f964 | 198 | # Mini-report on what will be built |
994dd8a4 AM |
199 | # |
200 | AS_ECHO() | |
201 | ||
202 | # Target architecture we're building for | |
203 | target_arch=$host_cpu | |
204 | [ | |
205 | for f in $CFLAGS; do | |
206 | if test $f = "-m32"; then | |
207 | target_arch="32-bit" | |
208 | elif test $f = "-m64"; then | |
209 | target_arch="64-bit" | |
210 | fi | |
211 | done | |
212 | ] | |
213 | AS_ECHO_N("Target architecture: ") | |
214 | AS_ECHO($target_arch) | |
215 | ||
216 | # LTTng-UST enabled/disabled | |
6299f964 | 217 | AS_ECHO_N("Lttng-UST support: ") |
994dd8a4 AM |
218 | AS_IF([test "x$lttng_ust_support" = "xyes"],[ |
219 | AS_ECHO("Enabled") | |
220 | ],[ | |
221 | AS_ECHO("Disabled") | |
222 | ]) | |
55bed213 | 223 | |
994dd8a4 AM |
224 | # Do we build only the consumerd, or everything |
225 | AS_IF([test "x$consumerd_only" = "xyes"],[ | |
226 | AS_ECHO("Only the consumerd daemon will be built.") | |
227 | ],[ | |
228 | AS_ECHO("All binaries will be built.") | |
229 | ]) | |
230 | ||
5fb528f1 AM |
231 | # Print the bindir and libdir this `make install' will install into. |
232 | AS_ECHO() | |
233 | AS_ECHO_N("Binaries will be installed in: ") | |
234 | AS_ECHO("`eval eval echo $bindir`") | |
235 | AS_ECHO_N("Libraries will be installed in: ") | |
236 | AS_ECHO("`eval eval echo $libdir`") | |
237 | ||
994dd8a4 AM |
238 | # If we build the sessiond, print the paths it will use |
239 | AS_IF([test "x$consumerd_only" = "xno"],[ | |
240 | AS_ECHO() | |
241 | AS_ECHO("The sessiond daemon will look in the following directories: ") | |
242 | AS_ECHO_N("32-bit consumerd executable at: ") | |
243 | AS_IF([test "$CONSUMERD32_BIN" = ""],[ | |
386418ba | 244 | AS_ECHO_N("`eval eval echo $lttnglibexecdir`") |
994dd8a4 AM |
245 | AS_ECHO("/lttng-consumerd") |
246 | ],[ | |
247 | AS_ECHO("$CONSUMERD32_BIN") | |
248 | ]) | |
249 | ||
250 | AS_ECHO_N("32-bit consumer libraries in: ") | |
251 | AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[ | |
252 | AS_ECHO("`eval eval echo $libdir`") | |
253 | ],[ | |
254 | AS_ECHO("$CONSUMERD32_LIBDIR") | |
255 | ]) | |
256 | ||
257 | AS_ECHO_N("64-bit consumerd executable at: ") | |
258 | AS_IF([test "$CONSUMERD64_BIN" = ""],[ | |
386418ba | 259 | AS_ECHO_N("`eval eval echo $lttnglibexecdir`") |
994dd8a4 AM |
260 | AS_ECHO("/lttng-consumerd") |
261 | ],[ | |
262 | AS_ECHO("$CONSUMERD64_BIN") | |
263 | ]) | |
264 | ||
265 | AS_ECHO_N("64-bit consumer libraries in: ") | |
266 | AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[ | |
267 | AS_ECHO("`eval eval echo $libdir`") | |
268 | ],[ | |
269 | AS_ECHO("$CONSUMERD64_LIBDIR") | |
270 | ]) | |
271 | ]) | |
6299f964 | 272 | |
994dd8a4 | 273 | AS_ECHO() |
6299f964 | 274 |