Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++" |
| 2 | HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey" |
| 3 | LICENSE = "MPL-2.0" |
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad" |
| 5 | |
| 6 | SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/main/m/mozjs52/mozjs52_52.9.1.orig.tar.xz \ |
| 7 | file://0001-js.pc.in-do-not-include-RequiredDefines.h-for-depend.patch \ |
| 8 | file://0010-fix-cross-compilation-on-i586-targets.patch \ |
| 9 | file://0001-do-not-create-python-environment.patch \ |
| 10 | file://0002-fix-cannot-find-link.patch \ |
| 11 | file://0003-workaround-autoconf-2.13-detection-failed.patch \ |
| 12 | file://0004-do-not-use-autoconf-2.13-to-refresh-old.configure.patch \ |
| 13 | file://0005-fix-do_compile-failed-on-mips.patch \ |
| 14 | file://disable-mozglue-in-stand-alone-builds.patch \ |
| 15 | file://add-riscv-support.patch \ |
| 16 | file://0001-mozjs-fix-coredump-caused-by-getenv.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 17 | file://format-overflow.patch \ |
Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame] | 18 | file://JS_PUBLIC_API.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 19 | " |
| 20 | SRC_URI_append_libc-musl = " \ |
| 21 | file://0006-support-musl.patch \ |
| 22 | " |
| 23 | SRC_URI_append_mipsarchn32 = " \ |
| 24 | file://0001-fix-compiling-failure-on-mips64-n32-bsp.patch \ |
| 25 | " |
| 26 | |
| 27 | SRC_URI[md5sum] = "c9473c625ee0a9edaaac8b742ff24c5f" |
| 28 | SRC_URI[sha256sum] = "f9324a6724233ab15f10381fe13e635e89d725ef1e78025a0a7d36c58a84a0f9" |
| 29 | |
| 30 | inherit autotools pkgconfig perlnative pythonnative |
| 31 | |
| 32 | inherit distro_features_check |
| 33 | CONFLICT_DISTRO_FEATURES_mipsarchn32 = "ld-is-gold" |
| 34 | |
| 35 | DEPENDS += "nspr zlib" |
| 36 | |
| 37 | # Disable null pointer optimization in gcc >= 6 |
| 38 | # https://bugzilla.redhat.com/show_bug.cgi?id=1328045 |
| 39 | CFLAGS += "-fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks" |
| 40 | CXXFLAGS += "-fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks" |
| 41 | |
| 42 | # nspr's package-config is ignored so set libs manually |
| 43 | EXTRA_OECONF = " \ |
| 44 | --target=${TARGET_SYS} \ |
| 45 | --host=${BUILD_SYS} \ |
| 46 | --prefix=${prefix} \ |
| 47 | --libdir=${libdir} \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 48 | --disable-tests --disable-strip --disable-optimize \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 49 | --with-nspr-libs='-lplds4 -lplc4 -lnspr4' \ |
| 50 | ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "--enable-gold", '--disable-gold', d)} \ |
| 51 | " |
| 52 | |
| 53 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame] | 54 | PACKAGECONFIG[x11] = "--x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},--x-includes=no --x-libraries=no,virtual/libx11" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 55 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 56 | EXTRA_OEMAKE_task-compile += "BUILD_OPT=1 OS_LDFLAGS='-Wl,-latomic ${LDFLAGS}'" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 57 | EXTRA_OEMAKE_task-install += "STATIC_LIBRARY_NAME=js_static" |
| 58 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 59 | export HOST_CC = "${BUILD_CC}" |
| 60 | export HOST_CXX = "${BUILD_CXX}" |
| 61 | export HOST_CFLAGS = "${BUILD_CFLAGS}" |
| 62 | export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}" |
| 63 | export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}" |
| 64 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 65 | do_configure() { |
| 66 | export SHELL="/bin/sh" |
| 67 | export TMP="${B}" |
| 68 | ${S}/js/src/configure ${EXTRA_OECONF} |
| 69 | } |
| 70 | |
| 71 | do_compile_prepend() { |
| 72 | export SHELL="/bin/sh" |
| 73 | export S |
| 74 | export PYTHONPATH |
| 75 | cd ${S} |
| 76 | for sub_dir in python testing/mozbase; do |
| 77 | for module_dir in `ls $sub_dir -1`;do |
| 78 | [ $module_dir = "virtualenv" ] && continue |
| 79 | if [ -d "${S}/$sub_dir/$module_dir" ];then |
| 80 | PYTHONPATH="$PYTHONPATH:${S}/$sub_dir/$module_dir" |
| 81 | fi |
| 82 | done |
| 83 | done |
| 84 | PYTHONPATH="$PYTHONPATH:${S}/config:${S}/build" |
| 85 | cd - |
| 86 | } |
| 87 | |
| 88 | do_install_prepend() { |
| 89 | export SHELL="/bin/sh" |
| 90 | export S |
| 91 | export PYTHONPATH |
| 92 | cd ${S} |
| 93 | for sub_dir in python testing/mozbase; do |
| 94 | for module_dir in `ls $sub_dir -1`;do |
| 95 | [ $module_dir = "virtualenv" ] && continue |
| 96 | if [ -d "${S}/$sub_dir/$module_dir" ];then |
| 97 | PYTHONPATH="$PYTHONPATH:${S}/$sub_dir/$module_dir" |
| 98 | fi |
| 99 | done |
| 100 | done |
| 101 | PYTHONPATH="$PYTHONPATH:${S}/config:${S}/build" |
| 102 | cd - |
| 103 | } |
| 104 | |
| 105 | PACKAGES =+ "lib${BPN}" |
| 106 | FILES_lib${BPN} += "${libdir}/lib*.so" |
| 107 | FILES_${PN}-dev += "${bindir}/js52-config" |
| 108 | |
| 109 | # Fails to build with thumb-1 (qemuarm) |
| 110 | #| {standard input}: Assembler messages: |
| 111 | #| {standard input}:2172: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r2,r1,LSR#20' |
| 112 | #| {standard input}:2173: Error: unshifted register required -- `bic r2,r2,#(1<<11)' |
| 113 | #| {standard input}:2174: Error: unshifted register required -- `orr r1,r1,#(1<<20)' |
| 114 | #| {standard input}:2176: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#0x300' |
| 115 | #| {standard input}:2178: Error: instruction not supported in Thumb16 mode -- `subs r5,r2,#52' |
| 116 | ARM_INSTRUCTION_SET_armv5 = "arm" |
| 117 | ARM_INSTRUCTION_SET_armv4 = "arm" |
| 118 | |
| 119 | DISABLE_STATIC = "" |