summaryrefslogtreecommitdiff
path: root/meta-openpower/recipes-bsp/ecmd/libecmd_git.bb
blob: 445dce289237121abe7c7b51e874317141455417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
SUMMARY = "eCMD"
DESCRIPTION = "eCMD is a hardware access API for POWER Systems"
LICENSE= "Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/NOTICE;md5=fee220301a2af3faf8f211524b4248ea"

SRC_URI = "git://github.com/open-power/eCMD.git;branch=ecmd15;protocol=git"
SRCREV = "15e382180d49f7ea4117ccc341ca91e361721fd4"

inherit python3native
DEPENDS = "zlib"

S = "${WORKDIR}/git"

export LD="${CXX}"
export SLDFLAGS="${LDFLAGS}"

# use native config.py to build required ecmd extensions
do_configure() {
   ${S}/config.py --without-swig --without-python --without-python3 --without-perl \
       --without-pyecmd --install-path ${D}${prefix} --output-root ${B} --target ${TARGET_ARCH} \
       --extensions "cmd cip"
}

do_compile() {
    oe_runmake all
}

do_install() {
    oe_runmake install

    # we don't need the target scripts or ecmd setup
    rm ${D}${bindir}/target.* ${D}${bindir}/ecmdsetup.pl

    # ecmd installs to atypical places in the filesystem.
    # move all the installed files to more conventional directories.
    install -d ${D}${includedir} ${D}${datadir}/${BPN}/help ${D}${bindir} ${D}${libdir}
    mv ${D}${prefix}/help/**  ${D}${datadir}/${BPN}/help
    mv ${D}${prefix}/${TARGET_ARCH}/bin/**  ${D}${bindir}
    mv ${D}${prefix}/${TARGET_ARCH}/lib/**  ${D}${libdir}

    rm ${D}${bindir}/ecmdVersion

    rmdir  ${D}${prefix}/help \
        ${D}${prefix}/${TARGET_ARCH}/lib \
        ${D}${prefix}/${TARGET_ARCH}/bin \
        ${D}${prefix}/${TARGET_ARCH}/perl \
        ${D}${prefix}/${TARGET_ARCH}
}

# ecmd makefile assumes that dependencies are built from left to right.
PARALLEL_MAKE = ""

# ecmd doesn't have proper library versioning
FILES:${PN}-dev:remove = "${libdir}/lib*.so"
FILES:${PN} += "${libdir}/lib*.so"

RDEPENDS:${PN}-bin = "libecmd"

# This allows someone to easily use ecmd bins, even if you dont want them.
PACKAGE_BEFORE_PN = "libecmd-bin"
FILES:${PN}-bin += "${bindir}"