Bug 1292463 - Set MOZ_PGO subst/config from python configure. r?chmanchester
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1,14 +1,21 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+# PGO
+# ==============================================================
+option(env='MOZ_PGO', help='Build with profile guided optimizations')
+
+set_config('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
+add_old_configure_assignment('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
+
# yasm detection
# ==============================================================
yasm = check_prog('YASM', ['yasm'], allow_missing=True)
@depends_if(yasm)
@checking('yasm version')
def yasm_version(yasm):
version = check_cmd_output(
--- a/old-configure.in
+++ b/old-configure.in
@@ -4745,17 +4745,16 @@ fi
fi # COMPILE_ENVIRONMENT
AC_SUBST(MOZ_OPTIMIZE)
AC_SUBST(MOZ_FRAMEPTR_FLAGS)
AC_SUBST(MOZ_OPTIMIZE_FLAGS)
AC_SUBST(MOZ_OPTIMIZE_RUSTFLAGS)
AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
AC_SUBST_LIST(MOZ_ALLOW_HEAP_EXECUTE_FLAGS)
-AC_SUBST(MOZ_PGO)
AC_SUBST(MOZ_PGO_OPTIMIZE_FLAGS)
dnl ========================================================
dnl = Enable NS_StackWalk.
dnl ========================================================
# On Windows, NS_StackWalk will only work correctly if we have frame pointers
# available. That will only be true for non-optimized builds, debug builds or