]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd-utils: Use AC_SYS_LARGEFILE
authorSascha Hauer <s.hauer@pengutronix.de>
Fri, 26 Feb 2021 10:24:21 +0000 (11:24 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Sun, 28 Feb 2021 12:36:26 +0000 (13:36 +0100)
Currently mtd-utils on 32bit systems fail on devices >2GiB due to off_t being
a signed 32bit type. Add AC_SYS_LARGEFILE to make off_t a 64bit type.
Adding AC_SYS_LARGEFILE results in _FILE_OFFSET_BITS being defined to 64
in include/config.h. To let this have an effect we must make sure that
include/config.h is included before all other includes which is
archieved by adding its inclusion to CPPFLAGS.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Makefile.am
configure.ac
include/common.h
include/libmissing.h

index d4de62c86c144f8537082c5507162474fb776d5e..9da38afc867f723a9b0fcc8047cf49cdf82e26a4 100644 (file)
@@ -1,6 +1,7 @@
 ACLOCAL_AMFLAGS = -I m4
 
-AM_CPPFLAGS = $(WARN_CFLAGS) -D_GNU_SOURCE -std=gnu99 -I$(top_srcdir)/include
+AM_CPPFLAGS = $(WARN_CFLAGS) -D_GNU_SOURCE -std=gnu99 -I$(top_srcdir)/include \
+               -include $(top_builddir)/include/config.h
 
 if WITHOUT_XATTR
 AM_CPPFLAGS += -DWITHOUT_XATTR
index a792bd1de488bae5b71acef692ac28737c25763e..c57cf464e43fb95ce2007e240a989c963205b3a7 100644 (file)
@@ -23,7 +23,7 @@ AC_PROG_LIBTOOL
 AC_DISABLE_STATIC
 AC_PROG_CC
 AC_PROG_INSTALL
-
+AC_SYS_LARGEFILE
 
 m4_ifndef([PKG_PROG_PKG_CONFIG],
   [m4_fatal([Could not locate the pkg-config autoconf
index 72707697b170c4ce1a10605e392b126f9c0f65fc..31b6cd1cdd60c9efcb8907a400200973360e9684 100644 (file)
@@ -31,8 +31,6 @@
 #include <unistd.h>
 #include <sys/sysmacros.h>
 
-#include "config.h"
-
 #ifndef PROGRAM_NAME
 # error "You must define PROGRAM_NAME before including this header"
 #endif
index 01960330dab7081a241264b5c2f05fd5c91e4ca1..0fb0cf4da6cbb72836a4c9e116532de1f8bbed58 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef LIBMISSING_H
 #define LIBMISSING_H
 
-#include "config.h"
-
 #ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
 #endif