blob: 0dfe2f848405fe25bc28ff687377b459b090d3fe [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++"
2HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
3LICENSE = "MPL-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
5
6SRC_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 \
17 "
18SRC_URI_append_libc-musl = " \
19 file://0006-support-musl.patch \
20 "
21SRC_URI_append_mipsarchn32 = " \
22 file://0001-fix-compiling-failure-on-mips64-n32-bsp.patch \
23 "
24
25SRC_URI[md5sum] = "c9473c625ee0a9edaaac8b742ff24c5f"
26SRC_URI[sha256sum] = "f9324a6724233ab15f10381fe13e635e89d725ef1e78025a0a7d36c58a84a0f9"
27
28inherit autotools pkgconfig perlnative pythonnative
29
30inherit distro_features_check
31CONFLICT_DISTRO_FEATURES_mipsarchn32 = "ld-is-gold"
32
33DEPENDS += "nspr zlib"
34
35# Disable null pointer optimization in gcc >= 6
36# https://bugzilla.redhat.com/show_bug.cgi?id=1328045
37CFLAGS += "-fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks"
38CXXFLAGS += "-fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks"
39
40# nspr's package-config is ignored so set libs manually
41EXTRA_OECONF = " \
42 --target=${TARGET_SYS} \
43 --host=${BUILD_SYS} \
44 --prefix=${prefix} \
45 --libdir=${libdir} \
46 --disable-tests \
47 --with-nspr-libs='-lplds4 -lplc4 -lnspr4' \
48 ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "--enable-gold", '--disable-gold', d)} \
49"
50
51PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
52PACKAGECONFIG[x11] = "--x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR},,virtual/libx11"
53
54EXTRA_OEMAKE_task-compile += "OS_LDFLAGS='-Wl,-latomic ${LDFLAGS}'"
55EXTRA_OEMAKE_task-install += "STATIC_LIBRARY_NAME=js_static"
56
57do_configure() {
58 export SHELL="/bin/sh"
59 export TMP="${B}"
60 ${S}/js/src/configure ${EXTRA_OECONF}
61}
62
63do_compile_prepend() {
64 export SHELL="/bin/sh"
65 export S
66 export PYTHONPATH
67 cd ${S}
68 for sub_dir in python testing/mozbase; do
69 for module_dir in `ls $sub_dir -1`;do
70 [ $module_dir = "virtualenv" ] && continue
71 if [ -d "${S}/$sub_dir/$module_dir" ];then
72 PYTHONPATH="$PYTHONPATH:${S}/$sub_dir/$module_dir"
73 fi
74 done
75 done
76 PYTHONPATH="$PYTHONPATH:${S}/config:${S}/build"
77 cd -
78}
79
80do_install_prepend() {
81 export SHELL="/bin/sh"
82 export S
83 export PYTHONPATH
84 cd ${S}
85 for sub_dir in python testing/mozbase; do
86 for module_dir in `ls $sub_dir -1`;do
87 [ $module_dir = "virtualenv" ] && continue
88 if [ -d "${S}/$sub_dir/$module_dir" ];then
89 PYTHONPATH="$PYTHONPATH:${S}/$sub_dir/$module_dir"
90 fi
91 done
92 done
93 PYTHONPATH="$PYTHONPATH:${S}/config:${S}/build"
94 cd -
95}
96
97PACKAGES =+ "lib${BPN}"
98FILES_lib${BPN} += "${libdir}/lib*.so"
99FILES_${PN}-dev += "${bindir}/js52-config"
100
101# Fails to build with thumb-1 (qemuarm)
102#| {standard input}: Assembler messages:
103#| {standard input}:2172: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r2,r1,LSR#20'
104#| {standard input}:2173: Error: unshifted register required -- `bic r2,r2,#(1<<11)'
105#| {standard input}:2174: Error: unshifted register required -- `orr r1,r1,#(1<<20)'
106#| {standard input}:2176: Error: instruction not supported in Thumb16 mode -- `subs r2,r2,#0x300'
107#| {standard input}:2178: Error: instruction not supported in Thumb16 mode -- `subs r5,r2,#52'
108ARM_INSTRUCTION_SET_armv5 = "arm"
109ARM_INSTRUCTION_SET_armv4 = "arm"
110
111DISABLE_STATIC = ""