configure.in: no visibility option for older GCC

* configure.in (visibility_option): visibility attribute is not
  available before GCC 4, so do not use -fvisibility option in that
  case.  [ruby-core:48147] [Bug #7205]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-10-23 05:06:50 +00:00
Родитель a4f79a6ece
Коммит 0249395582
2 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Tue Oct 23 14:06:47 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (visibility_option): visibility attribute is not
available before GCC 4, so do not use -fvisibility option in that
case. [ruby-core:48147] [Bug #7205]
Tue Oct 23 12:57:29 2012 Koichi Sasada <ko1@atdot.net>
* vm_core.h, vm_insnhelper.c, vm_eval.c (OPT_CALL_CFUNC_WITHOUT_FRAME):

Просмотреть файл

@ -644,7 +644,15 @@ if test "$GCC" = ""; then
AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"])
fi
if test "$GCC" = yes; then
RUBY_TRY_CFLAGS(-fvisibility=hidden, [RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
@%:@if !(defined __GNUC__ && __GNUC__ >= 4)
@%:@error not GCC 4 or later
>>>not GCC 4 or later<<<
@%:@endif])],
[visibility_option=yes], [visibility_option=no])
if test "$visibility_option" = yes; then
RUBY_TRY_CFLAGS(-fvisibility=hidden, [visibility_option=yes], [visibility_option=no])
fi
AC_SUBST(WERRORFLAG, "-Werror")
if test "$visibility_option" = yes; then
RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)