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" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=dc9b6ecd19a14a54a628edaaf23733bf" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 5 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 6 | SRC_URI = "https://dev.gentoo.org/~axs/distfiles/mozjs-60.5.2.tar.bz2 \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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 \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 14 | file://add-riscv-support.patch \ |
| 15 | file://0001-mozjs-fix-coredump-caused-by-getenv.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | file://format-overflow.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 17 | file://0001-To-fix-build-error-on-arm32BE.patch \ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 18 | file://JS_PUBLIC_API.patch \ |
| 19 | file://0001-riscv-Disable-atomic-operations.patch \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 20 | file://fallback-to-2011-C++-standard.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 21 | " |
| 22 | SRC_URI_append_libc-musl = " \ |
| 23 | file://0006-support-musl.patch \ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 24 | file://0001-js-Fix-build-with-musl.patch \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 25 | " |
| 26 | SRC_URI_append_mipsarchn32 = " \ |
| 27 | file://0001-fix-compiling-failure-on-mips64-n32-bsp.patch \ |
| 28 | " |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 29 | SRC_URI[md5sum] = "023ed014e9e93d01620d121bc06a3589" |
| 30 | SRC_URI[sha256sum] = "f51039c997415fd0f13f8e01966b4a8ff80cbf90deb8b14c18827104a369cc0d" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 31 | |
| 32 | inherit autotools pkgconfig perlnative pythonnative |
| 33 | |
Brad Bishop | 8410d61 | 2019-11-25 09:40:59 -0500 | [diff] [blame^] | 34 | inherit features_check |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | CONFLICT_DISTRO_FEATURES_mipsarchn32 = "ld-is-gold" |
| 36 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 37 | DEPENDS += "nspr zlib python-six-native python-pytoml-native \ |
| 38 | python-jsmin-native python-futures-native \ |
| 39 | python-which-native" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 40 | |
| 41 | # Disable null pointer optimization in gcc >= 6 |
| 42 | # https://bugzilla.redhat.com/show_bug.cgi?id=1328045 |
| 43 | CFLAGS += "-fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks" |
| 44 | CXXFLAGS += "-fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks" |
| 45 | |
| 46 | # nspr's package-config is ignored so set libs manually |
| 47 | EXTRA_OECONF = " \ |
| 48 | --target=${TARGET_SYS} \ |
| 49 | --host=${BUILD_SYS} \ |
| 50 | --prefix=${prefix} \ |
| 51 | --libdir=${libdir} \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 52 | --disable-tests --disable-strip --disable-optimize \ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 53 | --disable-jemalloc \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 54 | --with-nspr-libs='-lplds4 -lplc4 -lnspr4' \ |
| 55 | ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "--enable-gold", '--disable-gold', d)} \ |
| 56 | " |
| 57 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 58 | # Without this, JS_Init() will fail for mips64. |
| 59 | EXTRA_OECONF_append_mips64 = " --with-intl-api=build" |
| 60 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 61 | EXTRA_OECONF_append_mipsarch = " --disable-ion" |
| 62 | EXTRA_OECONF_append_riscv64 = " --disable-ion" |
| 63 | EXTRA_OECONF_append_riscv32 = " --disable-ion" |
| 64 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 65 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame] | 66 | 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] | 67 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 68 | EXTRA_OEMAKE_task-compile += "BUILD_OPT=1 OS_LDFLAGS='-Wl,-latomic ${LDFLAGS}'" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 69 | EXTRA_OEMAKE_task-install += "STATIC_LIBRARY_NAME=js_static" |
| 70 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 71 | export HOST_CC = "${BUILD_CC}" |
| 72 | export HOST_CXX = "${BUILD_CXX}" |
| 73 | export HOST_CFLAGS = "${BUILD_CFLAGS}" |
| 74 | export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}" |
| 75 | export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}" |
| 76 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 77 | do_configure() { |
| 78 | export SHELL="/bin/sh" |
| 79 | export TMP="${B}" |
| 80 | ${S}/js/src/configure ${EXTRA_OECONF} |
| 81 | } |
| 82 | |
| 83 | do_compile_prepend() { |
| 84 | export SHELL="/bin/sh" |
| 85 | export S |
| 86 | export PYTHONPATH |
| 87 | cd ${S} |
| 88 | for sub_dir in python testing/mozbase; do |
| 89 | for module_dir in `ls $sub_dir -1`;do |
| 90 | [ $module_dir = "virtualenv" ] && continue |
| 91 | if [ -d "${S}/$sub_dir/$module_dir" ];then |
| 92 | PYTHONPATH="$PYTHONPATH:${S}/$sub_dir/$module_dir" |
| 93 | fi |
| 94 | done |
| 95 | done |
| 96 | PYTHONPATH="$PYTHONPATH:${S}/config:${S}/build" |
| 97 | cd - |
| 98 | } |
| 99 | |
| 100 | do_install_prepend() { |
| 101 | export SHELL="/bin/sh" |
| 102 | export S |
| 103 | export PYTHONPATH |
| 104 | cd ${S} |
| 105 | for sub_dir in python testing/mozbase; do |
| 106 | for module_dir in `ls $sub_dir -1`;do |
| 107 | [ $module_dir = "virtualenv" ] && continue |
| 108 | if [ -d "${S}/$sub_dir/$module_dir" ];then |
| 109 | PYTHONPATH="$PYTHONPATH:${S}/$sub_dir/$module_dir" |
| 110 | fi |
| 111 | done |
| 112 | done |
| 113 | PYTHONPATH="$PYTHONPATH:${S}/config:${S}/build" |
| 114 | cd - |
| 115 | } |
| 116 | |
| 117 | PACKAGES =+ "lib${BPN}" |
| 118 | FILES_lib${BPN} += "${libdir}/lib*.so" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 119 | FILES_${PN}-dev += "${bindir}/js60-config" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 120 | |
| 121 | # Fails to build with thumb-1 (qemuarm) |
| 122 | #| {standard input}: Assembler messages: |
| 123 | #| {standard input}:2172: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r2,r1,LSR#20' |
| 124 | #| {standard input}:2173: Error: unshifted register required -- `bic r2,r2,#(1<<11)' |
| 125 | #| {standard input}:2174: Error: unshifted register required -- `orr r1,r1,#(1<<20)' |
| 126 | #| {standard input}:2176: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#0x300' |
| 127 | #| {standard input}:2178: Error: instruction not supported in Thumb16 mode -- `subs r5,r2,#52' |
| 128 | ARM_INSTRUCTION_SET_armv5 = "arm" |
| 129 | ARM_INSTRUCTION_SET_armv4 = "arm" |
| 130 | |
| 131 | DISABLE_STATIC = "" |