2 # Copyright © 2005 Scott James Remnant <scott@netsplit.com>
3 # Copyright © 2009-2023 Guillem Jover <guillem@debian.org>
7 # Check for the ptrdiff_t type, defining to int if not defined
8 AC_DEFUN([DPKG_TYPE_PTRDIFF_T], [
9 AC_CHECK_TYPE([ptrdiff_t], [], [
10 AC_DEFINE_UNQUOTED([ptrdiff_t], [int],
11 [Define to 'int' if <malloc.h> does not define.])
13 ])# DPKG_TYPE_PTRDIFF_T
15 # DPKG_TYPE_STRUCT_PSINFO
16 # -----------------------
17 # Check for the struct psinfo type.
18 AC_DEFUN([DPKG_TYPE_STRUCT_PSINFO], [
19 AC_REQUIRE([DPKG_CHECK_HEADER_SYS_PROCFS])
21 AC_CHECK_TYPES([struct psinfo], [], [], [[
22 #if !DPKG_STRUCTURED_PROCFS_SUPPORTS_LFS
23 #undef _FILE_OFFSET_BITS
25 #define _STRUCTURED_PROC 1
27 #include <sys/procfs.h>
30 ])# DPKG_TYPE_STRUCT_PSINFO
32 # DPKG_DECL_SYS_SIGLIST
33 # ---------------------
34 # Check for the sys_siglist variable in either signal.h or unistd.h
35 AC_DEFUN([DPKG_DECL_SYS_SIGLIST], [
36 AC_CHECK_HEADERS([unistd.h])
37 AC_CHECK_DECLS([sys_siglist], [], [], [[
39 /* NetBSD declares sys_siglist in unistd.h. */
44 ])# DPKG_DECL_SYS_SIGLIST
46 # DPKG_DECL_SYS_ERRLIST
47 # ---------------------
48 # Check for the sys_errlist and sys_nerr variables in either errno.h or
50 AC_DEFUN([DPKG_DECL_SYS_ERRLIST], [
51 AC_CHECK_DECLS([sys_errlist, sys_nerr], [], [], [[
53 /* glibc declares sys_errlist in stdio.h. */
56 AM_CONDITIONAL([HAVE_SYS_ERRLIST],
57 [test "x$ac_cv_have_decl_sys_errlist" = "xyes" && \
58 test "x$ac_cv_have_decl_sys_nerr" = "xyes"])
59 ])# DPKG_DECL_SYS_SIGLIST
61 # DPKG_CHECK_DECL([DECL], [HEADER])
63 # Define HAVE_DECL to 1 if declared in HEADER
64 AC_DEFUN([DPKG_CHECK_DECL], [
66 AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
67 [Define to 1 if ']$1[' is declared in <$2>])
68 ], [], [[#include <$2>]])