diff --git a/build/autoconf/libstdcxx.py b/build/autoconf/libstdcxx.py index 35008918e6d..15fe60fe32e 100755 --- a/build/autoconf/libstdcxx.py +++ b/build/autoconf/libstdcxx.py @@ -12,6 +12,7 @@ import os import subprocess import re +import sys re_for_ld = re.compile('.*\((.*)\).*') @@ -67,7 +68,19 @@ def find_version(e): return encode_ver(last_version) if __name__ == '__main__': - cxx_env = os.environ['CXX'] - print 'MOZ_LIBSTDCXX_TARGET_VERSION=%s' % find_version(cxx_env) - host_cxx_env = os.environ.get('HOST_CXX', cxx_env) - print 'MOZ_LIBSTDCXX_HOST_VERSION=%s' % find_version(host_cxx_env) + if os.uname()[0] == 'Darwin': + sdk_dir = os.environ['MACOS_SDK_DIR'] + if 'MacOSX10.5.sdk' in sdk_dir: + target_ver = 0 + host_ver = 0 + else: + target_ver = encode_ver('3.4.9') + host_ver = encode_ver('3.4.9') + else: + cxx_env = os.environ['CXX'] + target_ver = find_version(cxx_env) + host_cxx_env = os.environ.get('HOST_CXX', cxx_env) + host_ver = find_version(host_cxx_env) + + print 'MOZ_LIBSTDCXX_TARGET_VERSION=%s' % target_ver + print 'MOZ_LIBSTDCXX_HOST_VERSION=%s' % host_ver diff --git a/build/macosx/common b/build/macosx/common index b52f56b29cf..b532039a234 100644 --- a/build/macosx/common +++ b/build/macosx/common @@ -1,2 +1,4 @@ CC=/usr/bin/gcc-4.2 CXX=/usr/bin/g++-4.2 + +ac_add_options --enable-stdcxx-compat diff --git a/build/stdc++compat.cpp b/build/stdc++compat.cpp index 499304c37d4..a7f73af9556 100644 --- a/build/stdc++compat.cpp +++ b/build/stdc++compat.cpp @@ -57,6 +57,9 @@ namespace std { template ostream& ostream::_M_insert(double); template ostream& ostream::_M_insert(long); template ostream& ostream::_M_insert(unsigned long); +#ifdef DEBUG + template ostream& ostream::_M_insert(const void*); +#endif template ostream& __ostream_insert(ostream&, const char*, streamsize); template istream& istream::_M_extract(double&); #endif diff --git a/configure.in b/configure.in index 71005f0e299..21f3fb702e9 100644 --- a/configure.in +++ b/configure.in @@ -7466,7 +7466,7 @@ MOZ_ARG_ENABLE_BOOL(stdcxx-compat, AC_SUBST(STDCXX_COMPAT) if test -n "$STDCXX_COMPAT"; then - eval $(CXX="$CXX" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py) + eval $(CXX="$CXX" MACOS_SDK_DIR="$MACOS_SDK_DIR" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py) AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION) AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION) fi