bug 1198226 - Move HOST_{C,CXX}FLAGS to moz.build HOST_{CFLAGS,CXXFLAGS,DEFINES}. r=mshal

As part of this move, HOST_NSPR_MDCPUCFG needed to be changed to get the quoting right.
This commit is contained in:
Ted Mielczarek 2015-09-08 11:35:43 -04:00
parent 666675babf
commit 326ab27018
16 changed files with 43 additions and 103 deletions

View File

@ -5,6 +5,3 @@
ENABLE_CLANG_PLUGIN :=
include $(topsrcdir)/config/rules.mk
CXXFLAGS += -DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_TARGET_VERSION)
HOST_CXXFLAGS += -DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_HOST_VERSION)

View File

@ -19,3 +19,6 @@ FORCE_STATIC_LIB = True
NO_PGO = True
DISABLE_STL_WRAPPING = True
DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']
HOST_DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']

View File

@ -41,8 +41,6 @@ endif
include $(topsrcdir)/config/rules.mk
HOST_CFLAGS += -DUNICODE -D_UNICODE
ifndef JS_STANDALONE
ifndef MOZ_PROFILE_USE
# Generate a new buildid every time we "export" in config... that's only

View File

@ -45,3 +45,8 @@ if CONFIG['GNU_CC'] and CONFIG['MOZ_OPTIMIZE']:
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
HOST_DEFINES = {
'UNICODE': True,
'_UNICODE': True,
}

View File

@ -1837,7 +1837,7 @@ case "$host" in
HOST_CFLAGS="$HOST_CFLAGS -mwindows"
fi
HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
HOST_NSPR_MDCPUCFG='"md/_winnt.cfg"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
HOST_BIN_SUFFIX=.exe
case "$host" in
@ -1863,13 +1863,13 @@ case "$host" in
*-darwin*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
HOST_NSPR_MDCPUCFG='"md/_darwin.cfg"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
;;
*-linux*|*-kfreebsd*-gnu|*-gnu*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
HOST_NSPR_MDCPUCFG='"md/_linux.cfg"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
;;

View File

@ -1436,7 +1436,6 @@ case "$host" in
HOST_CFLAGS="$HOST_CFLAGS -mwindows"
fi
HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
HOST_BIN_SUFFIX=.exe
case "$host" in
@ -1462,13 +1461,11 @@ case "$host" in
*-darwin*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
;;
*-linux*|*-kfreebsd*-gnu|*-gnu*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
;;
@ -3718,7 +3715,6 @@ AC_SUBST(HOST_AR)
AC_SUBST(HOST_AR_FLAGS)
AC_SUBST(HOST_LD)
AC_SUBST(HOST_RANLIB)
AC_SUBST(HOST_NSPR_MDCPUCFG)
AC_SUBST(HOST_BIN_SUFFIX)
AC_SUBST(HOST_OS_ARCH)

View File

@ -1,23 +0,0 @@
# vim:set ts=8 sw=8 sts=8 noet:
#
# 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/.
# The mar executable is output into dist/host/bin since it is something that
# would only be used by our build system and should not itself be included in a
# Mozilla distribution.
HOST_CFLAGS += \
-DNO_SIGN_VERIFY \
$(DEFINES) \
$(NULL)
include $(topsrcdir)/config/rules.mk
ifdef CROSS_COMPILE
ifdef HOST_NSPR_MDCPUCFG
HOST_CFLAGS += -DMDCPUCFG=$(HOST_NSPR_MDCPUCFG)
CFLAGS += -DMDCPUCFG=$(HOST_NSPR_MDCPUCFG)
endif
endif

View File

@ -59,3 +59,13 @@ if CONFIG['HOST_OS_ARCH'] == 'WINNT':
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
HOST_CFLAGS += [
#TODO: bug 1200360 - don't pass make variables here
'$(DEFINES)',
]
HOST_DEFINES['NO_SIGN_VERIFY'] = True
if CONFIG['CROSS_COMPILE'] and CONFIG['HOST_NSPR_MDCPUCFG']:
HOST_DEFINES['MDCPUCFG'] = CONFIG['HOST_NSPR_MDCPUCFG']

View File

@ -1,16 +0,0 @@
# 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/.
include $(topsrcdir)/config/rules.mk
ifeq (arm,$(TARGET_CPU))
ifdef MOZ_THUMB2
HOST_CXXFLAGS += -DTARGET_THUMB
else
HOST_CXXFLAGS += -DTARGET_ARM
endif
endif
ifeq (x86,$(CPU_ARCH))
HOST_CXXFLAGS += -DTARGET_X86
endif

View File

@ -33,3 +33,12 @@ TEST_DIRS += ['tests']
HOST_OS_LIBS += [
'z',
]
if CONFIG['TARGET_CPU'] == 'arm':
if CONFIG['MOZ_THUMB2']:
HOST_DEFINES['TARGET_THUMB'] = True
else:
HOST_DEFINES['TARGET_ARM'] = True
if CONFIG['CPU_ARCH'] == 'x86':
HOST_DEFINES['TARGET_X86'] = True

View File

@ -1,30 +0,0 @@
# vim:set ts=8 sw=8 sts=8 noet:
# 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/.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
# This program is output to dist/host/bin because it is only needed by the
# build system and is not intended to be included in Mozilla distributions.
include $(topsrcdir)/config/rules.mk
HOST_CXXFLAGS += $(MOZ_BZ2_CFLAGS)

View File

@ -26,3 +26,4 @@ LOCAL_INCLUDES += [
'/toolkit/mozapps/update/updater',
]
HOST_CXXFLAGS += CONFIG['MOZ_BZ2_CFLAGS']

View File

@ -2,23 +2,8 @@
# 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/.
ifneq (WINNT,$(OS_TARGET))
ifdef MOZ_CRASHREPORTER
endif
endif
ifeq ($(OS_TARGET),Android)
TARGET_LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/android/include/
endif
# This kind of sucks.
ifeq (Linux,$(OS_ARCH))
HOST_CXXFLAGS += -DHAVE_A_OUT_H
OS_CXXFLAGS += -DHAVE_A_OUT_H
endif
ifeq (Darwin,$(OS_ARCH))
HOST_CXXFLAGS += -DHAVE_MACH_O_NLIST_H
OS_CXXFLAGS += -DHAVE_MACH_O_NLIST_H
endif
include $(topsrcdir)/config/rules.mk

View File

@ -1,7 +0,0 @@
# 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/.
# This code is only compiled for build-time tools,
# so enabling RTTI should be fine.
HOST_CXXFLAGS += -funsigned-char -frtti

View File

@ -18,3 +18,11 @@ if CONFIG['MOZ_CRASHREPORTER']:
# need static lib
FORCE_STATIC_LIB = True
# This code is only compiled for build-time tools,
# so enabling RTTI should be fine.
HOST_CXXFLAGS += [
'-frtti',
'-funsigned-char',
]

View File

@ -35,6 +35,8 @@ if CONFIG['OS_ARCH'] == 'Linux':
'linux/dump_symbols.cc',
'linux/elf_symbols_to_module.cc',
]
HOST_DEFINES['HAVE_A_OUT_H'] = True
DEFINES['HAVE_A_OUT_H'] = True
if CONFIG['OS_TARGET'] == 'Android':
pass
@ -69,6 +71,8 @@ if CONFIG['OS_ARCH'] == 'Darwin':
UNIFIED_SOURCES += [
'mac/dump_syms.mm',
]
HOST_DEFINES['HAVE_MACH_O_NLIST_H'] = True
DEFINES['HAVE_MACH_O_NLIST_H'] = True
if CONFIG['OS_TARGET'] == 'Android':
# We don't support unifying assembly files.