summaryrefslogtreecommitdiffstats
path: root/recipes-extended/secure-obj/secure-obj_git.bb
blob: 84ecea1ea609e6fd93bfc59fa616538dfd24d292 (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
require secure-obj.inc

LIC_FILES_CHKSUM = "file://README;md5=82b72e88f23cded9dd23f0fb1790b8d2"

S = "${WORKDIR}/git"

RDEPENDS:{PN}  += "secure-obj-module"

WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}"
export SECURE_STORAGE_PATH = "${S}/secure_storage_ta/ta/"
export OPTEE_CLIENT_EXPORT = "${RECIPE_SYSROOT}/usr"
export CROSS_COMPILE_HOST = "${CROSS_COMPILE}"
export CROSS_COMPILE_TA = "${CROSS_COMPILE}"
ARCH:qoriq-arm64 = "aarch64"
ARCH:qoriq-arm = "arm"
CFLAGS += "${TOOLCHAIN_OPTIONS}"

do_compile() {
        unset LDFLAGS
        export TA_DEV_KIT_DIR="${RECIPE_SYSROOT}/usr/include/optee/export-user_ta"
        export CROSS_COMPILE="${WRAP_TARGET_PREFIX}"
        export OPENSSL_PATH="${RECIPE_SYSROOT}/usr" 
        for APP in  secure_storage_ta securekey_lib secure_obj-openssl-engine; do        
            cd  ${APP}
            oe_runmake
	    cd ..
        done       
}

do_install() {
	install -d ${D}${bindir}
        install -d ${D}${includedir}
        install -d ${D}${base_libdir}/optee_armtz
        install -d ${D}${libdir}/${ARCH}-linux-gnu/openssl-1.0.0/engines
        cp ${S}/secure_storage_ta/ta/b05bcf48-9732-4efa-a9e0-141c7c888c34.ta ${D}${base_libdir}/optee_armtz
        cp ${S}/securekey_lib/out/export/lib/libsecure_obj.so ${D}${libdir}
        cp ${S}/secure_obj-openssl-engine/libeng_secure_obj.so ${D}${libdir}/${ARCH}-linux-gnu/openssl-1.0.0/engines
        cp ${S}/securekey_lib/out/export/app/*_app ${D}${bindir}
        cp ${S}/securekey_lib/out/export/app/mp_verify ${D}${bindir}
        cp ${S}/secure_obj-openssl-engine/app/sobj_eng_app ${D}${bindir}
        cp ${S}/securekey_lib/out/export/include/*  ${D}${includedir}
        rm -rf ${D}${bindir}/test
}

FILES:${PN} += "${base_libdir}/optee_armtz ${libdir}/${ARCH}-linux-gnu/openssl-1.0.0/engines"
INSANE_SKIP:${PN} = "dev-deps ldflags"
INSANE_SKIP:${PN}-dev = "ldflags dev-elf"