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