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