Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | HOMEPAGE = "http://www.mozilla.org/js/" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 3 | LICENSE = "MPL-2.0" |
| 4 | LIC_FILES_CHKSUM = "file://../../LICENSE;md5=815ca599c9df247a0c7f619bab123dad" |
| 5 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 6 | SRC_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 Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 20 | |
| 21 | SRC_URI[md5sum] = "20b6f8f1140ef6e47daa3b16965c9202" |
| 22 | SRC_URI[sha256sum] = "321e964fe9386785d3bf80870640f2fa1c683e32fe988eeb201b04471c172fba" |
| 23 | |
| 24 | S = "${WORKDIR}/${BPN}${PV}/js/src" |
| 25 | |
| 26 | inherit autotools pkgconfig perlnative pythonnative |
| 27 | |
| 28 | DEPENDS += "nspr zlib" |
| 29 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 30 | # Host specific flags need to be defined, otherwise target flags will be passed to the host |
| 31 | export HOST_CFLAGS = "${BUILD_CFLAGS}" |
| 32 | export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}" |
| 33 | export HOST_LDFLAGS = "${BUILD_LDFLAGS}" |
| 34 | |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 35 | # nspr's package-config is ignored so set libs manually |
| 36 | EXTRA_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 Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 46 | EXTRA_OECONF_append_armv4 = " \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 47 | --disable-methodjit \ |
| 48 | " |
| 49 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 50 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 51 | PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},--without-x,virtual/libx11" |
| 52 | |
| 53 | # mozjs requires autoreconf 2.13 |
| 54 | do_configure() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 55 | export HOST_CFLAGS="${BUILD_CFLAGS}" |
| 56 | export HOST_CXXFLAGS="${BUILD_CPPFLAGS}" |
| 57 | export HOST_LDFLAGS="${BUILD_LDFLAGS}" |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 58 | ( cd ${S} |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 59 | 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 |
| 65 | do_unpack() { |
| 66 | tar -xvf ${DL_DIR}/mozjs17.0.0.tar.gz -C ${WORKDIR}/ |
| 67 | rm -rf ${WORKDIR}/${BPN}${PV}/patches |
| 68 | } |
| 69 | |
| 70 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 71 | PACKAGES =+ "lib${BPN}" |
| 72 | FILES_lib${BPN} += "${libdir}/lib*.so" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 73 | FILES_${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' |
| 82 | ARM_INSTRUCTION_SET = "arm" |