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