]>
Commit | Line | Data |
---|---|---|
b08d5a8f UD |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | dnl Configure input file for elfutils. -*-autoconf-*- | |
3 | dnl | |
e27e30ca | 4 | dnl Copyright (C) 1996-2019 Red Hat, Inc. |
b08d5a8f | 5 | dnl |
de2ed97f | 6 | dnl This file is part of elfutils. |
b08d5a8f | 7 | dnl |
de2ed97f MW |
8 | dnl This file is free software; you can redistribute it and/or modify |
9 | dnl it under the terms of the GNU General Public License as published by | |
10 | dnl the Free Software Foundation; either version 3 of the License, or | |
11 | dnl (at your option) any later version. | |
b08d5a8f | 12 | dnl |
de2ed97f MW |
13 | dnl elfutils is distributed in the hope that it will be useful, but |
14 | dnl WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | dnl GNU General Public License for more details. | |
b08d5a8f | 17 | dnl |
de2ed97f MW |
18 | dnl You should have received a copy of the GNU General Public License |
19 | dnl along with this program. If not, see <http://www.gnu.org/licenses/>. | |
d4fd0804 | 20 | AC_INIT([elfutils],[0.182],[https://sourceware.org/bugzilla],[elfutils],[http://elfutils.org/]) |
b08d5a8f | 21 | |
34b037b8 MW |
22 | dnl Workaround for older autoconf < 2.64 |
23 | m4_ifndef([AC_PACKAGE_URL], | |
24 | [AC_DEFINE([PACKAGE_URL], ["http://elfutils.org/"], | |
25 | [Define to home page for this package]) | |
26 | AC_SUBST([PACKAGE_URL], ["http://elfutils.org/"])]) | |
27 | ||
fc5e808d DL |
28 | LIBDEBUGINFOD_SONAME=libdebuginfod.so.1 |
29 | AC_SUBST([LIBDEBUGINFOD_SONAME]) | |
30 | ||
9ba24584 MW |
31 | # We want eu- as default program prefix if none was given by the user. |
32 | # But if the user explicitly provided --program-prefix="" then pretend | |
33 | # it wasn't set at all (NONE). We want to test this really early before | |
34 | # configure has a chance to use the value. | |
35 | ||
36 | if test "x$program_prefix" = "xNONE"; then | |
37 | AC_MSG_NOTICE([No --program-prefix given, using "eu-"]) | |
38 | program_prefix="eu-" | |
39 | elif test "x$program_prefix" = "x"; then | |
40 | AC_MSG_NOTICE([Using no program-prefix]) | |
41 | program_prefix=NONE | |
42 | fi | |
43 | ||
b08d5a8f UD |
44 | AC_CONFIG_AUX_DIR([config]) |
45 | AC_CONFIG_FILES([config/Makefile]) | |
46 | ||
a2bc0214 | 47 | AC_COPYRIGHT([Copyright (C) 1996-2020 The elfutils developers.]) |
db12f164 | 48 | AC_PREREQ(2.63) dnl Minimum Autoconf version required. |
b08d5a8f | 49 | |
9aa8ef7f | 50 | dnl We use GNU make extensions; automake 1.10 defaults to -Wportability. |
86be792c | 51 | AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests]) |
c373d850 | 52 | AM_MAINTAINER_MODE |
b08d5a8f | 53 | |
c04f491f MW |
54 | AM_SILENT_RULES([yes]) |
55 | ||
b08d5a8f UD |
56 | AC_CONFIG_SRCDIR([libelf/libelf.h]) |
57 | AC_CONFIG_FILES([Makefile]) | |
58 | AC_CONFIG_HEADERS([config.h]) | |
59 | ||
b08d5a8f UD |
60 | AC_CONFIG_FILES([m4/Makefile]) |
61 | ||
62 | dnl The RPM spec file. We substitute a few values in the file. | |
63 | AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in]) | |
64 | ||
288f6b19 | 65 | dnl debuginfo-server client & server parts. |
fc5e808d | 66 | AC_CONFIG_FILES([debuginfod/Makefile debuginfod/debuginfod.h]) |
b08d5a8f UD |
67 | |
68 | AC_CANONICAL_HOST | |
69 | ||
3284b799 RM |
70 | AC_ARG_ENABLE(deterministic-archives, |
71 | [AS_HELP_STRING([--enable-deterministic-archives], | |
72 | [ar and ranlib default to -D behavior])], [ | |
73 | if test "${enableval}" = no; then | |
74 | default_ar_deterministic=false | |
75 | else | |
76 | default_ar_deterministic=true | |
77 | fi], [default_ar_deterministic=false]) | |
78 | AC_DEFINE_UNQUOTED(DEFAULT_AR_DETERMINISTIC, $default_ar_deterministic, | |
79 | [Should ar and ranlib use -D behavior by default?]) | |
80 | ||
7e678fa3 | 81 | AC_ARG_ENABLE([thread-safety], |
09c9bb92 MW |
82 | AS_HELP_STRING([--enable-thread-safety], |
83 | [enable thread safety of libraries EXPERIMENTAL]), | |
84 | use_locks=$enableval, use_locks=no) | |
7e678fa3 UD |
85 | AM_CONDITIONAL(USE_LOCKS, test "$use_locks" = yes) |
86 | AS_IF([test "$use_locks" = yes], [AC_DEFINE(USE_LOCKS)]) | |
09c9bb92 MW |
87 | AS_IF([test "$use_locks" = yes], |
88 | [AC_MSG_WARN([thread-safety is EXPERIMENTAL tests might fail.])]) | |
d56e232f | 89 | |
7e678fa3 | 90 | AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.]) |
b08d5a8f | 91 | |
b08d5a8f UD |
92 | AC_PROG_CC |
93 | AC_PROG_RANLIB | |
94 | AC_PROG_YACC | |
95 | AM_PROG_LEX | |
a45c8043 MF |
96 | # Only available since automake 1.12 |
97 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) | |
98 | AC_CHECK_TOOL([READELF], [readelf]) | |
99 | AC_CHECK_TOOL([NM], [nm]) | |
b08d5a8f | 100 | |
aba6d762 MW |
101 | # We use -std=gnu99 but have explicit checks for some language constructs |
102 | # and GNU extensions since some compilers claim GNU99 support, but don't | |
103 | # really support all language extensions. In particular we need | |
104 | # Mixed Declarations and Code | |
105 | # https://gcc.gnu.org/onlinedocs/gcc/Mixed-Declarations.html | |
106 | # Nested Functions | |
107 | # https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html | |
108 | # Arrays of Variable Length | |
109 | # https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html | |
110 | AC_CACHE_CHECK([for gcc with GNU99 support], ac_cv_c99, [dnl | |
b08d5a8f UD |
111 | old_CFLAGS="$CFLAGS" |
112 | CFLAGS="$CFLAGS -std=gnu99" | |
f64e25f2 | 113 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl |
aba6d762 MW |
114 | int foo (int a) |
115 | { | |
116 | for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; return s; | |
117 | } | |
118 | ||
119 | double bar (double a, double b) | |
120 | { | |
121 | double square (double z) { return z * z; } | |
122 | return square (a) + square (b); | |
123 | } | |
124 | ||
125 | void baz (int n) | |
126 | { | |
127 | struct S { int x[[n]]; }; | |
128 | }])], | |
b08d5a8f UD |
129 | ac_cv_c99=yes, ac_cv_c99=no) |
130 | CFLAGS="$old_CFLAGS"]) | |
131 | AS_IF([test "x$ac_cv_c99" != xyes], | |
aba6d762 | 132 | AC_MSG_ERROR([gcc with GNU99 support required])) |
b08d5a8f | 133 | |
1127470a UH |
134 | AC_CACHE_CHECK([whether gcc supports __attribute__((visibility()))], |
135 | ac_cv_visibility, [dnl | |
136 | save_CFLAGS="$CFLAGS" | |
137 | CFLAGS="$save_CFLAGS -Werror" | |
138 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl | |
139 | int __attribute__((visibility("hidden"))) | |
140 | foo (int a) | |
141 | { | |
142 | return a; | |
143 | }])], ac_cv_visibility=yes, ac_cv_visibility=no) | |
144 | CFLAGS="$save_CFLAGS"]) | |
145 | if test "$ac_cv_visibility" = "yes"; then | |
146 | AC_DEFINE([HAVE_VISIBILITY], [1], | |
147 | [Defined if __attribute__((visibility())) is supported]) | |
148 | fi | |
149 | ||
17d7194d UH |
150 | AC_CACHE_CHECK([whether gcc supports __attribute__((gcc_struct))], |
151 | ac_cv_gcc_struct, [dnl | |
152 | save_CFLAGS="$CFLAGS" | |
153 | CFLAGS="$save_CFLAGS -Werror" | |
154 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl | |
155 | struct test { int x; } __attribute__((gcc_struct)); | |
156 | ])], ac_cv_gcc_struct=yes, ac_cv_gcc_struct=no) | |
157 | CFLAGS="$save_CFLAGS"]) | |
158 | if test "$ac_cv_gcc_struct" = "yes"; then | |
159 | AC_DEFINE([HAVE_GCC_STRUCT], [1], | |
160 | [Defined if __attribute__((gcc_struct)) is supported]) | |
161 | fi | |
162 | ||
07737584 UH |
163 | AC_CACHE_CHECK([whether gcc supports -fPIC], ac_cv_fpic, [dnl |
164 | save_CFLAGS="$CFLAGS" | |
165 | CFLAGS="$save_CFLAGS -fPIC -Werror" | |
166 | AC_COMPILE_IFELSE([AC_LANG_SOURCE()], ac_cv_fpic=yes, ac_cv_fpic=no) | |
167 | CFLAGS="$save_CFLAGS" | |
168 | ]) | |
169 | if test "$ac_cv_fpic" = "yes"; then | |
170 | fpic_CFLAGS="-fPIC" | |
171 | else | |
172 | fpic_CFLAGS="" | |
173 | fi | |
174 | AC_SUBST([fpic_CFLAGS]) | |
175 | ||
176 | AC_CACHE_CHECK([whether gcc supports -fPIE], ac_cv_fpie, [dnl | |
177 | save_CFLAGS="$CFLAGS" | |
178 | CFLAGS="$save_CFLAGS -fPIE -Werror" | |
179 | AC_COMPILE_IFELSE([AC_LANG_SOURCE()], ac_cv_fpie=yes, ac_cv_fpie=no) | |
180 | CFLAGS="$save_CFLAGS" | |
181 | ]) | |
182 | if test "$ac_cv_fpie" = "yes"; then | |
183 | fpie_CFLAGS="-fPIE" | |
184 | else | |
185 | fpie_CFLAGS="" | |
186 | fi | |
187 | AC_SUBST([fpie_CFLAGS]) | |
188 | ||
189 | dso_LDFLAGS="-shared" | |
190 | ||
191 | ZDEFS_LDFLAGS="-Wl,-z,defs" | |
192 | AC_CACHE_CHECK([whether gcc supports $ZDEFS_LDFLAGS], ac_cv_zdefs, [dnl | |
193 | save_LDFLAGS="$LDFLAGS" | |
194 | LDFLAGS="$ZDEFS_LDFLAGS $save_LDFLAGS" | |
195 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_cv_zdefs=yes, ac_cv_zdefs=no) | |
196 | LDFLAGS="$save_LDFLAGS" | |
197 | ]) | |
198 | if test "$ac_cv_zdefs" = "yes"; then | |
199 | dso_LDFLAGS="$dso_LDFLAGS $ZDEFS_LDFLAGS" | |
200 | fi | |
201 | ||
cf1b5fe1 MW |
202 | # We really want build-ids. Warn and force generating them if gcc was |
203 | # configure without --enable-linker-build-id | |
204 | AC_CACHE_CHECK([whether the compiler generates build-ids], ac_cv_buildid, [dnl | |
9698a399 | 205 | AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))]) |
cf1b5fe1 MW |
206 | if test "$ac_cv_buildid" = "no"; then |
207 | AC_MSG_WARN([compiler doesn't generate build-id by default]) | |
208 | LDFLAGS="$LDFLAGS -Wl,--build-id" | |
209 | fi | |
210 | ||
07737584 UH |
211 | ZRELRO_LDFLAGS="-Wl,-z,relro" |
212 | AC_CACHE_CHECK([whether gcc supports $ZRELRO_LDFLAGS], ac_cv_zrelro, [dnl | |
213 | save_LDFLAGS="$LDFLAGS" | |
214 | LDFLAGS="$ZRELRO_LDFLAGS $save_LDFLAGS" | |
215 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_cv_zrelro=yes, ac_cv_zrelro=no) | |
216 | LDFLAGS="$save_LDFLAGS" | |
217 | ]) | |
218 | if test "$ac_cv_zrelro" = "yes"; then | |
219 | dso_LDFLAGS="$dso_LDFLAGS $ZRELRO_LDFLAGS" | |
220 | fi | |
221 | ||
222 | AC_SUBST([dso_LDFLAGS]) | |
223 | ||
8181739c | 224 | AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl |
e72bf15c RM |
225 | # Use the same flags that we use for our DSOs, so the test is representative. |
226 | # Some old compiler/linker/libc combinations fail some ways and not others. | |
227 | save_CFLAGS="$CFLAGS" | |
228 | save_LDFLAGS="$LDFLAGS" | |
07737584 UH |
229 | CFLAGS="$fpic_CFLAGS $CFLAGS" |
230 | LDFLAGS="$dso_LDFLAGS $LDFLAGS" | |
8181739c | 231 | AC_LINK_IFELSE([dnl |
0a35e3ac MW |
232 | AC_LANG_PROGRAM([[#include <stdlib.h> |
233 | #undef __thread | |
e72bf15c | 234 | static __thread int a; int foo (int b) { return a + b; }]], |
8181739c | 235 | [[exit (foo (0));]])], |
e72bf15c RM |
236 | ac_cv_tls=yes, ac_cv_tls=no) |
237 | CFLAGS="$save_CFLAGS" | |
238 | LDFLAGS="$save_LDFLAGS"]) | |
7e678fa3 | 239 | AS_IF([test "x$ac_cv_tls" != xyes], |
8181739c | 240 | AC_MSG_ERROR([__thread support required])) |
7e678fa3 | 241 | |
98b69a97 | 242 | dnl Before 4.9 gcc doesn't ship stdatomic.h, but the necessary atomics are |
77b66a71 JA |
243 | dnl available by (at least) 4.7. So if the system doesn't have a stdatomic.h we |
244 | dnl fall back on one copied from FreeBSD that handles the difference. | |
245 | AC_CACHE_CHECK([whether gcc provides stdatomic.h], ac_cv_has_stdatomic, | |
246 | [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdatomic.h>]])], | |
247 | ac_cv_has_stdatomic=yes, ac_cv_has_stdatomic=no)]) | |
248 | AM_CONDITIONAL(HAVE_STDATOMIC_H, test "x$ac_cv_has_stdatomic" = xyes) | |
249 | AS_IF([test "x$ac_cv_has_stdatomic" = xyes], [AC_DEFINE(HAVE_STDATOMIC_H)]) | |
250 | ||
251 | AH_TEMPLATE([HAVE_STDATOMIC_H], [Define to 1 if `stdatomic.h` is provided by the | |
252 | system, 0 otherwise.]) | |
253 | ||
b08d5a8f UD |
254 | dnl This test must come as early as possible after the compiler configuration |
255 | dnl tests, because the choice of the file model can (in principle) affect | |
256 | dnl whether functions and headers are available, whether they work, etc. | |
257 | AC_SYS_LARGEFILE | |
258 | ||
ee225020 MW |
259 | dnl Older glibc had a broken fts that didn't work with Large File Systems. |
260 | dnl We want the version that can handler LFS, but include workaround if we | |
261 | dnl get a bad one. Add define to CFLAGS (not AC_DEFINE it) since we need to | |
262 | dnl check it before including config.h (which might define _FILE_OFFSET_BITS). | |
263 | AC_CACHE_CHECK([whether fts.h is bad when included (with LFS)], ac_cv_bad_fts, | |
264 | [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <fts.h>]])], | |
265 | ac_cv_bad_fts=no, ac_cv_bad_fts=yes)]) | |
ad7036f1 MW |
266 | AS_IF([test "x$ac_cv_bad_fts" = "xyes"], |
267 | [CFLAGS="$CFLAGS -DBAD_FTS=1" CXXFLAGS="$CXXFLAGS -DBAD_FTS=1"]) | |
ee225020 | 268 | |
01b994e3 MW |
269 | # See if we can add -D_FORTIFY_SOURCE=2. Don't do it if it is already |
270 | # (differently) defined or if it generates warnings/errors because we | |
271 | # don't use the right optimisation level (string.h will warn about that). | |
272 | AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 to CFLAGS]) | |
273 | case "$CFLAGS" in | |
274 | *-D_FORTIFY_SOURCE=2*) | |
275 | AC_MSG_RESULT([no, already there]) | |
276 | ;; | |
277 | *) | |
278 | save_CFLAGS="$CFLAGS" | |
c435a338 | 279 | CFLAGS="-D_FORTIFY_SOURCE=2 $CFLAGS -Werror" |
01b994e3 MW |
280 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
281 | #include <string.h> | |
282 | int main() { return 0; } | |
283 | ]])], [ AC_MSG_RESULT([yes]) | |
284 | CFLAGS="-D_FORTIFY_SOURCE=2 $save_CFLAGS" ], | |
285 | [ AC_MSG_RESULT([no]) | |
286 | CFLAGS="$save_CFLAGS"]) | |
287 | ;; | |
288 | esac | |
289 | ||
3cbdd387 | 290 | dnl enable debugging of branch prediction. |
28a0c615 | 291 | AC_ARG_ENABLE([debugpred], |
db12f164 | 292 | AS_HELP_STRING([--enable-debugpred],[build binaries with support to debug branch prediction]), |
8f3002e2 MF |
293 | [use_debugpred=$enableval], [use_debugpred=no]) |
294 | case $use_debugpred in | |
7702a3c1 MW |
295 | yes) use_debugpred_val=1 ;; |
296 | *) use_debugpred_val=0 ;; | |
8f3002e2 | 297 | esac |
7702a3c1 | 298 | AC_SUBST([DEBUGPRED], $use_debugpred_val) |
3cbdd387 | 299 | |
98b69a97 | 300 | dnl Enable gprof support. |
47be795d | 301 | AC_ARG_ENABLE([gprof], |
8f3002e2 | 302 | AS_HELP_STRING([--enable-gprof],[build binaries with gprof support]), [use_gprof=$enableval], [use_gprof=no]) |
47be795d UD |
303 | if test "$use_gprof" = yes; then |
304 | CFLAGS="$CFLAGS -pg" | |
305 | LDFLAGS="$LDFLAGS -pg" | |
306 | fi | |
307 | AM_CONDITIONAL(GPROF, test "$use_gprof" = yes) | |
fbe998a0 | 308 | |
98b69a97 | 309 | # Enable gcov support. |
fbe998a0 | 310 | AC_ARG_ENABLE([gcov], |
8f3002e2 | 311 | AS_HELP_STRING([--enable-gcov],[build binaries with gcov support]), [use_gcov=$enableval], [use_gcov=no]) |
fbe998a0 UD |
312 | if test "$use_gcov" = yes; then |
313 | CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" | |
3f81dbd2 | 314 | CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage" |
fbe998a0 UD |
315 | LDFLAGS="$LDFLAGS -fprofile-arcs" |
316 | fi | |
39cec7a0 | 317 | AM_CONDITIONAL(GCOV, test "$use_gcov" = yes) |
fbe998a0 | 318 | |
2b250b75 MW |
319 | AC_ARG_ENABLE([sanitize-undefined], |
320 | AS_HELP_STRING([--enable-sanitize-undefined], | |
321 | [Use gcc undefined behaviour sanitizer]), | |
322 | [use_undefined=$enableval], [use_undefined=no]) | |
323 | if test "$use_undefined" = yes; then | |
324 | old_CFLAGS="$CFLAGS" | |
325 | old_CXXFLAGS="$CXXFLAGS" | |
326 | # We explicitly use unaligned access when possible (see ALLOW_UNALIGNED) | |
327 | # We want to fail immediately on first error, don't try to recover. | |
170f1bb0 MW |
328 | CFLAGS="$CFLAGS -fsanitize=undefined -fno-sanitize-recover" |
329 | CXXFLAGS="$CXXFLAGS -fsanitize=undefined -fno-sanitize-recover" | |
330 | AC_LINK_IFELSE([AC_LANG_SOURCE([int main (int argc, char **argv) { return 0; }])], use_undefined=yes, use_undefined=no) | |
2b250b75 MW |
331 | AS_IF([test "x$use_undefined" != xyes], |
332 | AC_MSG_WARN([gcc undefined behaviour sanitizer not available]) | |
333 | CFLAGS="$old_CFLAGS" CXXFLAGS="$old_CXXFLAGS") | |
334 | fi | |
170f1bb0 MW |
335 | case $use_undefined in |
336 | yes) check_undefined_val=1 ;; | |
337 | *) check_undefined_val=0 ;; | |
338 | esac | |
339 | AC_DEFINE_UNQUOTED(CHECK_UNDEFINED, $check_undefined_val, | |
340 | [Building with -fsanitize=undefined or not]) | |
2b250b75 | 341 | |
e3e3ee26 MW |
342 | AC_ARG_ENABLE([valgrind], |
343 | AS_HELP_STRING([--enable-valgrind],[run all tests under valgrind]), | |
344 | [use_valgrind=$enableval], [use_valgrind=no]) | |
345 | if test "$use_valgrind" = yes; then | |
346 | AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no) | |
347 | if test "$HAVE_VALGRIND" = "no"; then | |
348 | AC_MSG_ERROR([valgrind not found]) | |
349 | fi | |
350 | fi | |
351 | AM_CONDITIONAL(USE_VALGRIND, test "$use_valgrind" = yes) | |
352 | ||
5e2a8e25 JA |
353 | AC_ARG_WITH([valgrind], |
354 | AS_HELP_STRING([--with-valgrind],[include directory for Valgrind headers]), | |
355 | [with_valgrind_headers=$withval], [with_valgrind_headers=no]) | |
356 | if test "x$with_valgrind_headers" != xno; then | |
357 | save_CFLAGS="$CFLAGS" | |
358 | CFLAGS="$CFLAGS -I$with_valgrind_headers" | |
359 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | |
360 | #include <valgrind/valgrind.h> | |
361 | int main() { return 0; } | |
362 | ]])], [ HAVE_VALGRIND_HEADERS="yes" | |
363 | CFLAGS="$save_CFLAGS -I$with_valgrind_headers" ], | |
364 | [ AC_MSG_ERROR([invalid valgrind include directory: $with_valgrind_headers]) ]) | |
365 | fi | |
366 | ||
367 | AC_ARG_ENABLE([valgrind-annotations], | |
368 | AS_HELP_STRING([--enable-valgrind-annotations],[insert extra annotations for better valgrind support]), | |
369 | [use_vg_annotations=$enableval], [use_vg_annotations=no]) | |
370 | if test "$use_vg_annotations" = yes; then | |
371 | if test "x$HAVE_VALGRIND_HEADERS" != "xyes"; then | |
372 | AC_MSG_CHECKING([whether Valgrind headers are available]) | |
373 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | |
374 | #include <valgrind/valgrind.h> | |
375 | int main() { return 0; } | |
376 | ]])], [ AC_MSG_RESULT([yes]) ], | |
377 | [ AC_MSG_ERROR([valgrind annotations requested but no headers are available]) ]) | |
378 | fi | |
379 | fi | |
380 | AM_CONDITIONAL(USE_VG_ANNOTATIONS, test "$use_vg_annotations" = yes) | |
381 | ||
b63007ed MW |
382 | AC_ARG_ENABLE([install-elfh], |
383 | AS_HELP_STRING([--enable-install-elfh],[install elf.h in include dir]), | |
384 | [install_elfh=$enableval], [install_elfh=no]) | |
385 | AM_CONDITIONAL(INSTALL_ELFH, test "$install_elfh" = yes) | |
386 | ||
47be795d | 387 | AM_CONDITIONAL(BUILD_STATIC, [dnl |
32324794 | 388 | test "$use_gprof" = yes -o "$use_gcov" = yes]) |
47be795d | 389 | |
1b8b446a | 390 | AC_ARG_ENABLE([tests-rpath], |
db12f164 | 391 | AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]), |
8f3002e2 | 392 | [tests_use_rpath=$enableval], [tests_use_rpath=no]) |
1b8b446a RM |
393 | AM_CONDITIONAL(TESTS_RPATH, test "$tests_use_rpath" = yes) |
394 | ||
528cb45f | 395 | dnl zlib is mandatory. |
bca43152 RM |
396 | save_LIBS="$LIBS" |
397 | LIBS= | |
24169646 | 398 | eu_ZIPLIB(zlib,ZLIB,z,gzdirect,gzip) |
2d703bf1 | 399 | AS_IF([test "x$with_zlib" = xno], [AC_MSG_ERROR([zlib not found but is required])]) |
528cb45f MW |
400 | LIBS="$save_LIBS" |
401 | ||
52536d7d MW |
402 | dnl Test for bzlib and xz/lzma/zstd, gives BZLIB/LZMALIB/ZSTD .am |
403 | dnl conditional and config.h USE_BZLIB/USE_LZMALIB/USE_ZSTD #define. | |
528cb45f MW |
404 | save_LIBS="$LIBS" |
405 | LIBS= | |
24169646 | 406 | eu_ZIPLIB(bzlib,BZLIB,bz2,BZ2_bzdopen,bzip2) |
0aa60ac6 MW |
407 | # We need this since bzip2 doesn't have a pkgconfig file. |
408 | BZ2_LIB="$LIBS" | |
409 | AC_SUBST([BZ2_LIB]) | |
24169646 | 410 | eu_ZIPLIB(lzma,LZMA,lzma,lzma_auto_decoder,[LZMA (xz)]) |
0aa60ac6 MW |
411 | AS_IF([test "x$with_lzma" = xyes], [LIBLZMA="liblzma"], [LIBLZMA=""]) |
412 | AC_SUBST([LIBLZMA]) | |
52536d7d MW |
413 | eu_ZIPLIB(zstd,ZSTD,zstd,ZSTD_decompress,[ZSTD (zst)]) |
414 | AS_IF([test "x$with_zstd" = xyes], [LIBZSTD="libzstd"], [LIBLZSTD=""]) | |
415 | AC_SUBST([LIBZSTD]) | |
bca43152 RM |
416 | zip_LIBS="$LIBS" |
417 | LIBS="$save_LIBS" | |
418 | AC_SUBST([zip_LIBS]) | |
419 | ||
a24d52ac AO |
420 | AC_CHECK_DECLS([memrchr, rawmemchr],[],[], |
421 | [#define _GNU_SOURCE | |
422 | #include <string.h>]) | |
423 | AC_CHECK_DECLS([powerof2],[],[],[#include <sys/param.h>]) | |
b3248e68 UH |
424 | AC_CHECK_DECLS([mempcpy],[],[], |
425 | [#define _GNU_SOURCE | |
426 | #include <string.h>]) | |
a24d52ac | 427 | |
afffdff2 MW |
428 | AC_CHECK_FUNCS([process_vm_readv]) |
429 | ||
b4a16cf0 UD |
430 | AC_CHECK_LIB([stdc++], [__cxa_demangle], [dnl |
431 | AC_DEFINE([USE_DEMANGLE], [1], [Defined if demangling is enabled])]) | |
1ce4a459 MF |
432 | AM_CONDITIONAL(DEMANGLE, test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes") |
433 | AS_IF([test "x$ac_cv_lib_stdcpp___cxa_demangle" = "xyes"], | |
e6e80dae | 434 | [enable_demangler=yes],[enable_demangler=no]) |
b4a16cf0 | 435 | |
805ec833 MW |
436 | AC_ARG_ENABLE([textrelcheck], |
437 | AS_HELP_STRING([--disable-textrelcheck], | |
438 | [Disable textrelcheck being a fatal error])) | |
439 | AM_CONDITIONAL(FATAL_TEXTREL, [test "x$enable_textrelcheck" != "xno"]) | |
7702a3c1 MW |
440 | AS_IF([test "x$enable_textrelcheck" != "xno"], |
441 | [enable_textrelcheck=yes],[enable_textrelcheck=no]) | |
805ec833 | 442 | |
bafacaca MF |
443 | AC_ARG_ENABLE([symbol-versioning], |
444 | AS_HELP_STRING([--disable-symbol-versioning], | |
445 | [Disable symbol versioning in shared objects])) | |
4a3330a9 UH |
446 | |
447 | AC_CACHE_CHECK([whether symbol versioning is supported], ac_cv_symbol_versioning, [dnl | |
448 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([dnl | |
449 | #define NEW_VERSION(name, version) \ | |
450 | asm (".symver " #name "," #name "@@@" #version); | |
451 | int foo(int x) { return x + 1; } | |
452 | NEW_VERSION (foo, ELFUTILS_12.12) | |
453 | ])], ac_cv_symbol_versioning=yes, ac_cv_symbol_versioning=no)]) | |
454 | if test "$ac_cv_symbol_versioning" = "no"; then | |
455 | if test "x$enable_symbol_versioning" != "xno"; then | |
456 | AC_MSG_ERROR([Symbol versioning is not supported. | |
457 | Use --disable-symbol-versioning to build without.]) | |
458 | fi | |
459 | fi | |
460 | ||
bafacaca MF |
461 | AM_CONDITIONAL(SYMBOL_VERSIONING, [test "x$enable_symbol_versioning" != "xno"]) |
462 | AS_IF([test "x$enable_symbol_versioning" = "xno"], | |
7702a3c1 MW |
463 | [AC_MSG_WARN([Disabling symbol versioning breaks ABI compatibility.]) |
464 | enable_symbol_versioning=no],[enable_symbol_versioning=yes]) | |
bafacaca | 465 | |
4b7953db MW |
466 | AC_CACHE_CHECK([whether gcc accepts -Wstack-usage], ac_cv_stack_usage, [dnl |
467 | old_CFLAGS="$CFLAGS" | |
239cd48b | 468 | CFLAGS="$CFLAGS -Wstack-usage=262144 -Werror" |
4b7953db MW |
469 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], |
470 | ac_cv_stack_usage=yes, ac_cv_stack_usage=no) | |
471 | CFLAGS="$old_CFLAGS"]) | |
472 | AM_CONDITIONAL(ADD_STACK_USAGE_WARNING, [test "x$ac_cv_stack_usage" != "xno"]) | |
473 | ||
8bc1423b MW |
474 | # -Wlogical-op was too fragile in the past, make sure we get a sane one. |
475 | AC_CACHE_CHECK([whether gcc has a sane -Wlogical-op], ac_cv_logical_op, [dnl | |
476 | old_CFLAGS="$CFLAGS" | |
477 | CFLAGS="$CFLAGS -Wlogical-op -Werror" | |
478 | AC_COMPILE_IFELSE([AC_LANG_SOURCE( | |
479 | [#define FLAG 1 | |
480 | int f (int r, int f) { return (r && (FLAG || (FLAG & f))); }])], | |
481 | ac_cv_logical_op=yes, ac_cv_logical_op=no) | |
482 | CFLAGS="$old_CFLAGS"]) | |
483 | AM_CONDITIONAL(SANE_LOGICAL_OP_WARNING, | |
484 | [test "x$ac_cv_logical_op" != "xno"]) | |
485 | ||
486 | # -Wduplicated-cond was added by GCC6 | |
487 | AC_CACHE_CHECK([whether gcc accepts -Wduplicated-cond], ac_cv_duplicated_cond, [dnl | |
488 | old_CFLAGS="$CFLAGS" | |
239cd48b | 489 | CFLAGS="$CFLAGS -Wduplicated-cond -Werror" |
8bc1423b MW |
490 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], |
491 | ac_cv_duplicated_cond=yes, ac_cv_duplicated_cond=no) | |
492 | CFLAGS="$old_CFLAGS"]) | |
493 | AM_CONDITIONAL(HAVE_DUPLICATED_COND_WARNING, | |
494 | [test "x$ac_cv_duplicated_cond" != "xno"]) | |
495 | ||
6993d408 MW |
496 | # -Wnull-dereference was added by GCC6 |
497 | AC_CACHE_CHECK([whether gcc accepts -Wnull-dereference], ac_cv_null_dereference, [dnl | |
498 | old_CFLAGS="$CFLAGS" | |
239cd48b | 499 | CFLAGS="$CFLAGS -Wnull-dereference -Werror" |
6993d408 MW |
500 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], |
501 | ac_cv_null_dereference=yes, ac_cv_null_dereference=no) | |
502 | CFLAGS="$old_CFLAGS"]) | |
503 | AM_CONDITIONAL(HAVE_NULL_DEREFERENCE_WARNING, | |
504 | [test "x$ac_cv_null_dereference" != "xno"]) | |
505 | ||
a3cc8182 MW |
506 | # -Wimplicit-fallthrough was added by GCC7 |
507 | AC_CACHE_CHECK([whether gcc accepts -Wimplicit-fallthrough], ac_cv_implicit_fallthrough, [dnl | |
508 | old_CFLAGS="$CFLAGS" | |
509 | CFLAGS="$CFLAGS -Wimplicit-fallthrough -Werror" | |
510 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], | |
511 | ac_cv_implicit_fallthrough=yes, ac_cv_implicit_fallthrough=no) | |
512 | CFLAGS="$old_CFLAGS"]) | |
513 | AM_CONDITIONAL(HAVE_IMPLICIT_FALLTHROUGH_WARNING, | |
514 | [test "x$ac_cv_implicit_fallthrough" != "xno"]) | |
515 | ||
555e15eb JW |
516 | # Assume the fallthrough attribute is supported if -Wimplict-fallthrough is supported |
517 | if test "$ac_cv_implicit_fallthrough" = "yes"; then | |
518 | AC_DEFINE([HAVE_FALLTHROUGH], [1], | |
519 | [Defined if __attribute__((fallthrough)) is supported]) | |
520 | fi | |
521 | ||
be084ccb DL |
522 | saved_LIBS="$LIBS" |
523 | AC_SEARCH_LIBS([argp_parse], [argp]) | |
524 | LIBS="$saved_LIBS" | |
525 | case "$ac_cv_search_argp_parse" in | |
526 | no) AC_MSG_FAILURE([failed to find argp_parse]) ;; | |
527 | -l*) argp_LDADD="$ac_cv_search_argp_parse" ;; | |
528 | *) argp_LDADD= ;; | |
529 | esac | |
1ab3c2be AB |
530 | AC_SUBST([argp_LDADD]) |
531 | ||
da855fc9 ÉR |
532 | saved_LIBS="$LIBS" |
533 | AC_SEARCH_LIBS([fts_close], [fts]) | |
534 | LIBS="$saved_LIBS" | |
535 | case "$ac_cv_search_fts_close" in | |
536 | no) AC_MSG_FAILURE([failed to find fts_close]) ;; | |
537 | -l*) fts_LIBS="$ac_cv_search_fts_close" ;; | |
538 | *) fts_LIBS= ;; | |
539 | esac | |
540 | AC_SUBST([fts_LIBS]) | |
541 | ||
542 | saved_LIBS="$LIBS" | |
543 | AC_SEARCH_LIBS([_obstack_free], [obstack]) | |
544 | LIBS="$saved_LIBS" | |
545 | case "$ac_cv_search__obstack_free" in | |
8ffada54 | 546 | no) AC_MSG_FAILURE([failed to find _obstack_free]) ;; |
da855fc9 ÉR |
547 | -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;; |
548 | *) obstack_LIBS= ;; | |
549 | esac | |
550 | AC_SUBST([obstack_LIBS]) | |
551 | ||
b08d5a8f UD |
552 | dnl The directories with content. |
553 | ||
554 | dnl Documentation. | |
f0a51767 | 555 | AC_CONFIG_FILES([doc/Makefile]) |
b08d5a8f UD |
556 | |
557 | dnl Support library. | |
558 | AC_CONFIG_FILES([lib/Makefile]) | |
559 | ||
560 | dnl ELF library. | |
2c9ee4f9 | 561 | AC_CONFIG_FILES([libelf/Makefile]) |
b08d5a8f UD |
562 | |
563 | dnl Higher-level ELF support library. | |
564 | AC_CONFIG_FILES([libebl/Makefile]) | |
565 | ||
9380297e MW |
566 | dnl DWARF-ELF Lower-level Functions support library. |
567 | AC_CONFIG_FILES([libdwelf/Makefile]) | |
568 | ||
b08d5a8f UD |
569 | dnl DWARF library. |
570 | AC_CONFIG_FILES([libdw/Makefile]) | |
571 | ||
572 | dnl Higher-level DWARF support library. | |
573 | AC_CONFIG_FILES([libdwfl/Makefile]) | |
574 | ||
575 | dnl CPU handling library. | |
576 | AC_CONFIG_FILES([libcpu/Makefile]) | |
577 | ||
578 | dnl Assembler library. | |
579 | AC_CONFIG_FILES([libasm/Makefile]) | |
580 | ||
e47ab76f RM |
581 | dnl CPU-specific backend libraries. |
582 | AC_CONFIG_FILES([backends/Makefile]) | |
583 | ||
b08d5a8f UD |
584 | dnl Tools. |
585 | AC_CONFIG_FILES([src/Makefile po/Makefile.in]) | |
586 | ||
587 | dnl Test suite. | |
588 | AC_CONFIG_FILES([tests/Makefile]) | |
589 | ||
0aa60ac6 | 590 | dnl pkgconfig files |
288f6b19 | 591 | AC_CONFIG_FILES([config/libelf.pc config/libdw.pc config/libdebuginfod.pc]) |
0aa60ac6 | 592 | |
b08d5a8f UD |
593 | # Get the definitions necessary to create the Makefiles in the po |
594 | # subdirectories. This is a small subset of the gettext rules. | |
595 | AC_SUBST(USE_NLS, yes) | |
596 | AM_PO_SUBDIRS | |
597 | ||
b4d6f0f8 RM |
598 | dnl Appended to the config.h file. |
599 | dnl We hide all kinds of configuration magic in lib/eu-config.h. | |
600 | AH_BOTTOM([#include <eu-config.h>]) | |
b08d5a8f | 601 | |
fbc7245d RM |
602 | dnl Version compatibility header. |
603 | AC_CONFIG_FILES([version.h:config/version.h.in]) | |
604 | AC_SUBST([eu_version]) | |
ee9d60de RM |
605 | |
606 | # 1.234<whatever> -> 1234<whatever> | |
607 | case "$PACKAGE_VERSION" in | |
e9bf1d30 | 608 | [[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;; |
ee9d60de RM |
609 | *) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;; |
610 | esac | |
611 | case "$eu_version" in | |
612 | *.*) | |
613 | # 1234.567 -> "1234", "567" | |
614 | eu_extra_version="${eu_version#*.}" | |
615 | eu_version="${eu_version%%.*}" | |
616 | case "$eu_extra_version" in | |
617 | [[0-9]][[0-9]][[0-9]]) ;; | |
618 | [[0-9]][[0-9]]) eu_extra_version="${eu_extra_version}0" ;; | |
619 | [[0-9]]) eu_extra_version="${eu_extra_version}00" ;; | |
620 | *) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;; | |
621 | esac | |
622 | ;; | |
623 | *) | |
624 | eu_extra_version=000 | |
625 | ;; | |
626 | esac | |
627 | ||
628 | case "$eu_version" in | |
629 | 0[[0-9]][[0-9]][[0-9]]) eu_version="${eu_version#0}$eu_extra_version" ;; | |
630 | [[0-9]][[0-9]][[0-9]][[0-9]]) eu_version="${eu_version}$eu_extra_version" ;; | |
631 | [[0-9]][[0-9]][[0-9]]) eu_version="${eu_version}0$eu_extra_version" ;; | |
2c71252e | 632 | [[0-9]][[0-9]]) eu_version="${eu_version}00$eu_extra_version";; |
ee9d60de | 633 | *) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;; |
fbc7245d RM |
634 | esac |
635 | ||
105e3984 | 636 | # Round up to the next release API (x.y) version. |
e9bf1d30 | 637 | eu_version=$(( (eu_version + 999) / 1000 )) |
105e3984 | 638 | |
0b867460 JK |
639 | AC_CHECK_SIZEOF(long) |
640 | ||
c1e0fcb9 KM |
641 | # On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead |
642 | # of the user_regs_struct from sys/user.h. They are structurally the same | |
643 | # but we get either one or the other. | |
644 | AC_CHECK_TYPE([struct user_regs_struct], | |
645 | [sys_user_has_user_regs=yes], [sys_user_has_user_regs=no], | |
646 | [[#include <sys/ptrace.h>] | |
647 | [#include <sys/time.h>] | |
648 | [#include <sys/user.h>]]) | |
649 | if test "$sys_user_has_user_regs" = "yes"; then | |
650 | AC_DEFINE(HAVE_SYS_USER_REGS, 1, | |
651 | [Define to 1 if <sys/user.h> defines struct user_regs_struct]) | |
652 | fi | |
653 | ||
0b867460 JK |
654 | # On a 64-bit host where can can use $CC -m32, we'll run two sets of tests. |
655 | # Likewise in a 32-bit build on a host where $CC -m64 works. | |
656 | utrace_BIARCH | |
657 | # `$utrace_biarch' will be `-m64' even on an uniarch i386 machine. | |
8ae9bc9d | 658 | CC_BIARCH="$CC $utrace_biarch" |
0b867460 JK |
659 | AC_SUBST([CC_BIARCH]) |
660 | ||
4664fd58 MW |
661 | # In maintainer mode we really need flex and bison. |
662 | # Otherwise we really need a release dir with maintainer files generated. | |
663 | if test "x$enable_maintainer_mode" = xyes; then | |
664 | AC_CHECK_PROG(HAVE_FLEX, flex, yes, no) | |
665 | if test "$HAVE_FLEX" = "no"; then | |
666 | AC_MSG_ERROR([flex needed in maintainer mode]) | |
667 | fi | |
668 | AC_CHECK_PROG(HAVE_BISON, bison, yes, no) | |
669 | if test "$HAVE_BISON" = "no"; then | |
670 | AC_MSG_ERROR([bison needed in maintainer mode]) | |
671 | fi | |
d6126841 RB |
672 | AC_CHECK_PROG(HAVE_GAWK, gawk, yes, no) |
673 | if test "$HAVE_GAWK" = "no"; then | |
674 | AC_MSG_ERROR([gawk needed in maintainer mode]) | |
675 | fi | |
4664fd58 MW |
676 | else |
677 | if test ! -f ${srcdir}/libdw/known-dwarf.h; then | |
678 | AC_MSG_ERROR([No libdw/known-dwarf.h. configure --enable-maintainer-mode]) | |
679 | fi | |
680 | fi | |
681 | ||
682 | # The testfiles are all compressed, we need bunzip2 when running make check | |
683 | AC_CHECK_PROG(HAVE_BUNZIP2, bunzip2, yes, no) | |
684 | if test "$HAVE_BUNZIP2" = "no"; then | |
685 | AC_MSG_WARN([No bunzip2, needed to run make check]) | |
686 | fi | |
687 | ||
52536d7d MW |
688 | # For tests that need to use zstd compression |
689 | AC_CHECK_PROG(HAVE_ZSTD, zstd, yes, no) | |
690 | AM_CONDITIONAL([HAVE_ZSTD],[test "x$HAVE_ZSTD" = "xyes"]) | |
691 | ||
f7f0cdc5 MW |
692 | # Look for libcurl for libdebuginfod minimum version as per rhel7. |
693 | AC_ARG_ENABLE([libdebuginfod],AC_HELP_STRING([--enable-libdebuginfod], [Build debuginfod client library (can be =dummy)])) | |
694 | AS_IF([test "x$enable_libdebuginfod" != "xno"], [ | |
695 | if test "x$enable_libdebuginfod" != "xdummy"; then | |
696 | AC_MSG_NOTICE([checking libdebuginfod dependencies, --disable-libdebuginfod or --enable-libdebuginfo=dummy to skip]) | |
697 | enable_libdebuginfod=yes # presume success | |
698 | PKG_PROG_PKG_CONFIG | |
699 | PKG_CHECK_MODULES([libcurl],[libcurl >= 7.29.0],[],[enable_libdebuginfod=no]) | |
700 | if test "x$enable_libdebuginfod" = "xno"; then | |
701 | AC_MSG_ERROR([dependencies not found, use --disable-libdebuginfod to disable or --enable-libdebuginfod=dummy to build a (bootstrap) dummy library.]) | |
702 | fi | |
703 | else | |
704 | AC_MSG_NOTICE([building (bootstrap) dummy libdebuginfo library]) | |
705 | fi | |
706 | ]) | |
707 | ||
4ced3010 DL |
708 | AS_IF([test "x$enable_libdebuginfod" = "xyes" || test "x$enable_libdebuginfod" = "xdummy"], |
709 | [AC_DEFINE([ENABLE_LIBDEBUGINFOD], [1], [Enable libdebuginfod])]) | |
710 | AS_IF([test "x$enable_libdebuginfod" = "xdummy"], | |
711 | [AC_DEFINE([DUMMY_LIBDEBUGINFOD], [1], [Build dummy libdebuginfod])]) | |
f7f0cdc5 MW |
712 | AM_CONDITIONAL([LIBDEBUGINFOD],[test "x$enable_libdebuginfod" = "xyes" || test "x$enable_libdebuginfod" = "xdummy"]) |
713 | AM_CONDITIONAL([DUMMY_LIBDEBUGINFOD],[test "x$enable_libdebuginfod" = "xdummy"]) | |
714 | ||
715 | # Look for libmicrohttpd, libarchive, sqlite for debuginfo server | |
716 | # minimum versions as per rhel7. | |
717 | AC_ARG_ENABLE([debuginfod],AC_HELP_STRING([--enable-debuginfod], [Build debuginfod server])) | |
e27e30ca | 718 | AC_PROG_CXX |
e27e30ca | 719 | AS_IF([test "x$enable_debuginfod" != "xno"], [ |
14d5b412 FCE |
720 | AC_MSG_NOTICE([checking debuginfod C++11 support, --disable-debuginfod to skip]) |
721 | AX_CXX_COMPILE_STDCXX(11, noext, mandatory) | |
722 | AC_MSG_NOTICE([checking debuginfod dependencies, --disable-debuginfod to skip]) | |
f7f0cdc5 MW |
723 | if test "x$enable_libdebuginfod" = "xno"; then |
724 | AC_MSG_ERROR([need libdebuginfod (or dummy), use --disable-debuginfod to disable.]) | |
725 | fi | |
e27e30ca FCE |
726 | enable_debuginfod=yes # presume success |
727 | PKG_PROG_PKG_CONFIG | |
e27e30ca | 728 | PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >= 0.9.33],[],[enable_debuginfod=no]) |
e27e30ca FCE |
729 | PKG_CHECK_MODULES([sqlite3],[sqlite3 >= 3.7.17],[],[enable_debuginfod=no]) |
730 | PKG_CHECK_MODULES([libarchive],[libarchive >= 3.1.2],[],[enable_debuginfod=no]) | |
731 | if test "x$enable_debuginfod" = "xno"; then | |
14d5b412 | 732 | AC_MSG_ERROR([dependencies not found, use --disable-debuginfod to disable.]) |
e27e30ca FCE |
733 | fi |
734 | ]) | |
735 | ||
736 | AS_IF([test "x$enable_debuginfod" != "xno"],AC_DEFINE([ENABLE_DEBUGINFOD],[1],[Build debuginfod])) | |
288f6b19 AM |
737 | AM_CONDITIONAL([DEBUGINFOD],[test "x$enable_debuginfod" = "xyes"]) |
738 | ||
94708e96 FCE |
739 | dnl for /etc/profile.d/elfutils.{csh,sh} |
740 | default_debuginfod_urls="" | |
741 | AC_ARG_ENABLE(debuginfod-urls, | |
742 | [AS_HELP_STRING([--enable-debuginfod-urls@<:@=URLS@:>@],[add URLS to profile.d DEBUGINFOD_URLS])], | |
743 | [if test "x${enableval}" = "xyes"; | |
744 | then default_debuginfod_urls="https://debuginfod.elfutils.org/"; | |
745 | elif test "x${enableval}" != "xno"; then | |
746 | default_debuginfod_urls="${enableval}"; | |
747 | fi], | |
748 | [default_debuginfod_urls=""]) | |
749 | AC_SUBST(DEBUGINFOD_URLS, $default_debuginfod_urls) | |
750 | AC_CONFIG_FILES([config/profile.sh config/profile.csh]) | |
288f6b19 | 751 | |
b08d5a8f | 752 | AC_OUTPUT |
7702a3c1 MW |
753 | |
754 | AC_MSG_NOTICE([ | |
755 | ===================================================================== | |
756 | elfutils: ${PACKAGE_VERSION} (eu_version: ${eu_version}) | |
757 | ===================================================================== | |
758 | ||
759 | Prefix : ${prefix} | |
760 | Program prefix ("eu-" recommended) : ${program_prefix} | |
761 | Source code location : ${srcdir} | |
762 | Maintainer mode : ${enable_maintainer_mode} | |
7702a3c1 MW |
763 | build arch : ${ac_cv_build} |
764 | ||
765 | RECOMMENDED FEATURES (should all be yes) | |
766 | gzip support : ${with_zlib} | |
767 | bzip2 support : ${with_bzlib} | |
768 | lzma/xz support : ${with_lzma} | |
52536d7d | 769 | zstd support : ${with_zstd} |
e6e80dae | 770 | libstdc++ demangle support : ${enable_demangler} |
7702a3c1 MW |
771 | File textrel check : ${enable_textrelcheck} |
772 | Symbol versioning : ${enable_symbol_versioning} | |
773 | ||
774 | NOT RECOMMENDED FEATURES (should all be no) | |
775 | Experimental thread safety : ${use_locks} | |
b63007ed | 776 | install elf.h : ${install_elfh} |
7702a3c1 MW |
777 | |
778 | OTHER FEATURES | |
779 | Deterministic archives by default : ${default_ar_deterministic} | |
780 | Native language support : ${USE_NLS} | |
5e2a8e25 | 781 | Extra Valgrind annotations : ${use_vg_annotations} |
f7f0cdc5 MW |
782 | libdebuginfod client support : ${enable_libdebuginfod} |
783 | Debuginfod server support : ${enable_debuginfod} | |
94708e96 | 784 | Default DEBUGINFOD_URLS : ${default_debuginfod_urls} |
7702a3c1 MW |
785 | |
786 | EXTRA TEST FEATURES (used with make check) | |
4664fd58 | 787 | have bunzip2 installed (required) : ${HAVE_BUNZIP2} |
52536d7d | 788 | have zstd installed : ${HAVE_ZSTD} |
7702a3c1 MW |
789 | debug branch prediction : ${use_debugpred} |
790 | gprof support : ${use_gprof} | |
791 | gcov support : ${use_gcov} | |
792 | run all tests under valgrind : ${use_valgrind} | |
2b250b75 | 793 | gcc undefined behaviour sanitizer : ${use_undefined} |
7702a3c1 MW |
794 | use rpath in tests : ${tests_use_rpath} |
795 | test biarch : ${utrace_cv_cc_biarch} | |
796 | ]) | |
b63007ed MW |
797 | |
798 | if test "$install_elfh" = yes; then | |
799 | if test "${prefix}" = "/usr/local" -o "${prefix}" = "/usr"; then | |
800 | AC_MSG_WARN([installing elf.h in ${includedir} might conflict with glibc/system elf.h]) | |
801 | fi | |
802 | fi |