Cleanup configure.ac
[lttng-tools.git] / configure.ac
CommitLineData
d46482f0 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
ebaeda94 17AC_ARG_WITH([consumerd32-path],
a4b279ba 18 AS_HELP_STRING([--with-consumerd32-path],
ebaeda94
MD
19 [Location of the 32-bit consumerd executable]),
20 [CONSUMERD32_PATH="$withval"],
21 [CONSUMERD32_PATH=''])
22AC_SUBST([CONSUMERD32_PATH])
23
24AC_ARG_WITH([consumerd64-path],
a4b279ba 25 AS_HELP_STRING([--with-consumerd64-path],
ebaeda94
MD
26 [Location of the 64-bit consumerd executable]),
27 [CONSUMERD64_PATH="$withval"],
28 [CONSUMERD64_PATH=''])
29AC_SUBST([CONSUMERD64_PATH])
30
31AC_ARG_WITH([consumerd32-libdir],
a4b279ba 32 AS_HELP_STRING([--with-consumerd32-libdir],
ebaeda94
MD
33 [Location of the 32-bit consumerd libraries]),
34 [CONSUMERD32_LIBDIR="$withval"],
35 [CONSUMERD32_LIBDIR=''])
36AC_SUBST([CONSUMERD32_LIBDIR])
37
38AC_ARG_WITH([consumer64d-libdir],
a4b279ba 39 AS_HELP_STRING([--with-consumerd64-libdir],
ebaeda94
MD
40 [Location of the 64-bit consumerd libraries]),
41 [CONSUMERD64_LIBDIR="$withval"],
42 [CONSUMERD64_LIBDIR=''])
43AC_SUBST([CONSUMERD64_LIBDIR])
44
45AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_PATH], $CONSUMERD32_PATH, [Location of the 32-bit consumerd executable.])
46AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_PATH], $CONSUMERD64_PATH, [Location of the 64-bit consumerd executable])
47AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], $CONSUMERD32_LIBDIR, [Search for consumerd 32-bit libraries in this location.])
48AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], $CONSUMERD64_LIBDIR, [Search for consumerd 64-bit libraries in this location.])
43cadc7e 49
fac6795d
DG
50# Check for pthread
51AC_CHECK_LIB([pthread], [pthread_create], [],
52 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
53)
54
55# Check libpopt
56AC_CHECK_LIB([popt], [poptGetContext], [],
57 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
58)
59
6e59ae26
DG
60# URCU library version needed or newer
61liburcu_version=">= 0.6.6"
62
3ffccaed 63# Check liburcu needed function calls
fac6795d 64AC_CHECK_DECL([cds_list_add], [],
8e12081b 65 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
fac6795d 66)
099e26bd 67AC_CHECK_DECL([cds_wfq_init], [],
8e12081b
DG
68 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
69)
487cf67c
DG
70AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
71 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
72)
8e12081b
DG
73AC_CHECK_DECL([futex_async], [],
74 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
099e26bd 75)
3ffccaed
DG
76AC_CHECK_DECL([rcu_thread_offline], [],
77 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
78)
79AC_CHECK_DECL([rcu_thread_online], [],
80 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
81)
6e59ae26
DG
82AC_CHECK_DECL([caa_likely], [],
83 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
84)
85
74d0b642
MD
86# Check liblttng-ust-ctl library
87AC_ARG_ENABLE(lttng-ust,
6299f964 88 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
0e636c80 89 lttng_ust_support=$enableval, lttng_ust_support=yes)
74d0b642 90
6299f964 91AS_IF([test "x$lttng_ust_support" = "xyes"], [
74d0b642
MD
92 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
93 [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.])]
94 )
6299f964 95])
74d0b642
MD
96
97AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
099e26bd 98
f6a9efaa
DG
99AC_CHECK_FUNCS([sched_getcpu sysconf])
100
3ffccaed 101# Epoll check. If not present, the build will fallback on poll() API
71615260
DG
102AX_HAVE_EPOLL(
103 [AX_CONFIG_FEATURE_ENABLE(epoll)],
104 [AX_CONFIG_FEATURE_DISABLE(epoll)]
105)
71615260
DG
106AX_CONFIG_FEATURE(
107 [epoll], [This platform supports epoll(7)],
108 [HAVE_EPOLL], [This platform supports epoll(7).],
109 [enable_epoll="yes"], [enable_epoll="no"]
110)
71615260
DG
111AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
112
fac6795d 113AC_PROG_CC
d46482f0 114LT_INIT
fac6795d 115
6e2d116c
DG
116CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
117
118DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir)"
119
120lttngincludedir="${includedir}/lttng"
121
122AC_SUBST(lttngincludedir)
123AC_SUBST(DEFAULT_INCLUDES)
124
fac6795d
DG
125AC_CONFIG_FILES([
126 Makefile
127 include/Makefile
ee0326c0 128 libkernelctl/Makefile
3bd1e081
MD
129 liblttng-consumer/Makefile
130 liblttng-kconsumer/Makefile
131 liblttng-ustconsumer/Makefile
fac6795d 132 liblttngctl/Makefile
ca3c5ac0 133 liblttng-sessiond-comm/Makefile
3bd1e081 134 lttng-consumerd/Makefile
32258573 135 lttng-sessiond/Makefile
fac6795d
DG
136 lttng/Makefile
137 tests/Makefile
ebb6ebd5 138 doc/Makefile
fac6795d
DG
139])
140
141AC_OUTPUT
6299f964
AM
142
143# Mini-report on what will be built
144AS_ECHO("")
145
146AS_ECHO_N("Lttng-UST support: ")
147AS_IF([test "x$lttng_ust_support" = "xyes"], [AS_ECHO("Enabled")],
148 [AS_ECHO("Disabled")])
149
150AS_ECHO("")
151
This page took 0.044773 seconds and 4 git commands to generate.