summaryrefslogtreecommitdiff
path: root/src/configure.ac
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-01-31 14:41:37 +0100
committerBram Moolenaar <Bram@vim.org>2018-01-31 14:41:37 +0100
commitec0557f08b2660118eaedb94471e5ab0f87cf2a3 (patch)
tree89cf3a14f97ef57688ae911902b26780e6b4a678 /src/configure.ac
parent059fd01021779ee369c1e55557275f6c349fda9e (diff)
downloadvim-git-ec0557f08b2660118eaedb94471e5ab0f87cf2a3.tar.gz
patch 8.0.1444: missing -D_FILE_OFFSET_BITS=64 may cause problemsv8.0.1444
Problem: Missing -D_FILE_OFFSET_BITS=64 may cause problems if a library is compiled with it. Solution: Include -D_FILE_OFFSET_BITS if some CFLAGS has it. (James McCoy, closes #2600)
Diffstat (limited to 'src/configure.ac')
-rw-r--r--src/configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/configure.ac b/src/configure.ac
index d78ec7a2b..274ba5907 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -4366,6 +4366,20 @@ if test "$GCC" = yes; then
fi
AC_SUBST(DEPEND_CFLAGS_FILTER)
+dnl On some systems AC_SYS_LARGEFILE determines that -D_FILE_OFFSET_BITS=64
+dnl isn't required, but the CFLAGS for some of the libraries we're using
+dnl include the define. Since the define changes the size of some datatypes
+dnl (e.g. ino_t and off_t), all of Vim's modules must be compiled with a
+dnl consistent value. It's therefore safest to force the use of the define
+dnl if it's present in any of the *_CFLAGS variables.
+AC_MSG_CHECKING(whether we need to force -D_FILE_OFFSET_BITS=64)
+if echo "$CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_GETPATH_CFLAGS $PYTHON_CFLAGS $PYTHON3_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $GTK_CFLAGS" | grep -q D_FILE_OFFSET_BITS 2>/dev/null; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(_FILE_OFFSET_BITS, 64)
+else
+ AC_MSG_RESULT(no)
+fi
+
dnl link.sh tries to avoid overlinking in a hackish way.
dnl At least GNU ld supports --as-needed which provides the same functionality
dnl at linker level. Let's use it.