config/config.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config/config.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,908 @@
     1.4 +#
     1.5 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 +
     1.9 +#
    1.10 +# config.mk
    1.11 +#
    1.12 +# Determines the platform and builds the macros needed to load the
    1.13 +# appropriate platform-specific .mk file, then defines all (most?)
    1.14 +# of the generic macros.
    1.15 +#
    1.16 +
    1.17 +# Define an include-at-most-once flag
    1.18 +ifdef INCLUDED_CONFIG_MK
    1.19 +$(error Do not include config.mk twice!)
    1.20 +endif
    1.21 +INCLUDED_CONFIG_MK = 1
    1.22 +
    1.23 +EXIT_ON_ERROR = set -e; # Shell loops continue past errors without this.
    1.24 +
    1.25 +ifndef topsrcdir
    1.26 +topsrcdir	= $(DEPTH)
    1.27 +endif
    1.28 +
    1.29 +ifndef INCLUDED_AUTOCONF_MK
    1.30 +include $(DEPTH)/config/autoconf.mk
    1.31 +endif
    1.32 +
    1.33 +-include $(DEPTH)/.mozconfig.mk
    1.34 +
    1.35 +# Integrate with mozbuild-generated make files. We first verify that no
    1.36 +# variables provided by the automatically generated .mk files are
    1.37 +# present. If they are, this is a violation of the separation of
    1.38 +# responsibility between Makefile.in and mozbuild files.
    1.39 +_MOZBUILD_EXTERNAL_VARIABLES := \
    1.40 +  ANDROID_GENERATED_RESFILES \
    1.41 +  ANDROID_RES_DIRS \
    1.42 +  CMSRCS \
    1.43 +  CMMSRCS \
    1.44 +  CPP_UNIT_TESTS \
    1.45 +  DIRS \
    1.46 +  EXTRA_PP_COMPONENTS \
    1.47 +  EXTRA_PP_JS_MODULES \
    1.48 +  FORCE_SHARED_LIB \
    1.49 +  FORCE_STATIC_LIB \
    1.50 +  FINAL_LIBRARY \
    1.51 +  HOST_CSRCS \
    1.52 +  HOST_CMMSRCS \
    1.53 +  HOST_LIBRARY_NAME \
    1.54 +  HOST_PROGRAM \
    1.55 +  HOST_SIMPLE_PROGRAMS \
    1.56 +  IS_COMPONENT \
    1.57 +  JAR_MANIFEST \
    1.58 +  JAVA_JAR_TARGETS \
    1.59 +  JS_MODULES_PATH \
    1.60 +  LIBRARY_NAME \
    1.61 +  MODULE \
    1.62 +  MSVC_ENABLE_PGO \
    1.63 +  NO_DIST_INSTALL \
    1.64 +  PARALLEL_DIRS \
    1.65 +  PROGRAM \
    1.66 +  RESOURCE_FILES \
    1.67 +  SDK_HEADERS \
    1.68 +  SIMPLE_PROGRAMS \
    1.69 +  TEST_DIRS \
    1.70 +  TIERS \
    1.71 +  TOOL_DIRS \
    1.72 +  XPCSHELL_TESTS \
    1.73 +  XPIDL_MODULE \
    1.74 +  $(NULL)
    1.75 +
    1.76 +_DEPRECATED_VARIABLES := \
    1.77 +  ANDROID_RESFILES \
    1.78 +  LIBXUL_LIBRARY \
    1.79 +  MOCHITEST_A11Y_FILES \
    1.80 +  MOCHITEST_BROWSER_FILES \
    1.81 +  MOCHITEST_BROWSER_FILES_PARTS \
    1.82 +  MOCHITEST_CHROME_FILES \
    1.83 +  MOCHITEST_FILES \
    1.84 +  MOCHITEST_FILES_PARTS \
    1.85 +  MOCHITEST_METRO_FILES \
    1.86 +  MOCHITEST_ROBOCOP_FILES \
    1.87 +  SHORT_LIBNAME \
    1.88 +  $(NULL)
    1.89 +
    1.90 +ifndef EXTERNALLY_MANAGED_MAKE_FILE
    1.91 +# Using $(firstword) may not be perfect. But it should be good enough for most
    1.92 +# scenarios.
    1.93 +_current_makefile = $(CURDIR)/$(firstword $(MAKEFILE_LIST))
    1.94 +
    1.95 +$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\
    1.96 +    $(error Variable $(var) is defined in $(_current_makefile). It should only be defined in moz.build files),\
    1.97 +    ))
    1.98 +
    1.99 +$(foreach var,$(_DEPRECATED_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\
   1.100 +    $(error Variable $(var) is defined in $(_current_makefile). This variable has been deprecated. It does nothing. It must be removed in order to build)\
   1.101 +    ))
   1.102 +
   1.103 +# Import the automatically generated backend file. If this file doesn't exist,
   1.104 +# the backend hasn't been properly configured. We want this to be a fatal
   1.105 +# error, hence not using "-include".
   1.106 +ifndef STANDALONE_MAKEFILE
   1.107 +GLOBAL_DEPS += backend.mk
   1.108 +include backend.mk
   1.109 +endif
   1.110 +
   1.111 +# Freeze the values specified by moz.build to catch them if they fail.
   1.112 +
   1.113 +$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(eval $(var)_FROZEN := '$($(var))'))
   1.114 +$(foreach var,$(_DEPRECATED_VARIABLES),$(eval $(var)_FROZEN := '$($(var))'))
   1.115 +
   1.116 +CHECK_MOZBUILD_VARIABLES = $(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES), \
   1.117 +  $(if $(subst $($(var)_FROZEN),,'$($(var))'), \
   1.118 +	  $(error Variable $(var) is defined in $(_current_makefile). It should only be defined in moz.build files),\
   1.119 +  )) $(foreach var,$(_DEPRECATED_VARIABLES), \
   1.120 +	$(if $(subst $($(var)_FROZEN),,'$($(var))'), \
   1.121 +    $(error Variable $(var) is defined in $(_current_makefile). This variable has been deprecated. It does nothing. It must be removed in order to build),\
   1.122 +    ))
   1.123 +
   1.124 +endif
   1.125 +
   1.126 +space = $(NULL) $(NULL)
   1.127 +
   1.128 +# Include defs.mk files that can be found in $(srcdir)/$(DEPTH),
   1.129 +# $(srcdir)/$(DEPTH-1), $(srcdir)/$(DEPTH-2), etc., and $(srcdir)
   1.130 +# where $(DEPTH-1) is one level less of depth, $(DEPTH-2), two, etc.
   1.131 +# i.e. for DEPTH=../../.., DEPTH-1 is ../.. and DEPTH-2 is ..
   1.132 +# These defs.mk files are used to define variables in a directory
   1.133 +# and all its subdirectories, recursively.
   1.134 +__depth := $(subst /, ,$(DEPTH))
   1.135 +ifeq (.,$(__depth))
   1.136 +__depth :=
   1.137 +endif
   1.138 +$(foreach __d,$(__depth) .,$(eval __depth = $(wordlist 2,$(words $(__depth)),$(__depth))$(eval -include $(subst $(space),/,$(strip $(srcdir) $(__depth) defs.mk)))))
   1.139 +
   1.140 +COMMA = ,
   1.141 +
   1.142 +# Sanity check some variables
   1.143 +CHECK_VARS := \
   1.144 + XPI_NAME \
   1.145 + LIBRARY_NAME \
   1.146 + MODULE \
   1.147 + DEPTH \
   1.148 + XPI_PKGNAME \
   1.149 + INSTALL_EXTENSION_ID \
   1.150 + SHARED_LIBRARY_NAME \
   1.151 + STATIC_LIBRARY_NAME \
   1.152 + $(NULL)
   1.153 +
   1.154 +# checks for internal spaces or trailing spaces in the variable
   1.155 +# named by $x
   1.156 +check-variable = $(if $(filter-out 0 1,$(words $($(x))z)),$(error Spaces are not allowed in $(x)))
   1.157 +
   1.158 +$(foreach x,$(CHECK_VARS),$(check-variable))
   1.159 +
   1.160 +ifndef INCLUDED_FUNCTIONS_MK
   1.161 +include $(topsrcdir)/config/makefiles/functions.mk
   1.162 +endif
   1.163 +
   1.164 +RM = rm -f
   1.165 +
   1.166 +# LIBXUL_DIST is not defined under js/src, thus we make it mean DIST there.
   1.167 +LIBXUL_DIST ?= $(DIST)
   1.168 +
   1.169 +# FINAL_TARGET specifies the location into which we copy end-user-shipped
   1.170 +# build products (typelibs, components, chrome). It may already be specified by
   1.171 +# a moz.build file.
   1.172 +#
   1.173 +# If XPI_NAME is set, the files will be shipped to $(DIST)/xpi-stage/$(XPI_NAME)
   1.174 +# instead of $(DIST)/bin. In both cases, if DIST_SUBDIR is set, the files will be
   1.175 +# shipped to a $(DIST_SUBDIR) subdirectory.
   1.176 +FINAL_TARGET ?= $(if $(XPI_NAME),$(DIST)/xpi-stage/$(XPI_NAME),$(DIST)/bin)$(DIST_SUBDIR:%=/%)
   1.177 +# Override the stored value for the check to make sure that the variable is not
   1.178 +# redefined in the Makefile.in value.
   1.179 +FINAL_TARGET_FROZEN := '$(FINAL_TARGET)'
   1.180 +
   1.181 +ifdef XPI_NAME
   1.182 +DEFINES += -DXPI_NAME=$(XPI_NAME)
   1.183 +endif
   1.184 +
   1.185 +# The VERSION_NUMBER is suffixed onto the end of the DLLs we ship.
   1.186 +VERSION_NUMBER		= 50
   1.187 +
   1.188 +ifeq ($(HOST_OS_ARCH),WINNT)
   1.189 +win_srcdir	:= $(subst $(topsrcdir),$(WIN_TOP_SRC),$(srcdir))
   1.190 +BUILD_TOOLS	= $(WIN_TOP_SRC)/build/unix
   1.191 +else
   1.192 +win_srcdir	:= $(srcdir)
   1.193 +BUILD_TOOLS	= $(topsrcdir)/build/unix
   1.194 +endif
   1.195 +
   1.196 +CONFIG_TOOLS	= $(MOZ_BUILD_ROOT)/config
   1.197 +AUTOCONF_TOOLS	= $(topsrcdir)/build/autoconf
   1.198 +
   1.199 +# Disable MOZ_PSEUDO_DERECURSE when it contains no-pymake and we're running
   1.200 +# pymake. This can be removed when no-pymake is removed from the default in
   1.201 +# build/autoconf/compiler-opts.m4.
   1.202 +ifdef .PYMAKE
   1.203 +comma = ,
   1.204 +ifneq (,$(filter no-pymake,$(subst $(comma), ,$(MOZ_PSEUDO_DERECURSE))))
   1.205 +MOZ_PSEUDO_DERECURSE :=
   1.206 +endif
   1.207 +endif
   1.208 +
   1.209 +# Disable MOZ_PSEUDO_DERECURSE on PGO builds until it's fixed.
   1.210 +ifneq (,$(MOZ_PROFILE_USE)$(MOZ_PROFILE_GENERATE))
   1.211 +MOZ_PSEUDO_DERECURSE :=
   1.212 +endif
   1.213 +
   1.214 +#
   1.215 +# Strip off the excessively long version numbers on these platforms,
   1.216 +# but save the version to allow multiple versions of the same base
   1.217 +# platform to be built in the same tree.
   1.218 +#
   1.219 +ifneq (,$(filter FreeBSD HP-UX Linux NetBSD OpenBSD SunOS,$(OS_ARCH)))
   1.220 +OS_RELEASE	:= $(basename $(OS_RELEASE))
   1.221 +
   1.222 +# Allow the user to ignore the OS_VERSION, which is usually irrelevant.
   1.223 +ifdef WANT_MOZILLA_CONFIG_OS_VERSION
   1.224 +OS_VERS		:= $(suffix $(OS_RELEASE))
   1.225 +OS_VERSION	:= $(shell echo $(OS_VERS) | sed 's/-.*//')
   1.226 +endif
   1.227 +
   1.228 +endif
   1.229 +
   1.230 +OS_CONFIG	:= $(OS_ARCH)$(OS_RELEASE)
   1.231 +
   1.232 +ifdef _MSC_VER
   1.233 +CC_WRAPPER ?= $(call py_action,cl)
   1.234 +CXX_WRAPPER ?= $(call py_action,cl)
   1.235 +endif # _MSC_VER
   1.236 +
   1.237 +CC := $(CC_WRAPPER) $(CC)
   1.238 +CXX := $(CXX_WRAPPER) $(CXX)
   1.239 +MKDIR ?= mkdir
   1.240 +SLEEP ?= sleep
   1.241 +TOUCH ?= touch
   1.242 +
   1.243 +ifdef .PYMAKE
   1.244 +PYCOMMANDPATH += $(PYTHON_SITE_PACKAGES)
   1.245 +endif
   1.246 +
   1.247 +PYTHON_PATH = $(PYTHON) $(topsrcdir)/config/pythonpath.py
   1.248 +
   1.249 +# determine debug-related options
   1.250 +_DEBUG_ASFLAGS :=
   1.251 +_DEBUG_CFLAGS :=
   1.252 +_DEBUG_LDFLAGS :=
   1.253 +
   1.254 +ifdef MOZ_DEBUG
   1.255 +  _DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
   1.256 +  XULPPFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
   1.257 +else
   1.258 +  _DEBUG_CFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
   1.259 +  XULPPFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
   1.260 +endif
   1.261 +
   1.262 +ifneq (,$(MOZ_DEBUG)$(MOZ_DEBUG_SYMBOLS))
   1.263 +  ifeq ($(AS),yasm)
   1.264 +    ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
   1.265 +      _DEBUG_ASFLAGS += -g cv8
   1.266 +    else
   1.267 +      ifneq ($(OS_ARCH),Darwin)
   1.268 +        _DEBUG_ASFLAGS += -g dwarf2
   1.269 +      endif
   1.270 +    endif
   1.271 +  else
   1.272 +    _DEBUG_ASFLAGS += $(MOZ_DEBUG_FLAGS)
   1.273 +  endif
   1.274 +  _DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
   1.275 +  _DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
   1.276 +endif
   1.277 +
   1.278 +MOZALLOC_LIB = $(call EXPAND_LIBNAME_PATH,mozalloc,$(DIST)/lib)
   1.279 +
   1.280 +ASFLAGS += $(_DEBUG_ASFLAGS)
   1.281 +OS_CFLAGS += $(_DEBUG_CFLAGS)
   1.282 +OS_CXXFLAGS += $(_DEBUG_CFLAGS)
   1.283 +OS_LDFLAGS += $(_DEBUG_LDFLAGS)
   1.284 +
   1.285 +# XXX: What does this? Bug 482434 filed for better explanation.
   1.286 +ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
   1.287 +ifdef MOZ_DEBUG
   1.288 +ifneq (,$(MOZ_BROWSE_INFO)$(MOZ_BSCFILE))
   1.289 +OS_CFLAGS += -FR
   1.290 +OS_CXXFLAGS += -FR
   1.291 +endif
   1.292 +else # ! MOZ_DEBUG
   1.293 +
   1.294 +# MOZ_DEBUG_SYMBOLS generates debug symbols in separate PDB files.
   1.295 +# Used for generating an optimized build with debugging symbols.
   1.296 +# Used in the Windows nightlies to generate symbols for crash reporting.
   1.297 +ifdef MOZ_DEBUG_SYMBOLS
   1.298 +OS_CXXFLAGS += -UDEBUG -DNDEBUG
   1.299 +OS_CFLAGS += -UDEBUG -DNDEBUG
   1.300 +ifdef HAVE_64BIT_OS
   1.301 +OS_LDFLAGS += -DEBUG -OPT:REF,ICF
   1.302 +else
   1.303 +OS_LDFLAGS += -DEBUG -OPT:REF
   1.304 +endif
   1.305 +endif
   1.306 +
   1.307 +#
   1.308 +# Handle trace-malloc and DMD in optimized builds.
   1.309 +# No opt to give sane callstacks.
   1.310 +#
   1.311 +ifneq (,$(NS_TRACE_MALLOC)$(MOZ_DMD))
   1.312 +MOZ_OPTIMIZE_FLAGS=-Zi -Od -UDEBUG -DNDEBUG
   1.313 +ifdef HAVE_64BIT_OS
   1.314 +OS_LDFLAGS = -DEBUG -OPT:REF,ICF
   1.315 +else
   1.316 +OS_LDFLAGS = -DEBUG -OPT:REF
   1.317 +endif
   1.318 +endif # NS_TRACE_MALLOC || MOZ_DMD
   1.319 +
   1.320 +endif # MOZ_DEBUG
   1.321 +
   1.322 +# We don't build a static CRT when building a custom CRT,
   1.323 +# it appears to be broken. So don't link to jemalloc if
   1.324 +# the Makefile wants static CRT linking.
   1.325 +ifeq ($(MOZ_MEMORY)_$(USE_STATIC_LIBS),1_1)
   1.326 +# Disable default CRT libs and add the right lib path for the linker
   1.327 +MOZ_GLUE_LDFLAGS=
   1.328 +endif
   1.329 +
   1.330 +endif # WINNT && !GNU_CC
   1.331 +
   1.332 +ifdef MOZ_GLUE_PROGRAM_LDFLAGS
   1.333 +DEFINES += -DMOZ_GLUE_IN_PROGRAM
   1.334 +else
   1.335 +MOZ_GLUE_PROGRAM_LDFLAGS=$(MOZ_GLUE_LDFLAGS)
   1.336 +endif
   1.337 +
   1.338 +#
   1.339 +# Build using PIC by default
   1.340 +#
   1.341 +_ENABLE_PIC=1
   1.342 +
   1.343 +# Determine if module being compiled is destined
   1.344 +# to be merged into libxul
   1.345 +
   1.346 +ifneq (,$(filter xul xul-%,$(FINAL_LIBRARY) $(LIBRARY_NAME)))
   1.347 +  LIBXUL_LIBRARY := 1
   1.348 +endif
   1.349 +
   1.350 +ifdef LIBXUL_LIBRARY
   1.351 +ifdef IS_COMPONENT
   1.352 +$(error IS_COMPONENT is set, but is not compatible with LIBXUL_LIBRARY)
   1.353 +endif
   1.354 +ifeq (,$(filter xul xul-%,$(LIBRARY_NAME)))
   1.355 +FORCE_STATIC_LIB=1
   1.356 +endif
   1.357 +endif
   1.358 +
   1.359 +# If we are building this component into an extension/xulapp, it cannot be
   1.360 +# statically linked. In the future we may want to add a xulapp meta-component
   1.361 +# build option.
   1.362 +
   1.363 +ifdef XPI_NAME
   1.364 +ifdef IS_COMPONENT
   1.365 +EXPORT_LIBRARY=
   1.366 +FORCE_STATIC_LIB=
   1.367 +FORCE_SHARED_LIB=1
   1.368 +endif
   1.369 +endif
   1.370 +
   1.371 +ifndef SHARED_LIBRARY_NAME
   1.372 +ifdef LIBRARY_NAME
   1.373 +SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
   1.374 +endif
   1.375 +endif
   1.376 +
   1.377 +ifndef STATIC_LIBRARY_NAME
   1.378 +ifdef LIBRARY_NAME
   1.379 +STATIC_LIBRARY_NAME=$(LIBRARY_NAME)
   1.380 +endif
   1.381 +endif
   1.382 +
   1.383 +# PGO on MSVC is opt-in
   1.384 +ifdef _MSC_VER
   1.385 +ifndef MSVC_ENABLE_PGO
   1.386 +NO_PROFILE_GUIDED_OPTIMIZE = 1
   1.387 +endif
   1.388 +endif
   1.389 +
   1.390 +# No sense in profiling tools
   1.391 +ifdef INTERNAL_TOOLS
   1.392 +NO_PROFILE_GUIDED_OPTIMIZE = 1
   1.393 +endif
   1.394 +
   1.395 +# Don't build SIMPLE_PROGRAMS with PGO, since they don't need it anyway,
   1.396 +# and we don't have the same build logic to re-link them in the second pass.
   1.397 +ifdef SIMPLE_PROGRAMS
   1.398 +NO_PROFILE_GUIDED_OPTIMIZE = 1
   1.399 +endif
   1.400 +
   1.401 +# No sense in profiling unit tests
   1.402 +ifdef CPP_UNIT_TESTS
   1.403 +NO_PROFILE_GUIDED_OPTIMIZE = 1
   1.404 +endif
   1.405 +
   1.406 +# Enable profile-based feedback
   1.407 +ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE))
   1.408 +ifdef MOZ_PROFILE_GENERATE
   1.409 +OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
   1.410 +OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
   1.411 +OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
   1.412 +ifeq (WINNT,$(OS_ARCH))
   1.413 +AR_FLAGS += -LTCG
   1.414 +endif
   1.415 +endif # MOZ_PROFILE_GENERATE
   1.416 +
   1.417 +ifdef MOZ_PROFILE_USE
   1.418 +OS_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS))
   1.419 +OS_CXXFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_USE_CFLAGS))
   1.420 +OS_LDFLAGS += $(PROFILE_USE_LDFLAGS)
   1.421 +ifeq (WINNT,$(OS_ARCH))
   1.422 +AR_FLAGS += -LTCG
   1.423 +endif
   1.424 +endif # MOZ_PROFILE_USE
   1.425 +endif # NO_PROFILE_GUIDED_OPTIMIZE
   1.426 +
   1.427 +ifdef _MSC_VER
   1.428 +OS_LDFLAGS += $(DELAYLOAD_LDFLAGS)
   1.429 +endif # _MSC_VER
   1.430 +
   1.431 +ifneq (,$(LIBXUL_LIBRARY))
   1.432 +DEFINES += -DMOZILLA_INTERNAL_API
   1.433 +endif
   1.434 +
   1.435 +# Force XPCOM/widget/gfx methods to be _declspec(dllexport) when we're
   1.436 +# building libxul libraries
   1.437 +ifdef LIBXUL_LIBRARY
   1.438 +DEFINES += \
   1.439 +	  -DIMPL_LIBXUL \
   1.440 +		$(NULL)
   1.441 +
   1.442 +ifndef JS_SHARED_LIBRARY
   1.443 +DEFINES += -DSTATIC_EXPORTABLE_JS_API
   1.444 +endif
   1.445 +endif
   1.446 +
   1.447 +MAKE_JARS_FLAGS = \
   1.448 +	-t $(topsrcdir) \
   1.449 +	-f $(MOZ_CHROME_FILE_FORMAT) \
   1.450 +	$(NULL)
   1.451 +
   1.452 +ifdef USE_EXTENSION_MANIFEST
   1.453 +MAKE_JARS_FLAGS += -e
   1.454 +endif
   1.455 +
   1.456 +TAR_CREATE_FLAGS = -chf
   1.457 +
   1.458 +#
   1.459 +# Personal makefile customizations go in these optional make include files.
   1.460 +#
   1.461 +MY_CONFIG	:= $(DEPTH)/config/myconfig.mk
   1.462 +MY_RULES	:= $(DEPTH)/config/myrules.mk
   1.463 +
   1.464 +#
   1.465 +# Default command macros; can be overridden in <arch>.mk.
   1.466 +#
   1.467 +CCC = $(CXX)
   1.468 +
   1.469 +# Java macros
   1.470 +JAVA_GEN_DIR  = _javagen
   1.471 +JAVA_DIST_DIR = $(DEPTH)/$(JAVA_GEN_DIR)
   1.472 +JAVA_IFACES_PKG_NAME = org/mozilla/interfaces
   1.473 +
   1.474 +OS_INCLUDES += $(MOZ_JPEG_CFLAGS) $(MOZ_PNG_CFLAGS) $(MOZ_ZLIB_CFLAGS) $(MOZ_PIXMAN_CFLAGS)
   1.475 +
   1.476 +# NSPR_CFLAGS and NSS_CFLAGS must appear ahead of OS_INCLUDES to avoid Linux
   1.477 +# builds wrongly picking up system NSPR/NSS header files.
   1.478 +INCLUDES = \
   1.479 +  -I$(srcdir) \
   1.480 +  -I. \
   1.481 +  $(LOCAL_INCLUDES) \
   1.482 +  -I$(DIST)/include \
   1.483 +  $(if $(LIBXUL_SDK),-I$(LIBXUL_SDK)/include) \
   1.484 +  $(NSPR_CFLAGS) $(NSS_CFLAGS) \
   1.485 +  $(OS_INCLUDES) \
   1.486 +  $(NULL)
   1.487 +
   1.488 +include $(topsrcdir)/config/static-checking-config.mk
   1.489 +
   1.490 +CFLAGS		= $(OS_CPPFLAGS) $(OS_CFLAGS)
   1.491 +CXXFLAGS	= $(OS_CPPFLAGS) $(OS_CXXFLAGS)
   1.492 +LDFLAGS		= $(OS_LDFLAGS) $(MOZBUILD_LDFLAGS) $(MOZ_FIX_LINK_PATHS)
   1.493 +
   1.494 +# Allow each module to override the *default* optimization settings
   1.495 +# by setting MODULE_OPTIMIZE_FLAGS if the developer has not given
   1.496 +# arguments to --enable-optimize
   1.497 +ifdef MOZ_OPTIMIZE
   1.498 +ifeq (1,$(MOZ_OPTIMIZE))
   1.499 +ifdef MODULE_OPTIMIZE_FLAGS
   1.500 +CFLAGS		+= $(MODULE_OPTIMIZE_FLAGS)
   1.501 +CXXFLAGS	+= $(MODULE_OPTIMIZE_FLAGS)
   1.502 +else
   1.503 +ifneq (,$(if $(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE),$(MOZ_PGO_OPTIMIZE_FLAGS)))
   1.504 +CFLAGS		+= $(MOZ_PGO_OPTIMIZE_FLAGS)
   1.505 +CXXFLAGS	+= $(MOZ_PGO_OPTIMIZE_FLAGS)
   1.506 +else
   1.507 +CFLAGS		+= $(MOZ_OPTIMIZE_FLAGS)
   1.508 +CXXFLAGS	+= $(MOZ_OPTIMIZE_FLAGS)
   1.509 +endif # neq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
   1.510 +endif # MODULE_OPTIMIZE_FLAGS
   1.511 +else
   1.512 +CFLAGS		+= $(MOZ_OPTIMIZE_FLAGS)
   1.513 +CXXFLAGS	+= $(MOZ_OPTIMIZE_FLAGS)
   1.514 +endif # MOZ_OPTIMIZE == 1
   1.515 +LDFLAGS		+= $(MOZ_OPTIMIZE_LDFLAGS)
   1.516 +endif # MOZ_OPTIMIZE
   1.517 +
   1.518 +ifdef CROSS_COMPILE
   1.519 +HOST_CFLAGS	+= $(HOST_OPTIMIZE_FLAGS)
   1.520 +else
   1.521 +ifdef MOZ_OPTIMIZE
   1.522 +ifeq (1,$(MOZ_OPTIMIZE))
   1.523 +ifdef MODULE_OPTIMIZE_FLAGS
   1.524 +HOST_CFLAGS	+= $(MODULE_OPTIMIZE_FLAGS)
   1.525 +else
   1.526 +HOST_CFLAGS	+= $(MOZ_OPTIMIZE_FLAGS)
   1.527 +endif # MODULE_OPTIMIZE_FLAGS
   1.528 +else
   1.529 +HOST_CFLAGS	+= $(MOZ_OPTIMIZE_FLAGS)
   1.530 +endif # MOZ_OPTIMIZE == 1
   1.531 +endif # MOZ_OPTIMIZE
   1.532 +endif # CROSS_COMPILE
   1.533 +
   1.534 +CFLAGS += $(MOZ_FRAMEPTR_FLAGS)
   1.535 +CXXFLAGS += $(MOZ_FRAMEPTR_FLAGS)
   1.536 +
   1.537 +# Check for FAIL_ON_WARNINGS & FAIL_ON_WARNINGS_DEBUG (Shorthand for Makefiles
   1.538 +# to request that we use the 'warnings as errors' compile flags)
   1.539 +
   1.540 +# NOTE: First, we clear FAIL_ON_WARNINGS[_DEBUG] if we're doing a Windows PGO
   1.541 +# build, since WARNINGS_AS_ERRORS has been suspected of causing isuses in that
   1.542 +# situation. (See bug 437002.)
   1.543 +ifeq (WINNT_1,$(OS_ARCH)_$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
   1.544 +FAIL_ON_WARNINGS_DEBUG=
   1.545 +FAIL_ON_WARNINGS=
   1.546 +endif # WINNT && (MOS_PROFILE_GENERATE ^ MOZ_PROFILE_USE)
   1.547 +
   1.548 +# Now, check for debug version of flag; it turns on normal flag in debug builds.
   1.549 +ifdef FAIL_ON_WARNINGS_DEBUG
   1.550 +ifdef MOZ_DEBUG
   1.551 +FAIL_ON_WARNINGS = 1
   1.552 +endif # MOZ_DEBUG
   1.553 +endif # FAIL_ON_WARNINGS_DEBUG
   1.554 +
   1.555 +# Check for normal version of flag, and add WARNINGS_AS_ERRORS if it's set to 1.
   1.556 +ifdef FAIL_ON_WARNINGS
   1.557 +CXXFLAGS += $(WARNINGS_AS_ERRORS)
   1.558 +CFLAGS   += $(WARNINGS_AS_ERRORS)
   1.559 +endif # FAIL_ON_WARNINGS
   1.560 +
   1.561 +ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
   1.562 +#// Currently, unless USE_STATIC_LIBS is defined, the multithreaded
   1.563 +#// DLL version of the RTL is used...
   1.564 +#//
   1.565 +#//------------------------------------------------------------------------
   1.566 +ifdef USE_STATIC_LIBS
   1.567 +RTL_FLAGS=-MT          # Statically linked multithreaded RTL
   1.568 +ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
   1.569 +ifndef MOZ_NO_DEBUG_RTL
   1.570 +RTL_FLAGS=-MTd         # Statically linked multithreaded MSVC4.0 debug RTL
   1.571 +endif
   1.572 +endif # MOZ_DEBUG || NS_TRACE_MALLOC
   1.573 +
   1.574 +else # !USE_STATIC_LIBS
   1.575 +
   1.576 +RTL_FLAGS=-MD          # Dynamically linked, multithreaded RTL
   1.577 +ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
   1.578 +ifndef MOZ_NO_DEBUG_RTL
   1.579 +RTL_FLAGS=-MDd         # Dynamically linked, multithreaded MSVC4.0 debug RTL
   1.580 +endif
   1.581 +endif # MOZ_DEBUG || NS_TRACE_MALLOC
   1.582 +endif # USE_STATIC_LIBS
   1.583 +endif # WINNT && !GNU_CC
   1.584 +
   1.585 +ifeq ($(OS_ARCH),Darwin)
   1.586 +# Compiling ObjC requires an Apple compiler anyway, so it's ok to set
   1.587 +# host CMFLAGS here.
   1.588 +HOST_CMFLAGS += -fobjc-exceptions
   1.589 +HOST_CMMFLAGS += -fobjc-exceptions
   1.590 +OS_COMPILE_CMFLAGS += -fobjc-exceptions
   1.591 +OS_COMPILE_CMMFLAGS += -fobjc-exceptions
   1.592 +ifeq ($(MOZ_WIDGET_TOOLKIT),uikit)
   1.593 +OS_COMPILE_CMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
   1.594 +OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
   1.595 +endif
   1.596 +endif
   1.597 +
   1.598 +COMPILE_CFLAGS	= $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_CPPFLAGS) $(OS_COMPILE_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS) $(EXTRA_COMPILE_FLAGS)
   1.599 +COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_CPPFLAGS) $(OS_COMPILE_CXXFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS) $(EXTRA_COMPILE_FLAGS)
   1.600 +COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS) $(EXTRA_COMPILE_FLAGS)
   1.601 +COMPILE_CMMFLAGS = $(OS_COMPILE_CMMFLAGS) $(MOZBUILD_CMMFLAGS) $(EXTRA_COMPILE_FLAGS)
   1.602 +ASFLAGS += $(EXTRA_ASSEMBLER_FLAGS)
   1.603 +
   1.604 +ifndef CROSS_COMPILE
   1.605 +HOST_CFLAGS += $(RTL_FLAGS)
   1.606 +endif
   1.607 +
   1.608 +#
   1.609 +# Name of the binary code directories
   1.610 +#
   1.611 +# Override defaults
   1.612 +
   1.613 +# We need to know where to find the libraries we
   1.614 +# put on the link line for binaries, and should
   1.615 +# we link statically or dynamic?  Assuming dynamic for now.
   1.616 +
   1.617 +ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
   1.618 +LIBS_DIR	= -L$(DIST)/bin -L$(DIST)/lib
   1.619 +ifdef LIBXUL_SDK
   1.620 +LIBS_DIR	+= -L$(LIBXUL_SDK)/bin -L$(LIBXUL_SDK)/lib
   1.621 +endif
   1.622 +endif
   1.623 +
   1.624 +# Default location of include files
   1.625 +ifndef LIBXUL_SDK
   1.626 +IDL_PARSER_DIR = $(topsrcdir)/xpcom/idl-parser
   1.627 +IDL_PARSER_CACHE_DIR = $(DEPTH)/xpcom/idl-parser
   1.628 +else
   1.629 +IDL_PARSER_DIR = $(LIBXUL_SDK)/sdk/bin
   1.630 +IDL_PARSER_CACHE_DIR = $(LIBXUL_SDK)/sdk/bin
   1.631 +endif
   1.632 +
   1.633 +SDK_LIB_DIR = $(DIST)/sdk/lib
   1.634 +SDK_BIN_DIR = $(DIST)/sdk/bin
   1.635 +
   1.636 +DEPENDENCIES	= .md
   1.637 +
   1.638 +MOZ_COMPONENT_LIBS=$(XPCOM_LIBS) $(MOZ_COMPONENT_NSPR_LIBS)
   1.639 +
   1.640 +ifdef MACOSX_DEPLOYMENT_TARGET
   1.641 +export MACOSX_DEPLOYMENT_TARGET
   1.642 +endif # MACOSX_DEPLOYMENT_TARGET
   1.643 +
   1.644 +ifdef MOZ_USING_CCACHE
   1.645 +ifdef CLANG_CXX
   1.646 +export CCACHE_CPP2=1
   1.647 +endif
   1.648 +endif
   1.649 +
   1.650 +# Set link flags according to whether we want a console.
   1.651 +ifdef MOZ_WINCONSOLE
   1.652 +ifeq ($(MOZ_WINCONSOLE),1)
   1.653 +ifeq ($(OS_ARCH),WINNT)
   1.654 +ifdef GNU_CC
   1.655 +WIN32_EXE_LDFLAGS	+= -mconsole
   1.656 +else
   1.657 +WIN32_EXE_LDFLAGS	+= -SUBSYSTEM:CONSOLE
   1.658 +endif
   1.659 +endif
   1.660 +else # MOZ_WINCONSOLE
   1.661 +ifeq ($(OS_ARCH),WINNT)
   1.662 +ifdef GNU_CC
   1.663 +WIN32_EXE_LDFLAGS	+= -mwindows
   1.664 +else
   1.665 +WIN32_EXE_LDFLAGS	+= -SUBSYSTEM:WINDOWS
   1.666 +endif
   1.667 +endif
   1.668 +endif
   1.669 +endif
   1.670 +
   1.671 +ifdef _MSC_VER
   1.672 +ifeq ($(CPU_ARCH),x86_64)
   1.673 +# set stack to 2MB on x64 build.  See bug 582910
   1.674 +WIN32_EXE_LDFLAGS	+= -STACK:2097152
   1.675 +endif
   1.676 +endif
   1.677 +
   1.678 +# If we're building a component on MSVC, we don't want to generate an
   1.679 +# import lib, because that import lib will collide with the name of a
   1.680 +# static version of the same library.
   1.681 +ifeq ($(GNU_LD)$(OS_ARCH),WINNT)
   1.682 +ifdef IS_COMPONENT
   1.683 +LDFLAGS += -IMPLIB:fake.lib
   1.684 +DELETE_AFTER_LINK = fake.lib fake.exp
   1.685 +endif
   1.686 +endif
   1.687 +
   1.688 +#
   1.689 +# Include any personal overrides the user might think are needed.
   1.690 +#
   1.691 +-include $(topsrcdir)/$(MOZ_BUILD_APP)/app-config.mk
   1.692 +-include $(MY_CONFIG)
   1.693 +
   1.694 +######################################################################
   1.695 +
   1.696 +GARBAGE		+= $(DEPENDENCIES) core $(wildcard core.[0-9]*) $(wildcard *.err) $(wildcard *.pure) $(wildcard *_pure_*.o) Templates.DB
   1.697 +
   1.698 +ifeq ($(OS_ARCH),Darwin)
   1.699 +ifndef NSDISTMODE
   1.700 +NSDISTMODE=absolute_symlink
   1.701 +endif
   1.702 +PWD := $(CURDIR)
   1.703 +endif
   1.704 +
   1.705 +NSINSTALL_PY := $(PYTHON) $(abspath $(topsrcdir)/config/nsinstall.py)
   1.706 +# For Pymake, wherever we use nsinstall.py we're also going to try to make it
   1.707 +# a native command where possible. Since native commands can't be used outside
   1.708 +# of single-line commands, we continue to provide INSTALL for general use.
   1.709 +# Single-line commands should be switched over to install_cmd.
   1.710 +NSINSTALL_NATIVECMD := %nsinstall nsinstall
   1.711 +
   1.712 +ifdef NSINSTALL_BIN
   1.713 +NSINSTALL = $(NSINSTALL_BIN)
   1.714 +else
   1.715 +ifeq ($(HOST_OS_ARCH),WINNT)
   1.716 +NSINSTALL = $(NSINSTALL_PY)
   1.717 +else
   1.718 +NSINSTALL = $(DIST)/bin/nsinstall$(HOST_BIN_SUFFIX)
   1.719 +endif # WINNT
   1.720 +endif # NSINSTALL_BIN
   1.721 +
   1.722 +
   1.723 +ifeq (,$(CROSS_COMPILE)$(filter-out WINNT, $(OS_ARCH)))
   1.724 +INSTALL = $(NSINSTALL) -t
   1.725 +ifdef .PYMAKE
   1.726 +install_cmd = $(NSINSTALL_NATIVECMD) -t $(1)
   1.727 +endif # .PYMAKE
   1.728 +
   1.729 +else
   1.730 +
   1.731 +# This isn't laid out as conditional directives so that NSDISTMODE can be
   1.732 +# target-specific.
   1.733 +INSTALL         = $(if $(filter copy, $(NSDISTMODE)), $(NSINSTALL) -t, $(if $(filter absolute_symlink, $(NSDISTMODE)), $(NSINSTALL) -L $(PWD), $(NSINSTALL) -R))
   1.734 +
   1.735 +endif # WINNT
   1.736 +
   1.737 +# The default for install_cmd is simply INSTALL
   1.738 +install_cmd ?= $(INSTALL) $(1)
   1.739 +
   1.740 +# Use nsinstall in copy mode to install files on the system
   1.741 +SYSINSTALL	= $(NSINSTALL) -t
   1.742 +# This isn't necessarily true, just here
   1.743 +sysinstall_cmd = install_cmd
   1.744 +
   1.745 +#
   1.746 +# Localization build automation
   1.747 +#
   1.748 +
   1.749 +# Because you might wish to "make locales AB_CD=ab-CD", we don't hardcode
   1.750 +# MOZ_UI_LOCALE directly, but use an intermediate variable that can be
   1.751 +# overridden by the command line. (Besides, AB_CD is prettier).
   1.752 +AB_CD = $(MOZ_UI_LOCALE)
   1.753 +
   1.754 +ifndef L10NBASEDIR
   1.755 +  L10NBASEDIR = $(error L10NBASEDIR not defined by configure)
   1.756 +else
   1.757 +  IS_LANGUAGE_REPACK = 1
   1.758 +endif
   1.759 +
   1.760 +EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/$(1)/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/$(subst /locales,,$(1)))
   1.761 +
   1.762 +ifdef relativesrcdir
   1.763 +LOCALE_SRCDIR ?= $(call EXPAND_LOCALE_SRCDIR,$(relativesrcdir))
   1.764 +endif
   1.765 +
   1.766 +ifdef relativesrcdir
   1.767 +MAKE_JARS_FLAGS += --relativesrcdir=$(relativesrcdir)
   1.768 +ifneq (en-US,$(AB_CD))
   1.769 +ifdef LOCALE_MERGEDIR
   1.770 +MAKE_JARS_FLAGS += --locale-mergedir=$(LOCALE_MERGEDIR)
   1.771 +endif
   1.772 +ifdef IS_LANGUAGE_REPACK
   1.773 +MAKE_JARS_FLAGS += --l10n-base=$(L10NBASEDIR)/$(AB_CD)
   1.774 +endif
   1.775 +else
   1.776 +MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR)
   1.777 +endif # en-US
   1.778 +else
   1.779 +MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR)
   1.780 +endif # ! relativesrcdir
   1.781 +
   1.782 +ifdef LOCALE_MERGEDIR
   1.783 +MERGE_FILE = $(firstword \
   1.784 +  $(wildcard $(LOCALE_MERGEDIR)/$(subst /locales,,$(relativesrcdir))/$(1)) \
   1.785 +  $(wildcard $(LOCALE_SRCDIR)/$(1)) \
   1.786 +  $(srcdir)/en-US/$(1) )
   1.787 +else
   1.788 +MERGE_FILE = $(LOCALE_SRCDIR)/$(1)
   1.789 +endif
   1.790 +MERGE_FILES = $(foreach f,$(1),$(call MERGE_FILE,$(f)))
   1.791 +
   1.792 +ifneq (WINNT,$(OS_ARCH))
   1.793 +RUN_TEST_PROGRAM = $(LIBXUL_DIST)/bin/run-mozilla.sh
   1.794 +endif # ! WINNT
   1.795 +
   1.796 +#
   1.797 +# Java macros
   1.798 +#
   1.799 +
   1.800 +# Make sure any compiled classes work with at least JVM 1.4
   1.801 +JAVAC_FLAGS += -source 1.4
   1.802 +
   1.803 +ifdef MOZ_DEBUG
   1.804 +JAVAC_FLAGS += -g
   1.805 +endif
   1.806 +
   1.807 +CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(topsrcdir)/config/createprecomplete.py)
   1.808 +
   1.809 +# MDDEPDIR is the subdirectory where dependency files are stored
   1.810 +MDDEPDIR := .deps
   1.811 +
   1.812 +EXPAND_LIBS_EXEC = $(PYTHON) $(topsrcdir)/config/expandlibs_exec.py $(if $@,--depend $(MDDEPDIR)/$@.pp --target $@)
   1.813 +EXPAND_LIBS_GEN = $(PYTHON) $(topsrcdir)/config/expandlibs_gen.py $(if $@,--depend $(MDDEPDIR)/$@.pp)
   1.814 +EXPAND_AR = $(EXPAND_LIBS_EXEC) --extract -- $(AR)
   1.815 +EXPAND_CC = $(EXPAND_LIBS_EXEC) --uselist -- $(CC)
   1.816 +EXPAND_CCC = $(EXPAND_LIBS_EXEC) --uselist -- $(CCC)
   1.817 +EXPAND_LD = $(EXPAND_LIBS_EXEC) --uselist -- $(LD)
   1.818 +EXPAND_MKSHLIB_ARGS = --uselist
   1.819 +ifdef SYMBOL_ORDER
   1.820 +EXPAND_MKSHLIB_ARGS += --symbol-order $(SYMBOL_ORDER)
   1.821 +endif
   1.822 +EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) $(EXPAND_MKSHLIB_ARGS) -- $(MKSHLIB)
   1.823 +
   1.824 +ifneq (,$(MOZ_LIBSTDCXX_TARGET_VERSION)$(MOZ_LIBSTDCXX_HOST_VERSION))
   1.825 +ifneq ($(OS_ARCH),Darwin)
   1.826 +CHECK_STDCXX = @$(TOOLCHAIN_PREFIX)objdump -p $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_stdcxx | We do not want these libstdc++ symbols to be used:' && $(TOOLCHAIN_PREFIX)objdump -T $(1) | grep -e 'GLIBCXX_3\.4\.\(9\|[1-9][0-9]\)' && false || true
   1.827 +endif
   1.828 +
   1.829 +ifdef MOZ_LIBSTDCXX_TARGET_VERSION
   1.830 +EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,stdc++compat,$(DEPTH)/build/unix/stdc++compat)
   1.831 +endif
   1.832 +ifdef MOZ_LIBSTDCXX_HOST_VERSION
   1.833 +HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,host_stdc++compat,$(DEPTH)/build/unix/stdc++compat)
   1.834 +endif
   1.835 +endif
   1.836 +
   1.837 +ifeq (,$(filter $(OS_TARGET),WINNT Darwin))
   1.838 +CHECK_TEXTREL = @$(TOOLCHAIN_PREFIX)readelf -d $(1) | grep TEXTREL > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_textrel | We do not want text relocations in libraries and programs' || true
   1.839 +endif
   1.840 +
   1.841 +define CHECK_BINARY
   1.842 +$(call CHECK_STDCXX,$(1))
   1.843 +$(call CHECK_TEXTREL,$(1))
   1.844 +endef
   1.845 +
   1.846 +# autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
   1.847 +# this file
   1.848 +OBJ_SUFFIX := $(_OBJ_SUFFIX)
   1.849 +
   1.850 +# PGO builds with GCC build objects with instrumentation in a first pass,
   1.851 +# then objects optimized, without instrumentation, in a second pass. If
   1.852 +# we overwrite the objects from the first pass with those from the second,
   1.853 +# we end up not getting instrumentation data for better optimization on
   1.854 +# incremental builds. As a consequence, we use a different object suffix
   1.855 +# for the first pass.
   1.856 +ifndef NO_PROFILE_GUIDED_OPTIMIZE
   1.857 +ifdef MOZ_PROFILE_GENERATE
   1.858 +ifdef GNU_CC
   1.859 +OBJ_SUFFIX := i_o
   1.860 +endif
   1.861 +endif
   1.862 +endif
   1.863 +
   1.864 +# EXPAND_LIBNAME - $(call EXPAND_LIBNAME,foo)
   1.865 +# expands to $(LIB_PREFIX)foo.$(LIB_SUFFIX) or -lfoo, depending on linker
   1.866 +# arguments syntax. Should only be used for system libraries
   1.867 +
   1.868 +# EXPAND_LIBNAME_PATH - $(call EXPAND_LIBNAME_PATH,foo,dir)
   1.869 +# expands to dir/$(LIB_PREFIX)foo.$(LIB_SUFFIX)
   1.870 +
   1.871 +# EXPAND_MOZLIBNAME - $(call EXPAND_MOZLIBNAME,foo)
   1.872 +# expands to $(DIST)/lib/$(LIB_PREFIX)foo.$(LIB_SUFFIX)
   1.873 +
   1.874 +ifdef GNU_CC
   1.875 +EXPAND_LIBNAME = $(addprefix -l,$(1))
   1.876 +else
   1.877 +EXPAND_LIBNAME = $(foreach lib,$(1),$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
   1.878 +endif
   1.879 +EXPAND_LIBNAME_PATH = $(foreach lib,$(1),$(2)/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
   1.880 +EXPAND_MOZLIBNAME = $(foreach lib,$(1),$(DIST)/lib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX))
   1.881 +
   1.882 +PLY_INCLUDE = -I$(topsrcdir)/other-licenses/ply
   1.883 +
   1.884 +export CL_INCLUDES_PREFIX
   1.885 +# Make sure that the build system can handle non-ASCII characters
   1.886 +# in environment variables to prevent it from breking silently on
   1.887 +# non-English systems.
   1.888 +export NONASCII
   1.889 +
   1.890 +ifdef MOZ_GTK2_CFLAGS
   1.891 +MOZ_GTK2_CFLAGS := -I$(topsrcdir)/widget/gtk/compat $(MOZ_GTK2_CFLAGS)
   1.892 +endif
   1.893 +
   1.894 +DEFINES += -DNO_NSPR_10_SUPPORT
   1.895 +
   1.896 +ifdef IS_GYP_DIR
   1.897 +LOCAL_INCLUDES += \
   1.898 +  -I$(topsrcdir)/ipc/chromium/src \
   1.899 +  -I$(topsrcdir)/ipc/glue \
   1.900 +  -I$(DEPTH)/ipc/ipdl/_ipdlheaders \
   1.901 +  $(NULL)
   1.902 +
   1.903 +ifeq (WINNT,$(OS_TARGET))
   1.904 +# These get set via VC project file settings for normal GYP builds.
   1.905 +DEFINES += -DUNICODE -D_UNICODE
   1.906 +endif
   1.907 +
   1.908 +DISABLE_STL_WRAPPING := 1
   1.909 +# Skip most Mozilla-specific include locations.
   1.910 +INCLUDES = -I. $(LOCAL_INCLUDES) -I$(DEPTH)/dist/include
   1.911 +endif

mercurial