blob: 49b7f156e1ac50ae37c70931ca55f76eb3bff52a [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002HOMEPAGE = "http://www.mozilla.org/js/"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05003LICENSE = "MPL-2.0"
4LIC_FILES_CHKSUM = "file://../../LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
5
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/js/${BPN}${PV}.tar.gz \
7 file://0001-mozjs17.0.0-fix-the-compile-bug-of-powerpc.patch \
8 file://0001-js.pc.in-do-not-include-RequiredDefines.h-for-depend.patch \
9 file://0002-Move-JS_BYTES_PER_WORD-out-of-config.h.patch;patchdir=../../ \
10 file://0003-Add-AArch64-support.patch;patchdir=../../ \
11 file://0004-mozbug746112-no-decommit-on-large-pages.patch;patchdir=../../ \
12 file://0005-aarch64-64k-page.patch;patchdir=../../ \
13 file://0001-regenerate-configure.patch;patchdir=../../ \
14 file://fix-the-compile-error-of-powerpc64.patch;patchdir=../../ \
15 file://fix_milestone_compile_issue.patch \
16 file://0010-fix-cross-compilation-on-i586-targets.patch;patchdir=../../ \
17 file://Manually_mmap_heap_memory_esr17.patch;patchdir=../../ \
18 file://0001-compare-the-first-character-of-string-to-be-null-or-.patch;patchdir=../../ \
19 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050020
21SRC_URI[md5sum] = "20b6f8f1140ef6e47daa3b16965c9202"
22SRC_URI[sha256sum] = "321e964fe9386785d3bf80870640f2fa1c683e32fe988eeb201b04471c172fba"
23
24S = "${WORKDIR}/${BPN}${PV}/js/src"
25
26inherit autotools pkgconfig perlnative pythonnative
27
28DEPENDS += "nspr zlib"
29
Brad Bishop6e60e8b2018-02-01 10:27:11 -050030# Host specific flags need to be defined, otherwise target flags will be passed to the host
31export HOST_CFLAGS = "${BUILD_CFLAGS}"
32export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
33export HOST_LDFLAGS = "${BUILD_LDFLAGS}"
34
Patrick Williamsb48b7b42016-08-17 15:04:38 -050035# nspr's package-config is ignored so set libs manually
36EXTRA_OECONF = " \
37 --target=${TARGET_SYS} \
38 --host=${BUILD_SYS} \
39 --build=${BUILD_SYS} \
40 --prefix=${prefix} \
41 --libdir=${libdir} \
42 --with-nspr-libs='-lplds4 -lplc4 -lnspr4' \
43 --enable-threadsafe \
44 --disable-static \
45"
Patrick Williamsddad1a12017-02-23 20:36:32 -060046EXTRA_OECONF_append_armv4 = " \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050047 --disable-methodjit \
48"
49
Brad Bishop6e60e8b2018-02-01 10:27:11 -050050PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050051PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},--without-x,virtual/libx11"
52
53# mozjs requires autoreconf 2.13
54do_configure() {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050055 export HOST_CFLAGS="${BUILD_CFLAGS}"
56 export HOST_CXXFLAGS="${BUILD_CPPFLAGS}"
57 export HOST_LDFLAGS="${BUILD_LDFLAGS}"
Patrick Williamsddad1a12017-02-23 20:36:32 -060058 ( cd ${S}
Patrick Williamsb48b7b42016-08-17 15:04:38 -050059 gnu-configize --force
60 mv config.guess config.sub build/autoconf )
61 ${S}/configure ${EXTRA_OECONF}
62}
63
64# patch.bbclass will try to apply the patches already present and fail, so clean them out
65do_unpack() {
66 tar -xvf ${DL_DIR}/mozjs17.0.0.tar.gz -C ${WORKDIR}/
67 rm -rf ${WORKDIR}/${BPN}${PV}/patches
68}
69
70
Patrick Williamsddad1a12017-02-23 20:36:32 -060071PACKAGES =+ "lib${BPN}"
72FILES_lib${BPN} += "${libdir}/lib*.so"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050073FILES_${PN}-dev += "${bindir}/js17-config"
74
75# Fails to build with thumb-1 (qemuarm)
76#| {standard input}: Assembler messages:
77#| {standard input}:2172: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r2,r1,LSR#20'
78#| {standard input}:2173: Error: unshifted register required -- `bic r2,r2,#(1<<11)'
79#| {standard input}:2174: Error: unshifted register required -- `orr r1,r1,#(1<<20)'
80#| {standard input}:2176: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#0x300'
81#| {standard input}:2178: Error: instruction not supported in Thumb16 mode -- `subs r5,r2,#52'
82ARM_INSTRUCTION_SET = "arm"