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