Introduce --with-consumer32-bindir and --with-consumer64-bindir
[lttng-tools.git] / configure.ac
1 AC_INIT([lttng-tools], [2.0-pre14], [david.goulet@polymtl.ca], ,[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 AC_CONFIG_HEADERS([include/config.h])
10
11 AC_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 AC_ARG_WITH([consumer32-bindir],
18 AC_HELP_STRING([--with-consumer32-bindir],
19 [Location of the 32-bit consumer executable]),
20 [LTTNG_TOOLS_32BIT_BINDIR="$withval"],
21 [LTTNG_TOOLS_32BIT_BINDIR=''])
22 AC_SUBST([LTTNG_TOOLS_32BIT_BINDIR])
23
24 AC_ARG_WITH([consumer64-bindir],
25 AC_HELP_STRING([--with-consumer64-bindir],
26 [Location of the 64-bit consumer executable]),
27 [LTTNG_TOOLS_64BIT_BINDIR="$withval"],
28 [LTTNG_TOOLS_64BIT_BINDIR=''])
29 AC_SUBST([LTTNG_TOOLS_64BIT_BINDIR])
30
31 AC_DEFINE_UNQUOTED([CONFIG_32BIT_BINDIR], $LTTNG_TOOLS_32BIT_BINDIR, [Search for LTTng Tools 32-bit binaries in this location.])
32 AC_DEFINE_UNQUOTED([CONFIG_64BIT_BINDIR], $LTTNG_TOOLS_64BIT_BINDIR, [Search for LTTng Tools 64-bit binaries in this location.])
33
34 # Check for pthread
35 AC_CHECK_LIB([pthread], [pthread_create], [],
36 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
37 )
38
39 # Check libpopt
40 AC_CHECK_LIB([popt], [poptGetContext], [],
41 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
42 )
43
44 # URCU library version needed or newer
45 liburcu_version=">= 0.6.6"
46
47 # Check liburcu needed function calls
48 AC_CHECK_DECL([cds_list_add], [],
49 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
50 )
51 AC_CHECK_DECL([cds_wfq_init], [],
52 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
53 )
54 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
55 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
56 )
57 AC_CHECK_DECL([futex_async], [],
58 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
59 )
60 AC_CHECK_DECL([rcu_thread_offline], [],
61 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
62 )
63 AC_CHECK_DECL([rcu_thread_online], [],
64 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
65 )
66 AC_CHECK_DECL([caa_likely], [],
67 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
68 )
69
70 # Check liblttng-ust-ctl library
71 AC_ARG_ENABLE(lttng-ust,
72 [ --disable-lttng-ust build without LTTng-UST (Userspace Tracing) support.],
73 lttng_ust_support=no, lttng_ust_support=yes)
74
75 [
76 if test "x$lttng_ust_support" = "xno"; then
77 echo "LTTng-UST support disabled."
78 else
79 ]
80 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
81 [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.])]
82 )
83 [
84 echo "LTTng-UST support enabled."
85 fi
86 ]
87
88 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
89
90 AC_CHECK_FUNCS([sched_getcpu sysconf])
91
92 # Epoll check. If not present, the build will fallback on poll() API
93 AX_HAVE_EPOLL(
94 [AX_CONFIG_FEATURE_ENABLE(epoll)],
95 [AX_CONFIG_FEATURE_DISABLE(epoll)]
96 )
97 AX_CONFIG_FEATURE(
98 [epoll], [This platform supports epoll(7)],
99 [HAVE_EPOLL], [This platform supports epoll(7).],
100 [enable_epoll="yes"], [enable_epoll="no"]
101 )
102 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
103
104 AC_PROG_CC
105 AC_PROG_LIBTOOL
106
107 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
108
109 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir)"
110
111 lttngincludedir="${includedir}/lttng"
112
113 AC_SUBST(lttngincludedir)
114 AC_SUBST(DEFAULT_INCLUDES)
115
116 AC_CONFIG_FILES([
117 Makefile
118 include/Makefile
119 libkernelctl/Makefile
120 liblttng-consumer/Makefile
121 liblttng-kconsumer/Makefile
122 liblttng-ustconsumer/Makefile
123 liblttngctl/Makefile
124 liblttng-sessiond-comm/Makefile
125 lttng-consumerd/Makefile
126 lttng-sessiond/Makefile
127 lttng/Makefile
128 tests/Makefile
129 doc/Makefile
130 ])
131
132 AC_OUTPUT
This page took 0.043976 seconds and 4 git commands to generate.