diff options
author | Martin Szulecki | 2015-01-29 20:23:06 +0100 |
---|---|---|
committer | Martin Szulecki | 2015-01-29 20:23:06 +0100 |
commit | 16a329e152d8573aed882c8a4c0d65f403ce3a48 (patch) | |
tree | 3c8f740cbc1283a47925b56eeaf8305481459a8e /configure.ac | |
parent | 3249bc11252a3fc53b36b61def3eac27d5929e09 (diff) | |
download | libirecovery-16a329e152d8573aed882c8a4c0d65f403ce3a48.tar.gz libirecovery-16a329e152d8573aed882c8a4c0d65f403ce3a48.tar.bz2 |
Add large file support
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index d7aafbf..7a28800 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,33 @@ case "$GLOBAL_CFLAGS" in AC_DEFINE([HAVE_FVISIBILITY], [1], [Define if compiled with -fvisibility=hidden]) esac +# 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([ |