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