]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
build: Do not rely on internal autoconf ac_cv_sys_file_offset_bits variable
authorGuillem Jover <guillem@hadrons.org>
Thu, 14 Mar 2024 00:56:36 +0000 (01:56 +0100)
committerGuillem Jover <guillem@hadrons.org>
Thu, 14 Mar 2024 01:00:36 +0000 (02:00 +0100)
This is an internal implementation detail from AC_SYS_LARGEFILE, which
happened to change with autoconf 2.72. Instead compute our own size
for off_t.

Closes: #28
m4/libbsd-large.m4

index dc00c6e3458a854e0769d983dec2ae9c11de1f26..213f2cb0ea9e48cd7f329d27f613dda06d0741e2 100644 (file)
@@ -43,7 +43,17 @@ AC_DEFUN([LIBBSD_SYS_TIME64], [
   ])
   LIBBSD_SELECT_ABI([time64], [explicit time64 time_t support])
 
-  AS_IF([test $ac_cv_sys_file_offset_bits -eq 64 && \
+  AC_CHECK_SIZEOF([off_t], [], [[
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+]])
+  AS_IF([test $ac_cv_sizeof_off_t = 8], [
+    libbsd_sys_has_lfs=1
+  ], [
+    libbsd_sys_has_lfs=0
+  ])
+
+  AS_IF([test $libbsd_sys_has_lfs -eq 1 && \
          test $libbsd_sys_time_bits -eq 32 && \
          test $ac_cv_sizeof_time_t -eq 8], [
     AC_DEFINE([_TIME_BITS], [64], [Enable 64-bit time_t support])