Add the lttng view command
[lttng-tools.git] / configure.ac
... / ...
CommitLineData
1AC_INIT([lttng-tools],[2.0-pre19],[dgoulet@efficios.com],[],[http://lttng.org])
2AC_CONFIG_AUX_DIR([config])
3AC_CANONICAL_TARGET
4AC_CANONICAL_HOST
5AC_CONFIG_MACRO_DIR([config])
6AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9AC_CONFIG_HEADERS([include/config.h])
10
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
17# Babeltrace viewer check
18AC_ARG_WITH([babeltrace-bin],
19 AS_HELP_STRING([--with-babeltrace-bin],
20 [Location of the babeltrace viewer executable (including the filename)]),
21 [BABELTRACE_BIN="$withval"],
22 [BABELTRACE_BIN=''])
23AC_SUBST([BABELTRACE_BIN])
24
25# lttv-gui
26AC_ARG_WITH([lttv-gui-bin],
27 AS_HELP_STRING([--with-lttv-gui-bin],
28 [Location of the lttv GUI viewer executable (including the filename)]),
29 [LTTV_GUI_BIN="$withval"],
30 [LTTV_GUI_BIN=''])
31AC_SUBST([LTTV_GUI_BIN])
32
33AC_ARG_WITH([consumerd32-bin],
34 AS_HELP_STRING([--with-consumerd32-bin],
35 [Location of the 32-bit consumerd executable (including the filename)]),
36 [CONSUMERD32_BIN="$withval"],
37 [CONSUMERD32_BIN=''])
38AC_SUBST([CONSUMERD32_BIN])
39
40AC_ARG_WITH([consumerd64-bin],
41 AS_HELP_STRING([--with-consumerd64-bin],
42 [Location of the 64-bit consumerd executable (including the filename)]),
43 [CONSUMERD64_BIN="$withval"],
44 [CONSUMERD64_BIN=''])
45AC_SUBST([CONSUMERD64_BIN])
46
47AC_ARG_WITH([consumerd32-libdir],
48 AS_HELP_STRING([--with-consumerd32-libdir],
49 [Directory containing the 32-bit consumerd libraries]),
50 [CONSUMERD32_LIBDIR="$withval"],
51 [CONSUMERD32_LIBDIR=''])
52AC_SUBST([CONSUMERD32_LIBDIR])
53
54AC_ARG_WITH([consumer64d-libdir],
55 AS_HELP_STRING([--with-consumerd64-libdir],
56 [Directory containing the 64-bit consumerd libraries]),
57 [CONSUMERD64_LIBDIR="$withval"],
58 [CONSUMERD64_LIBDIR=''])
59AC_SUBST([CONSUMERD64_LIBDIR])
60
61AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
62AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
63AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
64AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
65AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
66AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
67
68# Check for pthread
69AC_CHECK_LIB([pthread], [pthread_create], [],
70 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
71)
72
73# Check libpopt
74AC_CHECK_LIB([popt], [poptGetContext], [],
75 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
76)
77
78# URCU library version needed or newer
79liburcu_version=">= 0.6.7"
80
81# Check liburcu needed function calls
82AC_CHECK_DECL([cds_list_add], [],
83 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
84)
85AC_CHECK_DECL([cds_wfq_init], [],
86 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
87)
88AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
89 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
90)
91AC_CHECK_DECL([futex_async], [],
92 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
93)
94AC_CHECK_DECL([rcu_thread_offline], [],
95 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
96)
97AC_CHECK_DECL([rcu_thread_online], [],
98 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
99)
100AC_CHECK_DECL([caa_likely], [],
101 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
102)
103
104# Check liblttng-ust-ctl library
105AC_ARG_ENABLE(lttng-ust,
106 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
107 lttng_ust_support=$enableval, lttng_ust_support=yes)
108
109AS_IF([test "x$lttng_ust_support" = "xyes"], [
110 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
111 [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.])]
112 )
113])
114
115AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
116
117AC_CHECK_FUNCS([sched_getcpu sysconf])
118
119# Option to only build the consumer daemon and its libraries
120AC_ARG_WITH([consumerd-only],
121 AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]),
122 [consumerd_only=$withval],
123 [consumerd_only=no])
124AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"])
125
126# Epoll check. If not present, the build will fallback on poll() API
127AX_HAVE_EPOLL(
128 [AX_CONFIG_FEATURE_ENABLE(epoll)],
129 [AX_CONFIG_FEATURE_DISABLE(epoll)]
130)
131AX_CONFIG_FEATURE(
132 [epoll], [This platform supports epoll(7)],
133 [HAVE_EPOLL], [This platform supports epoll(7).],
134 [enable_epoll="yes"], [enable_epoll="no"]
135)
136AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
137
138AC_PROG_CC
139LT_INIT
140
141CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
142
143DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include"
144
145lttngincludedir="${includedir}/lttng"
146
147AC_SUBST(lttngincludedir)
148AC_SUBST(DEFAULT_INCLUDES)
149
150AC_CONFIG_FILES([
151 Makefile
152 doc/Makefile
153 include/Makefile
154 src/Makefile
155 src/common/Makefile
156 src/common/kernel-ctl/Makefile
157 src/common/kernel-consumer/Makefile
158 src/common/ust-consumer/Makefile
159 src/common/hashtable/Makefile
160 src/common/sessiond-comm/Makefile
161 src/lib/Makefile
162 src/lib/lttng-ctl/Makefile
163 src/bin/Makefile
164 src/bin/lttng-consumerd/Makefile
165 src/bin/lttng-sessiond/Makefile
166 src/bin/lttng/Makefile
167 tests/Makefile
168 tests/ust-nevents/Makefile
169 tests/ust-nprocesses/Makefile
170])
171
172AC_OUTPUT
173
174#
175# Mini-report on what will be built
176#
177AS_ECHO()
178
179# Target architecture we're building for
180target_arch=$host_cpu
181[
182for f in $CFLAGS; do
183 if test $f = "-m32"; then
184 target_arch="32-bit"
185 elif test $f = "-m64"; then
186 target_arch="64-bit"
187 fi
188done
189]
190AS_ECHO_N("Target architecture: ")
191AS_ECHO($target_arch)
192
193# LTTng-UST enabled/disabled
194AS_ECHO_N("Lttng-UST support: ")
195AS_IF([test "x$lttng_ust_support" = "xyes"],[
196 AS_ECHO("Enabled")
197],[
198 AS_ECHO("Disabled")
199])
200
201# Do we build only the consumerd, or everything
202AS_IF([test "x$consumerd_only" = "xyes"],[
203 AS_ECHO("Only the consumerd daemon will be built.")
204],[
205 AS_ECHO("All binaries will be built.")
206])
207
208# Print the bindir and libdir this `make install' will install into.
209AS_ECHO()
210AS_ECHO_N("Binaries will be installed in: ")
211AS_ECHO("`eval eval echo $bindir`")
212AS_ECHO_N("Libraries will be installed in: ")
213AS_ECHO("`eval eval echo $libdir`")
214
215# If we build the sessiond, print the paths it will use
216AS_IF([test "x$consumerd_only" = "xno"],[
217 AS_ECHO()
218 AS_ECHO("The sessiond daemon will look in the following directories: ")
219 AS_ECHO_N("32-bit consumerd executable at: ")
220 AS_IF([test "$CONSUMERD32_BIN" = ""],[
221 AS_ECHO_N("`eval eval echo $bindir`")
222 AS_ECHO("/lttng-consumerd")
223 ],[
224 AS_ECHO("$CONSUMERD32_BIN")
225 ])
226
227 AS_ECHO_N("32-bit consumer libraries in: ")
228 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
229 AS_ECHO("`eval eval echo $libdir`")
230 ],[
231 AS_ECHO("$CONSUMERD32_LIBDIR")
232 ])
233
234 AS_ECHO_N("64-bit consumerd executable at: ")
235 AS_IF([test "$CONSUMERD64_BIN" = ""],[
236 AS_ECHO_N("`eval eval echo $bindir`")
237 AS_ECHO("/lttng-consumerd")
238 ],[
239 AS_ECHO("$CONSUMERD64_BIN")
240 ])
241
242 AS_ECHO_N("64-bit consumer libraries in: ")
243 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
244 AS_ECHO("`eval eval echo $libdir`")
245 ],[
246 AS_ECHO("$CONSUMERD64_LIBDIR")
247 ])
248])
249
250AS_ECHO()
251
This page took 0.023224 seconds and 4 git commands to generate.