Add consumer socket object and relayd commands
[lttng-tools.git] / configure.ac
1 AC_INIT([lttng-tools],[2.0.1],[dgoulet@efficios.com],[],[http://lttng.org])
2 AC_CONFIG_AUX_DIR([config])
3 AC_CANONICAL_TARGET
4 AC_CANONICAL_HOST
5 AC_CONFIG_MACRO_DIR([config])
6 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9 version_name="Annedd'ale"
10 version_description="New type of beer, 100% from Quebec, flavored with sapin beaumier needles, with a touch of hops."
11
12 AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "")
13 AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description"], "")
14
15 AC_CONFIG_HEADERS([include/config.h])
16
17 AC_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
23 # Babeltrace viewer check
24 AC_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=''])
29 AC_SUBST([BABELTRACE_BIN])
30
31 # lttv-gui
32 AC_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=''])
37 AC_SUBST([LTTV_GUI_BIN])
38
39 AC_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=''])
44 AC_SUBST([CONSUMERD32_BIN])
45
46 AC_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=''])
51 AC_SUBST([CONSUMERD64_BIN])
52
53 AC_ARG_WITH([consumerd32-libdir],
54 AS_HELP_STRING([--with-consumerd32-libdir],
55 [Directory containing the 32-bit consumerd libraries]),
56 [CONSUMERD32_LIBDIR="$withval"],
57 [CONSUMERD32_LIBDIR=''])
58 AC_SUBST([CONSUMERD32_LIBDIR])
59
60 AC_ARG_WITH([consumerd64-libdir],
61 AS_HELP_STRING([--with-consumerd64-libdir],
62 [Directory containing the 64-bit consumerd libraries]),
63 [CONSUMERD64_LIBDIR="$withval"],
64 [CONSUMERD64_LIBDIR=''])
65 AC_SUBST([CONSUMERD64_LIBDIR])
66
67 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
68 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
69 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
70 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
71 AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
72 AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
73
74 # Check for pthread
75 AC_CHECK_LIB([pthread], [pthread_create], [],
76 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
77 )
78
79 # Check libpopt
80 AC_CHECK_LIB([popt], [poptGetContext], [],
81 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
82 )
83
84 # URCU library version needed or newer
85 liburcu_version=">= 0.6.7"
86
87 # Check liburcu needed function calls
88 AC_CHECK_DECL([cds_list_add], [],
89 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
90 )
91 AC_CHECK_DECL([cds_wfq_init], [],
92 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
93 )
94 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
95 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
96 )
97 AC_CHECK_DECL([futex_async], [],
98 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
99 )
100 AC_CHECK_DECL([rcu_thread_offline], [],
101 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
102 )
103 AC_CHECK_DECL([rcu_thread_online], [],
104 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
105 )
106 AC_CHECK_DECL([caa_likely], [],
107 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
108 )
109
110 # Check liblttng-ust-ctl library
111 AC_ARG_ENABLE(lttng-ust,
112 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
113 lttng_ust_support=$enableval, lttng_ust_support=yes)
114
115 AS_IF([test "x$lttng_ust_support" = "xyes"], [
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 )
119 ])
120
121 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
122
123 AC_CHECK_FUNCS([sched_getcpu sysconf])
124
125 # check for dlopen
126 AC_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 ])
140 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
141 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
142
143 # Check for fmemopen
144 AC_CHECK_LIB([c], [fmemopen],
145 [
146 AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.])
147 ]
148 )
149
150 # Check for open_memstream
151 AC_CHECK_LIB([c], [open_memstream],
152 [
153 AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])
154 ]
155 )
156
157 # Option to only build the consumer daemon and its libraries
158 AC_ARG_WITH([consumerd-only],
159 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
160 [consumerd_only=$withval],
161 [consumerd_only=no])
162 AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
163
164 # Epoll check. If not present, the build will fallback on poll() API
165 AX_HAVE_EPOLL(
166 [AX_CONFIG_FEATURE_ENABLE(epoll)],
167 [AX_CONFIG_FEATURE_DISABLE(epoll)]
168 )
169 AX_CONFIG_FEATURE(
170 [epoll], [This platform supports epoll(7)],
171 [HAVE_EPOLL], [This platform supports epoll(7).],
172 [enable_epoll="yes"], [enable_epoll="no"]
173 )
174 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
175
176 AC_SYS_LARGEFILE
177 AC_PROG_CC
178 LT_INIT
179 AC_PROG_YACC
180 AC_PROG_LEX
181
182 AC_DEFUN([AC_PROG_BISON], [AC_CHECK_PROGS(BISON, bison, bison)])
183
184 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
185
186 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h"
187
188 lttngincludedir="${includedir}/lttng"
189
190 AC_SUBST(lttngincludedir)
191 AC_SUBST(DEFAULT_INCLUDES)
192
193 lttnglibexecdir="${libdir}/lttng/libexec"
194 AC_SUBST(lttnglibexecdir)
195
196 AC_CONFIG_FILES([
197 Makefile
198 doc/Makefile
199 doc/man/Makefile
200 include/Makefile
201 src/Makefile
202 src/common/Makefile
203 src/common/kernel-ctl/Makefile
204 src/common/kernel-consumer/Makefile
205 src/common/ust-consumer/Makefile
206 src/common/hashtable/Makefile
207 src/common/sessiond-comm/Makefile
208 src/common/compat/Makefile
209 src/common/relayd/Makefile
210 src/lib/Makefile
211 src/lib/lttng-ctl/Makefile
212 src/bin/Makefile
213 src/bin/lttng-consumerd/Makefile
214 src/bin/lttng-sessiond/Makefile
215 src/bin/lttng-relayd/Makefile
216 src/bin/lttng/Makefile
217 tests/Makefile
218 tests/kernel/Makefile
219 tests/tools/Makefile
220 tests/tools/streaming/Makefile
221 tests/ust/Makefile
222 tests/ust/nprocesses/Makefile
223 tests/ust/high-throughput/Makefile
224 tests/ust/low-throughput/Makefile
225 tests/ust/before-after/Makefile
226 tests/ust/multi-session/Makefile
227 ])
228
229 AC_OUTPUT
230
231 #
232 # Mini-report on what will be built
233 #
234 AS_ECHO()
235
236 AS_ECHO("Version name: $version_name")
237 AS_ECHO("$version_description")
238
239 AS_ECHO()
240
241 # Target architecture we're building for
242 target_arch=$host_cpu
243 [
244 for f in $CFLAGS; do
245 if test $f = "-m32"; then
246 target_arch="32-bit"
247 elif test $f = "-m64"; then
248 target_arch="64-bit"
249 fi
250 done
251 ]
252 AS_ECHO_N("Target architecture: ")
253 AS_ECHO($target_arch)
254
255 # LTTng-UST enabled/disabled
256 AS_ECHO_N("Lttng-UST support: ")
257 AS_IF([test "x$lttng_ust_support" = "xyes"],[
258 AS_ECHO("Enabled")
259 ],[
260 AS_ECHO("Disabled")
261 ])
262
263 # Do we build only the consumerd, or everything
264 AS_IF([test "x$consumerd_only" = "xyes"],[
265 AS_ECHO("Only the consumerd daemon will be built.")
266 ],[
267 AS_ECHO("All binaries will be built.")
268 ])
269
270 # Print the bindir and libdir this `make install' will install into.
271 AS_ECHO()
272 AS_ECHO_N("Binaries will be installed in: ")
273 AS_ECHO("`eval eval echo $bindir`")
274 AS_ECHO_N("Libraries will be installed in: ")
275 AS_ECHO("`eval eval echo $libdir`")
276
277 # If we build the sessiond, print the paths it will use
278 AS_IF([test "x$consumerd_only" = "xno"],[
279 AS_ECHO()
280 AS_ECHO("The sessiond daemon will look in the following directories: ")
281 AS_ECHO_N("32-bit consumerd executable at: ")
282 AS_IF([test "$CONSUMERD32_BIN" = ""],[
283 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
284 AS_ECHO("/lttng-consumerd")
285 ],[
286 AS_ECHO("$CONSUMERD32_BIN")
287 ])
288
289 AS_ECHO_N("32-bit consumer libraries in: ")
290 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
291 AS_ECHO("`eval eval echo $libdir`")
292 ],[
293 AS_ECHO("$CONSUMERD32_LIBDIR")
294 ])
295
296 AS_ECHO_N("64-bit consumerd executable at: ")
297 AS_IF([test "$CONSUMERD64_BIN" = ""],[
298 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
299 AS_ECHO("/lttng-consumerd")
300 ],[
301 AS_ECHO("$CONSUMERD64_BIN")
302 ])
303
304 AS_ECHO_N("64-bit consumer libraries in: ")
305 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
306 AS_ECHO("`eval eval echo $libdir`")
307 ],[
308 AS_ECHO("$CONSUMERD64_LIBDIR")
309 ])
310 ])
311
312 AS_ECHO()
313
This page took 0.038145 seconds and 4 git commands to generate.