Bug 1299919 - Set CPP/CXXCPP from python configure. r=chmanchester

This commit is contained in:
Mike Hommey 2016-09-06 08:22:36 +09:00
Родитель 9eb3978fde
Коммит 935ad653b8
6 изменённых файлов: 27 добавлений и 8 удалений

Просмотреть файл

@ -2,6 +2,14 @@ dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Several autoconf functions AC_REQUIRE AC_PROG_CPP/AC_PROG_CXXCPP,
dnl meaning they are called even when we don't call them explicitly.
dnl However, theses checks are not necessary and python configure sets
dnl the corresponding variables already, so just skip those tests
dnl entirely.
define([AC_PROG_CPP],[])
define([AC_PROG_CXXCPP],[])
AC_DEFUN([MOZ_TOOL_VARIABLES],
[
GNU_AS=

Просмотреть файл

@ -754,6 +754,23 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
valid_compiler.try_compile(check_msg='%s works' % what,
onerror=compiler_error)
# Set CPP/CXXCPP for both the build system and old-configure. We don't
# need to check this works for preprocessing, because we already relied
# on $CC -E/$CXX -E doing preprocessing work to validate the compiler
# in the first place.
if host_or_target == target:
pp_var = {
'C': 'CPP',
'C++': 'CXXCPP',
}[language]
preprocessor = depends_if(valid_compiler)(
lambda x: list(x.wrapper) + [x.compiler, '-E'] + list(x.flags))
set_config(pp_var, preprocessor)
add_old_configure_assignment(pp_var, preprocessor)
return valid_compiler

Просмотреть файл

@ -16,7 +16,7 @@ def generateLine(propName, extendedAttrs):
return " [%s] attribute DOMString %s;\n" % (", ".join(extendedAttrs),
propName)
def generate(output, idlFilename, preprocessorHeader):
cpp = shellutil.split(buildconfig.substs['CPP'])
cpp = list(buildconfig.substs['CPP'])
cpp += shellutil.split(buildconfig.substs['ACDEFINES'])
cpp.append(preprocessorHeader)
preprocessed = subprocess.check_output(cpp)

Просмотреть файл

@ -140,9 +140,6 @@ fi
MOZ_TOOL_VARIABLES
AC_PROG_CPP
AC_PROG_CXXCPP
dnl Special win32 checks
dnl ========================================================

Просмотреть файл

@ -10,7 +10,7 @@ import buildconfig
from mozbuild import shellutil
def get_properties(preprocessorHeader):
cpp = shellutil.split(buildconfig.substs['CPP'])
cpp = list(buildconfig.substs['CPP'])
cpp += shellutil.split(buildconfig.substs['ACDEFINES'])
cpp.append(preprocessorHeader)
preprocessed = subprocess.check_output(cpp)

Просмотреть файл

@ -241,9 +241,6 @@ fi
MOZ_TOOL_VARIABLES
AC_PROG_CPP
AC_PROG_CXXCPP
dnl ========================================================
dnl Special win32 checks
dnl ========================================================