diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 8aaf2fd14a71..8718845a60f0 100644 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -882,5 +882,26 @@ def libcxx_inline_visibility(c_compiler, target): set_define('_LIBCPP_INLINE_VISIBILITY', libcxx_inline_visibility) set_define('_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49', libcxx_inline_visibility) +@depends(c_compiler, target, check_build_environment) +def visibility_flags(c_compiler, target, env): + if target.os != 'WINNT': + if target.kernel == 'Darwin': + return ('-fvisibility=hidden', '-fvisibility-inlines-hidden') + return ('-I%s/system_wrappers' % os.path.join(env.dist), + '-include', + '%s/config/gcc_hidden.h' % env.topsrcdir) + +@depends(target, visibility_flags) +def wrap_system_includes(target, visibility_flags): + if visibility_flags and target.kernel != 'Darwin': + return True + +set_define('HAVE_VISIBILITY_HIDDEN_ATTRIBUTE', + depends(visibility_flags)(lambda v: bool(v) or None)) +set_define('HAVE_VISIBILITY_ATTRIBUTE', + depends(visibility_flags)(lambda v: bool(v) or None)) +set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes) +set_config('VISIBILITY_FLAGS', visibility_flags) + include('windows.configure') include('rust.configure') diff --git a/js/src/old-configure.in b/js/src/old-configure.in index 8fb4c96f01e8..b7283b4916ac 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -1018,23 +1018,6 @@ AC_LANG_CPLUSPLUS MOZ_CXX11 -dnl Check for .hidden assembler directive and visibility attribute. -dnl Borrowed from glibc configure.in -dnl =============================================================== -if test "$GNU_CC" -a "$OS_TARGET" != WINNT; then - AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE) - AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE) - case "$OS_TARGET" in - Darwin) - VISIBILITY_FLAGS='-fvisibility=hidden -fvisibility-inlines-hidden' - ;; - *) - VISIBILITY_FLAGS="-I${DIST}/system_wrappers -include ${_topsrcdir}/config/gcc_hidden.h" - WRAP_SYSTEM_INCLUDES=1 - ;; - esac -fi # GNU_CC - case "${OS_TARGET}" in WINNT|Darwin|Android) ;; @@ -1044,9 +1027,6 @@ WINNT|Darwin|Android) ;; esac -AC_SUBST(WRAP_SYSTEM_INCLUDES) -AC_SUBST_LIST(VISIBILITY_FLAGS) - dnl Checks for header files. dnl ======================================================== AC_HEADER_DIRENT diff --git a/old-configure.in b/old-configure.in index 3b357fa9277f..b3d2d4edbf39 100644 --- a/old-configure.in +++ b/old-configure.in @@ -1360,23 +1360,6 @@ MOZ_CXX11 AC_LANG_C -dnl Check for .hidden assembler directive and visibility attribute. -dnl Borrowed from glibc configure.in -dnl =============================================================== -if test "$GNU_CC" -a "$OS_TARGET" != WINNT; then - AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE) - AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE) - case "$OS_TARGET" in - Darwin) - VISIBILITY_FLAGS='-fvisibility=hidden -fvisibility-inlines-hidden' - ;; - *) - VISIBILITY_FLAGS="-I${DIST}/system_wrappers -include ${_topsrcdir}/config/gcc_hidden.h" - WRAP_SYSTEM_INCLUDES=1 - ;; - esac -fi # GNU_CC - case "${OS_TARGET}" in Darwin) ;; @@ -1386,9 +1369,6 @@ Darwin) ;; esac -AC_SUBST(WRAP_SYSTEM_INCLUDES) -AC_SUBST_LIST(VISIBILITY_FLAGS) - dnl Checks for header files. dnl ======================================================== AC_HEADER_DIRENT diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build index 53b547469ba5..6301757fbc1c 100644 --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build @@ -127,9 +127,6 @@ if CONFIG['TARGET_XPCOM_ABI']: DEFINES['TARGET_OS_ABI'] = '"%s_%s"' % (CONFIG['OS_TARGET'], CONFIG['TARGET_XPCOM_ABI']) -if CONFIG['WRAP_SYSTEM_INCLUDES']: - DEFINES['WRAP_SYSTEM_INCLUDES'] = True - if CONFIG['OS_ARCH'] == 'Linux' and 'lib64' in CONFIG['libdir']: DEFINES['HAVE_USR_LIB64_DIR'] = True