Commit | Line | Data |
---|---|---|
9d594903 | 1 | AC_PREREQ([2.50]) |
a2edfc7d PP |
2 | m4_define([bt_version_major], [2]) |
3 | m4_define([bt_version_minor], [0]) | |
4 | m4_define([bt_version_patch], [0]) | |
f6cf9f76 | 5 | m4_define([bt_version_extra], [-pre3]) |
a2edfc7d PP |
6 | m4_define([bt_version], bt_version_major[.]bt_version_minor[.]bt_version_patch[]bt_version_extra) |
7 | AC_INIT([babeltrace],bt_version,[jeremie dot galarneau at efficios dot com]) | |
3fbccce7 MD |
8 | |
9 | # Following the numbering scheme proposed by libtool for the library version | |
10 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html | |
a2edfc7d | 11 | AC_SUBST([BABELTRACE_LIBRARY_VERSION], bt_version_major[:]bt_version_minor[:]bt_version_patch) |
3fbccce7 | 12 | |
989e97b6 | 13 | AC_CONFIG_HEADERS([include/config.h]) |
ac65e355 | 14 | AC_CONFIG_AUX_DIR([config]) |
80e2fb15 MJ |
15 | AC_CONFIG_MACRO_DIR([m4]) |
16 | ||
a2edfc7d PP |
17 | AC_DEFINE([BT_VERSION_MAJOR], bt_version_major, [Babeltrace library major version]) |
18 | AC_DEFINE([BT_VERSION_MINOR], bt_version_minor, [Babeltrace library minor version]) | |
19 | AC_DEFINE([BT_VERSION_PATCH], bt_version_patch, [Babeltrace library patch version]) | |
20 | AC_DEFINE([BT_VERSION_EXTRA], ["]bt_version_extra["], [Babeltrace library extra version]) | |
21 | ||
ac65e355 MD |
22 | AC_CANONICAL_TARGET |
23 | AC_CANONICAL_HOST | |
80e2fb15 | 24 | |
989e97b6 | 25 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-ustar nostdinc]) |
99e3ba41 | 26 | AM_MAINTAINER_MODE([enable]) |
ac65e355 | 27 | |
80e2fb15 MJ |
28 | # Enable silent rules if available (Introduced in AM 1.11) |
29 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | |
0671bd13 | 30 | |
3d5e9596 MJ |
31 | AC_REQUIRE_AUX_FILE([tap-driver.sh]) |
32 | ||
80e2fb15 MJ |
33 | # Checks for C compiler |
34 | AC_USE_SYSTEM_EXTENSIONS | |
217108a9 | 35 | AC_SYS_LARGEFILE |
80e2fb15 MJ |
36 | AC_PROG_CC |
37 | AC_PROG_CC_STDC | |
217108a9 | 38 | |
ac65e355 | 39 | # Checks for programs. |
ac65e355 | 40 | AC_PROG_MAKE_SET |
08146472 | 41 | LT_INIT(win32-dll) |
8b9d5b5e MD |
42 | AC_PROG_YACC |
43 | AC_PROG_LEX | |
80e2fb15 MJ |
44 | AC_PROG_MKDIR_P |
45 | AC_PROG_LN_S | |
ac65e355 | 46 | |
ec8add54 MJ |
47 | AX_C___ATTRIBUTE__ |
48 | AS_IF([test "x$ax_cv___attribute__" = "xyes"], | |
49 | [:], | |
50 | [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])]) | |
51 | ||
a2bc83d4 | 52 | AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])]) |
a2bc83d4 | 53 | |
f0d8d709 AM |
54 | # Check linker option |
55 | AX_APPEND_LINK_FLAGS([-Wl,--no-as-needed], [LD_NO_AS_NEEDED]) | |
56 | AC_SUBST([LD_NO_AS_NEEDED]) | |
57 | ||
f847f3ae MJ |
58 | AC_HEADER_STDBOOL |
59 | AC_CHECK_HEADERS([ \ | |
60 | fcntl.h \ | |
61 | float.h \ | |
1307d39e | 62 | ftw.h \ |
f847f3ae MJ |
63 | libintl.h \ |
64 | limits.h \ | |
65 | malloc.h \ | |
66 | netdb.h \ | |
67 | netinet/in.h \ | |
68 | stddef.h \ | |
69 | sys/socket.h \ | |
70 | ]) | |
80e2fb15 | 71 | |
dc3fffef | 72 | if test ! -f "$srcdir/plugins/ctf/common/metadata/parser.h"; then |
e3e6755d | 73 | if test x"$(basename "$YACC")" != "xbison -y"; then |
331d78f5 YB |
74 | AC_MSG_ERROR([[bison not found and is required when building from git. |
75 | Please install bison]]) | |
76 | fi | |
2b4887a2 JR |
77 | AC_PATH_PROG([BISON],[bison]) |
78 | AX_PROG_BISON_VERSION([2.4], [],[ | |
79 | AC_MSG_ERROR([[Bison >= 2.4 is required when building from git]]) | |
80 | ]) | |
331d78f5 YB |
81 | fi |
82 | ||
dc3fffef | 83 | if test ! -f "$srcdir/plugins/ctf/common/metadata/lexer.c"; then |
331d78f5 YB |
84 | if test x"$LEX" != "xflex"; then |
85 | AC_MSG_ERROR([[flex not found and is required when building from git. | |
86 | Please install flex]]) | |
87 | fi | |
33bdeb6a JR |
88 | AC_PATH_PROG([FLEX],[flex]) |
89 | AX_PROG_FLEX_VERSION([2.5.35], [],[ | |
90 | AC_MSG_ERROR([[Flex >= 2.5.35 is required when building from git]]) | |
91 | ]) | |
331d78f5 YB |
92 | fi |
93 | ||
e5f5317f | 94 | |
5cbf5347 | 95 | AM_PATH_GLIB_2_0(2.22.0, ,AC_MSG_ERROR([glib is required in order to compile BabelTrace - download it from ftp://ftp.gtk.org/pub/gtk]) , gmodule-no-export) |
ac65e355 | 96 | |
39fa4402 MJ |
97 | # Check what libraries are required on this platform to link sockets programs. |
98 | AX_LIB_SOCKET_NSL | |
99 | ||
ac65e355 MD |
100 | # Checks for typedefs, structures, and compiler characteristics. |
101 | AC_C_INLINE | |
102 | AC_TYPE_PID_T | |
103 | AC_TYPE_SIZE_T | |
31510f02 JR |
104 | AC_TYPE_INT16_T |
105 | AC_TYPE_INT32_T | |
106 | AC_TYPE_INT64_T | |
107 | AC_TYPE_INT8_T | |
108 | AC_TYPE_OFF_T | |
109 | AC_TYPE_SSIZE_T | |
110 | AC_TYPE_UINT16_T | |
111 | AC_TYPE_UINT32_T | |
112 | AC_TYPE_UINT64_T | |
113 | AC_TYPE_UINT8_T | |
ac65e355 MD |
114 | |
115 | # Checks for library functions. | |
f847f3ae MJ |
116 | AC_FUNC_ALLOCA |
117 | AC_FUNC_FORK | |
f847f3ae | 118 | AC_FUNC_MKTIME |
ac65e355 | 119 | AC_FUNC_MMAP |
f847f3ae | 120 | AC_FUNC_STRERROR_R |
2f8c0e47 | 121 | AC_CHECK_FUNCS([ \ |
f847f3ae | 122 | atexit \ |
f847f3ae MJ |
123 | dup2 \ |
124 | ftruncate \ | |
125 | gethostbyname \ | |
126 | gethostname \ | |
127 | gettimeofday \ | |
128 | localtime_r \ | |
129 | memchr \ | |
130 | memset \ | |
131 | mkdir \ | |
132 | mkdtemp \ | |
133 | munmap \ | |
134 | rmdir \ | |
135 | setenv \ | |
136 | socket \ | |
137 | strchr \ | |
138 | strdup \ | |
139 | strerror \ | |
140 | strndup \ | |
141 | strnlen \ | |
142 | strrchr \ | |
143 | strtoul \ | |
144 | strtoull \ | |
145 | tzset \ | |
146 | uname \ | |
2f8c0e47 | 147 | ]) |
ac65e355 | 148 | |
34064482 MJ |
149 | # AC_FUNC_MALLOC causes problems when cross-compiling. |
150 | #AC_FUNC_MALLOC | |
151 | #AC_FUNC_REALLOC | |
152 | ||
58819898 | 153 | MINGW32=no |
2748fb3b | 154 | DEFAULT_ENABLE_DEBUG_INFO=yes |
08146472 | 155 | LT_NO_UNDEFINED="" |
a3d28380 MJ |
156 | AS_CASE([$host_os], |
157 | [solaris*|darwin*], | |
158 | [ | |
2748fb3b | 159 | DEFAULT_ENABLE_DEBUG_INFO=no |
a3d28380 | 160 | ], |
c613db5e MJ |
161 | [cygwin*], |
162 | [ | |
163 | DEFAULT_ENABLE_DEBUG_INFO=no | |
164 | LT_NO_UNDEFINED="-no-undefined" | |
165 | ], | |
a3d28380 MJ |
166 | [mingw*], |
167 | [ | |
168 | MINGW32=yes | |
251b4638 | 169 | DEFAULT_ENABLE_DEBUG_INFO=no |
08146472 | 170 | LT_NO_UNDEFINED="-no-undefined" |
a3d28380 MJ |
171 | ] |
172 | ) | |
58819898 JI |
173 | |
174 | AM_CONDITIONAL([BABELTRACE_BUILD_WITH_MINGW], [test "x$MINGW32" = "xyes"]) | |
08146472 | 175 | AC_SUBST(LT_NO_UNDEFINED) |
58819898 | 176 | |
8a995d73 MJ |
177 | # First, check for uuid in system libs |
178 | AH_TEMPLATE([BABELTRACE_HAVE_LIBUUID], [Define if you have libuuid support]) | |
4120f662 | 179 | AC_CHECK_FUNCS([uuid_generate], |
4120f662 | 180 | [ |
8a995d73 MJ |
181 | AC_DEFINE([BABELTRACE_HAVE_LIBUUID], [1]) |
182 | UUID_LIBS="" | |
4120f662 MJ |
183 | ], |
184 | [ | |
8a995d73 MJ |
185 | # Then, check if the pkg-config module is available, otherwise explicitly check |
186 | # for libuuid, or uuid support in the C-library. | |
187 | PKG_CHECK_MODULES([UUID], [uuid], | |
2741f55b | 188 | [ |
8a995d73 MJ |
189 | AC_DEFINE([BABELTRACE_HAVE_LIBUUID], [1]) |
190 | dnl PKG_CHECK_MODULES defines UUID_LIBS | |
2741f55b SM |
191 | ], |
192 | [ | |
8a995d73 MJ |
193 | AC_MSG_WARN([pkg-config was unable to find a valid .pc for libuuid. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location]) |
194 | AC_MSG_WARN([Finding libuuid without pkg-config.]) | |
195 | AC_CHECK_LIB([uuid], [uuid_generate], | |
196 | [ | |
197 | AC_DEFINE([BABELTRACE_HAVE_LIBUUID], [1]) | |
198 | UUID_LIBS="-luuid" | |
199 | ], | |
200 | [ | |
201 | # libuuid not found, check for uuid_create in libc. | |
202 | AC_CHECK_LIB([c], [uuid_create], | |
203 | [ | |
204 | AC_DEFINE([BABELTRACE_HAVE_LIBUUID], [1]) | |
205 | UUID_LIBS="-lc" | |
206 | ], | |
207 | [ | |
208 | # for MinGW32 we have our own internal implementation of uuid using Windows functions. | |
209 | if test "x$MINGW32" = xno; then | |
210 | AC_MSG_FAILURE([Cannot find libuuid uuid_generate nor libc uuid_create. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location]) | |
211 | fi | |
212 | ] | |
213 | ) | |
214 | ] | |
215 | ) | |
216 | ] | |
217 | ) | |
218 | ] | |
219 | ) | |
220 | AC_SUBST(UUID_LIBS) | |
fd55fc57 | 221 | |
f8370579 MD |
222 | # Check for fmemopen |
223 | AC_CHECK_LIB([c], [fmemopen], | |
224 | [ | |
225 | AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_FMEMOPEN], 1, [Has fmemopen support.]) | |
226 | ] | |
227 | ) | |
228 | ||
229 | # Check for open_memstream | |
230 | AC_CHECK_LIB([c], [open_memstream], | |
231 | [ | |
232 | AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.]) | |
233 | ] | |
234 | ) | |
235 | ||
a323afb2 JG |
236 | # Check for posix_fallocate |
237 | AC_CHECK_LIB([c], [posix_fallocate], | |
238 | [ | |
239 | AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_POSIX_FALLOCATE], 1, [Has posix_fallocate support.]) | |
240 | ] | |
241 | ) | |
242 | ||
5cddb897 MJ |
243 | # Check libpopt |
244 | PKG_CHECK_MODULES([POPT], [popt], | |
245 | [ | |
246 | dnl PKG_CHECK_MODULES defines POPT_LIBS | |
247 | ], | |
248 | [ | |
249 | AC_MSG_WARN([pkg-config was unable to find a valid .pc for libpopt. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location]) | |
250 | AC_MSG_WARN([Finding libpopt without pkg-config.]) | |
251 | AC_CHECK_LIB([popt], | |
252 | [poptGetContext], | |
253 | [POPT_LIBS="-lpopt"], | |
254 | [ | |
255 | AC_MSG_FAILURE([Cannot find libpopt. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location]) | |
256 | ] | |
257 | ) | |
258 | ] | |
0f536a74 | 259 | ) |
5cddb897 | 260 | AC_SUBST(POPT_LIBS) |
0f536a74 | 261 | |
a094f13b PP |
262 | # Plugins |
263 | AC_ARG_VAR([PLUGINSDIR], [built-in plugins install directory [LIBDIR/babeltrace/plugins]]) | |
264 | AS_IF([test "x$PLUGINSDIR" = x], [PLUGINSDIR='$(libdir)/babeltrace/plugins']) | |
265 | ||
24a3136a DS |
266 | # For Python |
267 | # SWIG version needed or newer: | |
268 | swig_version=2.0.0 | |
269 | ||
94a6cea3 JG |
270 | AC_ARG_ENABLE([python-bindings], |
271 | [AC_HELP_STRING([--enable-python-bindings], | |
272 | [generate Python bindings])], | |
fb4be38a | 273 | [enable_python_bindings=$enableval], [enable_python_bindings=no]) |
24a3136a | 274 | |
55bb57e0 | 275 | AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python_bindings:-yes}" = xyes]) |
24a3136a | 276 | |
55bb57e0 PP |
277 | AC_ARG_ENABLE( |
278 | [python-plugins], | |
279 | [AC_HELP_STRING( | |
280 | [--enable-python-plugins], | |
281 | [add support for the Babeltrace library and converter to load Python plugins]) | |
282 | ], | |
fb4be38a | 283 | [enable_python_plugins=$enableval], |
55bb57e0 PP |
284 | [enable_python_plugins=no] |
285 | ) | |
9cf643d1 | 286 | |
55bb57e0 PP |
287 | if test "x${enable_python_bindings:-yes}" = xyes; then |
288 | AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ]) | |
289 | else | |
290 | AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl | |
291 | [if you want Python bindings.]) | |
4f5f37d9 PP |
292 | fi |
293 | ||
55bb57e0 | 294 | if test "x$enable_python_bindings" != xno || test "x$enable_python_plugins" != xno; then |
c3ddb532 | 295 | AM_PATH_PYTHON([3.0], , [AC_MSG_ERROR(Python 3 is not available or is not the default Python interpreter on your system. See the README file to learn how to override your distribution's default Python interpreter.)]) |
24a3136a | 296 | |
1b39e2de JG |
297 | AM_PATH_PYTHON_MODULES([PYTHON]) |
298 | # pythondir is the path where extra modules are to be installed | |
299 | pythondir=$PYTHON_PREFIX/$PYTHON_MODULES_PATH | |
300 | # pyexecdir is the path that contains shared objects used by the extra modules | |
301 | pyexecdir=$PYTHON_EXEC_PREFIX/$PYTHON_MODULES_PATH | |
55bb57e0 PP |
302 | AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for Python, bypassing python-config]) |
303 | AC_ARG_VAR([PYTHON_LIBS], [Library flags for Python, bypassing python-config]) | |
24a3136a DS |
304 | AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) |
305 | AS_IF([test -z "$PYTHON_INCLUDE"], [ | |
306 | AS_IF([test -z "$PYTHON_CONFIG"], [ | |
307 | AC_PATH_PROGS([PYTHON_CONFIG], | |
308 | [python$PYTHON_VERSION-config python-config], | |
309 | [no], | |
310 | [`dirname $PYTHON`]) | |
94a6cea3 | 311 | AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])]) |
24a3136a | 312 | ]) |
55bb57e0 | 313 | AC_MSG_CHECKING([Python include flags]) |
24a3136a DS |
314 | PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` |
315 | AC_MSG_RESULT([$PYTHON_INCLUDE]) | |
316 | ]) | |
55bb57e0 PP |
317 | AS_IF([test -z "$PYTHON_LIBS"], [ |
318 | AS_IF([test -z "$PYTHON_CONFIG"], [ | |
319 | AC_PATH_PROGS([PYTHON_CONFIG], | |
320 | [python$PYTHON_VERSION-config python-config], | |
321 | [no], | |
322 | [`dirname $PYTHON`]) | |
323 | AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])]) | |
324 | ]) | |
325 | AC_MSG_CHECKING([Python library flags]) | |
326 | PYTHON_LIBS=`$PYTHON_CONFIG --libs` | |
327 | AC_MSG_RESULT([$PYTHON_LIBS]) | |
328 | ]) | |
329 | fi | |
330 | ||
c3ddb532 PP |
331 | AS_IF([test "x$BUILT_IN_PLUGINS" = ""]) |
332 | ||
55bb57e0 PP |
333 | AM_CONDITIONAL([WITH_PYTHON_PLUGINS], [test "x$enable_python_plugins" != xno]) |
334 | AS_IF( | |
335 | [test "x$enable_python_plugins" != xno], | |
336 | AC_DEFINE_UNQUOTED([WITH_PYTHON_PLUGINS], [1], [Python plugin support.]) | |
337 | ) | |
338 | ||
339 | AC_ARG_ENABLE([python-bindings-doc], | |
340 | [AC_HELP_STRING([--enable-python-bindings-doc], | |
341 | [generate Python bindings documentation])], | |
fb4be38a | 342 | [enable_python_bindings_doc=$enableval], [enable_python_bindings_doc=no]) |
55bb57e0 PP |
343 | |
344 | AM_CONDITIONAL([BUILD_PYTHON_BINDINGS_DOC], [test "x${enable_python_bindings_doc:-yes}" = xyes]) | |
94a6cea3 | 345 | |
55bb57e0 PP |
346 | AC_ARG_ENABLE([python-bindings-tests], |
347 | [AC_HELP_STRING([--enable-python-bindings-tests], | |
348 | [test Python bindings])], | |
fb4be38a | 349 | [enable_python_bindings_tests=$enableval], [enable_python_bindings_tests=no]) |
55bb57e0 PP |
350 | |
351 | AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS_TESTS], [test "x${enable_python_bindings_tests:-yes}" = xyes]) | |
352 | ||
353 | if test "x${enable_python_bindings:-no}" = xno; then | |
354 | if test "x${enable_python_bindings_doc:-yes}" = xyes; then | |
355 | AC_MSG_ERROR([--enable-python-bindings-doc was specified without --enable-python-bindings]) | |
356 | fi | |
357 | ||
358 | if test "x${enable_python_bindings_tests:-yes}" = xyes; then | |
359 | AC_MSG_ERROR([--enable-python-bindings-tests was specified without --enable-python-bindings]) | |
360 | fi | |
24a3136a DS |
361 | fi |
362 | ||
4f5f37d9 | 363 | if test "x${enable_python_bindings_doc:-yes}" = xyes; then |
17137804 PP |
364 | AM_CHECK_PYTHON_SPHINX([PYTHON]) |
365 | AS_IF([test "x$PYTHON_SPHINX_EXISTS" = xno], | |
366 | AC_MSG_ERROR([The Sphinx package for Python 3 is required to build Python bindings documentation]) | |
4f5f37d9 PP |
367 | ) |
368 | fi | |
369 | ||
9cf643d1 PP |
370 | if test "x${enable_python_bindings_tests:-yes}" = xyes; then |
371 | AM_CHECK_PYTHON_TAPPY([PYTHON]) | |
372 | AS_IF([test "x$PYTHON_TAPPY_EXISTS" = xno], | |
373 | AC_MSG_ERROR([You need the tappy Python project to test the Python bindings (see <https://github.com/python-tap/tappy>)]) | |
374 | ) | |
375 | fi | |
376 | ||
2748fb3b AB |
377 | # Set default enable state for debug info. |
378 | # The _enable_debug_info variable is prepended with an underscore to | |
379 | # avoid clashing with the one generated by AC_ARG_ENABLE. | |
380 | AS_IF([test "x$DEFAULT_ENABLE_DEBUG_INFO" = xyes], [_enable_debug_info=yes], [_enable_debug_info=no]) | |
4fe06062 | 381 | |
2748fb3b | 382 | # Optional debug info feature |
4fe06062 MD |
383 | # Do _not_ indent the help string below (appears in the configure --help |
384 | # output). | |
385 | AC_ARG_ENABLE([debug-info], | |
2748fb3b AB |
386 | [AC_HELP_STRING([--enable-debug-info], [enable the debug info feature (default on Linux)])] |
387 | [AC_HELP_STRING([--disable-debug-info], [disable the debug info feature (default on OS X and Solaris)])], | |
388 | [AS_IF([test "x$enableval" = xyes], [_enable_debug_info=yes], [_enable_debug_info=no])], []) | |
c40a57e5 | 389 | |
2748fb3b | 390 | AM_CONDITIONAL([ENABLE_DEBUG_INFO], [test "x$_enable_debug_info" = xyes]) |
7433a3a4 | 391 | |
2748fb3b | 392 | AS_IF([test "x$_enable_debug_info" = xyes], [ |
ce406405 PP |
393 | # Check if libelf and libdw are present |
394 | AC_CHECK_LIB([elf], [elf_version], [], [AC_MSG_ERROR(Missing libelf (from elfutils >= 0.154) which is required by debug info. You can disable this feature using --disable-debug-info.)]) | |
395 | AC_CHECK_LIB([dw], [dwarf_begin], [], [AC_MSG_ERROR(Missing libdw (from elfutils >= 0.154) which is required by debug info. You can disable this feature using --disable-debug-info.)]) | |
396 | BT_LIB_ELFUTILS([0], [154], [:], [AC_MSG_ERROR(elfutils >= 0.154 is required to use the debug info feature. You can disable this feature using --disable-debug-info.)]) | |
397 | AC_DEFINE([ENABLE_DEBUG_INFO], [1], [Define to 1 if you enable the 'debug info' feature]) | |
c40a57e5 AB |
398 | ], []) |
399 | ||
cba174d5 JG |
400 | AC_ARG_VAR([BUILT_IN_PLUGINS], [Statically-link in-tree plug-ins into the babeltrace binary]) |
401 | AS_IF([test "x$BUILT_IN_PLUGINS" != x], [ | |
402 | # Built-in plug-ins are only available when the --disable-shared --enable-static options are used. | |
403 | AS_IF([test "x$enable_static" != "xyes"], [AC_MSG_ERROR(--enable-static must be used to bundle plug-ins in the babeltrace executable)]) | |
404 | AS_IF([test "x$enable_shared" = "xyes"], [AC_MSG_ERROR(--disable-shared must be used to bundle plug-ins in the babeltrace executable)]) | |
405 | built_in_plugins=yes | |
406 | AC_DEFINE([BT_BUILT_IN_PLUGINS], [1], [Define to 1 to register plug-in attributes in static executable sections]) | |
407 | ]) | |
408 | AM_CONDITIONAL([BUILT_IN_PLUGINS], [test "x$built_in_plugins" = "xyes"]) | |
409 | ||
c3ddb532 | 410 | AC_ARG_VAR([BUILT_IN_PYTHON_PLUGIN_SUPPORT], [Statically-link Python plugin support into the babeltrace library]) |
6fbd4105 PP |
411 | AS_IF([test "x$BUILT_IN_PYTHON_PLUGIN_SUPPORT" != x], [ |
412 | # Built-in plug-ins are only available when the --disable-shared --enable-static options are used. | |
413 | AS_IF([test "x$enable_static" != "xyes"], [AC_MSG_ERROR(--enable-static must be used to bundle Python plugin support in the babeltrace executable)]) | |
414 | AS_IF([test "x$enable_shared" = "xyes"], [AC_MSG_ERROR(--disable-shared must be used to bundle Python plugin support in the babeltrace executable)]) | |
c3ddb532 PP |
415 | AS_IF([test "x$enable_python_plugins" = "xno"], [ |
416 | AC_MSG_ERROR([You can't use BUILT_IN_PYTHON_PLUGIN_SUPPORT=1 without --enable-python-plugins.]) | |
417 | ]) | |
6fbd4105 PP |
418 | built_in_python_plugin_support=yes |
419 | AC_DEFINE([BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections]) | |
420 | ]) | |
421 | AM_CONDITIONAL([BUILT_IN_PYTHON_PLUGIN_SUPPORT], [test "x$built_in_python_plugin_support" = "xyes"]) | |
422 | ||
5cbf5347 | 423 | PKG_CHECK_MODULES(GMODULE, [gmodule-no-export-2.0 >= 2.0.0]) |
ac65e355 | 424 | |
beb0fb75 PP |
425 | # Logging |
426 | AC_ARG_VAR([BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level for Babeltrace program, library, and plugins (VERBOSE, DEBUG, INFO, WARN, ERROR (default), FATAL, or NONE)]) | |
4b328724 | 427 | AS_IF([test "x$BABELTRACE_MINIMAL_LOG_LEVEL" = "x"], [BABELTRACE_MINIMAL_LOG_LEVEL=VERBOSE]) |
beb0fb75 PP |
428 | AS_IF([test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "VERBOSE" && test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "DEBUG" && test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "INFO" && test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "WARN" && test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "ERROR" && test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "FATAL" && test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "NONE"], [ |
429 | AC_MSG_ERROR([Invalid BABELTRACE_MINIMAL_LOG_LEVEL value ($BABELTRACE_MINIMAL_LOG_LEVEL): use VERBOSE, DEBUG, INFO, WARN, ERROR, FATAL, or NONE.]) | |
430 | ]) | |
431 | AC_DEFINE_UNQUOTED([BT_LOG_LEVEL], [BT_LOG_$BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level]) | |
432 | ||
989e97b6 MJ |
433 | AM_CFLAGS="-Wall -Wformat $PTHREAD_CFLAGS $GLIB_CFLAGS" |
434 | AC_SUBST(AM_CFLAGS) | |
ac65e355 | 435 | |
989e97b6 MJ |
436 | AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -include config.h" |
437 | AC_SUBST(AM_CPPFLAGS) | |
438 | ||
439 | LIBS="$GLIB_LIBS" | |
38424656 | 440 | |
e4d70dc3 | 441 | babeltraceincludedir="${includedir}/babeltrace" |
70bd0a12 JD |
442 | AC_SUBST(babeltraceincludedir) |
443 | ||
273b65be JG |
444 | babeltracectfwriterincludedir="${includedir}/babeltrace/ctf-writer" |
445 | AC_SUBST(babeltracectfwriterincludedir) | |
446 | ||
dc3fffef PP |
447 | babeltracectfincludedir="${includedir}/babeltrace/ctf" |
448 | AC_SUBST(babeltracectfincludedir) | |
449 | ||
adc315b8 JG |
450 | babeltracectfirincludedir="${includedir}/babeltrace/ctf-ir" |
451 | AC_SUBST(babeltracectfirincludedir) | |
452 | ||
6ee873c6 JG |
453 | babeltracepluginincludedir="${includedir}/babeltrace/plugin" |
454 | AC_SUBST(babeltracepluginincludedir) | |
455 | ||
b2e0c907 PP |
456 | babeltracegraphincludedir="${includedir}/babeltrace/graph" |
457 | AC_SUBST(babeltracegraphincludedir) | |
592ddb00 | 458 | |
5781a924 | 459 | program_transform_name="s&babeltrace\.bin&babeltrace&;s&babeltrace-log\.bin&babeltrace-log&;$program_transform_name" |
33b34c43 | 460 | AC_SUBST(program_transform_name) |
591999ca | 461 | |
d1dab1d2 PP |
462 | # check for Doxygen |
463 | AC_ARG_ENABLE( | |
464 | [api-doc], | |
465 | [AC_HELP_STRING( | |
466 | [--enable-api-doc], | |
467 | [generate and install HTML API documentation] | |
468 | )], | |
469 | [enable_api_doc=$enableval], | |
470 | [enable_api_doc=no] | |
471 | ) | |
472 | AM_CONDITIONAL([ENABLE_API_DOC], [test "x$enable_api_doc" = "xyes"]) | |
473 | ||
474 | AS_IF([test "x$enable_api_doc" = "xyes"], [ | |
475 | DX_DOXYGEN_FEATURE(ON) | |
476 | DX_DOT_FEATURE(OFF) | |
477 | DX_HTML_FEATURE(ON) | |
478 | DX_CHM_FEATURE(OFF) | |
479 | DX_CHI_FEATURE(OFF) | |
480 | DX_MAN_FEATURE(OFF) | |
481 | DX_RTF_FEATURE(OFF) | |
482 | DX_XML_FEATURE(OFF) | |
483 | DX_PDF_FEATURE(OFF) | |
484 | DX_PS_FEATURE(OFF) | |
485 | DX_INIT_DOXYGEN([Babeltrace], [$(srcdir)/Doxyfile], [output]) | |
486 | ]) | |
487 | ||
45ff8fe4 MD |
488 | #TODO: removed, work in progress |
489 | #bindings/python/Makefile | |
490 | #bindings/python/babeltrace/Makefile | |
491 | #bindings/python/bt2/Makefile | |
492 | #bindings/python/bt2/__init__.py | |
ac65e355 MD |
493 | AC_CONFIG_FILES([ |
494 | Makefile | |
1670bffd | 495 | common/Makefile |
9d1e7de0 | 496 | compat/Makefile |
8d77550c | 497 | cli/Makefile |
d2c0553c | 498 | doc/Makefile |
dc3fffef PP |
499 | doc/api/Makefile |
500 | doc/api/Doxyfile | |
4f5f37d9 PP |
501 | doc/bindings/Makefile |
502 | doc/bindings/python/Makefile | |
e7b68776 | 503 | doc/images/Makefile |
1eb0c69c | 504 | lib/Makefile |
74f21e2d | 505 | lib/prio_heap/Makefile |
33b34c43 | 506 | lib/plugin/Makefile |
c5504f73 PP |
507 | lib/graph/Makefile |
508 | lib/graph/notification/Makefile | |
dc3fffef PP |
509 | lib/ctf-ir/Makefile |
510 | lib/ctf-writer/Makefile | |
e92927d1 | 511 | include/Makefile |
beb0fb75 | 512 | logging/Makefile |
24a3136a | 513 | bindings/Makefile |
ac65e355 | 514 | tests/Makefile |
a8101b91 PP |
515 | tests/cli/Makefile |
516 | tests/cli/intersection/Makefile | |
aa968dde | 517 | tests/lib/Makefile |
4c3453a1 | 518 | tests/lib/writer/Makefile |
cbb9e0b1 | 519 | tests/lib/test-plugin-plugins/Makefile |
1833a3d1 CB |
520 | tests/utils/Makefile |
521 | tests/utils/tap/Makefile | |
9cf643d1 PP |
522 | tests/bindings/Makefile |
523 | tests/bindings/python/Makefile | |
524 | tests/bindings/python/bt2/Makefile | |
8deeabc6 | 525 | tests/plugins/Makefile |
6aa249b5 MD |
526 | extras/Makefile |
527 | extras/valgrind/Makefile | |
8ca04164 | 528 | plugins/Makefile |
38d02a17 | 529 | plugins/ctf/Makefile |
06a626b8 JG |
530 | plugins/ctf/common/Makefile |
531 | plugins/ctf/common/btr/Makefile | |
532 | plugins/ctf/common/metadata/Makefile | |
533 | plugins/ctf/common/notif-iter/Makefile | |
d8866baa PP |
534 | plugins/ctf/fs-src/Makefile |
535 | plugins/ctf/fs-sink/Makefile | |
f3bc2010 JG |
536 | plugins/ctf/lttng-live/Makefile |
537 | plugins/text/Makefile | |
e2531d3b | 538 | plugins/text/dmesg/Makefile |
3228cc1d | 539 | plugins/text/pretty/Makefile |
e0dfa761 PP |
540 | plugins/utils/Makefile |
541 | plugins/utils/dummy/Makefile | |
14b7ef9e | 542 | plugins/utils/counter/Makefile |
e0dfa761 | 543 | plugins/utils/trimmer/Makefile |
958f7d11 | 544 | plugins/utils/muxer/Makefile |
6fbd4105 | 545 | python-plugin-provider/Makefile |
91b73004 | 546 | plugins/libctfcopytrace/Makefile |
456a4476 | 547 | plugins/lttng-utils/Makefile |
d0acc96d | 548 | babeltrace.pc |
e7a7efdb | 549 | babeltrace-ctf.pc |
ac65e355 | 550 | ]) |
c41a7502 | 551 | |
c1870f57 | 552 | #AC_CONFIG_FILES([converter/babeltrace], [chmod +x converter/babeltrace]) |
d6a1ced5 | 553 | AC_CONFIG_FILES([tests/lib/test_ctf_writer_complete], [chmod +x tests/lib/test_ctf_writer_complete]) |
cbb9e0b1 | 554 | AC_CONFIG_FILES([tests/lib/test_plugin_complete], [chmod +x tests/lib/test_plugin_complete]) |
3413e389 SM |
555 | AC_CONFIG_FILES([tests/lib/test_dwarf_complete], [chmod +x tests/lib/test_dwarf_complete]) |
556 | AC_CONFIG_FILES([tests/lib/test_bin_info_complete], [chmod +x tests/lib/test_bin_info_complete]) | |
d6a1ced5 | 557 | |
8deeabc6 PP |
558 | AC_CONFIG_FILES([tests/plugins/test-utils-muxer-complete], [chmod +x tests/plugins/test-utils-muxer-complete]) |
559 | ||
a8101b91 | 560 | AC_CONFIG_FILES([tests/cli/test_trace_read], [chmod +x tests/cli/test_trace_read]) |
673a485c | 561 | AC_CONFIG_FILES([tests/cli/test_trace_copy], [chmod +x tests/cli/test_trace_copy]) |
8bef670e | 562 | AC_CONFIG_FILES([tests/cli/test_debug_info], [chmod +x tests/cli/test_debug_info]) |
0c305c6e | 563 | AC_CONFIG_FILES([tests/cli/test_trimmer], [chmod +x tests/cli/test_trimmer]) |
a8101b91 | 564 | AC_CONFIG_FILES([tests/cli/intersection/test_intersection], [chmod +x tests/cli/intersection/test_intersection]) |
73d7fabb | 565 | AC_CONFIG_FILES([tests/cli/test_convert_args], [chmod +x tests/cli/test_convert_args]) |
a8101b91 | 566 | AC_CONFIG_FILES([tests/cli/intersection/bt_python_helper.py]) |
4c3453a1 | 567 | AC_CONFIG_FILES([tests/lib/writer/bt_python_helper.py]) |
cd36b2f1 MD |
568 | AC_CONFIG_FILES([tests/lib/writer/test_ctf_writer_empty_packet.py]) |
569 | AC_CONFIG_FILES([tests/lib/writer/test_ctf_writer_no_packet_context.py]) | |
a8101b91 | 570 | AC_CONFIG_FILES([tests/cli/test_packet_seq_num], [chmod +x tests/cli/test_packet_seq_num]) |
c41a7502 | 571 | |
9cf643d1 PP |
572 | AS_IF([test "x$enable_python" = "xyes"], [ |
573 | AC_CONFIG_FILES( | |
574 | [tests/bindings/python/bt2/testall.sh], | |
575 | [chmod +x tests/bindings/python/bt2/testall.sh] | |
576 | ) | |
577 | ]) | |
578 | ||
ac65e355 | 579 | AC_OUTPUT |
1a0399f9 MJ |
580 | |
581 | # | |
582 | # Mini-report on what will be built. | |
583 | # | |
584 | ||
585 | PPRINT_INIT | |
586 | PPRINT_SET_INDENT(1) | |
587 | PPRINT_SET_TS(38) | |
588 | ||
589 | AS_ECHO | |
590 | AS_ECHO("${PPRINT_COLOR_BLDBLU}Babeltrace $PACKAGE_VERSION$PPRINT_COLOR_RST") | |
591 | AS_ECHO | |
592 | ||
4266f2ad | 593 | PPRINT_SUBTITLE([System]) |
1a0399f9 MJ |
594 | |
595 | # Target architecture we're building for. | |
596 | target_arch=$host_cpu | |
597 | [ | |
598 | for f in $CFLAGS; do | |
599 | if test $f = "-m32"; then | |
600 | target_arch="32-bit" | |
601 | elif test $f = "-m64"; then | |
602 | target_arch="64-bit" | |
603 | fi | |
604 | done | |
605 | ] | |
beb0fb75 | 606 | |
4266f2ad | 607 | PPRINT_PROP_STRING([Target architecture], $target_arch) |
d1dab1d2 | 608 | |
4266f2ad PP |
609 | AS_ECHO |
610 | PPRINT_SUBTITLE([Python 3 language support]) | |
55bb57e0 | 611 | test "x$enable_python_bindings" = "xyes" && value=1 || value=0 |
1a0399f9 | 612 | PPRINT_PROP_BOOL([Python bindings], $value) |
55bb57e0 PP |
613 | test "x$enable_python_plugins" = "xyes" && value=1 || value=0 |
614 | PPRINT_PROP_BOOL([Python plugin support], $value) | |
4266f2ad PP |
615 | AS_IF([test "x$enable_python_bindings" = "xyes" || test "x$enable_python_plugins" = "xyes"], [ |
616 | PPRINT_PROP_STRING([Python include paths], [$PYTHON_INCLUDE]) | |
617 | PPRINT_PROP_STRING([Python libraries], [$PYTHON_LIBS]) | |
618 | ]) | |
55bb57e0 | 619 | |
4266f2ad PP |
620 | AS_ECHO |
621 | PPRINT_SUBTITLE([Plugins]) | |
622 | PPRINT_PROP_BOOL(['ctf' plugin], 1) | |
623 | test "x$_enable_debug_info" = "xyes" && value=1 || value=0 | |
624 | PPRINT_PROP_BOOL(['lttng-utils' plugin], $value) | |
625 | PPRINT_PROP_BOOL(['text' plugin], 1) | |
626 | PPRINT_PROP_BOOL(['utils' plugin], 1) | |
627 | ||
628 | AS_ECHO | |
629 | PPRINT_SUBTITLE([Built-in features]) | |
630 | test "x$built_in_plugins" = "xyes" && value=1 || value=0 | |
631 | PPRINT_PROP_BOOL([Built-in plugins], $value) | |
6fbd4105 PP |
632 | test "x$built_in_python_plugin_support" = "xyes" && value=1 || value=0 |
633 | PPRINT_PROP_BOOL([Built-in Python plugin support], $value) | |
634 | ||
4266f2ad PP |
635 | AS_ECHO |
636 | PPRINT_SUBTITLE([Documentation]) | |
637 | test "x$enable_api_doc" = "xyes" && value=1 || value=0 | |
638 | PPRINT_PROP_BOOL([HTML API documentation], $value) | |
639 | test "x$enable_python_bindings_doc" = "xyes" && value=1 || value=0 | |
640 | PPRINT_PROP_BOOL([Python bindings documentation], $value) | |
1a0399f9 | 641 | |
4266f2ad PP |
642 | AS_ECHO |
643 | PPRINT_SUBTITLE([Logging]) | |
644 | PPRINT_PROP_STRING([Minimal log level], $BABELTRACE_MINIMAL_LOG_LEVEL) | |
645 | ||
646 | AS_ECHO | |
647 | PPRINT_SUBTITLE([Testing]) | |
648 | test "x$enable_python_bindings_tests" = "xyes" && value=1 || value=0 | |
649 | PPRINT_PROP_BOOL([Python bindings tests], $value) | |
1a0399f9 MJ |
650 | |
651 | report_bindir="`eval eval echo $bindir`" | |
652 | report_libdir="`eval eval echo $libdir`" | |
4266f2ad | 653 | report_sysconfdif="`eval eval echo $sysconfdir`" |
1a0399f9 MJ |
654 | |
655 | # Print the bindir and libdir this `make install' will install into. | |
656 | AS_ECHO | |
657 | PPRINT_SUBTITLE([Install directories]) | |
658 | PPRINT_PROP_STRING([Binaries], [$report_bindir]) | |
659 | PPRINT_PROP_STRING([Libraries], [$report_libdir]) | |
4266f2ad PP |
660 | PPRINT_PROP_STRING([Plugins], [$report_libdir/babeltrace/plugins]) |
661 | PPRINT_PROP_STRING([Configuration], [$report_sysconfdif]) |