blob: 24631e4eac20bdd66680ad543bf8baeb814eda46 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++"
2LICENSE = "MPL-2.0"
3LIC_FILES_CHKSUM = "file://../../LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
4
5SRC_URI = " \
6 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=../../ \
Patrick Williamsddad1a12017-02-23 20:36:32 -060013 file://0001-regenerate-configure.patch;patchdir=../../ \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050014 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://0001-add-support-for-big-endian-32bit-ARM.patch;patchdir=../../ \
Patrick Williamsddad1a12017-02-23 20:36:32 -060018 file://Manually_mmap_heap_memory_esr17.patch;patchdir=../../ \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050019 "
20
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
30# nspr's package-config is ignored so set libs manually
31EXTRA_OECONF = " \
32 --target=${TARGET_SYS} \
33 --host=${BUILD_SYS} \
34 --build=${BUILD_SYS} \
35 --prefix=${prefix} \
36 --libdir=${libdir} \
37 --with-nspr-libs='-lplds4 -lplc4 -lnspr4' \
38 --enable-threadsafe \
39 --disable-static \
40"
Patrick Williamsddad1a12017-02-23 20:36:32 -060041EXTRA_OECONF_append_armv4 = " \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050042 --disable-methodjit \
43"
44
45PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
46PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},--without-x,virtual/libx11"
47
48# mozjs requires autoreconf 2.13
49do_configure() {
Patrick Williamsddad1a12017-02-23 20:36:32 -060050 ( cd ${S}
Patrick Williamsb48b7b42016-08-17 15:04:38 -050051 gnu-configize --force
52 mv config.guess config.sub build/autoconf )
53 ${S}/configure ${EXTRA_OECONF}
54}
55
56# patch.bbclass will try to apply the patches already present and fail, so clean them out
57do_unpack() {
58 tar -xvf ${DL_DIR}/mozjs17.0.0.tar.gz -C ${WORKDIR}/
59 rm -rf ${WORKDIR}/${BPN}${PV}/patches
60}
61
62
Patrick Williamsddad1a12017-02-23 20:36:32 -060063PACKAGES =+ "lib${BPN}"
64FILES_lib${BPN} += "${libdir}/lib*.so"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050065FILES_${PN}-dev += "${bindir}/js17-config"
66
67# Fails to build with thumb-1 (qemuarm)
68#| {standard input}: Assembler messages:
69#| {standard input}:2172: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r2,r1,LSR#20'
70#| {standard input}:2173: Error: unshifted register required -- `bic r2,r2,#(1<<11)'
71#| {standard input}:2174: Error: unshifted register required -- `orr r1,r1,#(1<<20)'
72#| {standard input}:2176: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#0x300'
73#| {standard input}:2178: Error: instruction not supported in Thumb16 mode -- `subs r5,r2,#52'
74ARM_INSTRUCTION_SET = "arm"