* configure.in (LIBRUBY_DLDFLAGS): use -unexported_symbol only

when available.  http://trac.macports.org/ticket/26341

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-09-25 01:30:52 +00:00
Родитель 4fd8930898
Коммит bab83d2628
2 изменённых файлов: 33 добавлений и 1 удалений

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

@ -1,3 +1,8 @@
Sat Sep 25 10:30:37 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (LIBRUBY_DLDFLAGS): use -unexported_symbol only
when available. http://trac.macports.org/ticket/26341
Sat Sep 25 10:05:49 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* configure.in: Always add -mieee for Renesas SH4.

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

@ -302,7 +302,7 @@ AC_CHECK_TOOL(AS, as)
ASFLAGS=$ASFLAGS
AC_SUBST(ASFLAGS)
AS_CASE(["$target_os"],[cygwin*|mingw*|darwin*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
AS_CASE(["$target_os"],[cygwin*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
# BSD's ports and MacPorts prefix GNU binutils with 'g'
AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump])
@ -419,6 +419,21 @@ AC_DEFUN(RUBY_TRY_CFLAGS, [
save_CFLAGS=
])
AC_DEFUN(RUBY_TRY_LDFLAGS, [
save_LDFLAGS="$LDFLAGS"
LDFLAGS="[$]LDFLAGS $1"
AC_MSG_CHECKING([whether ]$1[ is accepted])
RUBY_WERROR_FLAG([
AC_TRY_LINK([$4], [$5],
[$2
AC_MSG_RESULT(yes)],
[$3
AC_MSG_RESULT(no)])
])
LDFLAGS="$save_LDFLAGS"
save_LDFLAGS=
])
if test "$GCC:${warnflags+set}:no" = yes::no; then
for wflag in -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings \
-Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long; do
@ -431,6 +446,14 @@ fi
if test "$GCC" = yes; then
RUBY_TRY_CFLAGS(-fvisibility=hidden, [RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)])
fi
if test "$GCC" = yes; then
if test "$visibility_option" = yes; then
RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
else
RUBY_TRY_LDFLAGS(['-Wl,-unexported_symbol,_Init_*'], [visibility_option=ld], [visibility_option=no])
fi
test "$visibility_option" = no || OBJCOPY=:
fi
test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""
test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\""
@ -2180,6 +2203,10 @@ AS_CASE("$enable_shared", [yes], [
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version)'
if test "$visibility_option" = ld; then
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
fi
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
LIBRUBY_SO='lib$(RUBY_SO_NAME).dylib'
LIBRUBY_ALIASES='lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'