aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-21 16:37:12 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-21 16:37:12 +0000
commit0a205155cf2eeee9ffc81ff931266a3e55322fdc (patch)
treec2ba46f66aa126b858125915c5f7c48cc7aef5cc /configure.in
parentc3bc3b1646d474dc2582c8ff348fa2888a2b4844 (diff)
downloadruby-0a205155cf2eeee9ffc81ff931266a3e55322fdc.tar.gz
* configure.in: Add -D_XOPEN_SOURCE=500 (or 600 or 700) on Solaris
if available, mainly for enabling some features in sockets. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in49
1 files changed, 49 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 6018a0a8bc..7c2a8c9ea1 100644
--- a/configure.in
+++ b/configure.in
@@ -1094,6 +1094,55 @@ main()
ac_cv_c_inline=no],
[solaris*], [ LIBS="-lm $LIBS"
ac_cv_func_vfork=no
+ AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given)
+ AC_TRY_COMPILE([#include <unistd.h>
+ #ifndef _XOPEN_SOURCE
+ #error _XOPEN_SOURCE is not defined
+ #endif
+ ], [],
+ [given_xopen_source=yes], [given_xopen_source=no])
+ AC_MSG_RESULT($given_xopen_source)
+ if test $given_xopen_source = no; then
+ AC_MSG_CHECKING(appropriate _XOPEN_SOURCE value to define)
+ define_xopen_source=""
+ if test x"$define_xopen_source" = x; then
+ AC_TRY_COMPILE([
+ #define _XOPEN_SOURCE 700
+ #include <unistd.h>
+ #ifndef _XPG7
+ #error _XPG7 should be defined by _XOPEN_SOURCE=700
+ #endif
+ ], [],
+ [define_xopen_source=700], [])
+ fi
+ if test x"$define_xopen_source" = x; then
+ AC_TRY_COMPILE([
+ #define _XOPEN_SOURCE 600
+ #include <unistd.h>
+ #ifndef _XPG6
+ #error _XPG6 should be defined by _XOPEN_SOURCE=600
+ #endif
+ ], [],
+ [define_xopen_source=600], [])
+ fi
+ if test x"$define_xopen_source" = x; then
+ AC_TRY_COMPILE([
+ #define _XOPEN_SOURCE 500
+ #include <unistd.h>
+ #ifndef _XPG5
+ #error _XPG5 should be defined by _XOPEN_SOURCE=500
+ #endif
+ ], [],
+ [define_xopen_source=500], [])
+ fi
+ if test x"$define_xopen_source" = x; then
+ define_xopen_source=no
+ fi
+ AC_MSG_RESULT($define_xopen_source)
+ if test x"$define_xopen_source" != xno; then
+ RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
+ fi
+ fi
],
[beos*|haiku*], [
ac_cv_func_link=no