Commit | Line | Data |
---|---|---|
8fb84ecc | 1 | dnl This file was derived from acinclude.m4. |
5bf135a7 | 2 | dnl |
250d07de | 3 | dnl Copyright (C) 2012-2021 Free Software Foundation, Inc. |
5bf135a7 NC |
4 | dnl |
5 | dnl This file is free software; you can redistribute it and/or modify | |
6 | dnl it under the terms of the GNU General Public License as published by | |
7 | dnl the Free Software Foundation; either version 3 of the License, or | |
8 | dnl (at your option) any later version. | |
1b786873 | 9 | dnl |
5bf135a7 NC |
10 | dnl This program is distributed in the hope that it will be useful, |
11 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | dnl GNU General Public License for more details. | |
1b786873 | 14 | dnl |
5bf135a7 NC |
15 | dnl You should have received a copy of the GNU General Public License |
16 | dnl along with this program; see the file COPYING3. If not see | |
17 | dnl <http://www.gnu.org/licenses/>. | |
18 | dnl | |
8fb84ecc | 19 | |
c8693053 RO |
20 | dnl Check for sys/procfs.h, enforcing structured /proc on Solaris. |
21 | ||
22 | AC_DEFUN([BFD_SYS_PROCFS_H], | |
23 | [AC_DEFINE(_STRUCTURED_PROC, 1, [Use structured /proc on Solaris.]) | |
24 | AC_CHECK_HEADERS(sys/procfs.h)]) | |
25 | ||
8fb84ecc AC |
26 | dnl Check for existence of a type $1 in sys/procfs.h |
27 | ||
28 | AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE], | |
c8693053 RO |
29 | [AC_REQUIRE([BFD_SYS_PROCFS_H]) |
30 | AC_MSG_CHECKING([for $1 in sys/procfs.h]) | |
8fb84ecc AC |
31 | AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, |
32 | [AC_TRY_COMPILE([ | |
33 | #define _SYSCALL32 | |
34 | #include <sys/procfs.h>], | |
35 | [$1 avar], | |
36 | bfd_cv_have_sys_procfs_type_$1=yes, | |
37 | bfd_cv_have_sys_procfs_type_$1=no | |
38 | )]) | |
39 | if test $bfd_cv_have_sys_procfs_type_$1 = yes; then | |
40 | AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1, | |
41 | [Define if <sys/procfs.h> has $1.]) | |
42 | fi | |
43 | AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1) | |
44 | ]) | |
45 | ||
8fb84ecc AC |
46 | dnl Check for existence of member $2 in type $1 in sys/procfs.h |
47 | ||
48 | AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER], | |
c8693053 RO |
49 | [AC_REQUIRE([BFD_SYS_PROCFS_H]) |
50 | AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) | |
8fb84ecc AC |
51 | AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, |
52 | [AC_TRY_COMPILE([ | |
53 | #define _SYSCALL32 | |
54 | #include <sys/procfs.h>], | |
55 | [$1 avar; void* aref = (void*) &avar.$2], | |
56 | bfd_cv_have_sys_procfs_type_member_$1_$2=yes, | |
57 | bfd_cv_have_sys_procfs_type_member_$1_$2=no | |
58 | )]) | |
59 | if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then | |
60 | AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1, | |
61 | [Define if <sys/procfs.h> has $1.$2.]) | |
62 | fi | |
63 | AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) | |
64 | ]) | |
65 |