Commit | Line | Data |
---|---|---|
3266f10b | 1 | dnl Autoconf configure snippets for common. |
32d0add0 | 2 | dnl Copyright (C) 1995-2015 Free Software Foundation, Inc. |
3266f10b TT |
3 | dnl |
4 | dnl This file is part of GDB. | |
5 | dnl | |
6 | dnl This program is free software; you can redistribute it and/or modify | |
7 | dnl it under the terms of the GNU General Public License as published by | |
8 | dnl the Free Software Foundation; either version 3 of the License, or | |
9 | dnl (at your option) any later version. | |
10 | dnl | |
11 | dnl This program is distributed in the hope that it will be useful, | |
12 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | dnl GNU General Public License for more details. | |
15 | dnl | |
16 | dnl You should have received a copy of the GNU General Public License | |
17 | dnl along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | dnl Invoke configury needed by the files in 'common'. | |
20 | AC_DEFUN([GDB_AC_COMMON], [ | |
21 | AC_HEADER_STDC | |
3266f10b TT |
22 | AC_FUNC_ALLOCA |
23 | ||
24 | dnl Note that this requires codeset.m4, which is included | |
25 | dnl by the users of common.m4. | |
26 | AM_LANGINFO_CODESET | |
27 | ||
28 | AC_CHECK_HEADERS(linux/perf_event.h locale.h memory.h signal.h dnl | |
3266f10b TT |
29 | sys/resource.h sys/socket.h sys/syscall.h dnl |
30 | sys/un.h sys/wait.h dnl | |
31 | thread_db.h wait.h) | |
32 | ||
33 | AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 socketpair]) | |
34 | ||
35 | AC_CHECK_DECLS([strerror, strstr]) | |
e9bcb658 GB |
36 | |
37 | dnl Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't | |
38 | dnl do since sigsetjmp might only be defined as a macro. | |
39 | AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp, | |
40 | [AC_TRY_COMPILE([ | |
41 | #include <setjmp.h> | |
42 | ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);], | |
43 | gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)]) | |
44 | if test $gdb_cv_func_sigsetjmp = yes; then | |
45 | AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ]) | |
46 | fi | |
6e5b4429 JK |
47 | |
48 | # Assume we'll default to using the included libiberty regex. | |
49 | gdb_use_included_regex=yes | |
50 | ||
51 | # However, if the system regex is GNU regex, then default to *not* | |
52 | # using the included regex. | |
53 | AC_CACHE_CHECK( | |
54 | [for GNU regex], | |
55 | [gdb_cv_have_gnu_regex], | |
56 | [AC_TRY_COMPILE( | |
57 | [#include <gnu-versions.h>], | |
58 | [#define REGEX_INTERFACE_VERSION 1 | |
59 | #if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION | |
60 | # error "Version mismatch" | |
61 | #endif], | |
62 | gdb_cv_have_gnu_regex=yes, | |
63 | gdb_cv_have_gnu_regex=no)]) | |
64 | if test $gdb_cv_have_gnu_regex = yes; then | |
65 | gdb_use_included_regex=no | |
66 | fi | |
67 | ||
68 | AC_ARG_WITH(included-regex, | |
69 | AS_HELP_STRING([--without-included-regex], [don't use included regex; this is the default on systems with version 2 of the GNU C library (use with caution on other system)]), | |
70 | gdb_with_regex=$withval, | |
71 | gdb_with_regex=$gdb_use_included_regex) | |
72 | if test "$gdb_with_regex" = yes; then | |
73 | AC_DEFINE(USE_INCLUDED_REGEX, 1, | |
74 | [Define to 1 if the regex included in libiberty should be used.]) | |
75 | fi | |
3266f10b | 76 | ]) |