1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/Makefile.in Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,425 @@ 1.4 +# -*- Mode: makefile -*- 1.5 +# 1.6 +# This Source Code Form is subject to the terms of the Mozilla Public 1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.9 + 1.10 +ifndef .PYMAKE 1.11 +ifeq (,$(MAKE_VERSION)) 1.12 +$(error GNU Make is required) 1.13 +endif 1.14 +make_min_ver := 3.81 1.15 +ifneq ($(make_min_ver),$(firstword $(sort $(make_min_ver) $(MAKE_VERSION)))) 1.16 +$(error GNU Make $(make_min_ver) or higher is required) 1.17 +endif 1.18 +endif 1.19 + 1.20 +TOPLEVEL_BUILD := 1 1.21 + 1.22 +run_for_side_effects := $(shell echo 'MAKE: $(MAKE)') 1.23 +STATIC_LIBRARY_NAME = js_static 1.24 +LIBS = $(NSPR_LIBS) 1.25 + 1.26 +DIST_INSTALL = 1 1.27 + 1.28 +ifdef JS_STANDALONE 1.29 +SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,mfbt,$(DEPTH)/mfbt) 1.30 +endif 1.31 + 1.32 +ifdef JS_HAS_CTYPES 1.33 +ifdef MOZ_NATIVE_FFI 1.34 +LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS) 1.35 +endif 1.36 + 1.37 +ifdef MOZ_NATIVE_FFI 1.38 +EXTRA_DSO_LDOPTS += $(MOZ_FFI_LIBS) 1.39 +else 1.40 +SHARED_LIBRARY_LIBS += \ 1.41 + ctypes/libffi/.libs/libffi.$(LIB_SUFFIX) \ 1.42 + $(NULL) 1.43 +endif 1.44 + 1.45 +endif # JS_HAS_CTYPES 1.46 + 1.47 +DASH_R = -r 1.48 + 1.49 +ifneq (,$(filter WINNT,$(OS_ARCH))) 1.50 +SDK_LIBRARY = $(IMPORT_LIBRARY) 1.51 +else 1.52 +SDK_LIBRARY = $(SHARED_LIBRARY) 1.53 +endif 1.54 + 1.55 +EXTRA_DSO_LDOPTS += $(NSPR_LIBS) 1.56 + 1.57 +# Define keyword generator before rules.mk, see bug 323979 comment 50 1.58 + 1.59 +GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX) 1.60 + 1.61 +GARBAGE += selfhosted.out.h 1.62 + 1.63 +USE_HOST_CXX = 1 1.64 + 1.65 +ifdef HAVE_DTRACE 1.66 +ifneq ($(OS_ARCH),Darwin) 1.67 +DTRACE_PROBE_OBJ = $(LIBRARY_NAME)-dtrace.$(OBJ_SUFFIX) 1.68 +endif 1.69 +MOZILLA_DTRACE_SRC = $(srcdir)/devtools/javascript-trace.d 1.70 +endif 1.71 + 1.72 +# Ensure symbol versions of shared library on Linux do not conflict 1.73 +# with those in libxul. 1.74 +ifeq (Linux,$(OS_TARGET)) 1.75 +EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript 1.76 + 1.77 +symverscript: symverscript.in 1.78 + $(call py_action,preprocessor, \ 1.79 + -DVERSION='$(subst -,_,$(LIBRARY_NAME))' $< -o $@) 1.80 + 1.81 +EXTRA_DEPS += symverscript 1.82 +endif 1.83 + 1.84 +export_files = js-config.h 1.85 +ifdef HAVE_DTRACE 1.86 +export_files += $(CURDIR)/javascript-trace.h 1.87 +endif 1.88 + 1.89 +INSTALL_TARGETS += jsconfig 1.90 +jsconfig_FILES = $(export_files) 1.91 +jsconfig_DEST = $(DIST)/include 1.92 +jsconfig_TARGET := export 1.93 + 1.94 +include $(topsrcdir)/config/rules.mk 1.95 + 1.96 +############################################# 1.97 +# BEGIN ECMAScript Internationalization API 1.98 +# 1.99 + 1.100 +# ICU headers need to be available whether we build with the complete 1.101 +# Internationalization API or not - ICU stubs rely on them. 1.102 + 1.103 +LOCAL_INCLUDES += $(MOZ_ICU_CFLAGS) 1.104 + 1.105 +ifdef ENABLE_INTL_API 1.106 +ifndef MOZ_NATIVE_ICU 1.107 + 1.108 +endif 1.109 +endif 1.110 + 1.111 +# 1.112 +# END ECMAScript Internationalization API 1.113 +############################################# 1.114 + 1.115 + 1.116 +# check_vanilla_allocations.py is tailored to Linux, so only run it there. 1.117 +# That should be enough to catch any problems. 1.118 +check-vanilla-allocations: 1.119 + $(PYTHON) $(topsrcdir)/config/check_vanilla_allocations.py $(REAL_LIBRARY) 1.120 + 1.121 +# The "aggressive" variant will likely fail on some compiler/platform 1.122 +# combinations, but is worth running by hand every once in a while. 1.123 +check-vanilla-allocations-aggressive: 1.124 + $(PYTHON) $(topsrcdir)/config/check_vanilla_allocations.py --aggressive $(REAL_LIBRARY) 1.125 + 1.126 +ifeq ($(OS_ARCH),Linux) 1.127 +check:: check-vanilla-allocations 1.128 +endif 1.129 + 1.130 +# Help ensure that the number of OOM errors in SpiderMonkey doesn't increase. 1.131 +# If the number of OOM errors changes, update the number below. We intend this 1.132 +# number to go down over time, by fixing OOMs. 1.133 +check-ooms: 1.134 + $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(topsrcdir)/config/find_OOM_errors.py --regression 125 1.135 + 1.136 +ifeq ($(MOZ_DEBUG),1) 1.137 +#check:: check-ooms 1.138 +endif 1.139 + 1.140 +ifdef MOZ_VALGRIND 1.141 +ifndef MOZ_ASAN 1.142 +JITTEST_VALGRIND_FLAG = --valgrind 1.143 +endif 1.144 +endif 1.145 + 1.146 +ifdef MOZ_ASAN 1.147 +ifneq ($(LLVM_SYMBOLIZER),) 1.148 +# Use the LLVM symbolizer when running jit-tests under ASan, if available 1.149 +JITTEST_ASAN_ENV=ASAN_SYMBOLIZER_PATH='$(LLVM_SYMBOLIZER)' 1.150 +endif 1.151 +endif 1.152 + 1.153 +check-style:: 1.154 + (cd $(srcdir) && $(PYTHON) $(topsrcdir)/config/check_spidermonkey_style.py); 1.155 + 1.156 +check-jit-test:: 1.157 + $(JITTEST_ASAN_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \ 1.158 + --no-slow --no-progress --tinderbox --tbpl $(JITTEST_VALGRIND_FLAG) \ 1.159 + $(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX) 1.160 + 1.161 +check:: check-style 1.162 + 1.163 +# jstests doesn't have a --jitflags option, so we need to loop, updating the 1.164 +# exit code (RC) after each invocation. 1.165 +# FIXME: MethodJIT doesn't work for 1 test case (bug 644393), so 1.166 +# --no-extensions is set to skip that test. Remove as soon as possible. 1.167 +check-jstests: 1.168 + RC=0; \ 1.169 + for f in `echo '$(JITFLAGS)' | tr ',' '\n'`; \ 1.170 + do \ 1.171 + $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/tests/jstests.py \ 1.172 + --tinderbox --no-progress \ 1.173 + --no-extensions \ 1.174 + --timeout 300 \ 1.175 + --args="`echo $$f | sed 's/\(.\)/ -\1/g'`" \ 1.176 + $(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX); \ 1.177 + RC=$$(( $$RC || $$?)); \ 1.178 + done; \ 1.179 + exit $$RC 1.180 + 1.181 +# FIXME: 1.182 +# We want to run check-jstests as part of |make check| on all platforms, on 1.183 +# tinderbox. However, some configurations don't work quite right just yet. 1.184 +# Rather than risking regressions in major configurations while fixing these 1.185 +# secondary configuration, we work around them and fix the bugs later. 1.186 +# 1.187 +# Bug 652154: On Windows, SM(!m !t) don't work because of path problems with 1.188 +# their unusual directory layout 1.189 +# 1.190 +# Bug 652155: On Mac, SM(d) doesn't work for unknown reasons 1.191 + 1.192 +ifneq ($(OS_ARCH),WINNT) 1.193 +ifndef HAVE_DTRACE 1.194 +#check:: check-jstests 1.195 +endif 1.196 +endif 1.197 + 1.198 +DIST_GARBAGE = config.cache config.log config.status* \ 1.199 + config/autoconf.mk config/emptyvars.mk \ 1.200 + js-config.h js-confdefs.h \ 1.201 + backend.mk config/backend.mk devtools/backend.mk editline/backend.mk \ 1.202 + gdb/backend.mk jsapi-tests/backend.mk shell/backend.mk tests/backend.mk \ 1.203 + backend.RecursiveMakeBackend backend.RecursiveMakeBackend.pp \ 1.204 + devtools/rootAnalysis/Makefile 1.205 + 1.206 +distclean:: 1.207 + $(RM) $(DIST_GARBAGE) 1.208 + 1.209 +ifneq ($(findstring -L,$(NSPR_LIBS)),) 1.210 +NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS))) 1.211 +else 1.212 +NSPR_STATIC_PATH = $(DIST)/lib 1.213 +endif 1.214 + 1.215 +# HP-UX does not require the extra linking of "-lm" 1.216 +ifeq (,$(filter HP-UX WINNT,$(OS_ARCH))) 1.217 +EXTRA_LIBS += -lm 1.218 +endif 1.219 + 1.220 +CFLAGS += $(MOZ_ZLIB_CFLAGS) 1.221 +EXTRA_LIBS += $(MOZ_ZLIB_LIBS) 1.222 +# Enable zlib usage if zlib has been located. When building the browser on 1.223 +# Windows, MOZ_ZLIB_LIBS is empty because zlib is part of libmozglue. We thus 1.224 +# also enable zlib if mozglue is present. 1.225 +ifneq (,$(MOZ_ZLIB_LIBS)$(MOZ_GLUE_LDFLAGS)) 1.226 +DEFINES += -DUSE_ZLIB 1.227 +endif 1.228 + 1.229 +ifdef MOZ_SHARED_ICU 1.230 +EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS) 1.231 +else 1.232 +SHARED_LIBRARY_LIBS += $(MOZ_ICU_LIBS) 1.233 +endif 1.234 + 1.235 +# Prevent floating point errors caused by VC++ optimizations 1.236 +ifdef _MSC_VER 1.237 +# XXX We should add this to CXXFLAGS, too? 1.238 +CFLAGS += -fp:precise 1.239 +endif # _MSC_VER 1.240 + 1.241 +ifeq ($(OS_ARCH),FreeBSD) 1.242 +EXTRA_LIBS += -pthread 1.243 +endif 1.244 +ifeq ($(OS_ARCH),Linux) 1.245 +EXTRA_LIBS += -ldl 1.246 +endif 1.247 +# Silence warnings on AIX/HP-UX from non-GNU compilers 1.248 +ifndef GNU_CC 1.249 +ifeq ($(OS_ARCH),AIX) 1.250 +# Suppress warnings from xlC 1.251 +# 1540-1281: offsetof() on null non-POD types 1.252 +# 1540-1608: anonymous unions using static data members 1.253 +CFLAGS += -qsuppress=1540-1281 -qsuppress=1540-1608 1.254 +CXXFLAGS += -qsuppress=1540-1281 -qsuppress=1540-1608 1.255 +endif 1.256 +ifeq ($(OS_ARCH),HP-UX) 1.257 +# Suppress warnings from aCC 1.258 +# 3055: anonymous unions declaring types 1.259 +# 4189: offsetof() on non-POD types 1.260 +CFLAGS += +W3055,4189 1.261 +CXXFLAGS += +W3055,4189 1.262 +endif 1.263 +endif 1.264 +ifeq ($(OS_ARCH),SunOS) 1.265 +ifeq ($(TARGET_CPU),sparc) 1.266 + 1.267 +ifdef GNU_CC 1.268 +CFLAGS += -mcpu=v9 1.269 +CXXFLAGS += -mcpu=v9 1.270 +endif # GNU_CC 1.271 + 1.272 +endif 1.273 +EXTRA_LIBS += -lposix4 -ldl -lnsl -lsocket 1.274 +endif 1.275 + 1.276 +SCRIPTS = $(JS_CONFIG_NAME) 1.277 +SDK_BINARY = $(JS_CONFIG_NAME) 1.278 + 1.279 +$(LIBRARY_NAME).pc: js.pc 1.280 + cp $^ $@ 1.281 + 1.282 +install:: $(LIBRARY_NAME).pc 1.283 + $(SYSINSTALL) $^ $(DESTDIR)$(libdir)/pkgconfig 1.284 + 1.285 +###################################################### 1.286 +# BEGIN SpiderMonkey header installation 1.287 +# 1.288 +# Mozilla/Gecko/Firefox mostly doesn't concern itself with defining a sensible 1.289 +# install target, because it's shipping primarily packaged builds. And even if 1.290 +# it did, those builds wouldn't really have reason to include header files. So 1.291 +# we have to install public headers ourselves, rather than using something from 1.292 +# config/rules.mk or similar. 1.293 +# 1.294 +# The overall directory structure of the installed headers looks like so: 1.295 +# 1.296 +# $(includedir)/ 1.297 +# $(LIBRARY_NAME)/ 1.298 +# jsapi.h, jspubtd.h, etc. (all of EXPORTS) 1.299 +# js/ 1.300 +# js/public/* headers (all are public) 1.301 +# ds/ 1.302 +# js/src/ds/* public headers 1.303 +# gc/ 1.304 +# js/src/gc/* public headers 1.305 +# mozilla/ 1.306 +# mfbt headers 1.307 +# 1.308 + 1.309 +install:: 1.310 + $(call py_action,process_install_manifest,--no-remove $(DESTDIR)$(includedir) $(DEPTH)/_build_manifests/install/dist_include) 1.311 + 1.312 +# 1.313 +# END SpiderMonkey header installation 1.314 +############################################# 1.315 + 1.316 +install:: $(SCRIPTS) 1.317 + $(SYSINSTALL) $^ $(DESTDIR)$(bindir) 1.318 + 1.319 +install:: $(REAL_LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) 1.320 +ifneq (,$(REAL_LIBRARY)) 1.321 + $(SYSINSTALL) $(REAL_LIBRARY) $(DESTDIR)$(libdir) 1.322 + mv -f $(DESTDIR)$(libdir)/$(REAL_LIBRARY) $(subst $(STATIC_LIBRARY_NAME),$(LIBRARY_NAME),$(DESTDIR)$(libdir)/$(REAL_LIBRARY)) 1.323 +endif 1.324 +ifneq (,$(SHARED_LIBRARY)) 1.325 + $(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir) 1.326 +endif 1.327 +ifneq (,$(IMPORT_LIBRARY)) 1.328 + $(SYSINSTALL) $(IMPORT_LIBRARY) $(DESTDIR)$(libdir) 1.329 +endif 1.330 + $(MAKE) -C shell install 1.331 + 1.332 +# Use CURDIR to avoid finding a jsautokw.h in the source tree (from a 1.333 +# previous build?) via VPATH when we're building in a separate tree. 1.334 +$(CURDIR)/jsautokw.h: host_jskwgen$(HOST_BIN_SUFFIX) 1.335 + ./host_jskwgen$(HOST_BIN_SUFFIX) $@ 1.336 + 1.337 +# Force auto-header generation before compiling any source that may use them 1.338 +$(OBJS): $(CURDIR)/jsautokw.h 1.339 + 1.340 +ifdef MOZ_ETW 1.341 +ETWProvider.h ETWProvider.rc ETWProvider.mof: ETWProvider.man 1.342 + $(MC) -um -mof $^ 1.343 + 1.344 +ETWProvider.res: ETWProvider.rc 1.345 + $(RC) -r -i '$(SDKDIR)Include' $^ 1.346 + 1.347 +export:: ETWProvider.res 1.348 + 1.349 +install:: ETWProvider.mof ETWProvider.man 1.350 + $(SYSINSTALL) $^ $(DESTDIR)$(bindir) 1.351 + 1.352 +endif 1.353 + 1.354 +ifdef HAVE_DTRACE 1.355 +$(CURDIR)/javascript-trace.h: $(srcdir)/devtools/javascript-trace.d 1.356 + dtrace -h -s $(srcdir)/devtools/javascript-trace.d -o javascript-trace.h.in 1.357 + sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \ 1.358 + -e '/const/!s/char \*/const char */g' \ 1.359 + javascript-trace.h.in > javascript-trace.h 1.360 + 1.361 +# We can't automatically generate dependencies on auto-generated headers; 1.362 +# we have to list them explicitly. 1.363 +$(addsuffix .$(OBJ_SUFFIX),Probes jsinterp jsobj): $(CURDIR)/javascript-trace.h 1.364 +endif 1.365 + 1.366 +# Prepare self-hosted JS code for embedding 1.367 +export:: selfhosting 1.368 +selfhosting:: selfhosted.out.h 1.369 + 1.370 +selfhosting_srcs := \ 1.371 + $(srcdir)/builtin/Utilities.js \ 1.372 + $(srcdir)/builtin/ParallelUtilities.js \ 1.373 + $(srcdir)/builtin/Array.js \ 1.374 + $(srcdir)/builtin/Date.js \ 1.375 + $(srcdir)/builtin/Intl.js \ 1.376 + $(srcdir)/builtin/IntlData.js \ 1.377 + $(srcdir)/builtin/Iterator.js \ 1.378 + $(srcdir)/builtin/Map.js \ 1.379 + $(srcdir)/builtin/Number.js \ 1.380 + $(srcdir)/builtin/String.js \ 1.381 + $(srcdir)/builtin/Set.js \ 1.382 + $(srcdir)/builtin/TypedObject.js \ 1.383 + $(NULL) 1.384 + 1.385 +selfhosted_out_h_deps := \ 1.386 + $(selfhosting_srcs) \ 1.387 + $(srcdir)/js.msg \ 1.388 + $(srcdir)/builtin/embedjs.py \ 1.389 + $(srcdir)/builtin/TypedObjectConstants.h \ 1.390 + $(NULL) 1.391 + 1.392 +SELFHOSTED_DEFINES += $(DEFINES) $(ACDEFINES) 1.393 +ifdef MOZ_DEBUG 1.394 +SELFHOSTED_DEFINES += $(MOZ_DEBUG_ENABLE_DEFS) 1.395 +else 1.396 +SELFHOSTED_DEFINES += $(MOZ_DEBUG_DISABLE_DEFS) 1.397 +endif 1.398 + 1.399 +selfhosted.out.h: $(selfhosted_out_h_deps) 1.400 + $(PYTHON) $(srcdir)/builtin/embedjs.py $(SELFHOSTED_DEFINES) \ 1.401 + -p '$(CPP)' -m $(srcdir)/js.msg -o $@ $(selfhosting_srcs) 1.402 + 1.403 +############################################### 1.404 +# Generating source package tarballs 1.405 +# (only possible when tar is found) 1.406 +ifneq (,$(TAR)) 1.407 + 1.408 +source-package: 1.409 + SRCDIR=$(srcdir) \ 1.410 + DIST=$(DIST) \ 1.411 + MAKE=$(MAKE) \ 1.412 + MKDIR=$(MKDIR) \ 1.413 + TAR=$(TAR) \ 1.414 + MOZJS_MAJOR_VERSION=$(MOZJS_MAJOR_VERSION) \ 1.415 + MOZJS_MINOR_VERSION=$(MOZJS_MINOR_VERSION) \ 1.416 + MOZJS_PATCH_VERSION=$(MOZJS_PATCH_VERSION) \ 1.417 + MOZJS_ALPHA=$(MOZJS_ALPHA) \ 1.418 + $(srcdir)/make-source-package.sh 1.419 + 1.420 +clean:: 1.421 + DIST=$(DIST) \ 1.422 + MOZJS_MAJOR_VERSION=$(MOZJS_MAJOR_VERSION) \ 1.423 + MOZJS_MINOR_VERSION=$(MOZJS_MINOR_VERSION) \ 1.424 + MOZJS_PATCH_VERSION=$(MOZJS_PATCH_VERSION) \ 1.425 + MOZJS_ALPHA=$(MOZJS_ALPHA) \ 1.426 + $(srcdir)/make-source-package.sh clean 1.427 + 1.428 +endif