diff options
author | Mike Hommey <mh@glandium.org> | 2020-08-20 17:01:43 +0000 |
---|---|---|
committer | Mike Hommey <mh@glandium.org> | 2020-08-20 17:01:43 +0000 |
commit | fd04d1db65c74d7792f473151360b727bc8341df (patch) | |
tree | 29fae68360184f84ff17cc25bb127543e316833b | |
parent | 9a9e911bcd185d2898a6772ddd5463a39f83255d (diff) | |
download | nspr-hg-fd04d1db65c74d7792f473151360b727bc8341df.tar.gz |
Bug 484411 - Remove XP_MACOSX and OS_TARGET=MacOSX. r=kaie
With support for macOS < 10.3 dropped, we don't need to care about
special cases for 10.1 anymore, which were the last places using
XP_MACOSX, which we can remove. And as per the previous change,
OS_TARGET=MacOSX is not used anymore. The value will now be Darwin
on all Darwin-based platforms. Also, as per the previous change,
we don't need to check for Carbon anymore.
Differential Revision: https://phabricator.services.mozilla.com/D86793
-rwxr-xr-x | configure | 101 | ||||
-rw-r--r-- | configure.in | 188 | ||||
-rw-r--r-- | pr/src/misc/prdtoa.c | 11 | ||||
-rw-r--r-- | pr/src/misc/prnetdb.c | 4 |
4 files changed, 139 insertions, 165 deletions
@@ -6483,78 +6483,71 @@ fi PR_MD_CSRCS=darwin.c PR_MD_ASFILES=os_Darwin.s - # Add Mac OS X support for loading CFM & CFBundle plugins - if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then - $as_echo "#define XP_MACOSX 1" >>confdefs.h - - OS_TARGET=MacOSX - - if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then - export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET - elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then - case "${target_cpu}" in - powerpc*) - export MACOSX_DEPLOYMENT_TARGET=10.3 - ;; - i*86*) - export MACOSX_DEPLOYMENT_TARGET=10.4 - ;; - esac - fi + if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then + export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET + elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then + case "${target_cpu}" in + powerpc*) + export MACOSX_DEPLOYMENT_TARGET=10.3 + ;; + i*86*) + export MACOSX_DEPLOYMENT_TARGET=10.4 + ;; + esac + fi - if test "$MACOS_SDK_DIR"; then + if test "$MACOS_SDK_DIR"; then - if test ! -d "$MACOS_SDK_DIR"; then - as_fn_error $? "SDK not found. When using --with-macos-sdk, you must + if test ! -d "$MACOS_SDK_DIR"; then + as_fn_error $? "SDK not found. When using --with-macos-sdk, you must specify a valid SDK. SDKs are installed when the optional cross-development tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5 - fi + fi - CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'` - GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` - GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` + CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'` + GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` + GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` - GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'` - if test "$GCC_VERSION_MAJOR" -lt "4" ; then - SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks" - if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then - SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks" - fi + GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'` + if test "$GCC_VERSION_MAJOR" -lt "4" ; then + SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks" + if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then + SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks" + fi - SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}" + SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}" - CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}" + CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}" - CPP="$CPP -nostdinc ${SDK_C_INCLUDE}" + CPP="$CPP -nostdinc ${SDK_C_INCLUDE}" - HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'` + HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'` - if test "$HOST_DARWIN_MAJOR" -lt 9 ; then - MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}" - else - MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}" - fi + if test "$HOST_DARWIN_MAJOR" -lt 9 ; then + MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}" + else + MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}" + fi - LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS" - export NEXT_ROOT=$MACOS_SDK_DIR + LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS" + export NEXT_ROOT=$MACOS_SDK_DIR - if test -n "$CROSS_COMPILE" ; then - HOST_CC="NEXT_ROOT= $HOST_CC" - HOST_CXX="NEXT_ROOT= $HOST_CXX" - fi - else - CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}" + if test -n "$CROSS_COMPILE" ; then + HOST_CC="NEXT_ROOT= $HOST_CC" + HOST_CXX="NEXT_ROOT= $HOST_CXX" + fi + else + CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}" - CPP="$CPP -isysroot ${MACOS_SDK_DIR}" + CPP="$CPP -isysroot ${MACOS_SDK_DIR}" - if test "$GCC_VERSION_FULL" != "4.0.0" ; then - LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}" - else - LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}" - fi + if test "$GCC_VERSION_FULL" != "4.0.0" ; then + LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}" + else + LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}" fi fi fi diff --git a/configure.in b/configure.in index f93dbea5..20b3a599 100644 --- a/configure.in +++ b/configure.in @@ -1346,116 +1346,110 @@ case "$target" in PR_MD_CSRCS=darwin.c PR_MD_ASFILES=os_Darwin.s - # Add Mac OS X support for loading CFM & CFBundle plugins - if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then - AC_DEFINE(XP_MACOSX) - OS_TARGET=MacOSX - - if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then - dnl Use the specified value - export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET - elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then - dnl No value specified on the command line or in the environment, - dnl use the lesser of the library's minimum or the architecture's - dnl minimum. - case "${target_cpu}" in - powerpc*) - dnl Architecture minimum 10.3 - export MACOSX_DEPLOYMENT_TARGET=10.3 - ;; - i*86*) - dnl Architecture minimum 10.4 - export MACOSX_DEPLOYMENT_TARGET=10.4 - ;; - esac - fi + if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then + dnl Use the specified value + export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET + elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then + dnl No value specified on the command line or in the environment, + dnl use the lesser of the library's minimum or the architecture's + dnl minimum. + case "${target_cpu}" in + powerpc*) + dnl Architecture minimum 10.3 + export MACOSX_DEPLOYMENT_TARGET=10.3 + ;; + i*86*) + dnl Architecture minimum 10.4 + export MACOSX_DEPLOYMENT_TARGET=10.4 + ;; + esac + fi - dnl MACOS_SDK_DIR will be set to the SDK location whenever one is - dnl in use. NEXT_ROOT will be set and exported if it's needed for - dnl ld. + dnl MACOS_SDK_DIR will be set to the SDK location whenever one is + dnl in use. NEXT_ROOT will be set and exported if it's needed for + dnl ld. - if test "$MACOS_SDK_DIR"; then - dnl Sync this section with the one in Mozilla's top level. + if test "$MACOS_SDK_DIR"; then + dnl Sync this section with the one in Mozilla's top level. - if test ! -d "$MACOS_SDK_DIR"; then - AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must + if test ! -d "$MACOS_SDK_DIR"; then + AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must specify a valid SDK. SDKs are installed when the optional cross-development tools are selected during the Xcode/Developer Tools installation.]) - fi + fi - changequote(,) - CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'` - GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` - GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` - changequote([,]) - GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'` - if test "$GCC_VERSION_MAJOR" -lt "4" ; then - SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks" - if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then - SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks" - fi + changequote(,) + CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'` + GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` + GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` + changequote([,]) + GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'` + if test "$GCC_VERSION_MAJOR" -lt "4" ; then + SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks" + if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then + SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks" + fi - SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}" + SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}" - CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}" + CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}" - dnl CPP needs to be set for AC_CHECK_HEADER. - CPP="$CPP -nostdinc ${SDK_C_INCLUDE}" + dnl CPP needs to be set for AC_CHECK_HEADER. + CPP="$CPP -nostdinc ${SDK_C_INCLUDE}" - changequote(,) - HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'` - changequote([,]) - if test "$HOST_DARWIN_MAJOR" -lt 9 ; then - dnl The build host is running Tiger (10.4) or earlier. - dnl ld support for -syslibroot is compiler-agnostic, but - dnl only available on Tiger and later. On Tiger and - dnl earlier build hosts, just rely on NEXT_ROOT, because - dnl it's not been shown to cause any problems. - MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}" - else - dnl The build host is running Leopard (10.5) or later. - dnl With NEXT_ROOT set, the linker will still not apply - dnl it when resolving dependencies. This causes problems - dnl on Leopard, where an SDK depends on frameworks which - dnl were present in earlier OS releases (and the associated - dnl SDK) but not in Leopard. -syslibroot does not have - dnl this problem, but it results in harmless warnings when - dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even - dnl on Leopard because the compiler uses it too. - MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}" - fi + changequote(,) + HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'` + changequote([,]) + if test "$HOST_DARWIN_MAJOR" -lt 9 ; then + dnl The build host is running Tiger (10.4) or earlier. + dnl ld support for -syslibroot is compiler-agnostic, but + dnl only available on Tiger and later. On Tiger and + dnl earlier build hosts, just rely on NEXT_ROOT, because + dnl it's not been shown to cause any problems. + MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}" + else + dnl The build host is running Leopard (10.5) or later. + dnl With NEXT_ROOT set, the linker will still not apply + dnl it when resolving dependencies. This causes problems + dnl on Leopard, where an SDK depends on frameworks which + dnl were present in earlier OS releases (and the associated + dnl SDK) but not in Leopard. -syslibroot does not have + dnl this problem, but it results in harmless warnings when + dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even + dnl on Leopard because the compiler uses it too. + MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}" + fi - LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS" - export NEXT_ROOT=$MACOS_SDK_DIR + LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS" + export NEXT_ROOT=$MACOS_SDK_DIR - if test -n "$CROSS_COMPILE" ; then - dnl NEXT_ROOT will be in the environment, but it - dnl shouldn't be set for the build host. HOST_CXX is - dnl presently unused. - HOST_CC="NEXT_ROOT= $HOST_CC" - HOST_CXX="NEXT_ROOT= $HOST_CXX" - fi + if test -n "$CROSS_COMPILE" ; then + dnl NEXT_ROOT will be in the environment, but it + dnl shouldn't be set for the build host. HOST_CXX is + dnl presently unused. + HOST_CC="NEXT_ROOT= $HOST_CC" + HOST_CXX="NEXT_ROOT= $HOST_CXX" + fi + else + dnl gcc >= 4.0 uses different paths than above, but knows + dnl how to find them itself. + CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}" + + dnl CPP needs to be set for AC_CHECK_HEADER. + CPP="$CPP -isysroot ${MACOS_SDK_DIR}" + + dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which + dnl has an ld that supports -syslibroot. Don't set + dnl NEXT_ROOT because it will be ignored and cause + dnl warnings when -syslibroot is specified. + if test "$GCC_VERSION_FULL" != "4.0.0" ; then + dnl gcc > 4.0.0 will pass -syslibroot to ld automatically + dnl based on the -isysroot it receives. + LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}" else - dnl gcc >= 4.0 uses different paths than above, but knows - dnl how to find them itself. - CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}" - - dnl CPP needs to be set for AC_CHECK_HEADER. - CPP="$CPP -isysroot ${MACOS_SDK_DIR}" - - dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which - dnl has an ld that supports -syslibroot. Don't set - dnl NEXT_ROOT because it will be ignored and cause - dnl warnings when -syslibroot is specified. - if test "$GCC_VERSION_FULL" != "4.0.0" ; then - dnl gcc > 4.0.0 will pass -syslibroot to ld automatically - dnl based on the -isysroot it receives. - LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}" - else - dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs - dnl to be explicit. - LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}" - fi + dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs + dnl to be explicit. + LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}" fi fi fi diff --git a/pr/src/misc/prdtoa.c b/pr/src/misc/prdtoa.c index f0963370..51b331ba 100644 --- a/pr/src/misc/prdtoa.c +++ b/pr/src/misc/prdtoa.c @@ -304,17 +304,6 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem; #else /* ifndef Bad_float_h */ #include "float.h" -/* - * MacOS 10.2 defines the macro FLT_ROUNDS to an internal function - * which does not exist on 10.1. We can safely #define it to 1 here - * to allow 10.2 builds to run on 10.1, since we can't use fesetround() - * (which does not exist on 10.1 either). - */ -#if defined(XP_MACOSX) && (!defined(MAC_OS_X_VERSION_10_2) || \ - MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2) -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 -#endif /* DT < 10.2 */ #endif /* Bad_float_h */ #ifndef __MATH_H__ diff --git a/pr/src/misc/prnetdb.c b/pr/src/misc/prnetdb.c index 6ad0242d..0f645b64 100644 --- a/pr/src/misc/prnetdb.c +++ b/pr/src/misc/prnetdb.c @@ -166,9 +166,7 @@ static PRBool _pr_have_inet6_if = PR_FALSE; #undef DEBUG_QUERY_IFS #if defined(AIX) \ - || (defined(DARWIN) && (!defined(HAVE_GETIFADDRS) \ - || (defined(XP_MACOSX) && (!defined(MAC_OS_X_VERSION_10_2) || \ - MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2)))) + || (defined(DARWIN) && !defined(HAVE_GETIFADDRS)) /* * Use SIOCGIFCONF ioctl on platforms that don't have routing |