[前][次][番号順一覧][スレッド一覧]

ruby-changes:40624

From: ngoto <ko1@a...>
Date: Sun, 22 Nov 2015 01:37:22 +0900 (JST)
Subject: [ruby-changes:40624] ngoto:r52703 (trunk): * configure.in: Add -D_XOPEN_SOURCE=500 (or 600 or 700) on Solaris

ngoto	2015-11-22 01:37:12 +0900 (Sun, 22 Nov 2015)

  New Revision: 52703

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52703

  Log:
    * configure.in: Add -D_XOPEN_SOURCE=500 (or 600 or 700) on Solaris
      if available, mainly for enabling some features in sockets.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
Index: configure.in
===================================================================
--- configure.in	(revision 52702)
+++ configure.in	(revision 52703)
@@ -1094,6 +1094,55 @@ main() https://github.com/ruby/ruby/blob/trunk/configure.in#L1094
 		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
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52702)
+++ ChangeLog	(revision 52703)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Nov 22 01:23:43 2015  Naohisa Goto  <ngotogenome@g...>
+
+	* configure.in: Add -D_XOPEN_SOURCE=500 (or 600 or 700) on Solaris
+	  if available, mainly for enabling some features in sockets.
+
 Sun Nov 22 00:17:22 2015  Naohisa Goto  <ngotogenome@g...>
 
 	* test/socket/test_socket.rb (test/socket/test_socket.rb): skip

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]