summaryrefslogtreecommitdiffstats
path: root/m4/dpkg-headers.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:35:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:35:28 +0000
commitea314d2f45c40a006c0104157013ab4b857f665f (patch)
tree3ef2971cb3675c318b8d9effd987854ad3f6d3e8 /m4/dpkg-headers.m4
parentInitial commit. (diff)
downloaddpkg-ea314d2f45c40a006c0104157013ab4b857f665f.tar.xz
dpkg-ea314d2f45c40a006c0104157013ab4b857f665f.zip
Adding upstream version 1.22.4.upstream/1.22.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/dpkg-headers.m4')
-rw-r--r--m4/dpkg-headers.m432
1 files changed, 32 insertions, 0 deletions
diff --git a/m4/dpkg-headers.m4 b/m4/dpkg-headers.m4
new file mode 100644
index 0000000..a95c65f
--- /dev/null
+++ b/m4/dpkg-headers.m4
@@ -0,0 +1,32 @@
+# serial 1
+# Copyright © 2023 Guillem Jover <guillem@debian.org>
+
+# DPKG_CHECK_HEADER_SYS_PROCFS
+# ----------------------------
+# Check for the <sys/procfs.h> header.
+AC_DEFUN([DPKG_CHECK_HEADER_SYS_PROCFS], [
+ # On at least Solaris <= 11.3 we cannot use the new structured procfs API
+ # while also using LFS, so we need to check whether including <sys/procfs.h>
+ # is usable, and otherwise undefine _FILE_OFFSET_BITS, but only for the
+ # code using this (that is s-s-d).
+ dpkg_structured_procfs_supports_lfs=1
+ AC_CHECK_HEADERS([sys/procfs.h], [], [
+ # We need to reset the cached value, otherwise we will not be able to
+ # check it again.
+ AS_UNSET([ac_cv_header_sys_procfs_h])
+ # If a bare include failed, check whether we need to disable LFS to be
+ # able to use structured procfs.
+ AC_CHECK_HEADERS([sys/procfs.h], [
+ dpkg_structured_procfs_supports_lfs=0
+ ], [], [[
+#undef _FILE_OFFSET_BITS
+#define _STRUCTURED_PROC 1
+ ]])
+ ], [[
+#define _STRUCTURED_PROC 1
+ ]])
+
+ AC_DEFINE_UNQUOTED([DPKG_STRUCTURED_PROCFS_SUPPORTS_LFS],
+ [$dpkg_structured_procfs_supports_lfs],
+ [Whether structured procfs supports LFS])
+])# DPKG_CHECK_HEADER_SYS_PROCFS