summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-24 15:00:57 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-24 15:00:57 +0000
commit06c04b3874a764b5bcdcadcea2e30ed9d9c69d86 (patch)
tree2ba31464ada5cebeaf3faeda40b7de0dee7d7360
parent17f2a12f1f4e11906d0aa4164a7f0a3d0128a4d1 (diff)
* configure.in: On Solaris, it is safe to define _LARGEFILE_SOURCE
when _FILE_OFFSET_BITS=64 is defined (= when 32-bit compile). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--configure.in18
2 files changed, 23 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a3121ad..99381a8 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 f04d606..dccac08 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