* configure.in: On Solaris, add -D_XOPEN_SOURCE=n only when both
AC_TRY_CPP and AC_TRY_COMPILE pass, because some options (e.g. -std=iso9899:1999) are not set when running C preprocessor or building ext. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a05ef8460a
commit
9546cb5272
@ -1,3 +1,10 @@
|
|||||||
|
Sun Nov 22 17:59:50 2015 Naohisa Goto <ngotogenome@gmail.com>
|
||||||
|
|
||||||
|
* configure.in: On Solaris, add -D_XOPEN_SOURCE=n only when both
|
||||||
|
AC_TRY_CPP and AC_TRY_COMPILE pass, because some options
|
||||||
|
(e.g. -std=iso9899:1999) are not set when running C preprocessor
|
||||||
|
or building ext.
|
||||||
|
|
||||||
Sun Nov 22 16:53:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Nov 22 16:53:34 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* compile.c (iseq_peephole_optimize): remove unreachable code
|
* compile.c (iseq_peephole_optimize): remove unreachable code
|
||||||
|
47
configure.in
47
configure.in
@ -1105,36 +1105,29 @@ main()
|
|||||||
if test $given_xopen_source = no; then
|
if test $given_xopen_source = no; then
|
||||||
AC_MSG_CHECKING(appropriate _XOPEN_SOURCE value to define)
|
AC_MSG_CHECKING(appropriate _XOPEN_SOURCE value to define)
|
||||||
define_xopen_source=""
|
define_xopen_source=""
|
||||||
if test x"$define_xopen_source" = x; then
|
for tmp_xpg in 7 6 5; do
|
||||||
AC_TRY_COMPILE([
|
if test x"$define_xopen_source" != x; then
|
||||||
#define _XOPEN_SOURCE 700
|
break
|
||||||
|
fi
|
||||||
|
# Both AC_TRY_CPP and AC_TRY_COMPILE should pass
|
||||||
|
# because some options may not be set to CPPFLAGS.
|
||||||
|
AC_TRY_CPP([
|
||||||
|
#define _XOPEN_SOURCE ${tmp_xpg}00
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifndef _XPG7
|
#ifndef _XPG${tmp_xpg}
|
||||||
#error _XPG7 should be defined by _XOPEN_SOURCE=700
|
#error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
|
||||||
|
#endif
|
||||||
|
], [
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#define _XOPEN_SOURCE ${tmp_xpg}00
|
||||||
|
#include <unistd.h>
|
||||||
|
#ifndef _XPG${tmp_xpg}
|
||||||
|
#error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
|
||||||
#endif
|
#endif
|
||||||
], [],
|
], [],
|
||||||
[define_xopen_source=700], [])
|
[define_xopen_source=${tmp_xpg}00], [])
|
||||||
fi
|
], [])
|
||||||
if test x"$define_xopen_source" = x; then
|
done
|
||||||
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
|
if test x"$define_xopen_source" = x; then
|
||||||
define_xopen_source=no
|
define_xopen_source=no
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user