Commit | Line | Data |
---|---|---|
0235b0db | 1 | dnl SPDX-License-Identifier: MIT |
9ffc0257 | 2 | dnl |
0235b0db | 3 | dnl Copyright (C) 2017 EfficiOS, Inc. |
9ffc0257 | 4 | dnl |
0235b0db | 5 | dnl Process this file with autoconf to produce a configure script. |
9ffc0257 MJ |
6 | |
7 | ## ## | |
8 | ## Autoconf base setup ## | |
9 | ## ## | |
10 | ||
e97fe75e | 11 | AC_PREREQ([2.69]) |
9ffc0257 | 12 | |
a2edfc7d | 13 | m4_define([bt_version_major], [2]) |
d5427d80 | 14 | m4_define([bt_version_minor], [1]) |
a2edfc7d | 15 | m4_define([bt_version_patch], [0]) |
d5427d80 | 16 | m4_define([bt_version_dev_stage], [-rc1]) |
2671dfad | 17 | m4_define([bt_version], bt_version_major[.]bt_version_minor[.]bt_version_patch[]bt_version_dev_stage) |
d5427d80 | 18 | m4_define([bt_version_name], []) |
9ffc0257 | 19 | |
e97fe75e | 20 | AC_INIT([babeltrace2],[bt_version],[jeremie dot galarneau at efficios dot com],[],[https://efficios.com/babeltrace/]) |
3fbccce7 MD |
21 | |
22 | # Following the numbering scheme proposed by libtool for the library version | |
23 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html | |
7e69c04f MJ |
24 | m4_define([bt_lib_version_current], [0]) |
25 | m4_define([bt_lib_version_revision], [0]) | |
26 | m4_define([bt_lib_version_age], [0]) | |
27 | m4_define([bt_lib_version], bt_lib_version_current[:]bt_lib_version_revision[:]bt_lib_version_age) | |
e97fe75e MJ |
28 | m4_define([bt_version_description], []) |
29 | m4_define([bt_version_description_c_safe], AS_ESCAPE(bt_version_description)) | |
af597f37 | 30 | |
7e69c04f | 31 | AC_SUBST([BABELTRACE_LIBRARY_VERSION], bt_lib_version) |
3fbccce7 | 32 | |
578e048b | 33 | AC_CONFIG_HEADERS([src/common/config.h]) |
ac65e355 | 34 | AC_CONFIG_AUX_DIR([config]) |
80e2fb15 MJ |
35 | AC_CONFIG_MACRO_DIR([m4]) |
36 | ||
7e69c04f MJ |
37 | AC_DEFINE([BT_VERSION_MAJOR], bt_version_major, [Babeltrace major version]) |
38 | AC_DEFINE([BT_VERSION_MINOR], bt_version_minor, [Babeltrace minor version]) | |
39 | AC_DEFINE([BT_VERSION_PATCH], bt_version_patch, [Babeltrace patch version]) | |
2671dfad | 40 | AC_DEFINE([BT_VERSION_DEV_STAGE], ["]bt_version_dev_stage["], [Babeltrace version development stage (can be empty)]) |
aaa8b698 | 41 | AC_DEFINE([BT_VERSION_NAME], ["]bt_version_name["], [Babeltrace version name]) |
e97fe75e | 42 | AC_DEFINE([BT_VERSION_DESCRIPTION], ["]bt_version_description_c_safe["], [Babeltrace version description]) |
a2edfc7d | 43 | |
ac65e355 MD |
44 | AC_CANONICAL_TARGET |
45 | AC_CANONICAL_HOST | |
80e2fb15 | 46 | |
9ffc0257 MJ |
47 | |
48 | ## ## | |
49 | ## Automake base setup ## | |
50 | ## ## | |
51 | ||
e97fe75e | 52 | AM_INIT_AUTOMAKE([1.12 foreign dist-bzip2 no-dist-gzip tar-ustar nostdinc -Wall -Wno-portability -Werror]) |
99e3ba41 | 53 | AM_MAINTAINER_MODE([enable]) |
ac65e355 | 54 | |
e97fe75e MJ |
55 | # Enable silent rules by default |
56 | AM_SILENT_RULES([yes]) | |
0671bd13 | 57 | |
3d5e9596 | 58 | |
9ffc0257 MJ |
59 | ## ## |
60 | ## OS specific defaults ## | |
61 | ## ## | |
62 | ||
63 | MINGW32=no | |
9ffc0257 MJ |
64 | LT_NO_UNDEFINED="" |
65 | AS_CASE([$host_os], | |
66 | [solaris*|darwin*], | |
67 | [ | |
887d26fa | 68 | AE_FEATURE_DISABLE([debug-info]) |
9ffc0257 | 69 | ], |
f4f8f798 MJ |
70 | [freebsd*], |
71 | [ | |
cbf9cf74 | 72 | AE_FEATURE_DISABLE([debug-info]) |
f4f8f798 | 73 | ], |
9ffc0257 MJ |
74 | [cygwin*], |
75 | [ | |
887d26fa | 76 | AE_FEATURE_DISABLE([debug-info]) |
9ffc0257 MJ |
77 | LT_NO_UNDEFINED="-no-undefined" |
78 | ], | |
79 | [mingw*], | |
80 | [ | |
81 | MINGW32=yes | |
887d26fa | 82 | AE_FEATURE_DISABLE([debug-info]) |
9ffc0257 MJ |
83 | LT_NO_UNDEFINED="-no-undefined" |
84 | ] | |
85 | ) | |
86 | ||
87 | AM_CONDITIONAL([BABELTRACE_BUILD_WITH_MINGW], [test "x$MINGW32" = "xyes"]) | |
88 | AC_SUBST(LT_NO_UNDEFINED) | |
89 | ||
90 | ||
91 | ## ## | |
92 | ## C compiler checks ## | |
93 | ## ## | |
94 | ||
9ffc0257 | 95 | # Choose the c compiler |
e97fe75e | 96 | AC_PROG_CC_STDC |
217108a9 | 97 | |
9ffc0257 | 98 | # Make sure the c compiler supports C99 |
e97fe75e MJ |
99 | AS_IF([test "$ac_cv_prog_cc_c99" = "no"], [AC_MSG_ERROR([The compiler does not support C99])]) |
100 | ||
101 | # Enable available system extensions and LFS support | |
102 | AC_USE_SYSTEM_EXTENSIONS | |
103 | AC_SYS_LARGEFILE | |
ac65e355 | 104 | |
9ffc0257 | 105 | # Make sure the c compiler supports __attributes__ |
ec8add54 | 106 | AX_C___ATTRIBUTE__ |
9ffc0257 MJ |
107 | AS_IF([test "x$ax_cv___attribute__" != "xyes"], |
108 | [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])]) | |
ec8add54 | 109 | |
9ffc0257 MJ |
110 | # Make sur we have pthread support |
111 | AX_PTHREAD([], [AC_MSG_ERROR([Could not configure pthread support])]) | |
112 | ||
113 | # Checks for typedefs, structures, and compiler characteristics. | |
114 | AC_C_INLINE | |
115 | AC_C_TYPEOF | |
116 | AC_TYPE_PID_T | |
117 | AC_TYPE_SIZE_T | |
118 | AC_TYPE_INT16_T | |
119 | AC_TYPE_INT32_T | |
120 | AC_TYPE_INT64_T | |
121 | AC_TYPE_INT8_T | |
122 | AC_TYPE_OFF_T | |
123 | AC_TYPE_SSIZE_T | |
124 | AC_TYPE_UINT16_T | |
125 | AC_TYPE_UINT32_T | |
126 | AC_TYPE_UINT64_T | |
127 | AC_TYPE_UINT8_T | |
128 | AC_CHECK_TYPES([ptrdiff_t]) | |
a2bc83d4 | 129 | |
9ffc0257 | 130 | |
c20049fd MJ |
131 | ## ## |
132 | ## C++ compiler checks ## | |
133 | ## ## | |
134 | ||
135 | # Require a C++11 compiler without GNU extensions (-std=c++11) | |
136 | AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory]) | |
137 | ||
138 | ||
9ffc0257 MJ |
139 | ## ## |
140 | ## Header checks ## | |
141 | ## ## | |
f0d8d709 | 142 | |
f847f3ae MJ |
143 | AC_HEADER_STDBOOL |
144 | AC_CHECK_HEADERS([ \ | |
145 | fcntl.h \ | |
146 | float.h \ | |
e1f4c4f7 | 147 | ftw.h \ |
f847f3ae MJ |
148 | libintl.h \ |
149 | limits.h \ | |
150 | malloc.h \ | |
151 | netdb.h \ | |
152 | netinet/in.h \ | |
153 | stddef.h \ | |
154 | sys/socket.h \ | |
9ffc0257 | 155 | sys/time.h |
f847f3ae | 156 | ]) |
80e2fb15 | 157 | |
9ffc0257 MJ |
158 | |
159 | ## ## | |
160 | ## Linker checks ## | |
161 | ## ## | |
162 | ||
163 | # Check if the linker supports no-as-needed | |
164 | AX_APPEND_LINK_FLAGS([-Wl,--no-as-needed], [LD_NO_AS_NEEDED]) | |
165 | AC_SUBST([LD_NO_AS_NEEDED]) | |
166 | ||
1244e794 MJ |
167 | # Check if the linker supports whole-archive |
168 | AX_CHECK_LINK_FLAG([-Wl,--whole-archive,--no-whole-archive], | |
169 | [ | |
170 | AC_SUBST([LD_WHOLE_ARCHIVE], [-Wl,--whole-archive,]) | |
171 | AC_SUBST([LD_NO_WHOLE_ARCHIVE], [,--no-whole-archive]) | |
172 | ],[ | |
173 | # Fallback to force_load for the macOS linker | |
174 | AX_CHECK_LINK_FLAG([-Wl,-force_load], | |
175 | [ | |
176 | AC_SUBST([LD_WHOLE_ARCHIVE], [-Wl,-force_load,]) | |
177 | AC_SUBST([LD_NO_WHOLE_ARCHIVE], []) | |
178 | ],[ | |
179 | AC_MSG_WARN([Can't find a linker option to force the inclusion of the static plugin archive objects.]) | |
180 | ] | |
181 | ) | |
182 | ] | |
183 | ) | |
184 | ||
5e8a0751 MJ |
185 | # Check if the linker supports the "notext" keyword |
186 | AX_CHECK_LINK_FLAG([-Wl,-z,notext],[ | |
187 | AC_SUBST([LD_NOTEXT], [-Wl,-z,notext]) | |
188 | ]) | |
189 | ||
9ffc0257 MJ |
190 | |
191 | ## ## | |
192 | ## Programs checks ## | |
193 | ## ## | |
194 | ||
e97fe75e | 195 | AM_PROG_AR |
9ffc0257 MJ |
196 | AC_PROG_MAKE_SET |
197 | AC_PROG_MKDIR_P | |
198 | AC_PROG_LN_S | |
e97fe75e | 199 | AC_PROG_SED |
aaa8b698 | 200 | AC_PATH_PROG([report_fold], [fold]) |
9ffc0257 | 201 | |
540d833d MJ |
202 | # set $IN_GIT_REPO if we're in the Git repository; the `bootstrap` file |
203 | # is not distributed in tarballs | |
204 | AS_IF([test -f "$srcdir/bootstrap"], [in_git_repo=yes], [in_git_repo=no]) | |
205 | AM_CONDITIONAL([IN_GIT_REPO], [test "x$in_git_repo" = "xyes"]) | |
206 | ||
207 | # check for bison | |
208 | AC_PROG_YACC | |
042f640b | 209 | AX_PROG_BISON_VERSION([2.5], [have_bison=yes]) |
540d833d MJ |
210 | |
211 | AS_IF([test "x$have_bison" != "xyes"], [ | |
212 | AS_IF([test "x$in_git_repo" = "xyes"], [ | |
9ffc0257 | 213 | AC_MSG_FAILURE([dnl |
540d833d MJ |
214 | Bison >= 2.4 is required when building from the Git repository. You can |
215 | set the YACC variable to override automatic detection. | |
216 | ]) | |
217 | ], [ | |
9ffc0257 | 218 | AC_MSG_WARN([dnl |
540d833d MJ |
219 | Missing Bison >= 2.4. Note that the parser files are already built in |
220 | this distribution tarball, so Bison is only needed if you intend to | |
221 | modify their sources. You can set the YACC variable to override automatic | |
222 | detection. | |
223 | ]) | |
224 | ]) | |
225 | ]) | |
226 | AM_CONDITIONAL([HAVE_BISON], [test "x$have_bison" = "xyes"]) | |
227 | ||
228 | # check for flex | |
229 | AC_PROG_LEX | |
230 | AX_PROG_FLEX_VERSION([2.5.35], [have_flex=yes]) | |
231 | ||
232 | AS_IF([test "x$have_flex" != "xyes"], [ | |
233 | AS_IF([test "x$in_git_repo" = "xyes"], [ | |
9ffc0257 | 234 | AC_MSG_FAILURE([dnl |
540d833d MJ |
235 | Flex >= 2.5.35 is required when building from the Git repository. You can |
236 | set the LEX variable to override automatic detection. | |
237 | ]) | |
238 | ], [ | |
9ffc0257 | 239 | AC_MSG_WARN([dnl |
540d833d MJ |
240 | Missing Flex >= 2.5.35. Note that the lexer files are already built in |
241 | this distribution tarball, so Flex is only needed if you intend to | |
242 | modify their sources. You can set the LEX variable to override automatic | |
243 | detection. | |
244 | ]) | |
245 | ]) | |
246 | ]) | |
247 | AM_CONDITIONAL([HAVE_FLEX], [test "x$have_flex" = "xyes"]) | |
331d78f5 | 248 | |
e97fe75e MJ |
249 | # Initialize and configure libtool |
250 | LT_INIT([win32-dll]) | |
251 | ||
e5f5317f | 252 | |
9ffc0257 MJ |
253 | ## ## |
254 | ## Library checks ## | |
255 | ## ## | |
ac65e355 | 256 | |
39fa4402 MJ |
257 | # Check what libraries are required on this platform to link sockets programs. |
258 | AX_LIB_SOCKET_NSL | |
259 | ||
ef9559ae SM |
260 | # Check for glib >= 2.28 with gmodule support |
261 | AM_PATH_GLIB_2_0([2.28.0], [], | |
262 | AC_MSG_ERROR([glib >= 2.28 is required - download it from ftp://ftp.gtk.org/pub/gtk]), | |
9ffc0257 MJ |
263 | [gmodule-no-export] |
264 | ) | |
ac65e355 MD |
265 | |
266 | # Checks for library functions. | |
f847f3ae MJ |
267 | AC_FUNC_ALLOCA |
268 | AC_FUNC_FORK | |
f847f3ae | 269 | AC_FUNC_MKTIME |
ac65e355 | 270 | AC_FUNC_MMAP |
f847f3ae | 271 | AC_FUNC_STRERROR_R |
9ffc0257 | 272 | AC_FUNC_STRNLEN |
2f8c0e47 | 273 | AC_CHECK_FUNCS([ \ |
f847f3ae | 274 | atexit \ |
f847f3ae MJ |
275 | dup2 \ |
276 | ftruncate \ | |
277 | gethostbyname \ | |
f847f3ae MJ |
278 | gettimeofday \ |
279 | localtime_r \ | |
280 | memchr \ | |
281 | memset \ | |
282 | mkdir \ | |
283 | mkdtemp \ | |
284 | munmap \ | |
285 | rmdir \ | |
286 | setenv \ | |
287 | socket \ | |
288 | strchr \ | |
289 | strdup \ | |
290 | strerror \ | |
291 | strndup \ | |
292 | strnlen \ | |
293 | strrchr \ | |
9ffc0257 | 294 | strstr \ |
f847f3ae MJ |
295 | strtoul \ |
296 | strtoull \ | |
297 | tzset \ | |
2f8c0e47 | 298 | ]) |
ac65e355 | 299 | |
dc4cb410 MJ |
300 | # AC_FUNC_MALLOC causes problems when cross-compiling. |
301 | #AC_FUNC_MALLOC | |
302 | #AC_FUNC_REALLOC | |
303 | ||
f8370579 MD |
304 | # Check for fmemopen |
305 | AC_CHECK_LIB([c], [fmemopen], | |
9ffc0257 | 306 | [AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_FMEMOPEN], 1, [Has fmemopen support.])] |
f8370579 MD |
307 | ) |
308 | ||
309 | # Check for open_memstream | |
310 | AC_CHECK_LIB([c], [open_memstream], | |
9ffc0257 | 311 | [AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.])] |
f8370579 MD |
312 | ) |
313 | ||
a323afb2 JG |
314 | # Check for posix_fallocate |
315 | AC_CHECK_LIB([c], [posix_fallocate], | |
9ffc0257 | 316 | [AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_POSIX_FALLOCATE], 1, [Has posix_fallocate support.])] |
a323afb2 JG |
317 | ) |
318 | ||
887d26fa | 319 | |
9ffc0257 MJ |
320 | ## ## |
321 | ## User variables ## | |
322 | ## ## | |
323 | ||
324 | AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for Python, bypassing python-config]) | |
0b9113bf | 325 | AC_ARG_VAR([PYTHON_LDFLAGS], [Linker flags for Python, bypassing python-config]) |
9ffc0257 MJ |
326 | AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) |
327 | ||
056632bf MJ |
328 | # BABELTRACE_PLUGINS_DIR: Plugins directory |
329 | AC_ARG_VAR([BABELTRACE_PLUGINS_DIR], [built-in plugins install directory [LIBDIR/babeltrace2/plugins]]) | |
330 | AS_IF([test "x$BABELTRACE_PLUGINS_DIR" = x], [BABELTRACE_PLUGINS_DIR='${libdir}/babeltrace2/plugins']) | |
a094f13b | 331 | |
b14c7bf1 MJ |
332 | # BABELTRACE_PLUGIN_PROVIDERS_DIR: Plugin providers directory |
333 | AC_ARG_VAR([BABELTRACE_PLUGIN_PROVIDERS_DIR], [built-in plugin providers install directory [LIBDIR/babeltrace2/plugin-providers]]) | |
334 | AS_IF([test "x$BABELTRACE_PLUGIN_PROVIDERS_DIR" = x], [BABELTRACE_PLUGIN_PROVIDERS_DIR='${libdir}/babeltrace2/plugin-providers']) | |
335 | ||
9ffc0257 | 336 | # BABELTRACE_MINIMAL_LOG_LEVEL: |
dd22a91f | 337 | AC_ARG_VAR([BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level for Babeltrace program, library, and plugins (TRACE, DEBUG (default), or INFO)]) |
f7a9ecd3 | 338 | AS_IF([test "x$BABELTRACE_MINIMAL_LOG_LEVEL" = x], [BABELTRACE_MINIMAL_LOG_LEVEL="DEBUG"]) |
ef267d12 | 339 | AS_IF([test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "TRACE" && \ |
9ffc0257 | 340 | test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "DEBUG" && \ |
dd22a91f PP |
341 | test "$BABELTRACE_MINIMAL_LOG_LEVEL" != "INFO"], |
342 | [AC_MSG_ERROR([Invalid BABELTRACE_MINIMAL_LOG_LEVEL value ($BABELTRACE_MINIMAL_LOG_LEVEL): use TRACE, DEBUG, or INFO.])] | |
9ffc0257 | 343 | ) |
510400a9 | 344 | AC_DEFINE_UNQUOTED([BT_MINIMAL_LOG_LEVEL], [BT_LOG_$BABELTRACE_MINIMAL_LOG_LEVEL], [Minimal log level]) |
9ffc0257 | 345 | |
464ebc31 PP |
346 | # BABELTRACE_DEV_MODE: |
347 | AC_ARG_VAR([BABELTRACE_DEV_MODE], [Set to 1 to enable the Babeltrace developer mode (enables run-time checks for plugin developers)]) | |
348 | AS_IF([test "x$BABELTRACE_DEV_MODE" = x1], [ | |
464ebc31 PP |
349 | AC_DEFINE([BT_DEV_MODE], 1, [Babeltrace developer mode]) |
350 | ], [BABELTRACE_DEV_MODE=0]) | |
5d7e8359 | 351 | AM_CONDITIONAL([DEV_MODE], [test "x$BABELTRACE_DEV_MODE" = x1]) |
464ebc31 PP |
352 | |
353 | # BABELTRACE_DEBUG_MODE: | |
354 | AC_ARG_VAR([BABELTRACE_DEBUG_MODE], [Set to 1 to enable the Babeltrace debug mode (enables internal assertions for Babeltrace maintainers)]) | |
355 | AS_IF([test "x$BABELTRACE_DEBUG_MODE" = x1], [ | |
356 | AC_DEFINE([BT_DEBUG_MODE], 1, [Babeltrace debug mode]) | |
357 | ], [BABELTRACE_DEBUG_MODE=0]) | |
358 | ||
9ffc0257 MJ |
359 | |
360 | ## ## | |
361 | ## Optionnal features selection ## | |
362 | ## ## | |
24a3136a | 363 | |
9ffc0257 MJ |
364 | # Python bindings |
365 | # Disabled by default | |
887d26fa MJ |
366 | AE_FEATURE_DEFAULT_DISABLE |
367 | AE_FEATURE([python-bindings],[build the Python bindings]) | |
9ffc0257 | 368 | |
ba64dfcc SM |
369 | # Python bindings documentation |
370 | # Disabled by default | |
887d26fa MJ |
371 | AE_FEATURE_DEFAULT_DISABLE |
372 | AE_FEATURE([python-bindings-doc],[build the Python bindings documentation]) | |
ba64dfcc | 373 | |
9ffc0257 MJ |
374 | # Python plugins |
375 | # Disabled by default | |
887d26fa MJ |
376 | AE_FEATURE_DEFAULT_DISABLE |
377 | AE_FEATURE([python-plugins],[enable the Python plugins support for the library and converter]) | |
9ffc0257 MJ |
378 | |
379 | # Debug info | |
380 | # Enabled by default, except on some platforms | |
887d26fa MJ |
381 | AE_FEATURE_DEFAULT_ENABLE |
382 | AE_FEATURE([debug-info],[disable the debug info support (default on macOS, Solaris and Windows)]) | |
9ffc0257 MJ |
383 | |
384 | # API documentation | |
385 | # Disabled by default | |
887d26fa MJ |
386 | AE_FEATURE_DEFAULT_DISABLE |
387 | AE_FEATURE([api-doc],[build the HTML API documentation]) | |
9ffc0257 MJ |
388 | |
389 | # Built-in plugins | |
390 | # Disabled by default | |
887d26fa MJ |
391 | AE_FEATURE_DEFAULT_DISABLE |
392 | AE_FEATURE([built-in-plugins],[Statically-link in-tree plug-ins into the babeltrace2 executable]) | |
9ffc0257 MJ |
393 | |
394 | # Built-in python plugin support | |
395 | # Disabled by default | |
887d26fa MJ |
396 | AE_FEATURE_DEFAULT_DISABLE |
397 | AE_FEATURE([built-in-python-plugin-support],[Statically-link Python plugin support into the babeltrace library]) | |
9ffc0257 | 398 | |
0659f3af PP |
399 | # Man pages |
400 | # Enabled by default | |
887d26fa MJ |
401 | AE_FEATURE_DEFAULT_ENABLE |
402 | AE_FEATURE([man-pages],[Do not build and install man pages (already built in a distributed tarball]) | |
0659f3af | 403 | |
c20049fd | 404 | # When given, add -Werror to WARN_CFLAGS and WARN_CXXFLAGS. |
887d26fa MJ |
405 | # Disabled by default |
406 | AE_FEATURE_DEFAULT_DISABLE | |
407 | AE_FEATURE([Werror],[Treat compiler warnings as errors.]) | |
9ffc0257 | 408 | |
9ffc0257 | 409 | |
887d26fa MJ |
410 | ## ## |
411 | ## Check for conflicting features selection ## | |
412 | ## ## | |
9ffc0257 | 413 | |
887d26fa MJ |
414 | # Check for conflicting Python related features user choices. |
415 | AE_IF_FEATURE_ENABLED([python-plugins], [ | |
416 | AE_IF_FEATURE_UNDEF([python-bindings], [ | |
417 | # --enable-python-plugins was provided but --enable-python-bindings was | |
418 | # omitted. Turn the Python bindings ON anyway because it's needed to | |
419 | # use the Python plugins. | |
420 | AE_FEATURE_ENABLE([python-bindings]) | |
421 | ], [ | |
422 | AE_IF_FEATURE_DISABLED([python-bindings], [ | |
423 | # --enable-python-plugins _and_ --disable-python-bindings were | |
424 | # used. This is invalid because Python plugins need the Python | |
425 | # bindings to be useful. | |
426 | AC_MSG_ERROR(--enable-python-bindings must be used to support Python plugins) | |
427 | ]) | |
428 | ]) | |
429 | ]) | |
9ffc0257 | 430 | |
887d26fa MJ |
431 | # Check for conflicting optional features user choices |
432 | AE_IF_FEATURE_ENABLED([built-in-plugins], [ | |
433 | # Built-in plug-ins are only available when the --disable-shared --enable-static options are used. | |
434 | AE_IF_FEATURE_NOT_ENABLED([static], [AC_MSG_ERROR(--enable-static must be used to bundle plug-ins in the babeltrace2 executable)]) | |
435 | AE_IF_FEATURE_ENABLED([shared], [AC_MSG_ERROR(--disable-shared must be used to bundle plug-ins in the babeltrace2 executable)]) | |
436 | ]) | |
9ffc0257 | 437 | |
887d26fa MJ |
438 | AE_IF_FEATURE_ENABLED([built-in-python-plugin-support], [ |
439 | AE_IF_FEATURE_NOT_ENABLED([python-plugins], [AC_MSG_ERROR([--enable-python-plugins must be used to bundle Python plugin support in the babeltrace2 executable])]) | |
440 | # Built-in plug-ins are only available when the --disable-shared --enable-static options are used. | |
441 | AE_IF_FEATURE_NOT_ENABLED([static], [AC_MSG_ERROR(--enable-static must be used to bundle Python plugin support in the babeltrace2 executable)]) | |
442 | AE_IF_FEATURE_ENABLED([shared], [AC_MSG_ERROR(--disable-shared must be used to bundle Python plugin support in the babeltrace2 executable)]) | |
443 | ]) | |
0659f3af | 444 | |
0659f3af | 445 | |
887d26fa MJ |
446 | ## ## |
447 | ## Set automake variables for optionnal feature conditionnals in Makefile.am ## | |
448 | ## ## | |
9ffc0257 | 449 | |
887d26fa MJ |
450 | AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS], AE_IS_FEATURE_ENABLED([python-bindings])) |
451 | AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS_DOC], AE_IS_FEATURE_ENABLED([python-bindings-doc])) | |
452 | AM_CONDITIONAL([ENABLE_PYTHON_PLUGINS], AE_IS_FEATURE_ENABLED([python-plugins])) | |
453 | AM_CONDITIONAL([ENABLE_DEBUG_INFO], AE_IS_FEATURE_ENABLED([debug-info])) | |
454 | AM_CONDITIONAL([ENABLE_API_DOC], AE_IS_FEATURE_ENABLED([api-doc])) | |
455 | AM_CONDITIONAL([ENABLE_BUILT_IN_PLUGINS], AE_IS_FEATURE_ENABLED([built-in-plugins])) | |
456 | AM_CONDITIONAL([ENABLE_BUILT_IN_PYTHON_PLUGIN_SUPPORT], AE_IS_FEATURE_ENABLED([built-in-python-plugin-support])) | |
457 | AM_CONDITIONAL([ENABLE_MAN_PAGES], AE_IS_FEATURE_ENABLED([man-pages])) | |
458 | AM_CONDITIONAL([ENABLE_PYTHON_COMMON_DEPS], AE_IS_FEATURE_ENABLED([python-bindings]) || AE_IS_FEATURE_ENABLED([python-plugins])) | |
9ffc0257 | 459 | |
887d26fa MJ |
460 | |
461 | ## ## | |
462 | ## Set defines for optionnal features conditionnals in the source code ## | |
463 | ## ## | |
464 | ||
465 | AE_IF_FEATURE_ENABLED([built-in-plugins], | |
466 | [AC_DEFINE([BT_BUILT_IN_PLUGINS], [1], [Define to 1 to register plug-in attributes in static executable sections])] | |
9ffc0257 MJ |
467 | ) |
468 | ||
887d26fa MJ |
469 | AE_IF_FEATURE_ENABLED([built-in-python-plugin-support], |
470 | [AC_DEFINE([BT_BUILT_IN_PYTHON_PLUGIN_SUPPORT], [1], [Define to 1 to register plug-in attributes in static executable sections])] | |
55bb57e0 | 471 | ) |
9cf643d1 | 472 | |
887d26fa MJ |
473 | AE_IF_FEATURE_ENABLED([debug-info], [ENABLE_DEBUG_INFO_VAL=1], [ENABLE_DEBUG_INFO_VAL=0]) |
474 | AC_SUBST([ENABLE_DEBUG_INFO_VAL]) | |
475 | ||
4f5f37d9 | 476 | |
887d26fa MJ |
477 | ## ## |
478 | ## Check for optionnal features dependencies ## | |
479 | ## ## | |
9ffc0257 | 480 | |
887d26fa MJ |
481 | # The Python bindings require SWIG |
482 | AE_IF_FEATURE_ENABLED([python-plugins], | |
9ffc0257 MJ |
483 | [AX_PKG_SWIG(2.0.0, [], [AC_MSG_ERROR([SWIG 2.0.0 or newer is required to build the python bindings])])] |
484 | ) | |
485 | ||
887d26fa MJ |
486 | # Always check for python, we will fail later if some features require it and |
487 | # it's unavailable. | |
419fff0b | 488 | AM_PATH_PYTHON([3.0], [ |
e015bae2 | 489 | AE_PATH_PYTHON_MODULES([PYTHON]) |
419fff0b | 490 | |
1b39e2de JG |
491 | # pythondir is the path where extra modules are to be installed |
492 | pythondir=$PYTHON_PREFIX/$PYTHON_MODULES_PATH | |
419fff0b | 493 | |
1b39e2de JG |
494 | # pyexecdir is the path that contains shared objects used by the extra modules |
495 | pyexecdir=$PYTHON_EXEC_PREFIX/$PYTHON_MODULES_PATH | |
419fff0b PP |
496 | |
497 | AS_IF([test -z "$PYTHON_CONFIG"], [ | |
498 | AC_PATH_PROGS([PYTHON_CONFIG], | |
499 | [python$PYTHON_VERSION-config python-config], | |
500 | [], | |
501 | [`dirname $PYTHON`]) | |
24a3136a | 502 | ]) |
419fff0b PP |
503 | |
504 | AS_IF([test -n "$PYTHON_CONFIG"], [ | |
505 | AS_IF([test -z "$PYTHON_INCLUDE"], [ | |
506 | AC_MSG_CHECKING([Python include flags]) | |
507 | PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` | |
508 | AC_MSG_RESULT([$PYTHON_INCLUDE]) | |
509 | ]) | |
510 | ||
511 | AS_IF([test -z "$PYTHON_LDFLAGS"], [ | |
512 | AC_MSG_CHECKING([Python library flags]) | |
2d786d15 SM |
513 | # Python 3.8+ requires that we pass --embed to get the -lpython3.x flag. |
514 | AS_IF([! PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags --embed`], [ | |
515 | PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags` | |
516 | ]) | |
419fff0b | 517 | AC_MSG_RESULT([$PYTHON_LDFLAGS]) |
55bb57e0 | 518 | ]) |
55bb57e0 | 519 | ]) |
419fff0b PP |
520 | ], [:]) |
521 | ||
522 | AS_IF([test "$PYTHON" != :], [have_python=yes], [have_python=no]) | |
523 | AS_IF([test -n "$PYTHON_CONFIG"], [have_python_dev=yes], [have_python_dev=no]) | |
524 | ||
525 | AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = xyes]) | |
526 | AM_CONDITIONAL([HAVE_PYTHON_DEV], [test "x$have_python_dev" = xyes]) | |
527 | ||
887d26fa | 528 | AS_IF([AE_IS_FEATURE_ENABLED([python-bindings]) || AE_IS_FEATURE_ENABLED([python-plugins])], [ |
419fff0b PP |
529 | AS_IF([test "x$have_python_dev" = xno], [ |
530 | AC_MSG_ERROR([Cannot find a suitable python-config. You can override the python-config path with the PYTHON_CONFIG environment variable.]) | |
531 | ]) | |
532 | ]) | |
55bb57e0 | 533 | |
887d26fa | 534 | AE_IF_FEATURE_ENABLED([python-bindings-doc], |
ba64dfcc | 535 | [ |
435aa29a | 536 | AE_CHECK_PYTHON_SPHINX([PYTHON]) |
ba64dfcc SM |
537 | AS_IF([test "x$PYTHON_SPHINX_EXISTS" = xno], [ |
538 | AC_MSG_ERROR([The Sphinx package for Python 3 is required to build the Python bindings documentation]) | |
539 | ]) | |
540 | ||
887d26fa | 541 | AE_IF_FEATURE_NOT_ENABLED([python-bindings], [ |
ba64dfcc SM |
542 | AC_MSG_ERROR([The Python bindings are required to build their documentation]) |
543 | ]) | |
544 | ] | |
545 | ) | |
546 | ||
887d26fa | 547 | AE_IF_FEATURE_ENABLED([debug-info], [ |
e97fe75e MJ |
548 | # Check if libelf and libdw are present |
549 | PKG_CHECK_MODULES([ELFUTILS], [libelf >= 0.154 libdw >= 0.154], | |
550 | [ | |
551 | dnl PKG_CHECK_MODULES defines ELFUTILS_LIBS | |
552 | ], | |
553 | [ | |
1c482ed8 MJ |
554 | AC_MSG_WARN([pkg-config was unable to find a valid .pc for libelf/libdw. Set PKG_CONFIG_PATH to specify the pkg-config configuration file location.]) |
555 | ||
556 | # Turns out SLES12 doesn't bother shipping .pc file for libelf | |
557 | AC_MSG_WARN([Finding libelf without pkg-config.]) | |
558 | 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.)]) | |
559 | 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.)]) | |
560 | AE_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.)]) | |
561 | ELFUTILS_LIBS="-lelf -ldw" | |
e97fe75e MJ |
562 | ]) |
563 | ]) | |
901e5c12 | 564 | AC_SUBST([ELFUTILS_LIBS]) |
6fbd4105 | 565 | |
887d26fa | 566 | AE_IF_FEATURE_ENABLED([api-doc], |
9ffc0257 MJ |
567 | [ |
568 | DX_DOXYGEN_FEATURE(ON) | |
569 | DX_DOT_FEATURE(OFF) | |
570 | DX_HTML_FEATURE(ON) | |
571 | DX_CHM_FEATURE(OFF) | |
572 | DX_CHI_FEATURE(OFF) | |
573 | DX_MAN_FEATURE(OFF) | |
574 | DX_RTF_FEATURE(OFF) | |
575 | DX_XML_FEATURE(OFF) | |
576 | DX_PDF_FEATURE(OFF) | |
577 | DX_PS_FEATURE(OFF) | |
43c59509 | 578 | DX_INIT_DOXYGEN([Babeltrace 2], [$(builddir)/Doxyfile], [output]) |
9ffc0257 MJ |
579 | AS_IF([test -z "$DX_DOXYGEN"], |
580 | [AC_MSG_ERROR([You need doxygen to enable the API documentation])] | |
581 | ) | |
582 | ] | |
583 | ) | |
ac65e355 | 584 | |
0659f3af PP |
585 | have_asciidoc_xmlto=no |
586 | warn_prebuilt_man_pages=no | |
587 | ||
4a9f5414 MJ |
588 | AC_PATH_PROG([ASCIIDOC], [asciidoc], [no]) |
589 | AC_PATH_PROG([XMLTO], [xmlto], [no]) | |
0659f3af | 590 | |
887d26fa | 591 | AE_IF_FEATURE_ENABLED([man-pages], [ |
0659f3af PP |
592 | AS_IF([test "x$ASCIIDOC" = "xno" || test "x$XMLTO" = "xno"], [ |
593 | AS_IF([test "x$in_git_repo" = "xyes"], [ | |
594 | # this is an error because we're in the Git repo, which | |
595 | # means the man pages are not already generated for us, | |
596 | # thus asciixmlto are required because we were asked | |
597 | # to build the man pages | |
598 | AC_MSG_ERROR([ | |
599 | You need asciidoc and xmlto to build the Babeltrace man pages. Use | |
600 | --disable-man-pages to disable building the man pages, in which case | |
601 | they will not be installed. | |
602 | ]) | |
603 | ], [ | |
604 | # only warn here: since we're in the tarball, the man | |
605 | # pages should already be generated at this point, thus | |
606 | # asciidoc/xmlto are not strictly required | |
607 | warn_prebuilt_man_pages=yes | |
608 | ]) | |
609 | ], [ | |
610 | have_asciidoc_xmlto=yes | |
611 | ]) | |
612 | ]) | |
613 | ||
614 | # export AsciiDoc and xmlto existence | |
615 | AM_CONDITIONAL([HAVE_ASCIIDOC_XMLTO], [test "x$have_asciidoc_xmlto" = "xyes"]) | |
616 | ||
617 | # a wonderful hack that seems necessary because $libdir is | |
618 | # literally `${exec_prefix}/lib`, and $exec_prefix is set to `NONE` | |
619 | # by autoconf when it's not specified by the user | |
620 | AS_IF([test "x$exec_prefix" = xNONE], [ | |
621 | AS_IF([test "x$prefix" = xNONE], [ | |
622 | PREFIX="$ac_default_prefix" | |
623 | ], [ | |
624 | PREFIX="$prefix" | |
625 | ]) | |
626 | ||
627 | LIBDIR="$PREFIX/lib" | |
628 | ], [ | |
629 | LIBDIR="$libdir" | |
630 | ]) | |
631 | ||
632 | AC_SUBST(LIBDIR) | |
633 | ||
887d26fa MJ |
634 | |
635 | ||
636 | ||
02bb4fcc SM |
637 | # CFLAGS from libraries (the glib ones are needed for the following sizeof |
638 | # test). | |
639 | AM_CFLAGS="${PTHREAD_CFLAGS} ${GLIB_CFLAGS}" | |
c20049fd | 640 | AM_CXXFLAGS="${PTHREAD_CFLAGS} ${GLIB_CFLAGS}" |
38424656 | 641 | |
5b5959d4 MJ |
642 | # Check that the current size_t matches the size that glib thinks it should |
643 | # be. This catches problems on multi-arch where people try to do a 32-bit | |
644 | # build while pointing at 64-bit glib headers. This is a common error because | |
645 | # glib.h is not platform specific but it includes glibconfig.h which is and | |
646 | # is usually installed in a non-standard path. | |
647 | ||
02bb4fcc SM |
648 | # Do this before enabling all the warning flags, as the |
649 | # AC_LANG_PROGRAM-generated program may generate some warning, which makes this | |
650 | # test fail unnecessarily. | |
651 | ||
3d130ada MJ |
652 | # Older versions of the pkg-config macros disallows PKG_* in the autoconf |
653 | # output. Specifically allow pkg_config_libdir to be able to print the | |
654 | # error message. | |
655 | m4_pattern_allow([PKG_CONFIG_LIBDIR]) | |
656 | ||
5b5959d4 MJ |
657 | save_CFLAGS=${CFLAGS} |
658 | CFLAGS="${CFLAGS} ${AM_CFLAGS}" | |
659 | AC_COMPILE_IFELSE([ | |
660 | AC_LANG_PROGRAM([dnl | |
661 | #include <glib.h> | |
662 | #include <unistd.h> | |
663 | ], [dnl | |
664 | G_STATIC_ASSERT(sizeof(size_t) == GLIB_SIZEOF_SIZE_T); | |
665 | ]) | |
666 | ],[:],[ | |
667 | AC_MSG_ERROR([dnl | |
668 | sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T. You probably need to set | |
669 | PKG_CONFIG_LIBDIR to point to the right pkg-config files for your build | |
670 | target. | |
671 | ]) | |
672 | ]) | |
673 | CFLAGS=${save_CFLAGS} | |
674 | ||
02bb4fcc | 675 | # Detect C and LD warning flags supported by the compiler. |
28ba44ad | 676 | |
c20049fd MJ |
677 | # Detect warning flags supported by the C and C++ compilers and append them to |
678 | # WARN_CFLAGS and WARN_CXXFLAGS. | |
28ba44ad | 679 | # |
c20049fd | 680 | m4_define([WARN_FLAGS_LIST], [ dnl |
28ba44ad SM |
681 | -Wall dnl |
682 | -Wextra dnl | |
28ba44ad SM |
683 | -Wmissing-prototypes dnl |
684 | -Wmissing-declarations dnl | |
685 | -Wnull-dereference dnl | |
686 | -Wundef dnl | |
687 | -Wredundant-decls dnl | |
688 | -Wshadow dnl | |
689 | -Wjump-misses-init dnl | |
8b305066 | 690 | -Wsuggest-attribute=format dnl |
28ba44ad SM |
691 | -Wtautological-constant-out-of-range-compare dnl |
692 | -Wnested-externs dnl | |
693 | -Wwrite-strings dnl | |
694 | -Wformat=2 dnl | |
28ba44ad SM |
695 | -Wstrict-aliasing dnl |
696 | -Wmissing-noreturn dnl | |
697 | -Winit-self dnl | |
698 | -Wduplicated-cond dnl | |
699 | -Wduplicated-branches dnl | |
700 | -Wlogical-op dnl | |
701 | -Wno-unused-parameter dnl | |
702 | -Wno-sign-compare dnl | |
c29c23a0 SM |
703 | dnl |
704 | dnl Some versions of SWIG (like 3.0.12) generate code that produces | |
705 | dnl -Wcast-function-type warnings. This warning is present in gcc >= 8. This | |
706 | dnl combo happens on RHEL/Centos 8, for example. Later versions of SWIG (like | |
707 | dnl 4.0.1) have the correct function signatures to not produce this warning. | |
708 | dnl It's simpler to just disable the warning globally. | |
709 | dnl | |
710 | dnl Note that the Debian/Ubuntu SWIG package 3.0.12-2 contains a local patch to | |
711 | dnl fix this (python-fix-function-cast-warnings.patch), so you won't be able to | |
712 | dnl reproduce the warning using that package. | |
713 | dnl | |
714 | dnl Ref: https://github.com/swig/swig/issues/1259 | |
715 | -Wno-cast-function-type dnl | |
28ba44ad | 716 | -Wno-missing-field-initializers dnl |
c20049fd MJ |
717 | ]) |
718 | ||
719 | # Pass -Werror as an extra flag during the test: this is needed to make the | |
720 | # -Wunknown-warning-option diagnostic fatal with clang. | |
721 | AC_LANG([C++]) | |
722 | AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CXXFLAGS], [-Werror]) | |
723 | AC_LANG([C]) | |
724 | AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CFLAGS], [-Werror]) | |
28ba44ad | 725 | |
c20049fd | 726 | AE_IF_FEATURE_ENABLED([Werror], [WARN_CXXFLAGS="${WARN_CXXFLAGS} -Werror"]) |
887d26fa | 727 | AE_IF_FEATURE_ENABLED([Werror], [WARN_CFLAGS="${WARN_CFLAGS} -Werror"]) |
02bb4fcc | 728 | |
28ba44ad | 729 | # The test used in AX_APPEND_COMPILE_FLAGS, generated using AC_LANG_PROGRAM, is |
65679347 SM |
730 | # written in such a way that it triggers warnings with the following warning |
731 | # flags. So they would always end up disabled if we put them there, because | |
732 | # the test program would not build. | |
02bb4fcc | 733 | # |
65679347 | 734 | # Enable them here unconditionally. They are supported by GCC >= 4.8 and by |
c20049fd | 735 | # Clang >= 3.3 (required by the project) and are only valid for C code. |
65679347 | 736 | WARN_CFLAGS="${WARN_CFLAGS} -Wold-style-definition -Wstrict-prototypes" |
02bb4fcc | 737 | |
28ba44ad | 738 | # CFLAGS from AX_APPEND_COMPILE_FLAGS. |
c20049fd | 739 | AM_CXXFLAGS="${AM_CXXFLAGS} ${WARN_CXXFLAGS}" |
28ba44ad | 740 | AM_CFLAGS="${AM_CFLAGS} ${WARN_CFLAGS}" |
02bb4fcc | 741 | |
c20049fd MJ |
742 | # Done for AM_CXXFLAGS and AM_CFLAGS. |
743 | AC_SUBST(AM_CXXFLAGS) | |
02bb4fcc SM |
744 | AC_SUBST(AM_CFLAGS) |
745 | ||
746 | # Set global CPPFLAGS in AM_CPPFLAGS | |
747 | AM_CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/src -I\$(top_srcdir)/src -include common/config.h" | |
748 | AC_SUBST(AM_CPPFLAGS) | |
749 | ||
750 | # Add glib to global link libs | |
751 | LIBS="$LIBS $GLIB_LIBS" | |
752 | ||
9ffc0257 | 753 | # Abuse autoconf's AC_ARG_PROGRAM output variable 'program_transform_name' |
ec2c5e50 | 754 | # to rename babeltrace2.bin to babeltrace2 at install time. |
bb30da78 | 755 | program_transform_name="s&babeltrace2\.bin&babeltrace2&;$program_transform_name" |
33b34c43 | 756 | AC_SUBST(program_transform_name) |
591999ca | 757 | |
ac65e355 | 758 | AC_CONFIG_FILES([ |
578e048b | 759 | doc/api/Makefile |
43c59509 PP |
760 | doc/api/libbabeltrace2/Doxyfile |
761 | doc/api/libbabeltrace2/Makefile | |
ba64dfcc SM |
762 | doc/bindings/Makefile |
763 | doc/bindings/python/Makefile | |
f9ded0e0 | 764 | doc/contributing-images/Makefile |
578e048b MJ |
765 | doc/Makefile |
766 | doc/man/asciidoc-attrs.conf | |
767 | doc/man/Makefile | |
e92927d1 | 768 | include/Makefile |
578e048b | 769 | Makefile |
fac21c87 | 770 | src/argpar/Makefile |
97010665 | 771 | src/autodisc/Makefile |
578e048b MJ |
772 | src/babeltrace2-ctf-writer.pc |
773 | src/babeltrace2.pc | |
774 | src/bindings/Makefile | |
07041daf | 775 | src/bindings/python/bt2/bt2/version.py |
578e048b MJ |
776 | src/bindings/python/bt2/Makefile |
777 | src/bindings/python/bt2/setup.py | |
778 | src/bindings/python/Makefile | |
779 | src/cli/Makefile | |
780 | src/common/Makefile | |
781 | src/compat/Makefile | |
782 | src/ctfser/Makefile | |
783 | src/ctf-writer/Makefile | |
784 | src/fd-cache/Makefile | |
785 | src/lib/graph/Makefile | |
786 | src/lib/graph/message/Makefile | |
787 | src/lib/Makefile | |
788 | src/lib/plugin/Makefile | |
789 | src/lib/prio-heap/Makefile | |
790 | src/lib/trace-ir/Makefile | |
791 | src/logging/Makefile | |
792 | src/Makefile | |
1aca5200 FD |
793 | src/plugins/common/Makefile |
794 | src/plugins/common/muxing/Makefile | |
d0d4e0ed | 795 | src/plugins/common/param-validation/Makefile |
578e048b MJ |
796 | src/plugins/ctf/common/bfcr/Makefile |
797 | src/plugins/ctf/common/Makefile | |
798 | src/plugins/ctf/common/metadata/Makefile | |
799 | src/plugins/ctf/common/msg-iter/Makefile | |
578e048b MJ |
800 | src/plugins/ctf/fs-sink/Makefile |
801 | src/plugins/ctf/fs-src/Makefile | |
802 | src/plugins/ctf/lttng-live/Makefile | |
803 | src/plugins/ctf/Makefile | |
804 | src/plugins/lttng-utils/debug-info/Makefile | |
805 | src/plugins/lttng-utils/Makefile | |
806 | src/plugins/Makefile | |
807 | src/plugins/text/dmesg/Makefile | |
808 | src/plugins/text/Makefile | |
809 | src/plugins/text/pretty/Makefile | |
55478183 | 810 | src/plugins/text/details/Makefile |
578e048b MJ |
811 | src/plugins/utils/counter/Makefile |
812 | src/plugins/utils/dummy/Makefile | |
813 | src/plugins/utils/Makefile | |
814 | src/plugins/utils/muxer/Makefile | |
815 | src/plugins/utils/trimmer/Makefile | |
7085eeaa | 816 | src/py-common/Makefile |
578e048b | 817 | src/python-plugin-provider/Makefile |
5869b179 | 818 | src/param-parse/Makefile |
ec532b44 | 819 | src/string-format/Makefile |
906ac65f | 820 | tests/bitfield/Makefile |
331731aa | 821 | tests/ctf-writer/Makefile |
aa968dde | 822 | tests/lib/Makefile |
cbb9e0b1 | 823 | tests/lib/test-plugin-plugins/Makefile |
5d7e8359 | 824 | tests/lib/conds/Makefile |
578e048b | 825 | tests/Makefile |
d0d4e0ed | 826 | tests/param-validation/Makefile |
578e048b | 827 | tests/plugins/Makefile |
e30aed9e PP |
828 | tests/plugins/src.ctf.fs/Makefile |
829 | tests/plugins/src.ctf.fs/succeed/Makefile | |
4d227882 FD |
830 | tests/plugins/sink.ctf.fs/Makefile |
831 | tests/plugins/sink.ctf.fs/succeed/Makefile | |
66251464 | 832 | tests/plugins/flt.lttng-utils.debug-info/Makefile |
38403bf5 FD |
833 | tests/plugins/flt.utils.muxer/Makefile |
834 | tests/plugins/flt.utils.muxer/succeed/Makefile | |
188edac1 | 835 | tests/plugins/flt.utils.trimmer/Makefile |
ed30eb8d | 836 | tests/plugins/sink.text.pretty/Makefile |
1833a3d1 CB |
837 | tests/utils/Makefile |
838 | tests/utils/tap/Makefile | |
ac65e355 | 839 | ]) |
c41a7502 | 840 | |
ac65e355 | 841 | AC_OUTPUT |
1a0399f9 MJ |
842 | |
843 | # | |
844 | # Mini-report on what will be built. | |
845 | # | |
846 | ||
847 | PPRINT_INIT | |
848 | PPRINT_SET_INDENT(1) | |
849 | PPRINT_SET_TS(38) | |
850 | ||
851 | AS_ECHO | |
aaa8b698 PP |
852 | |
853 | AS_IF([test -n "bt_version_name"], [ | |
854 | AS_ECHO("${PPRINT_COLOR_BLDBLU}Babeltrace $PACKAGE_VERSION \"bt_version_name\"$PPRINT_COLOR_RST") | |
855 | ], [ | |
856 | AS_ECHO("${PPRINT_COLOR_BLDBLU}Babeltrace $PACKAGE_VERSION") | |
857 | ]) | |
858 | ||
1a0399f9 MJ |
859 | AS_ECHO |
860 | ||
e97fe75e | 861 | AS_IF([test -n "bt_version_description"], [ |
aaa8b698 | 862 | AS_IF([test -n "$report_fold"], [ |
e97fe75e | 863 | AS_ECHO("`AS_ECHO("bt_version_description") | $report_fold -s`") |
aaa8b698 | 864 | ], [ |
e97fe75e | 865 | AS_ECHO("bt_version_description") |
aaa8b698 PP |
866 | ]) |
867 | ||
868 | AS_ECHO | |
869 | ]) | |
870 | ||
4266f2ad | 871 | PPRINT_SUBTITLE([System]) |
1a0399f9 MJ |
872 | |
873 | # Target architecture we're building for. | |
874 | target_arch=$host_cpu | |
875 | [ | |
876 | for f in $CFLAGS; do | |
877 | if test $f = "-m32"; then | |
878 | target_arch="32-bit" | |
879 | elif test $f = "-m64"; then | |
880 | target_arch="64-bit" | |
881 | fi | |
882 | done | |
883 | ] | |
beb0fb75 | 884 | |
4266f2ad | 885 | PPRINT_PROP_STRING([Target architecture], $target_arch) |
d1dab1d2 | 886 | |
4266f2ad PP |
887 | AS_ECHO |
888 | PPRINT_SUBTITLE([Python 3 language support]) | |
419fff0b PP |
889 | test "x$have_python" = "xyes" && value=1 || value=0 |
890 | PPRINT_PROP_BOOL([Have Python interpreter], $value) | |
891 | test "x$have_python_dev" = "xyes" && value=1 || value=0 | |
892 | PPRINT_PROP_BOOL([Have Python development libraries], $value) | |
55bb57e0 | 893 | test "x$enable_python_bindings" = "xyes" && value=1 || value=0 |
f75e50ab | 894 | PPRINT_PROP_BOOL_CUSTOM([Python bindings], $value, [To enable, use --enable-python-bindings]) |
55bb57e0 | 895 | test "x$enable_python_plugins" = "xyes" && value=1 || value=0 |
f75e50ab | 896 | PPRINT_PROP_BOOL_CUSTOM([Python plugin support], $value, [To enable, use --enable-python-plugins]) |
419fff0b PP |
897 | AS_IF([test "x$have_python" = "xyes"], [ |
898 | PPRINT_PROP_STRING([Python interpreter path], [$PYTHON]) | |
899 | ]) | |
900 | AS_IF([test "x$have_python_dev" = "xyes"], [ | |
901 | PPRINT_PROP_STRING([python-config path], [$PYTHON_CONFIG]) | |
4266f2ad | 902 | PPRINT_PROP_STRING([Python include paths], [$PYTHON_INCLUDE]) |
0b9113bf | 903 | PPRINT_PROP_STRING([Python linker flags], [$PYTHON_LDFLAGS]) |
419fff0b | 904 | ]) |
887d26fa | 905 | AE_IF_FEATURE_ENABLED([python-bindings], [ |
8c102541 SM |
906 | PPRINT_PROP_STRING([SWIG executable], [$SWIG]) |
907 | PPRINT_PROP_STRING([SWIG library], [$SWIG_LIB]) | |
4266f2ad | 908 | ]) |
55bb57e0 | 909 | |
4266f2ad PP |
910 | AS_ECHO |
911 | PPRINT_SUBTITLE([Plugins]) | |
912 | PPRINT_PROP_BOOL(['ctf' plugin], 1) | |
9ffc0257 | 913 | test "x$enable_debug_info" = "xyes" && value=1 || value=0 |
f75e50ab | 914 | PPRINT_PROP_BOOL_CUSTOM(['lttng-utils' plugin], $value, [To enable, use --enable-debug-info]) |
4266f2ad PP |
915 | PPRINT_PROP_BOOL(['text' plugin], 1) |
916 | PPRINT_PROP_BOOL(['utils' plugin], 1) | |
917 | ||
918 | AS_ECHO | |
919 | PPRINT_SUBTITLE([Built-in features]) | |
9ffc0257 | 920 | test "x$enable_built_in_plugins" = "xyes" && value=1 || value=0 |
f75e50ab | 921 | PPRINT_PROP_BOOL_CUSTOM([Built-in plugins], $value, [To enable, use --enable-built-in-plugins]) |
9ffc0257 | 922 | test "x$enable_built_in_python_plugin_support" = "xyes" && value=1 || value=0 |
f75e50ab | 923 | PPRINT_PROP_BOOL_CUSTOM([Built-in Python plugin support], $value, [To enable, use --enable-built-in-python-plugin-support]) |
6fbd4105 | 924 | |
4266f2ad PP |
925 | AS_ECHO |
926 | PPRINT_SUBTITLE([Documentation]) | |
0659f3af PP |
927 | |
928 | # man pages build enabled/disabled | |
929 | m4_pushdef([build_man_pages_msg], [Build and install man pages]) | |
930 | ||
931 | AS_IF([test "x$enable_man_pages" != "xno"], [ | |
932 | AS_IF([test "x$in_git_repo" = "xyes"], [ | |
933 | PPRINT_PROP_BOOL([build_man_pages_msg], 1) | |
934 | ], [ | |
935 | AS_IF([test "x$have_asciidoc_xmlto" = "xyes"], [ | |
936 | PPRINT_PROP_BOOL([build_man_pages_msg], 1) | |
937 | ], [ | |
938 | PPRINT_PROP_STRING([build_man_pages_msg], | |
939 | [${PPRINT_COLOR_BLDGRN}yes (already built)], | |
940 | $PPRINT_COLOR_SUBTITLE) | |
941 | ]) | |
942 | ]) | |
943 | ], [ | |
f75e50ab | 944 | PPRINT_PROP_BOOL_CUSTOM([build_man_pages_msg], 0, [To build man pages, use --enable-man-pages]) |
0659f3af PP |
945 | ]) |
946 | ||
947 | m4_popdef([build_man_pages_msg]) | |
948 | ||
4266f2ad | 949 | test "x$enable_api_doc" = "xyes" && value=1 || value=0 |
f75e50ab | 950 | PPRINT_PROP_BOOL_CUSTOM([HTML API documentation], $value, [To build documentation, use --enable-api-doc]) |
ba64dfcc SM |
951 | test "x$enable_python_bindings_doc" = "xyes" && value=1 || value=0 |
952 | PPRINT_PROP_BOOL_CUSTOM([Python bindings documentation], $value, [To build the Python bindings documentation, use --enable-python-bindings-doc]) | |
1a0399f9 | 953 | |
4266f2ad PP |
954 | AS_ECHO |
955 | PPRINT_SUBTITLE([Logging]) | |
956 | PPRINT_PROP_STRING([Minimal log level], $BABELTRACE_MINIMAL_LOG_LEVEL) | |
957 | ||
464ebc31 PP |
958 | AS_ECHO |
959 | PPRINT_SUBTITLE([Special build modes]) | |
f75e50ab GB |
960 | PPRINT_PROP_BOOL_CUSTOM([Debug mode], $BABELTRACE_DEBUG_MODE, [To enable, set the BABELTRACE_DEBUG_MODE environment variable to 1]) |
961 | PPRINT_PROP_BOOL_CUSTOM([Developer mode], $BABELTRACE_DEV_MODE, [To enable, set the BABELTRACE_DEV_MODE environment variable to 1]) | |
464ebc31 | 962 | |
1a0399f9 MJ |
963 | report_bindir="`eval eval echo $bindir`" |
964 | report_libdir="`eval eval echo $libdir`" | |
4266f2ad | 965 | report_sysconfdif="`eval eval echo $sysconfdir`" |
056632bf | 966 | report_pluginsdir="`eval eval eval echo $BABELTRACE_PLUGINS_DIR`" |
b14c7bf1 | 967 | report_pluginprovidersdir="`eval eval eval echo $BABELTRACE_PLUGIN_PROVIDERS_DIR`" |
1a0399f9 MJ |
968 | |
969 | # Print the bindir and libdir this `make install' will install into. | |
970 | AS_ECHO | |
971 | PPRINT_SUBTITLE([Install directories]) | |
972 | PPRINT_PROP_STRING([Binaries], [$report_bindir]) | |
973 | PPRINT_PROP_STRING([Libraries], [$report_libdir]) | |
056632bf | 974 | PPRINT_PROP_STRING([Plugins], [$report_pluginsdir]) |
b14c7bf1 | 975 | PPRINT_PROP_STRING([Plugin providers], [$report_pluginprovidersdir]) |
4266f2ad | 976 | PPRINT_PROP_STRING([Configuration], [$report_sysconfdif]) |