GLIBCXX_ENABLE(symvers,$1,[=STYLE],
[enables symbol versioning of the shared library],
- [permit yes|no|gnu])
+ [permit yes|no|gnu|darwin-export])
# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
# don't know enough about $LD to do tricks...
AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
-# FIXME The following test is too strict, in theory.
-if test $enable_shared = no ||
- test "x$LD" = x ||
- test x$glibcxx_gnu_ld_version = x; then
- enable_symvers=no
+
+# Turn a 'yes' into a suitable default.
+if test x$enable_symvers = xyes ; then
+ if test $enable_shared = no ||
+ test "x$LD" = x ; then
+ enable_symvers=no
+ elif test $with_gnu_ld == yes ; then
+ enable_symvers=gnu
+ else
+ case ${target_os} in
+ darwin*)
+ enable_symvers=darwin-export ;;
+ *)
+ AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
+ AC_MSG_WARN([=== you are not using a supported linker.])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no ;;
+ esac
+ fi
fi
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
AC_MSG_RESULT($glibcxx_shared_libgcc)
fi
-# For GNU ld, we need at least this version. The format is described in
-# GLIBCXX_CHECK_LINKER_FEATURES above.
-glibcxx_min_gnu_ld_version=21400
+# If no shared libgcc, can't win.
+if test $glibcxx_shared_libgcc != yes &&
+ test $enable_symvers != no ; then
+ AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
+ AC_MSG_WARN([=== you are not building a shared libgcc_s.])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ enable_symvers=no
+fi
+
+# Check to see if 'gnu' can win.
+if test $enable_symvers = gnu; then
+ # For GNU ld, we need at least this version. The format is described in
+ # GLIBCXX_CHECK_LINKER_FEATURES above.
+ glibcxx_min_gnu_ld_version=21400
-# Check to see if unspecified "yes" value can win, given results above.
-# Change "yes" into either "no" or a style name.
-if test $enable_symvers = yes; then
- if test $with_gnu_ld = yes &&
- test $glibcxx_shared_libgcc = yes;
- then
- if test $glibcxx_gnu_ld_version -ge $glibcxx_min_gnu_ld_version ; then
- enable_symvers=gnu
- else
- # The right tools, the right setup, but too old. Fallbacks?
- AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
- AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
- AC_MSG_WARN(=== You would need to upgrade your binutils to version)
- AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.)
- if test $glibcxx_gnu_ld_version -ge 21200 ; then
- # Globbing fix is present, proper block support is not.
- AC_MSG_WARN([=== Symbol versioning will be disabled.])
- enable_symvers=no
- else
- # 2.11 or older.
- AC_MSG_WARN([=== Symbol versioning will be disabled.])
- enable_symvers=no
- fi
- fi
- else
+ if test $with_gnu_ld != yes ; then
# just fail for now
- AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
- AC_MSG_WARN([=== either you are not using a supported linker, or you are])
- AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
+ AC_MSG_WARN([=== You have requested GNU symbol versioning, but])
+ AC_MSG_WARN([=== you are not using the GNU linker.])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
+ enable_symvers=no
+ elif test $glibcxx_gnu_ld_version -lt $glibcxx_min_gnu_ld_version ; then
+ # The right tools, the right setup, but too old. Fallbacks?
+ AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
+ AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
+ AC_MSG_WARN(=== You would need to upgrade your binutils to version)
+ AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.)
AC_MSG_WARN([=== Symbol versioning will be disabled.])
enable_symvers=no
fi
gnu)
SYMVER_MAP=config/linker-map.gnu
AC_DEFINE(_GLIBCXX_SYMVER, 1,
- [Define to use symbol versioning in the shared library.])
+ [Define to use GNU symbol versioning in the shared library.])
+ ;;
+ darwin-export)
+ SYMVER_MAP=config/linker-map.gnu
;;
esac
AC_SUBST(SYMVER_MAP)
AC_SUBST(port_specific_symbol_files)
-GLIBCXX_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
+GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU, test $enable_symvers == gnu)
+GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_DARWIN_EXPORT, dnl
+ test $enable_symvers == darwin-export)
AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
])