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