summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--configure.in18
2 files changed, 23 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a3121ad6d3..99381a8881 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Nov 24 23:56:25 2015 Naohisa Goto <ngotogenome@gmail.com>
+
+ * configure.in: On Solaris, it is safe to define _LARGEFILE_SOURCE
+ when _FILE_OFFSET_BITS=64 is defined (= when 32-bit compile).
+
Tue Nov 24 10:00:10 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* lib/rubygems/installer.rb: Fix two double-word typos.
diff --git a/configure.in b/configure.in
index f04d606fd0..dccac086a8 100644
--- a/configure.in
+++ b/configure.in
@@ -1322,6 +1322,24 @@ dnl check for large file stuff
mv confdefs.h confdefs1.h
: > confdefs.h
AC_SYS_LARGEFILE
+# On 32-bit Solaris, it is safe to define _LARGEFILE_SOURCE
+# which is not added by AC_SYS_LARGEFILE.
+if test x"$enable_largefile" != xno; then
+ AS_CASE(["$target_os"], [solaris*], [
+ AC_MSG_CHECKING([wheather _LARGEFILE_SOURCE should be defined])
+ AS_CASE(["${ac_cv_sys_file_offset_bits}:${ac_cv_sys_large_files}"],
+ ["64:"|"64:no"|"64:unknown"], [
+ # insert _LARGEFILE_SOURCE before _FILE_OFFSET_BITS line
+ # that is the same order as "getconf LFS_CFLAGS" output
+ mv confdefs.h largefile0.h
+ : > confdefs.h
+ AC_DEFINE(_LARGEFILE_SOURCE)
+ cat largefile0.h >> confdefs.h
+ rm largefile0.h
+ AC_MSG_RESULT([yes])
+ ], [AC_MSG_RESULT([no])])
+ ])
+fi
mv confdefs.h largefile.h
mv confdefs1.h confdefs.h
cat largefile.h >> confdefs.h