NULL ptr validation across liblttngctl
[lttng-tools.git] / configure.ac
CommitLineData
ab7f4103 1AC_INIT([lttng-tools], [2.0-pre14], [david.goulet@polymtl.ca], ,[http://lttng.org])
fac6795d 2AC_CONFIG_AUX_DIR([config])
6e2d116c
DG
3AC_CANONICAL_TARGET
4AC_CANONICAL_HOST
fac6795d 5AC_CONFIG_MACRO_DIR([config])
0403d7c9 6AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
c615ee2f 7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
fac6795d 8
3bd1e081
MD
9AC_CONFIG_HEADERS([include/config.h])
10
fac6795d
DG
11AC_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
7753dea8
MD
17AC_ARG_VAR([LTTNG_TOOLS_32BIT_BINDIR], [Search for LTTng Tools 32-bit binaries in this location.])
18AC_DEFINE_UNQUOTED([CONFIG_32BIT_BINDIR], $LTTNG_TOOLS_32BIT_BINDIR, [Search for LTTng Tools 32-bit binaries in this location.])
19AC_ARG_VAR([LTTNG_TOOLS_64BIT_BINDIR], [Search for LTTng Tools 64-bit binaries in this location.])
20AC_DEFINE_UNQUOTED([CONFIG_64BIT_BINDIR], $LTTNG_TOOLS_64BIT_BINDIR, [Search for LTTng Tools 64-bit binaries in this location.])
43cadc7e 21
fac6795d
DG
22# Check for pthread
23AC_CHECK_LIB([pthread], [pthread_create], [],
24 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
25)
26
27# Check libpopt
28AC_CHECK_LIB([popt], [poptGetContext], [],
29 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
30)
31
6e59ae26
DG
32# URCU library version needed or newer
33liburcu_version=">= 0.6.6"
34
3ffccaed 35# Check liburcu needed function calls
fac6795d 36AC_CHECK_DECL([cds_list_add], [],
8e12081b 37 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
fac6795d 38)
099e26bd 39AC_CHECK_DECL([cds_wfq_init], [],
8e12081b
DG
40 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
41)
487cf67c
DG
42AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
43 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
44)
8e12081b
DG
45AC_CHECK_DECL([futex_async], [],
46 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
099e26bd 47)
3ffccaed
DG
48AC_CHECK_DECL([rcu_thread_offline], [],
49 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
50)
51AC_CHECK_DECL([rcu_thread_online], [],
52 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
53)
6e59ae26
DG
54AC_CHECK_DECL([caa_likely], [],
55 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
56)
57
74d0b642
MD
58# Check liblttng-ust-ctl library
59AC_ARG_ENABLE(lttng-ust,
60 [ --disable-lttng-ust build without LTTng-UST (Userspace Tracing) support.],
61 lttng_ust_support=no, lttng_ust_support=yes)
62
63[
64if test "x$lttng_ust_support" = "xno"; then
65 echo "LTTng-UST support disabled."
66else
67]
68 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
69 [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.])]
70 )
71[
72 echo "LTTng-UST support enabled."
73fi
74]
75
76AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
099e26bd 77
f6a9efaa
DG
78AC_CHECK_FUNCS([sched_getcpu sysconf])
79
3ffccaed 80# Epoll check. If not present, the build will fallback on poll() API
71615260
DG
81AX_HAVE_EPOLL(
82 [AX_CONFIG_FEATURE_ENABLE(epoll)],
83 [AX_CONFIG_FEATURE_DISABLE(epoll)]
84)
71615260
DG
85AX_CONFIG_FEATURE(
86 [epoll], [This platform supports epoll(7)],
87 [HAVE_EPOLL], [This platform supports epoll(7).],
88 [enable_epoll="yes"], [enable_epoll="no"]
89)
71615260
DG
90AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
91
fac6795d
DG
92AC_PROG_CC
93AC_PROG_LIBTOOL
94
6e2d116c
DG
95CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
96
97DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir)"
98
99lttngincludedir="${includedir}/lttng"
100
101AC_SUBST(lttngincludedir)
102AC_SUBST(DEFAULT_INCLUDES)
103
fac6795d
DG
104AC_CONFIG_FILES([
105 Makefile
106 include/Makefile
ee0326c0 107 libkernelctl/Makefile
3bd1e081
MD
108 liblttng-consumer/Makefile
109 liblttng-kconsumer/Makefile
110 liblttng-ustconsumer/Makefile
fac6795d 111 liblttngctl/Makefile
ca3c5ac0 112 liblttng-sessiond-comm/Makefile
3bd1e081 113 lttng-consumerd/Makefile
32258573 114 lttng-sessiond/Makefile
fac6795d
DG
115 lttng/Makefile
116 tests/Makefile
ebb6ebd5 117 doc/Makefile
fac6795d
DG
118])
119
120AC_OUTPUT
This page took 0.030219 seconds and 4 git commands to generate.