Commit | Line | Data |
---|---|---|
8fb84ecc AC |
1 | dnl This file was derived from acinclude.m4. |
2 | ||
3 | ||
8fb84ecc AC |
4 | dnl Check for existence of a type $1 in sys/procfs.h |
5 | ||
6 | AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE], | |
7 | [AC_MSG_CHECKING([for $1 in sys/procfs.h]) | |
8 | AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, | |
9 | [AC_TRY_COMPILE([ | |
10 | #define _SYSCALL32 | |
16231b7b DG |
11 | /* Needed for new procfs interface on sparc-solaris. */ |
12 | #define _STRUCTURED_PROC 1 | |
8fb84ecc AC |
13 | #include <sys/procfs.h>], |
14 | [$1 avar], | |
15 | bfd_cv_have_sys_procfs_type_$1=yes, | |
16 | bfd_cv_have_sys_procfs_type_$1=no | |
17 | )]) | |
18 | if test $bfd_cv_have_sys_procfs_type_$1 = yes; then | |
19 | AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1, | |
20 | [Define if <sys/procfs.h> has $1.]) | |
21 | fi | |
22 | AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1) | |
23 | ]) | |
24 | ||
8fb84ecc AC |
25 | dnl Check for existence of member $2 in type $1 in sys/procfs.h |
26 | ||
27 | AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER], | |
28 | [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) | |
29 | AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, | |
30 | [AC_TRY_COMPILE([ | |
31 | #define _SYSCALL32 | |
16231b7b DG |
32 | /* Needed for new procfs interface on sparc-solaris. */ |
33 | #define _STRUCTURED_PROC 1 | |
8fb84ecc AC |
34 | #include <sys/procfs.h>], |
35 | [$1 avar; void* aref = (void*) &avar.$2], | |
36 | bfd_cv_have_sys_procfs_type_member_$1_$2=yes, | |
37 | bfd_cv_have_sys_procfs_type_member_$1_$2=no | |
38 | )]) | |
39 | if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then | |
40 | AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1, | |
41 | [Define if <sys/procfs.h> has $1.$2.]) | |
42 | fi | |
43 | AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) | |
44 | ]) | |
45 |