<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 9b8b22249b579d5b3ee7f1a8fabf9801f438c1da Mon Sep 17 00:00:00 2001
From: t-m &lt;tomas.wolak@gmail.com&gt;
Date: Sat, 7 Jun 2025 21:36:53 +0200
Subject: [PATCH 1/1] autotools: fix LFS support on 32bit systems, #21

Also, added comments to a related section (above the new one),
since that section should be reviewed ie. regarding defining
_LARGE_FILES and _LARGEFILE_SOURCE. Linux (gcc) needs only
_FILE_OFFSET_BITS and _LARGEFILE64_SOURCE to get access
to fseeko64 and lseek64, but for other systems - this should
be further checked (and, possibly, improved).
---
 configure.ac | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/configure.ac b/configure.ac
index e171687d..fe0b6a05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,6 +177,9 @@ dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command
 dnl line because otherwise the system headers risk being included before
 dnl problems
 if test "x$ac_cv_sys_largefiles" = "xyes"; then
+    # judging from /usr/share/autoconf/autoconf/specific.m4, we can arrive here
+    # only on AIX... (section to review and fix/remove or keep it really needed, #21)
+
     if test "x$ac_cv_sys_file_offset_bits" = "x64"; then
         LIBCDIO_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
     else
@@ -188,6 +191,14 @@ if test "x$ac_cv_sys_largefiles" = "xyes"; then
     CPPFLAGS="$CPPFLAGS $LIBCDIO_LARGEFILE_FLAGS"
 fi
 
+dnl defining _LARGEFILE64_SOURCE is required for lseek64 and fseeko64 (#21) on Linux
+if test "x$enable_largefile" != "xno"; then
+   # note that getting here means that _FILE_OFFSET_BITS gets defined automatically,
+   # but not _LARGE_FILES and _LARGEFILE_SOURCE, so if any compiler needs those 2
+   # then either the section or updating this one may be needed
+   CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
+fi
+
 AC_DEFINE(LIBCDIO_CONFIG_H, 1,
   [Is set when libcdio's config.h has been included. Applications wishing to sue their own config.h values (such as set by the application's configure script can define this before including any of libcdio's headers.])
 
-- 
2.50.0

</pre></body></html>