summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-10-09 16:32:14 +0200
committerGravatar Martin Szulecki2014-10-09 16:38:28 +0200
commit0374c7f7cf3756f37db772d552e139956f26f3b2 (patch)
tree110bd53f13048e00c68d4a39a5df296f0eca3b68
parent6082040a5178a3741f4fb065c857f1457e2fc4c6 (diff)
downloadidevicerestore-0374c7f7cf3756f37db772d552e139956f26f3b2.tar.gz
idevicerestore-0374c7f7cf3756f37db772d552e139956f26f3b2.tar.bz2
Enable large file support if available for >2GB file support
-rw-r--r--configure.ac27
-rw-r--r--src/Makefile.am1
2 files changed, 28 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0d164e3..52cc695 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,33 @@ AC_SUBST(GLOBAL_CFLAGS)
AC_SUBST(AC_LDFLAGS)
AC_SUBST(AC_LDADD)
+# check for large file support
+AC_SYS_LARGEFILE
+LFS_CFLAGS=''
+if test "$enable_largefile" != no; then
+ if test "$ac_cv_sys_file_offset_bits" != 'no'; then
+ LFS_CFLAGS="$LFS_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
+ else
+ AC_MSG_CHECKING(for native large file support)
+ AC_RUN_IFELSE([AC_LANG_SOURCE([#include <unistd.h>
+ int main (int argc, char **argv)
+ {
+ exit(!(sizeof(off_t) == 8));
+ }])],
+ [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
+ fi
+ if test "$ac_cv_sys_large_files" != 'no'; then
+ LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES=1"
+ fi
+ AC_FUNC_FSEEKO
+ if test "$ac_cv_sys_largefile_source" != 'no'; then
+ LFS_CFLAGS="$LFS_CFLAGS -D_LARGEFILE_SOURCE=1"
+ fi
+fi
+AC_SUBST(LFS_CFLAGS)
+
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_OUTPUT([
diff --git a/src/Makefile.am b/src/Makefile.am
index f0e85c0..d823c2c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,6 @@
AM_CFLAGS = \
$(GLOBAL_CFLAGS) \
+ $(LFS_CFLAGS) \
$(libirecovery_CFLAGS) \
$(libimobiledevice_CFLAGS) \
$(libplist_CFLAGS) \