From 2a3d521318533bb1d0535b989be578b4f5c5ff1a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 14 Mar 2024 01:56:36 +0100 Subject: [PATCH] build: Do not rely on internal autoconf ac_cv_sys_file_offset_bits variable 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 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/m4/libbsd-large.m4 b/m4/libbsd-large.m4 index dc00c6e..213f2cb 100644 --- a/m4/libbsd-large.m4 +++ b/m4/libbsd-large.m4 @@ -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 +]]) + 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])