Port: cleanup and portability fix to configure.ac
[lttng-tools.git] / configure.ac
1 AC_PREREQ([2.64])
2 AC_INIT([lttng-tools],[2.8.0-pre],[jeremie.galarneau@efficios.com],[],[https://lttng.org])
3
4 AC_CONFIG_HEADERS([include/config.h])
5 AC_CONFIG_AUX_DIR([config])
6 AC_CONFIG_MACRO_DIR([m4])
7
8 AC_CANONICAL_TARGET
9 AC_CANONICAL_HOST
10
11 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
12 AM_MAINTAINER_MODE([enable])
13
14 # Enable silent rules if available (Introduced in AM 1.11)
15 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
16
17 # Checks for C compiler
18 AC_USE_SYSTEM_EXTENSIONS
19 AC_SYS_LARGEFILE
20 AC_PROG_CC
21 AC_PROG_CC_STDC
22
23 # Checks for programs.
24 AC_PROG_GREP
25 AC_PROG_LEX
26 AC_PROG_MAKE_SET
27 AC_PROG_SED
28 AC_PROG_YACC
29 LT_INIT
30
31 # Checks for typedefs, structures, and compiler characteristics.
32 AC_C_INLINE
33 AC_TYPE_INT32_T
34 AC_TYPE_INT64_T
35 AC_TYPE_MODE_T
36 AC_TYPE_OFF_T
37 AC_TYPE_PID_T
38 AC_TYPE_SIZE_T
39 AC_TYPE_SSIZE_T
40 AC_TYPE_UID_T
41 AC_TYPE_UINT16_T
42 AC_TYPE_UINT32_T
43 AC_TYPE_UINT64_T
44 AC_TYPE_UINT8_T
45
46 AX_C___ATTRIBUTE__
47 AS_IF([test "x$ax_cv___attribute__" = "xyes"],
48 [:],
49 [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
50
51 AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
52 LIBS="$PTHREAD_LIBS $LIBS"
53 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
54 CC="$PTHREAD_CC"
55
56 # Compute minor/major/patchlevel version numbers
57 major_version=$(echo AC_PACKAGE_VERSION | $SED 's/^\([[0-9]]\)*\.[[0-9]]*\.[[0-9]]*.*$/\1/')
58 minor_version=$(echo AC_PACKAGE_VERSION | $SED 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
59 patchlevel_version=$(echo AC_PACKAGE_VERSION | $SED 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\).*$/\1/')
60 AC_SUBST([MAJOR_VERSION], [$major_version])
61 AC_SUBST([MINOR_VERSION], [$minor_version])
62 AC_SUBST([PATCHLEVEL_VERSION], [$patchlevel_version])
63 AC_DEFINE_UNQUOTED([VERSION_MAJOR], $major_version, [LTTng-Tools major version number])
64 AC_DEFINE_UNQUOTED([VERSION_MINOR], $minor_version, [LTTng-Tools minor version number])
65 AC_DEFINE_UNQUOTED([VERSION_PATCHLEVEL], $patchlevel_version, [LTTng-Tools patchlevel version number])
66
67 version_name="Herbe à Détourne"
68 version_description='Brewed with unrestrained amounts of Citra hop, the Herbe à Détourne is a fantastic New World Tripel brewed by "Dieu du Ciel!". Aromas of mango, cantaloupe melon and passion fruit, combined with a controlled bitter finish, unite in making this smooth golden-orange beer stand apart.'
69 version_description_c=$(echo $version_description | $SED 's/"/\\"/g')
70
71 AC_DEFINE_UNQUOTED([VERSION_NAME], ["$version_name"], "")
72 AC_DEFINE_UNQUOTED([VERSION_DESCRIPTION], ["$version_description_c"], "")
73
74 # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321.
75 AC_ARG_ENABLE(libtool-linkdep-fixup,
76 AS_HELP_STRING([--disable-libtool-linkdep-fixup],
77 [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]),
78 libtool_fixup=$enableval,
79 libtool_fixup=yes)
80
81 AS_IF([test "x$libtool_fixup" = "xyes"],
82 [
83 libtool_m4="$srcdir/m4/libtool.m4"
84 libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)"
85 AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4])
86 libtool_flag_pattern_count=$($GREP -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4)
87 AS_IF([test $libtool_flag_pattern_count -ne 0],
88 [
89 AC_MSG_RESULT([$libtool_flag_pattern_count])
90 AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown])
91 SED -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4
92 ],
93 [
94 AC_MSG_RESULT([none])
95 ])
96 ])
97
98 AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno])
99
100 AC_CHECK_HEADERS([ \
101 sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \
102 signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \
103 getopt.h sys/ipc.h sys/shm.h popt.h grp.h arpa/inet.h \
104 netdb.h netinet/in.h paths.h stddef.h sys/file.h sys/ioctl.h \
105 sys/mount.h sys/param.h sys/time.h
106 ])
107
108 # Basic functions check
109 AC_CHECK_FUNCS([ \
110 atexit bzero clock_gettime dup2 fdatasync fls ftruncate \
111 gethostbyname gethostname getpagesize localtime_r memchr memset \
112 mkdir munmap putenv realpath rmdir socket strchr strcspn strdup \
113 strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul \
114 strtoull \
115 ])
116
117 # Babeltrace viewer check
118 AC_ARG_WITH([babeltrace-bin],
119 AS_HELP_STRING([--with-babeltrace-bin],
120 [Location of the babeltrace viewer executable (including the filename)]),
121 [BABELTRACE_BIN="$withval"],
122 [BABELTRACE_BIN=''])
123 AC_SUBST([BABELTRACE_BIN])
124
125 # lttv-gui
126 AC_ARG_WITH([lttv-gui-bin],
127 AS_HELP_STRING([--with-lttv-gui-bin],
128 [Location of the lttv GUI viewer executable (including the filename)]),
129 [LTTV_GUI_BIN="$withval"],
130 [LTTV_GUI_BIN=''])
131 AC_SUBST([LTTV_GUI_BIN])
132
133 AC_ARG_WITH([consumerd32-bin],
134 AS_HELP_STRING([--with-consumerd32-bin],
135 [Location of the 32-bit consumerd executable (including the filename)]),
136 [CONSUMERD32_BIN="$withval"],
137 [CONSUMERD32_BIN=''])
138 AC_SUBST([CONSUMERD32_BIN])
139
140 AC_ARG_WITH([consumerd64-bin],
141 AS_HELP_STRING([--with-consumerd64-bin],
142 [Location of the 64-bit consumerd executable (including the filename)]),
143 [CONSUMERD64_BIN="$withval"],
144 [CONSUMERD64_BIN=''])
145 AC_SUBST([CONSUMERD64_BIN])
146
147 AC_ARG_WITH([consumerd32-libdir],
148 AS_HELP_STRING([--with-consumerd32-libdir],
149 [Directory containing the 32-bit consumerd libraries]),
150 [CONSUMERD32_LIBDIR="$withval"],
151 [CONSUMERD32_LIBDIR=''])
152 AC_SUBST([CONSUMERD32_LIBDIR])
153
154 AC_ARG_WITH([consumerd64-libdir],
155 AS_HELP_STRING([--with-consumerd64-libdir],
156 [Directory containing the 64-bit consumerd libraries]),
157 [CONSUMERD64_LIBDIR="$withval"],
158 [CONSUMERD64_LIBDIR=''])
159 AC_SUBST([CONSUMERD64_LIBDIR])
160
161 AC_ARG_WITH([sessiond-bin],
162 AS_HELP_STRING([--with-sessiond-bin],
163 [Location of the sessiond executable (including the filename)]),
164 [SESSIOND_BIN="$withval"],
165 [SESSIOND_BIN=''])
166 AC_SUBST([SESSIOND_BIN])
167
168 AC_ARG_WITH([lttng-system-rundir],
169 AS_HELP_STRING([--with-lttng-system-rundir],
170 [Location of the system directory where the system-wide lttng-sessiond runtime files are kept. The default is "/var/run/lttng".]),
171 [LTTNG_SYSTEM_RUNDIR="$withval"],
172 [LTTNG_SYSTEM_RUNDIR="/var/run/lttng"])
173 AC_SUBST([LTTNG_SYSTEM_RUNDIR])
174
175 AC_ARG_ENABLE([test-java-agent-jul],
176 [AS_HELP_STRING([--enable-test-java-agent-jul],[enable the LTTng UST Java agent JUL tests [default=no]])],
177 [test_java_agent_jul=$enableval],
178 [test_java_agent_jul=no]
179 )
180
181 AC_ARG_ENABLE([test-java-agent-log4j],
182 [AS_HELP_STRING([--enable-test-java-agent-log4j],[enable the LTTng UST Java agent Log4j tests [default=no]])],
183 [test_java_agent_log4j=$enableval],
184 [test_java_agent_log4j=no]
185 )
186
187 AC_ARG_ENABLE([test-java-agent-all],
188 [AS_HELP_STRING([--enable-test-java-agent-all],[enable all the LTTng UST Java agent tests [default=no]])],
189 [test_java_agent_jul=$enableval
190 test_java_agent_log4j=$enableval],
191 [:]
192 )
193
194 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
195 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
196 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
197 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
198 AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.])
199 AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.])
200 AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.])
201 AC_DEFINE_UNQUOTED([CONFIG_LTTNG_SYSTEM_RUNDIR], ["$LTTNG_SYSTEM_RUNDIR"], [LTTng system runtime directory])
202
203 if test "x$prefix" = "xNONE"; then
204 prefix=$ac_default_prefix
205 fi
206 CONFDIR=`eval echo $sysconfdir`
207 AC_SUBST(CONFDIR)
208 AC_DEFINE_UNQUOTED([CONFIG_LTTNG_SYSTEM_CONFIGDIR],"$CONFDIR", [LTTng system configuration directory.])
209
210 AC_DEFINE_DIR([CONFIG_LTTNG_SYSTEM_DATADIR],[datadir], [LTTng system data directory.])
211
212 #
213 # Check for pthread
214 AC_CHECK_LIB([pthread], [pthread_create], [],
215 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
216 )
217
218 # Check libpopt
219 AC_CHECK_LIB([popt], [poptGetContext], [],
220 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
221 )
222
223 AM_PATH_XML2(2.7.6, true, AC_MSG_ERROR(No supported version of libxml2 found.))
224
225 # Check for libuuid
226 AC_CHECK_LIB([uuid], [uuid_generate],
227 [
228 AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBUUID], 1, [Has libuuid support.])
229 have_libuuid=yes
230 ],
231 [
232 # libuuid not found, check for uuid_create in libc.
233 AC_CHECK_LIB([c], [uuid_create],
234 [
235 AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBC_UUID], 1, [Has libc uuid support.])
236 have_libc_uuid=yes
237 ],
238 [
239 AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.])
240 ])
241 ]
242 )
243 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
244 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
245
246 # URCU library version needed or newer
247 liburcu_version=">= 0.8.0"
248
249 # Check liburcu needed function calls
250 AC_CHECK_DECL([cds_list_add], [],
251 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
252 )
253 AC_CHECK_DECL([cds_wfcq_init], [],
254 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfcqueue.h>]]
255 )
256 AC_CHECK_DECL([cds_wfcq_dequeue_blocking], [],
257 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfcqueue.h>]]
258 )
259 AC_CHECK_DECL([futex_async], [],
260 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
261 )
262 AC_CHECK_DECL([rcu_thread_offline], [],
263 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
264 )
265 AC_CHECK_DECL([rcu_thread_online], [],
266 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
267 )
268 AC_CHECK_DECL([caa_likely], [],
269 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
270 )
271 #Function added in urcu 0.7.0
272 AC_CHECK_DECL([cmm_smp_mb__before_uatomic_or], [],
273 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
274 )
275
276 # Check kmod library
277 AC_ARG_WITH(kmod-prefix,
278 AS_HELP_STRING([--with-kmod-prefix=PATH],
279 [Specify the installation prefix of the kmod library.
280 Headers must be in PATH/include; libraries in PATH/lib.]),
281 [
282 CPPFLAGS="$CPPFLAGS -I${withval}/include"
283 LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib"
284 ])
285
286 AC_ARG_ENABLE(kmod,
287 AS_HELP_STRING([--disable-kmod],[build without kmod support]),
288 kmod_support=zz$enableval, kmod_support=yes)
289
290 AS_IF([test "x$kmod_support" = "xyes"], [
291 AC_CHECK_LIB([kmod], [kmod_module_probe_insert_module],
292 [
293 AC_DEFINE([HAVE_KMOD], [1], [has kmod support])
294 LIBS="$LIBS -lkmod"
295 kmod_found=yes
296 ],
297 kmod_found=no
298 )
299 ])
300 AM_CONDITIONAL([HAVE_KMOD], [test "x$kmod_found" = xyes])
301
302 AC_ARG_WITH(lttng-ust-prefix,
303 AS_HELP_STRING([--with-lttng-ust-prefix=PATH],
304 [Specify the installation prefix of the lttng-ust library.
305 Headers must be in PATH/include; libraries in PATH/lib.]),
306 [
307 CPPFLAGS="$CPPFLAGS -I${withval}/include"
308 LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib"
309 ])
310
311 # Check liblttng-ust-ctl library
312 AC_ARG_ENABLE(lttng-ust,
313 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
314 lttng_ust_support=$enableval, lttng_ust_support=yes)
315
316 AS_IF([test "x$lttng_ust_support" = "xyes"], [
317 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_recv_channel_from_consumer],
318 [
319 AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support])
320 lttng_ust_ctl_found=yes
321 ],
322 [AC_MSG_ERROR([Cannot find LTTng-UST >= 2.2.x. Use --with-lttng-ust-prefix=PREFIX to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])],
323 [-lurcu-common -lurcu-bp -lurcu-cds -lrt -ldl]
324 )
325 ])
326 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes])
327 AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range])
328
329 # check for dlopen
330 AC_CHECK_LIB([dl], [dlopen],
331 [
332 have_libdl=yes
333 ],
334 [
335 #libdl not found, check for dlopen in libc.
336 AC_CHECK_LIB([c], [dlopen],
337 [
338 have_libc_dl=yes
339 ],
340 [
341 AC_MSG_ERROR([Cannot find dlopen in libdl nor libc. Use [LDFLAGS]=-Ldir to specify their location.])
342 ])
343 ])
344 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBDL], [test "x$have_libdl" = "xyes"])
345 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
346
347 # Check for fmemopen
348 AC_CHECK_LIB([c], [fmemopen],
349 [
350 AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.])
351 ]
352 )
353
354 # Check for open_memstream
355 AC_CHECK_LIB([c], [open_memstream],
356 [
357 AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])
358 ]
359 )
360
361 AC_ARG_ENABLE([git-version],
362 [AC_HELP_STRING([--disable-git-version],
363 [Do not use the git version for the build])],
364 [have_git_version=$enableval], [have_git_version=yes]
365 )
366
367 AM_CONDITIONAL([LTTNG_TOOLS_BUILD_GIT_SOURCE],
368 [test "x${have_git_version}" = "xyes"])
369
370 # For Python
371 # SWIG version needed or newer:
372 swig_version=2.0.0
373
374 AC_ARG_ENABLE([python-bindings],
375 [AC_HELP_STRING([--enable-python-bindings],
376 [compile Python bindings])],
377 [enable_python_binding=yes], [enable_python_binding=no])
378
379 AM_CONDITIONAL([PYTHON_BINDING], [test "x${enable_python_binding:-yes}" = xyes])
380
381 if test "x${enable_python_binding:-yes}" = xyes; then
382 AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ])
383 AM_PATH_PYTHON([3.0])
384
385 AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
386 AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
387 AS_IF([test -z "$PYTHON_INCLUDE"], [
388 AS_IF([test -z "$PYTHON_CONFIG"], [
389 AC_PATH_PROGS([PYTHON_CONFIG],
390 [python$PYTHON_VERSION-config python-config],
391 [no],
392 [`dirname $PYTHON`])
393 AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])])
394 ])
395 AC_MSG_CHECKING([python include flags])
396 PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
397 AC_MSG_RESULT([$PYTHON_INCLUDE])
398 ])
399
400 else
401 AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl
402 [if you want Python bindings.])
403
404 fi
405
406 AX_LIB_SOCKET_NSL
407
408 # Epoll check. If not present, the build will fallback on poll() API
409 AX_HAVE_EPOLL(
410 [AX_CONFIG_FEATURE_ENABLE(epoll)],
411 [AX_CONFIG_FEATURE_DISABLE(epoll)]
412 )
413 AX_CONFIG_FEATURE(
414 [epoll], [This platform supports epoll(7)],
415 [HAVE_EPOLL], [This platform supports epoll(7).],
416 [enable_epoll="yes"], [enable_epoll="no"]
417 )
418 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
419
420 AM_CONDITIONAL([TEST_JAVA_JUL_AGENT], [test "x$test_java_agent_jul" = "xyes"])
421 AM_CONDITIONAL([TEST_JAVA_LOG4J_AGENT], [test "x$test_java_agent_log4j" = "xyes"])
422
423 if test "x$test_java_agent_jul" = "xyes" || test "x$test_java_agent_log4j" = "xyes"; then
424 AX_JAVA_OPTIONS
425 AX_PROG_JAVAC
426 AX_PROG_JAVA
427 AX_PROG_JAR
428
429 AX_CHECK_CLASSPATH
430
431 # Check for Java UST agent common class first
432 AX_CHECK_CLASS(org.lttng.ust.agent.AbstractLttngAgent)
433 if test "x$ac_cv_class_org_lttng_ust_agent_AbstractLttngAgent" = "xno"; then
434 AC_MSG_ERROR([The UST Java agent common class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-common.jar"])
435 fi
436
437 if test "x$test_java_agent_jul" = "xyes"; then
438 # Check for JUL agent class
439 AX_CHECK_CLASS(org.lttng.ust.agent.jul.LttngLogHandler)
440 if test "x$ac_cv_class_org_lttng_ust_agent_jul_LttngLogHandler" = "xno"; then
441 AC_MSG_ERROR([The UST Java agent JUL class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-jul.jar"])
442 fi
443 fi
444
445 if test "x$test_java_agent_log4j" = "xyes"; then
446 # Check for Log4j agent class
447 AX_CHECK_CLASS(org.lttng.ust.agent.log4j.LttngLogAppender)
448 if test "x$ac_cv_class_org_lttng_ust_agent_log4j_LttngLogAppender" = "xno"; then
449 AC_MSG_ERROR([The UST Java agent Log4j class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/lttng-ust-agent-log4j.jar"])
450 fi
451
452 # Check for Log4j class
453 AX_CHECK_CLASS(org.apache.log4j.Logger)
454 if test "x$ac_cv_class_org_apache_log4j_Logger" = "xno"; then
455 AC_MSG_ERROR([The Log4j class was not found. Please specify the location of the jar via the Java CLASSPATH e.g: export CLASSPATH="/path/to/log4j.jar"])
456 fi
457 fi
458 fi
459
460 # Python agent test
461 UST_PYTHON_AGENT="lttngust"
462
463 AC_ARG_ENABLE(test-python2-agent,
464 AS_HELP_STRING([--enable-test-python2-agent],
465 [enable tests for python2 agent. Python2 interpreter path can be overridden by setting the PYTHON2 environment variable. Default: Autodetect]
466 ),[:],[test_python2_agent_autodetect=yes]
467 )
468
469 AC_ARG_ENABLE(test-python3-agent,
470 AS_HELP_STRING([--enable-test-python3-agent],
471 [enable tests for python3 agent. Python3 interpreter path can be overridden by setting the PYTHON3 environment variable. Default: Autodetect]
472 ),[:],[test_python3_agent_autodetect=yes]
473 )
474
475 AC_ARG_ENABLE(test-python-agent-all,
476 AS_HELP_STRING([--enable-test-python-agent-all],
477 [enable test for all python{2/3} agent.]
478 ),
479 )
480
481 AS_IF([test ! -z "$enable_test_python_agent_all"], [
482 unset test_python2_agent_autodetect
483 unset test_python3_agent_autodetect
484 ])
485
486 AS_IF([test "x$enable_test_python_agent_all" = "xyes"], [
487 enable_test_python2_agent=yes
488 enable_test_python3_agent=yes
489 ])
490
491 AS_IF([test "x$enable_test_python_agent_all" = "xno"], [
492 enable_test_python2_agent=no
493 enable_test_python3_agent=no
494 ])
495
496
497 AS_IF([test "x$enable_test_python2_agent" = "xyes" -o "x$test_python2_agent_autodetect" = "xyes" ], [
498 AS_IF([test -z "$PYTHON2"], [
499 PYTHON2=python2
500 ], [
501 AC_MSG_WARN([Using user-defined PYTHON2 ($PYTHON2) for lttng-ust python2 agent check])
502 ])
503
504 AC_PATH_PROG([PYTHON2_BIN],[$PYTHON2])
505 AS_IF([test -z "$PYTHON2_BIN"], [
506 AS_IF([test -z "$test_python2_agent_autodetect"],[
507 AC_MSG_ERROR([No python2 interpreter found. PYTHON2 can be set to override default interpreter path])
508 ])
509 ], [
510 AC_MSG_CHECKING([for python2 lttng-ust agent])
511 AS_IF([$PYTHON2_BIN -c "import $UST_PYTHON_AGENT" 2>/dev/null], [
512 PYTHON2_AGENT=$PYTHON2_BIN
513 AC_MSG_RESULT([yes])
514 RUN_PYTHON_AGENT_TEST=yes
515 ], [
516 AC_MSG_RESULT([no])
517 AS_IF([test -z "$test_python2_agent_autodetect"],[
518 AC_MSG_ERROR([No python2 agent found. The path to the agent can be specified by setting the PYTHONPATH environment variable.])
519 ])
520 ])
521
522 ])
523
524 ])
525
526 AS_IF([test "x$enable_test_python3_agent" = "xyes" -o "x$test_python3_agent_autodetect" = "xyes" ], [
527 AS_IF([test -z "$PYTHON3"], [
528 PYTHON3=python3
529 ], [
530 AC_MSG_WARN([Using user-defined PYTHON3 ($PYTHON3) for lttng-ust python3 agent check])
531 ])
532
533 AC_PATH_PROG([PYTHON3_BIN],[$PYTHON3])
534 AS_IF([test -z "$PYTHON3_BIN"], [
535 AS_IF([test -z "$test_python3_agent_autodetect"],[
536 AC_MSG_ERROR([No python3 interpreter found. PYTHON3 can be set to override default interpreter path])
537 ])
538 ], [
539 AC_MSG_CHECKING([for python3 lttng-ust agent])
540 AS_IF([$PYTHON3_BIN -c "import $UST_PYTHON_AGENT" 2>/dev/null], [
541 PYTHON3_AGENT=$PYTHON3_BIN
542 AC_MSG_RESULT([yes])
543 RUN_PYTHON_AGENT_TEST=yes
544 ], [
545 AC_MSG_RESULT([no])
546 AS_IF([test -z "$test_python3_agent_autodetect"],[
547 AC_MSG_ERROR([No python3 agent found. The path to the agent can be specified by setting the PYTHONPATH environment variable.])
548 ])
549 ])
550
551 ])
552 ])
553
554 AC_SUBST([RUN_PYTHON_AGENT_TEST])
555 AC_SUBST([PYTHON2_AGENT])
556 AC_SUBST([PYTHON3_AGENT])
557
558
559 if test ! -f "$srcdir/src/lib/lttng-ctl/filter/filter-parser.h"; then
560 if test x"$YACC" != "xbison -y"; then
561 AC_MSG_ERROR([[bison not found and is required when building from git.
562 Please install bison]])
563 fi
564 AC_PATH_PROG([BISON],[bison])
565 AX_PROG_BISON_VERSION([2.4], [],[
566 AC_MSG_ERROR([[Bison >= 2.4 is required when building from git]])
567 ])
568 fi
569
570 if test ! -f "$srcdir/src/lib/lttng-ctl/filter/filter-lexer.c"; then
571 if test x"$LEX" != "xflex"; then
572 AC_MSG_ERROR([[flex not found and is required when building from git.
573 Please install flex]])
574 fi
575 AC_PATH_PROG([FLEX],[flex])
576 AX_PROG_FLEX_VERSION([2.5.35], [],[
577 AC_MSG_ERROR([[Flex >= 2.5.35 is required when building from git]])
578 ])
579 fi
580
581 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
582
583 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include -include config.h"
584
585 lttngincludedir="${includedir}/lttng"
586
587 AC_SUBST(lttngincludedir)
588 AC_SUBST(DEFAULT_INCLUDES)
589
590 lttnglibexecdir="${libdir}/lttng/libexec"
591 AC_SUBST(lttnglibexecdir)
592
593 AC_CONFIG_FILES([
594 Makefile
595 doc/Makefile
596 doc/man/Makefile
597 include/Makefile
598 extras/Makefile
599 extras/bindings/Makefile
600 extras/bindings/swig/Makefile
601 extras/bindings/swig/python/Makefile
602 extras/core-handler/Makefile
603 src/Makefile
604 src/common/Makefile
605 src/common/kernel-ctl/Makefile
606 src/common/kernel-consumer/Makefile
607 src/common/ust-consumer/Makefile
608 src/common/hashtable/Makefile
609 src/common/sessiond-comm/Makefile
610 src/common/compat/Makefile
611 src/common/relayd/Makefile
612 src/common/testpoint/Makefile
613 src/common/index/Makefile
614 src/common/health/Makefile
615 src/common/config/Makefile
616 src/lib/Makefile
617 src/lib/lttng-ctl/Makefile
618 src/lib/lttng-ctl/filter/Makefile
619 src/lib/lttng-ctl/lttng-ctl.pc
620 src/bin/Makefile
621 src/bin/lttng-consumerd/Makefile
622 src/bin/lttng-sessiond/Makefile
623 src/bin/lttng-relayd/Makefile
624 src/bin/lttng/Makefile
625 src/bin/lttng-crash/Makefile
626 tests/Makefile
627 tests/regression/Makefile
628 tests/regression/kernel/Makefile
629 tests/regression/tools/Makefile
630 tests/regression/tools/streaming/Makefile
631 tests/regression/tools/filtering/Makefile
632 tests/regression/tools/health/Makefile
633 tests/regression/tools/tracefile-limits/Makefile
634 tests/regression/tools/snapshots/Makefile
635 tests/regression/tools/live/Makefile
636 tests/regression/tools/exclusion/Makefile
637 tests/regression/tools/save-load/Makefile
638 tests/regression/tools/mi/Makefile
639 tests/regression/tools/wildcard/Makefile
640 tests/regression/tools/crash/Makefile
641 tests/regression/ust/Makefile
642 tests/regression/ust/nprocesses/Makefile
643 tests/regression/ust/high-throughput/Makefile
644 tests/regression/ust/low-throughput/Makefile
645 tests/regression/ust/before-after/Makefile
646 tests/regression/ust/buffers-pid/Makefile
647 tests/regression/ust/periodical-metadata-flush/Makefile
648 tests/regression/ust/multi-session/Makefile
649 tests/regression/ust/overlap/Makefile
650 tests/regression/ust/overlap/demo/Makefile
651 tests/regression/ust/linking/Makefile
652 tests/regression/ust/daemon/Makefile
653 tests/regression/ust/exit-fast/Makefile
654 tests/regression/ust/fork/Makefile
655 tests/regression/ust/libc-wrapper/Makefile
656 tests/regression/ust/java-jul/Makefile
657 tests/regression/ust/java-log4j/Makefile
658 tests/regression/ust/python-logging/Makefile
659 tests/regression/ust/getcpu-override/Makefile
660 tests/regression/ust/clock-override/Makefile
661 tests/stress/Makefile
662 tests/unit/Makefile
663 tests/unit/ini_config/Makefile
664 tests/utils/Makefile
665 tests/utils/tap/Makefile
666 tests/utils/testapp/Makefile
667 tests/utils/testapp/gen-ust-events/Makefile
668 tests/utils/testapp/gen-ust-nevents/Makefile
669 tests/utils/testapp/gen-ust-tracef/Makefile
670 ])
671
672 # Inject variable into python test script
673 AC_CONFIG_FILES([tests/regression/ust/python-logging/test_python_logging],[chmod +x tests/regression/ust/python-logging/test_python_logging])
674
675 AC_OUTPUT
676
677 #
678 # Mini-report on what will be built
679 #
680 AS_ECHO()
681
682 AS_ECHO("Version name: $version_name")
683 AS_ECHO("$version_description")
684
685 AS_ECHO()
686
687 # Target architecture we're building for
688 target_arch=$host_cpu
689 [
690 for f in $CFLAGS; do
691 if test $f = "-m32"; then
692 target_arch="32-bit"
693 elif test $f = "-m64"; then
694 target_arch="64-bit"
695 fi
696 done
697 ]
698 AS_ECHO_N("Target architecture: ")
699 AS_ECHO($target_arch)
700
701 # kmod enabled/disabled
702 AS_ECHO_N("libkmod support: ")
703 AS_IF([test "x$kmod_found" = "xyes"],[
704 AS_ECHO("Enabled")
705 ],[
706 AS_ECHO("Disabled")
707 ])
708
709 # LTTng-UST enabled/disabled
710 AS_ECHO_N("Lttng-UST support: ")
711 AS_IF([test "x$lttng_ust_support" = "xyes"],[
712 AS_ECHO("Enabled")
713 ],[
714 AS_ECHO("Disabled")
715 ])
716
717 # LTTng UST Java agent JUL tests enabled/disabled
718 AS_ECHO_N("LTTng-UST Java agent JUL tests: ")
719 AS_IF([test "x$test_java_agent_jul" = "xyes"],[
720 AS_ECHO("Enabled")
721 ],[
722 AS_ECHO("Disabled")
723 ])
724
725 # LTTng UST Java agent Log4j tests enabled/disabled
726 AS_ECHO_N("LTTng-UST Java agent Log4j tests: ")
727 AS_IF([test "x$test_java_agent_log4j" = "xyes"],[
728 AS_ECHO("Enabled")
729 ],[
730 AS_ECHO("Disabled")
731 ])
732
733 AS_ECHO_N("LTTng-UST Python2 agent tests: ")
734 AS_IF([test ! -z "$PYTHON2_AGENT"],[
735 AS_ECHO("Enabled")
736 ],[
737 AS_ECHO("Disabled")
738 ])
739
740 AS_ECHO_N("LTTng-UST Python3 agent tests: ")
741 AS_IF([test ! -z "$PYTHON3_AGENT"],[
742 AS_ECHO("Enabled")
743 ],[
744 AS_ECHO("Disabled")
745 ])
746
747 #Python binding enabled/disabled
748 AS_ECHO_N("Python binding: ")
749 AS_IF([test "x${enable_python_binding:-yes}" = xyes], [
750 AS_ECHO("Enabled")
751 ],[
752 AS_ECHO("Disabled")
753 ])
754
755 # Do we build only the consumerd, or everything
756 AS_IF([test "x$consumerd_only" = "xyes"],[
757 AS_ECHO("Only the consumerd daemon will be built.")
758 ],[
759 AS_ECHO("All binaries will be built.")
760 ])
761
762 # Print the bindir and libdir this `make install' will install into.
763 AS_ECHO()
764 AS_ECHO_N("Binaries will be installed in: ")
765 AS_ECHO("`eval eval echo $bindir`")
766 AS_ECHO_N("Libraries will be installed in: ")
767 AS_ECHO("`eval eval echo $libdir`")
768
769 # If we build the sessiond, print the paths it will use
770 AS_IF([test "x$consumerd_only" = "xno"],[
771 AS_ECHO()
772 AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ")
773 AS_IF([test "$SESSIOND_BIN" = ""],[
774 AS_ECHO_N("`eval eval echo $bindir`")
775 AS_ECHO("/lttng-sessiond")
776 ],[
777 AS_ECHO("$SESSIOND_BIN")
778 ])
779
780 AS_ECHO()
781 AS_ECHO("The sessiond daemon will look in the following directories: ")
782 AS_ECHO_N("32-bit consumerd executable at: ")
783 AS_IF([test "$CONSUMERD32_BIN" = ""],[
784 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
785 AS_ECHO("/lttng-consumerd")
786 ],[
787 AS_ECHO("$CONSUMERD32_BIN")
788 ])
789
790 AS_ECHO_N("32-bit consumer libraries in: ")
791 AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[
792 AS_ECHO("`eval eval echo $libdir`")
793 ],[
794 AS_ECHO("$CONSUMERD32_LIBDIR")
795 ])
796
797 AS_ECHO_N("64-bit consumerd executable at: ")
798 AS_IF([test "$CONSUMERD64_BIN" = ""],[
799 AS_ECHO_N("`eval eval echo $lttnglibexecdir`")
800 AS_ECHO("/lttng-consumerd")
801 ],[
802 AS_ECHO("$CONSUMERD64_BIN")
803 ])
804
805 AS_ECHO_N("64-bit consumer libraries in: ")
806 AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[
807 AS_ECHO("`eval eval echo $libdir`")
808 ],[
809 AS_ECHO("$CONSUMERD64_LIBDIR")
810 ])
811 ])
812
813 AS_ECHO()
814
This page took 0.045173 seconds and 5 git commands to generate.