1 dnl This file was derived from acinclude.m4.
4 dnl See whether we need a declaration for a function.
6 AC_DEFUN([BFD_NEED_DECLARATION],
7 [AC_MSG_CHECKING([whether $1 must be declared])
8 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
24 [char *(*pfn) = (char *(*)) $1],
25 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
26 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
27 if test $bfd_cv_decl_needed_$1 = yes; then
28 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
29 [Define if $1 is not declared in system header files.])
34 dnl Check for existence of a type $1 in sys/procfs.h
36 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],
37 [AC_MSG_CHECKING([for $1 in sys/procfs.h])
38 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
41 #include <sys/procfs.h>],
43 bfd_cv_have_sys_procfs_type_$1=yes,
44 bfd_cv_have_sys_procfs_type_$1=no
46 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
47 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
48 [Define if <sys/procfs.h> has $1.])
50 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
54 dnl Check for existence of member $2 in type $1 in sys/procfs.h
56 AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER],
57 [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
58 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
61 #include <sys/procfs.h>],
62 [$1 avar; void* aref = (void*) &avar.$2],
63 bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
64 bfd_cv_have_sys_procfs_type_member_$1_$2=no
66 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
67 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
68 [Define if <sys/procfs.h> has $1.$2.])
70 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)