Cleanup configure.ac
[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([consumerd32-path],
18 AS_HELP_STRING([--with-consumerd32-path],
19 [Location of the 32-bit consumerd executable]),
20 [CONSUMERD32_PATH="$withval"],
21 [CONSUMERD32_PATH=''])
22 AC_SUBST([CONSUMERD32_PATH])
23
24 AC_ARG_WITH([consumerd64-path],
25 AS_HELP_STRING([--with-consumerd64-path],
26 [Location of the 64-bit consumerd executable]),
27 [CONSUMERD64_PATH="$withval"],
28 [CONSUMERD64_PATH=''])
29 AC_SUBST([CONSUMERD64_PATH])
30
31 AC_ARG_WITH([consumerd32-libdir],
32 AS_HELP_STRING([--with-consumerd32-libdir],
33 [Location of the 32-bit consumerd libraries]),
34 [CONSUMERD32_LIBDIR="$withval"],
35 [CONSUMERD32_LIBDIR=''])
36 AC_SUBST([CONSUMERD32_LIBDIR])
37
38 AC_ARG_WITH([consumer64d-libdir],
39 AS_HELP_STRING([--with-consumerd64-libdir],
40 [Location of the 64-bit consumerd libraries]),
41 [CONSUMERD64_LIBDIR="$withval"],
42 [CONSUMERD64_LIBDIR=''])
43 AC_SUBST([CONSUMERD64_LIBDIR])
44
45 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_PATH], $CONSUMERD32_PATH, [Location of the 32-bit consumerd executable.])
46 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_PATH], $CONSUMERD64_PATH, [Location of the 64-bit consumerd executable])
47 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], $CONSUMERD32_LIBDIR, [Search for consumerd 32-bit libraries in this location.])
48 AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], $CONSUMERD64_LIBDIR, [Search for consumerd 64-bit libraries in this location.])
49
50 # Check for pthread
51 AC_CHECK_LIB([pthread], [pthread_create], [],
52 [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])]
53 )
54
55 # Check libpopt
56 AC_CHECK_LIB([popt], [poptGetContext], [],
57 [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])]
58 )
59
60 # URCU library version needed or newer
61 liburcu_version=">= 0.6.6"
62
63 # Check liburcu needed function calls
64 AC_CHECK_DECL([cds_list_add], [],
65 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
66 )
67 AC_CHECK_DECL([cds_wfq_init], [],
68 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
69 )
70 AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
71 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
72 )
73 AC_CHECK_DECL([futex_async], [],
74 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
75 )
76 AC_CHECK_DECL([rcu_thread_offline], [],
77 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
78 )
79 AC_CHECK_DECL([rcu_thread_online], [],
80 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
81 )
82 AC_CHECK_DECL([caa_likely], [],
83 [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu.h>]]
84 )
85
86 # Check liblttng-ust-ctl library
87 AC_ARG_ENABLE(lttng-ust,
88 AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]),
89 lttng_ust_support=$enableval, lttng_ust_support=yes)
90
91 AS_IF([test "x$lttng_ust_support" = "xyes"], [
92 AC_CHECK_LIB([lttng-ust-ctl], [ustctl_create_session], [],
93 [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.])]
94 )
95 ])
96
97 AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [ test "x$ac_cv_lib_lttng_ust_ctl_ustctl_create_session" = "xyes" ])
98
99 AC_CHECK_FUNCS([sched_getcpu sysconf])
100
101 # Epoll check. If not present, the build will fallback on poll() API
102 AX_HAVE_EPOLL(
103 [AX_CONFIG_FEATURE_ENABLE(epoll)],
104 [AX_CONFIG_FEATURE_DISABLE(epoll)]
105 )
106 AX_CONFIG_FEATURE(
107 [epoll], [This platform supports epoll(7)],
108 [HAVE_EPOLL], [This platform supports epoll(7).],
109 [enable_epoll="yes"], [enable_epoll="no"]
110 )
111 AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ])
112
113 AC_PROG_CC
114 LT_INIT
115
116 CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing"
117
118 DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir)"
119
120 lttngincludedir="${includedir}/lttng"
121
122 AC_SUBST(lttngincludedir)
123 AC_SUBST(DEFAULT_INCLUDES)
124
125 AC_CONFIG_FILES([
126 Makefile
127 include/Makefile
128 libkernelctl/Makefile
129 liblttng-consumer/Makefile
130 liblttng-kconsumer/Makefile
131 liblttng-ustconsumer/Makefile
132 liblttngctl/Makefile
133 liblttng-sessiond-comm/Makefile
134 lttng-consumerd/Makefile
135 lttng-sessiond/Makefile
136 lttng/Makefile
137 tests/Makefile
138 doc/Makefile
139 ])
140
141 AC_OUTPUT
142
143 # Mini-report on what will be built
144 AS_ECHO("")
145
146 AS_ECHO_N("Lttng-UST support: ")
147 AS_IF([test "x$lttng_ust_support" = "xyes"], [AS_ECHO("Enabled")],
148 [AS_ECHO("Disabled")])
149
150 AS_ECHO("")
151
This page took 0.045307 seconds and 4 git commands to generate.