omap3-sgx-modules: strip unneeded stuff
[openembedded.git] / recipes / erlang / erlang_R11B.1.bb
1 include erlang.inc
2 DEPENDS += "erlang-native openssl"
3
4 SRC_URI += "file://erts-configure.in.patch;patch=1 \
5             file://erts-emulator-Makefile.in.patch;patch=1 \
6             file://erts-etc-unix-Install.src.patch;patch=1 \
7             file://lib-crypto-c_src-Makefile.in.patch;patch=1 \
8             file://lib-erl_interface-src-Makefile.in.patch;patch=1 \
9             file://Makefile.in.patch;patch=1 \
10             "
11
12 EXTRA_OEMAKE = "BUILD_CC='${BUILD_CC}'"
13
14 EXTRA_OECONF = "--with-ssl=${STAGING_DIR_HOST}${layout_exec_prefix}"
15
16 EXTRA_OECONF_append_arm = " --disable-smp-support --disable-hipe"
17 EXTRA_OECONF_append_armeb = " --disable-smp-support --disable-hipe"
18 EXTRA_OECONF_append_mipsel = " --disable-smp-support --disable-hipe"
19 EXTRA_OECONF_append_sh3 = " --disable-smp-support --disable-hipe"
20 EXTRA_OECONF_append_sh4 = " --disable-smp-support --disable-hipe"
21
22 NATIVE_BIN = "${TMPDIR}/work/erlang-native-${PV}-${PR}/otp_src_${UPSTREAM_VERSION}/bin"
23
24 do_configure() {
25
26     cd ${S}/erts; autoreconf; cd -
27
28     . ${CONFIG_SITE}
29
30     ac_cv_prog_javac_ver_1_2=no \
31     SHLIB_LD='${CC}' \
32     oe_runconf
33
34     sed -i -e 's|$(ERL_TOP)/bin/dialyzer|${NATIVE_BIN}/dialyzer --output_plt $@ -pa $(ERL_TOP)/lib/kernel/ebin -pa $(ERL_TOP)/lib/stdlib/ebin|' lib/dialyzer/src/Makefile
35 }
36
37 do_compile() {
38     TARGET=${TARGET_SYS} \
39     PATH=${NATIVE_BIN}:$PATH \
40     oe_runmake noboot
41 }
42
43 do_install() {
44     TARGET=${TARGET_SYS} \
45     PATH=${NATIVE_BIN}:$PATH \
46     oe_runmake 'INSTALL_PREFIX=${D}' install
47     for f in erl start
48         do sed -i -e 's:ROOTDIR=.*:ROOTDIR=/usr/lib/erlang:' \
49                 ${D}/usr/lib/erlang/erts-*/bin/$f ${D}/usr/lib/erlang/bin/$f
50     done
51 }
52
53 def get_erlang_libs(d):
54     import os, bb
55     install_root = bb.data.getVar('D', d, 1)
56     libdir = bb.data.getVar('libdir', d, 1)[1:]
57     libs = ["${bindir}/dialyzer", "${libdir}/erlang/bin/dialyzer"]
58     erlang_lib = os.path.join(install_root, libdir, "erlang/lib")
59     for fname in os.listdir(erlang_lib):
60         if not "-" in fname: continue
61         if fname.startswith("compiler-"): continue
62         if fname.startswith("kernel-"): continue
63         if fname.startswith("sasl-"): continue
64         if fname.startswith("stdlib-"): continue
65         if fname.startswith("tools-"): continue
66         libs.append(os.path.join("${libdir}", "erlang/lib", fname))
67     libs.sort()
68     return libs
69
70 FILES_${PN}-dbg += " ${libdir}/erlang/bin/.debug ${libdir}/erlang/*/bin/.debug ${libdir}/erlang/lib/*/bin/.debug"
71 FILES_${PN}-libs += " ${@' '.join(get_erlang_libs(d))}"
72 PACKAGES =+ "${PN}-libs"