Tests: Move tests to tests/regression
[lttng-tools.git] / configure.ac
... / ...
CommitLineData
1AC_INIT([lttng-tools],[2.1.0],[dgoulet@efficios.com],[],[http://lttng.org])
2AC_CONFIG_AUX_DIR([config])
3AC_CANONICAL_TARGET
4AC_CANONICAL_HOST
5AC_CONFIG_MACRO_DIR([config])
6AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9version_name="Basse Messe"
10version_description="Light coloured German ale whose style was named after the city Cologne (Koln) where it was first brewed. It is a rather simple beer with lightly fruity aromas and a delicate hoppy fragrance. The beer has a pronounced malty taste with a subtle bitter aftertaste"
11
12AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "")
13AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], "")
14
15AC_CONFIG_HEADERS([include/config.h])
16
17AC_PROG_GREP
18# libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321.
19AC_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
25AS_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
42AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
43
44AC_CHECK_HEADERS([ \
45 sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \
46 signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
47 getopt.h sys/ipc.h sys/shm.h popt.h grp.h \
48])
49
50# Babeltrace viewer check
51AC_ARG_WITH([babeltrace-bin],
52 AS_HELP_STRING([--with-babeltrace-bin],
53 [Location of the babeltrace viewer executable (including the filename)]),
54 [BABELTRACE_BIN="$withval"],
55 [BABELTRACE_BIN=''])
56AC_SUBST([BABELTRACE_BIN])
57
58# lttv-gui
59AC_ARG_WITH([lttv-gui-bin],
60 AS_HELP_STRING([--with-lttv-gui-bin],
61 [Location of the lttv GUI viewer executable (including the filename)]),
62 [LTTV_GUI_BIN="$withval"],
63 [LTTV_GUI_BIN=''])
64AC_SUBST([LTTV_GUI_BIN])
65
66AC_ARG_WITH([consumerd32-bin],
67 AS_HELP_STRING([--with-consumerd32-bin],
68 [Location of the 32-bit consumerd executable (including the filename)]),
69 [CONSUMERD32_BIN="$withval"],
70 [CONSUMERD32_BIN=''])
71AC_SUBST([CONSUMERD32_BIN])
72
73AC_ARG_WITH([consumerd64-bin],
74 AS_HELP_STRING([--with-consumerd64-bin],
75 [Location of the 64-bit consumerd executable (including the filename)]),
76 [CONSUMERD64_BIN="$withval"],
77 [CONSUMERD64_BIN=''])
78AC_SUBST([CONSUMERD64_BIN])
79
80AC_ARG_WITH([consumerd32-libdir],
81 AS_HELP_STRING([--with-consumerd32-libdir],
82 [Directory containing the 32-bit consumerd libraries]),
83 [CONSUMERD32_LIBDIR="$withval"],
84 [CONSUMERD32_LIBDIR=''])
85AC_SUBST([CONSUMERD32_LIBDIR])
86
87AC_ARG_WITH([consumerd64-libdir],
88 AS_HELP_STRING([--with-consumerd64-libdir],
89 [Directory containing the 64-bit consumerd libraries]),
90 [CONSUMERD64_LIBDIR="$withval"],
91 [CONSUMERD64_LIBDIR=''])
92AC_SUBST([CONSUMERD64_LIBDIR])
93
94AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
95AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
96AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
97AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
98AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
99AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
100
101# Check for pthread
102AC_CHECK_LIB([pthread], [pthread_create], [],
103 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
104)
105
106# Check libpopt
107AC_CHECK_LIB([popt], [poptGetContext], [],
108 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
109)
110
111# Check for libuuid
112AC_CHECK_LIB([uuid], [uuid_generate],
113[
114 AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBUUID], 1, [Has libuuid support.])
115 have_libuuid=yes
116],
117[
118 # libuuid not found, check for uuid_create in libc.
119 AC_CHECK_LIB([c], [uuid_create],
120 [
121 AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
122 have_libc_uuid=yes
123 ],
124 [
125 AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.])
126 ])
127]
128)
129AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
130AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
131
132# URCU library version needed or newer
133liburcu_version=">= 0.7.2"
134
135# Check liburcu needed function calls
136AC_CHECK_DECL([cds_list_add], [],
137 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
138)
139AC_CHECK_DECL([cds_wfq_init], [],
140 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
141)
142AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
143 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
144)
145AC_CHECK_DECL([futex_async], [],
146 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
147)
148AC_CHECK_DECL([rcu_thread_offline], [],
149 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
150)
151AC_CHECK_DECL([rcu_thread_online], [],
152 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
153)
154AC_CHECK_DECL([caa_likely], [],
155 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
156)
157
158# Check liblttng-ust-ctl library
159AC_ARG_ENABLE(lttng-ust,
160 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
161 lttng_ust_support=$enableval, lttng_ust_support=yes)
162
163AS_IF([test "x$lttng_ust_support" = "xyes"], [
164 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_set_filter],
165 [
166 AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support])
167 lttng_ust_ctl_found=yes
168 ],
169 [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])],
170 [-lurcu-common -lurcu-bp -lurcu-cds -lrt]
171 )
172])
173AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
174AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
175
176# check for dlopen
177AC_CHECK_LIB([dl], [dlopen],
178[
179 have_libdl=yes
180],
181[
182 #libdl not found, check for dlopen in libc.
183 AC_CHECK_LIB([c], [dlopen],
184 [
185 have_libc_dl=yes
186 ],
187 [
188 AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
189 ])
190])
191AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
192AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
193
194# Check for fmemopen
195AC_CHECK_LIB([c], [fmemopen],
196[
197 AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.])
198]
199)
200
201# Check for open_memstream
202AC_CHECK_LIB([c], [open_memstream],
203[
204 AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])
205]
206)
207
208# For Python
209# SWIG version needed or newer:
210swig_version=2.0.0
211
212AC_ARG_ENABLE([python-bindings],
213 [AC_HELP_STRING([--enable-python-bindings],
214 [compile Python bindings])],
215 [enable_python=yes], [enable_python=no])
216
217AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes])
218
219if test "x${enable_python:-yes}" = xyes; then
220 AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
221 AM_PATH_PYTHON
222
223 AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
224 AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
225 AS_IF([test -z "$PYTHON_INCLUDE"], [
226 AS_IF([test -z "$PYTHON_CONFIG"], [
227 AC_PATH_PROGS([PYTHON_CONFIG],
228 [python$PYTHON_VERSION-config python-config],
229 [no],
230 [`dirname $PYTHON`])
231 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
232 ])
233 AC_MSG_CHECKING([python include flags])
234 PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
235 AC_MSG_RESULT([$PYTHON_INCLUDE])
236 ])
237
238else
239 AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl
240[if you want Python bindings.])
241
242fi
243
244# Option to only build the consumer daemon and its libraries
245AC_ARG_WITH([consumerd-only],
246 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
247 [consumerd_only=$withval],
248 [consumerd_only=no])
249AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
250
251# Epoll check. If not present, the build will fallback on poll() API
252AX_HAVE_EPOLL(
253 [AX_CONFIG_FEATURE_ENABLE(epoll)],
254 [AX_CONFIG_FEATURE_DISABLE(epoll)]
255)
256AX_CONFIG_FEATURE(
257 [epoll], [This platform supports epoll(7)],
258 [HAVE_EPOLL], [This platform supports epoll(7).],
259 [enable_epoll="yes"], [enable_epoll="no"]
260)
261AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
262
263AC_SYS_LARGEFILE
264AC_PROG_CC
265LT_INIT
266AC_PROG_YACC
267AC_PROG_LEX
268
269AC_DEFUN([AC_PROG_BISON], [AC_CHECK_PROGS(BISON, bison, bison)])
270
271CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
272
273DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h"
274
275lttngincludedir="${includedir}/lttng"
276
277AC_SUBST(lttngincludedir)
278AC_SUBST(DEFAULT_INCLUDES)
279
280lttnglibexecdir="${libdir}/lttng/libexec"
281AC_SUBST(lttnglibexecdir)
282
283AC_CONFIG_FILES([
284 Makefile
285 doc/Makefile
286 doc/man/Makefile
287 include/Makefile
288 extras/Makefile
289 extras/bindings/Makefile
290 extras/bindings/swig/Makefile
291 extras/bindings/swig/python/Makefile
292 src/Makefile
293 src/common/Makefile
294 src/common/kernel-ctl/Makefile
295 src/common/kernel-consumer/Makefile
296 src/common/ust-consumer/Makefile
297 src/common/hashtable/Makefile
298 src/common/sessiond-comm/Makefile
299 src/common/compat/Makefile
300 src/common/relayd/Makefile
301 src/common/testpoint/Makefile
302 src/lib/Makefile
303 src/lib/lttng-ctl/Makefile
304 src/lib/lttng-ctl/filter/Makefile
305 src/lib/lttng-ctl/lttng-ctl.pc
306 src/bin/Makefile
307 src/bin/lttng-consumerd/Makefile
308 src/bin/lttng-sessiond/Makefile
309 src/bin/lttng-relayd/Makefile
310 src/bin/lttng/Makefile
311 tests/Makefile
312 tests/regression/Makefile
313 tests/regression/kernel/Makefile
314 tests/regression/tools/Makefile
315 tests/regression/tools/streaming/Makefile
316 tests/regression/tools/filtering/Makefile
317 tests/regression/tools/health/Makefile
318 tests/regression/ust/Makefile
319 tests/regression/ust/nprocesses/Makefile
320 tests/regression/ust/high-throughput/Makefile
321 tests/regression/ust/low-throughput/Makefile
322 tests/regression/ust/before-after/Makefile
323 tests/regression/ust/multi-session/Makefile
324 tests/regression/ust/overlap/Makefile
325 tests/regression/ust/overlap/demo/Makefile
326])
327
328AC_OUTPUT
329
330#
331# Mini-report on what will be built
332#
333AS_ECHO()
334
335AS_ECHO("Version name: $version_name")
336AS_ECHO("$version_description")
337
338AS_ECHO()
339
340# Target architecture we're building for
341target_arch=$host_cpu
342[
343for f in $CFLAGS; do
344 if test $f = "-m32"; then
345 target_arch="32-bit"
346 elif test $f = "-m64"; then
347 target_arch="64-bit"
348 fi
349done
350]
351AS_ECHO_N("Target architecture: ")
352AS_ECHO($target_arch)
353
354# LTTng-UST enabled/disabled
355AS_ECHO_N("Lttng-UST support: ")
356AS_IF([test "x$lttng_ust_support" = "xyes"],[
357 AS_ECHO("Enabled")
358],[
359 AS_ECHO("Disabled")
360])
361
362#Python binding enabled/disabled
363AS_ECHO_N("Python binding: ")
364AS_IF([test "x${enable_python:-yes}" = xyes], [
365 AS_ECHO("Enabled")
366],[
367 AS_ECHO("Disabled")
368])
369
370# Do we build only the consumerd, or everything
371AS_IF([test "x$consumerd_only" = "xyes"],[
372 AS_ECHO("Only the consumerd daemon will be built.")
373],[
374 AS_ECHO("All binaries will be built.")
375])
376
377# Print the bindir and libdir this `make install' will install into.
378AS_ECHO()
379AS_ECHO_N("Binaries will be installed in: ")
380AS_ECHO("`eval eval echo $bindir`")
381AS_ECHO_N("Libraries will be installed in: ")
382AS_ECHO("`eval eval echo $libdir`")
383
384# If we build the sessiond, print the paths it will use
385AS_IF([test "x$consumerd_only" = "xno"],[
386 AS_ECHO()
387 AS_ECHO("The sessiond daemon will look in the following directories: ")
388 AS_ECHO_N("32-bit consumerd executable at: ")
389 AS_IF([test "$CONSUMERD32_BIN" = ""],[
390 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
391 AS_ECHO("/lttng-consumerd")
392 ],[
393 AS_ECHO("$CONSUMERD32_BIN")
394 ])
395
396 AS_ECHO_N("32-bit consumer libraries in: ")
397 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
398 AS_ECHO("`eval eval echo $libdir`")
399 ],[
400 AS_ECHO("$CONSUMERD32_LIBDIR")
401 ])
402
403 AS_ECHO_N("64-bit consumerd executable at: ")
404 AS_IF([test "$CONSUMERD64_BIN" = ""],[
405 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
406 AS_ECHO("/lttng-consumerd")
407 ],[
408 AS_ECHO("$CONSUMERD64_BIN")
409 ])
410
411 AS_ECHO_N("64-bit consumer libraries in: ")
412 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
413 AS_ECHO("`eval eval echo $libdir`")
414 ],[
415 AS_ECHO("$CONSUMERD64_LIBDIR")
416 ])
417])
418
419AS_ECHO()
420
This page took 0.024367 seconds and 5 git commands to generate.