Bug 1257445 - Move some platform-specific defines to moz.configure. r=gps
☠☠ backed out by 7f3a38541755 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 17 Mar 2016 17:13:53 +0900
changeset 327590 136f541c44069cd114ca981ee76f0d3b9ed0b870
parent 327589 fcb7f6fbe3baaedb90ab645beb48d43c20adfd37
child 327591 a63437a74f7a04b32acf896e4484e31b25558d8a
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1257445
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1257445 - Move some platform-specific defines to moz.configure. r=gps
build/moz.configure/init.configure
js/src/old-configure.in
old-configure.in
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -510,16 +510,36 @@ def host_variables(host):
     if host.kernel == 'kFreeBSD':
         os_arch = 'GNU_kFreeBSD'
     else:
         os_arch = host.kernel
     add_old_configure_assignment('HOST_OS_ARCH', os_arch)
     set_config('HOST_OS_ARCH', os_arch)
 
 
+@depends(target)
+def target_platform_defines(target):
+    if target.kernel == 'WINNT':
+        set_define('_WINDOWS', '1')
+        set_define('WIN32', '1')
+        set_define('XP_WIN', '1')
+        set_define('XP_WIN32', '1')
+    else:
+        set_define('XP_UNIX', '1')
+
+    if target.kernel == 'Darwin':
+        set_define('XP_DARWIN', '1')
+        if target.os == 'iOS':
+            set_define('XP_IOS', '1')
+        elif target.os == 'OSX':
+            set_define('XP_MACOSX', '1')
+    elif target.kernel == 'Linux':
+        set_define('XP_LINUX', '1')
+
+
 # The application/project to build
 # ==============================================================
 option('--enable-application', nargs=1, env='MOZ_BUILD_APP',
        help='Application to build. Same as --enable-project.')
 
 @depends('--enable-application', '--help')
 def application(app, help):
     if app:
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -922,17 +922,16 @@ esac
 MOZ_DOING_LTO(lto_is_enabled)
 
 dnl ========================================================
 dnl System overrides of the defaults for target
 dnl ========================================================
 
 case "$target" in
 *-darwin*)
-    AC_DEFINE(XP_DARWIN)
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
     MOZ_OPTIMIZE_FLAGS="-O3 -fno-stack-protector"
     CFLAGS="$CFLAGS -fno-common"
     CXXFLAGS="$CXXFLAGS -fno-common"
     DLL_SUFFIX=".dylib"
     DSO_LDOPTS=''
     STRIP="$STRIP -x -S"
@@ -1189,20 +1188,16 @@ case "$target" in
         dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
         dnl Probably also a compiler bug, but what can you do?
         PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
         LDFLAGS="$LDFLAGS -DYNAMICBASE"
         RCFLAGS="-nologo"
     fi
     AC_DEFINE(HAVE_SNPRINTF)
     AC_DEFINE(HAVE__MSIZE)
-    AC_DEFINE(_WINDOWS)
-    AC_DEFINE(WIN32)
-    AC_DEFINE(XP_WIN)
-    AC_DEFINE(XP_WIN32)
     AC_DEFINE(HW_THREADS)
     AC_DEFINE(STDC_HEADERS)
     AC_DEFINE(WIN32_LEAN_AND_MEAN)
     BIN_SUFFIX='.exe'
     MOZ_USER_DIR="Mozilla"
 
     case "$host_os" in
     cygwin*|msvc*|mks*)
@@ -2772,28 +2767,16 @@ AC_SUBST(MOZ_LINKER)
 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
 
 AC_CHECK_FUNCS(posix_fadvise posix_fallocate)
 
 dnl Set various defines and substitutions
 dnl ========================================================
 
-if test "$OS_ARCH" = "Darwin"; then
-  if test -n "$MOZ_IOS"; then
-    AC_DEFINE(XP_IOS)
-  else
-    AC_DEFINE(XP_MACOSX)
-  fi
-  AC_DEFINE(XP_DARWIN)
-  AC_DEFINE(XP_UNIX)
-elif test "$OS_ARCH" != "WINNT"; then
-  AC_DEFINE(XP_UNIX)
-fi
-
 if test "$MOZ_DEBUG"; then
     AC_DEFINE(MOZ_REFLOW_PERF)
     AC_DEFINE(MOZ_REFLOW_PERF_DSP)
 fi
 
 dnl ========================================================
 dnl Determine options to use for running the preprocessor.
 dnl ========================================================
--- a/old-configure.in
+++ b/old-configure.in
@@ -1326,22 +1326,18 @@ case "$target" in
 #endif],
                                    [],
                                    ac_cv_ios_target="yes",
                                    ac_cv_ios_target="no")])
     if test "$ac_cv_ios_target" = "yes" -a -z $MOZ_IOS; then
        AC_MSG_ERROR([targeting iOS but not using an iOS SDK?])
     fi
     if test -n "$MOZ_IOS"; then
-        AC_DEFINE(XP_IOS)
-        AC_DEFINE(XP_DARWIN)
         direct_nspr_config=1
     else
-        AC_DEFINE(XP_MACOSX)
-        AC_DEFINE(XP_DARWIN)
         # The ExceptionHandling framework is needed for Objective-C exception
         # logging code in nsObjCExceptions.h. Currently we only use that in debug
         # builds.
         MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
     fi
 
     if test "x$lto_is_enabled" = "xyes"; then
         echo "Skipping -dead_strip because lto is enabled."
@@ -1638,20 +1634,16 @@ case "$target" in
         dnl both SSSE3 and SSE4.1.
         HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1
         HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1
         dnl allow AVX2 code from VS2012
         HAVE_X86_AVX2=1
         MOZ_MEMORY=1
     fi
     AC_DEFINE(HAVE_SNPRINTF)
-    AC_DEFINE(_WINDOWS)
-    AC_DEFINE(WIN32)
-    AC_DEFINE(XP_WIN)
-    AC_DEFINE(XP_WIN32)
     AC_DEFINE(HW_THREADS)
     AC_DEFINE(STDC_HEADERS)
     AC_DEFINE(WIN32_LEAN_AND_MEAN)
     dnl See http://support.microsoft.com/kb/143208 to use STL
     AC_DEFINE(NOMINMAX)
     BIN_SUFFIX='.exe'
     MOZ_USER_DIR="Mozilla"
 
@@ -1734,23 +1726,16 @@ case "$target" in
     ;;
 
 esac
 
 AC_SUBST_LIST(MMX_FLAGS)
 AC_SUBST_LIST(SSE_FLAGS)
 AC_SUBST_LIST(SSE2_FLAGS)
 
-case "$target" in
-*-*linux*)
-    # Includes linux-android
-    AC_DEFINE(XP_LINUX)
-    ;;
-esac
-
 AC_SUBST(MOZ_LINKER)
 if test -n "$MOZ_LINKER"; then
   AC_DEFINE(MOZ_LINKER)
 fi
 
 dnl Only one oddball right now (QNX), but this gives us flexibility
 dnl if any other platforms need to override this in the future.
 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
@@ -7719,20 +7704,16 @@ if test "$MOZ_X11"; then
 
 fi # MOZ_X11
 
 fi # COMPILE_ENVIRONMENT
 
 dnl Set various defines and substitutions
 dnl ========================================================
 
-if test "$OS_ARCH" != "WINNT"; then
-  AC_DEFINE(XP_UNIX)
-fi
-
 if test "$MOZ_DEBUG"; then
     AC_DEFINE(MOZ_REFLOW_PERF)
     AC_DEFINE(MOZ_REFLOW_PERF_DSP)
 fi
 
 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK" ; then
     AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
     ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`