netbase: fix file search path for 'interfaces' file
[glsdk/meta-ti-glsdk.git] / recipes-ti / dmai / ti-dmai.inc
1 DESCRIPTION = "Davinci Multimedia Application Interface (DMAI) for TI ARM/DSP processors"
2 HOMEPAGE = "https://gforge.ti.com/gf/project/dmai/"
3 SECTION = "multimedia"
4 LICENSE = "BSD"
6 # TODO :: 
8 require recipes-ti/includes/ti-paths.inc
9 require recipes-ti/includes/ti-staging.inc
11 PROVIDES += "ti-dmai-apps"
13 PE = "1"
15 SRCREV               ?= "UNDEFINED_SRCREV"
16 DMAIBRANCH           ?= "UNDEFINED_DMAIBRANCH"
18 S = "${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/dmai_${PV}/dmai"
20 SRC_URI = "svn://gforge.ti.com/svn/dmai/;module=${DMAIBRANCH};protocol=https;user=anonymous;pswd='' \
21                 file://loadmodules-ti-dmai-dm6446_al.sh \
22                 file://loadmodules-ti-dmai-dm6467_al.sh \
23                 file://loadmodules-ti-dmai-o3530_al.sh \
24                 file://loadmodules-ti-dmai-dm355_al.sh \
25                 file://loadmodules-ti-dmai-dm365_al.sh \
26                 file://loadmodules-ti-dmai-ol137_al.sh \
27                 file://loadmodules-ti-dmai-ol138_al.sh \
28             file://doxygen_templates.tar.gz \
29         file://arago-tdox \
30         "
32 DEPENDS = "virtual/kernel alsa-lib ti-framework-components ti-codec-engine ti-xdctools"
34 DEPENDS_append_dm6446   = " ti-codecs-dm6446   ti-dspbios ti-cgt6x ti-linuxutils"
35 DEPENDS_append_dm6467   = " ti-codecs-dm6467   ti-dspbios ti-cgt6x ti-linuxutils"
36 DEPENDS_append_omap3    = " ti-codecs-omap3530 ti-dspbios ti-cgt6x ti-linuxutils"
37 DEPENDS_append_dm355    = " ti-codecs-dm355"
38 DEPENDS_append_dm365    = " ti-codecs-dm365"
39 DEPENDS_append_omapl137 = " ti-codecs-omapl137 ti-dspbios ti-cgt6x ti-linuxutils"
40 DEPENDS_append_omapl138 = " ti-codecs-omapl138 ti-dspbios ti-cgt6x ti-linuxutils"
42 # Define DMAI build time variables
43 DMAIPLATFORM_dm6446    = "dm6446_al"
44 DMAIPLATFORM_dm6467    = "dm6467_al"
45 DMAIPLATFORM_omap3     = "o3530_al"
46 DMAIPLATFORM_dm355     = "dm355_al"
47 DMAIPLATFORM_dm365     = "dm365_al"
48 DMAIPLATFORM_omapl137  = "ol137_al"
49 DMAIPLATFORM_omapl138  = "ol138_al"
50 DMAIPLATFORM          ?= "UNDEFINED_DMAIPLATFORM"
52 # Need to set this for other platforms as well
53 #GPPOS_dm355      = "LINUX_GCC"
54 #GPPOS_dm365      = "LINUX_GCC"
55 #GPPOS           ?= "UNDEFINEDGPPOS"
57 # Need to re-define this for OMAP-L137/L138
58 DSPSUFFIX_omapl137 = "x64P"
59 DSPSUFFIX_omapl138 = "x64P"
60 DSPSUFFIX ?= "x64p"
62 # This is needed for dm355/dm365 targets in order to find ti.sdo.codecs.g711
63 # TODO :: review - should we just pass this in do_compile?
64 USER_XDC_PATH = "${CE_INSTALL_DIR}/examples"
66 PARALLEL_MAKE = ""
68 do_prepsources() {
69     # run the release steps - this will delete .svn file and run doxygen to
70     # generate proper documentation of the source etc.
71     find ${WORKDIR}/${DMAIBRANCH} -name .svn -type d | xargs rm -rf
72     cp -pPrf ${WORKDIR}/doxygen_templates ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface
73     cp -pPrf ${WORKDIR}/arago-tdox ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/tdox
74     chmod a+x ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/release.sh
75     chmod a+x ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/tdox
76     sed -i 's|tdox|./tdox|g' ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface/release.sh
77     (cd ${WORKDIR}/${DMAIBRANCH}/davinci_multimedia_application_interface; ./release.sh ${PV})
78 }
80 # run prepare sources before do_patch to ensure that sourceipk picks the right sources.
81 addtask prepsources after do_unpack before do_patch
83 do_compile () {
84         # Recent kernel headers warn against inclusion from userspace
85     for makefile in $(find ${S} -name "Makefile") ; do
86         sed -i -e s:-Werror::g $makefile
87     done
89     # Angstrom 2008 breaks with -Wl,-T, while angstrom 2010 needs it
90     if [ $(${TARGET_PREFIX}gcc -dumpversion | awk -F. '{print $2}') -gt 3 ] ; then
91         # Fix up linkerscripts, recent toolchains need -T to prepend the default script to the custom one 
92         for appmakefile in $(find ${S} -name "Makefile.app") ; do
93             sed -i -e 's: $(XDC_CFG)/linker.cmd: -Wl,-T,$(XDC_CFG)/linker.cmd:g' $appmakefile
94         done
95     fi
97     # TODO :: Why do we do this?
98     unset DMAI_INSTALL_DIR
99     cd ${S}
101     make XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" PLATFORM="${DMAIPLATFORM}" clean
103     for dir in ${S}; do
104         cd $dir
105         #  TODO: Figure out how to pass the alsa require location, currently 
106         #  LINUXLIBS_INSTALL_DIR is hard-coded for armv5te
107         make \
108             CE_INSTALL_DIR="${CE_INSTALL_DIR}" \
109             CODEC_INSTALL_DIR="${CODEC_INSTALL_DIR}" \
110             FC_INSTALL_DIR="${FC_INSTALL_DIR}" \
111             LINUXKERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" \
112             XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" \
113             CODEGEN_INSTALL_DIR="${CODEGEN_INSTALL_DIR}" \
114             BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}"\
115             LINUXLIBS_INSTALL_DIR="${STAGING_DIR_TARGET}/usr" \
116             USER_XDC_PATH="${USER_XDC_PATH}" \
117             CROSS_COMPILE="${TOOLCHAIN_PATH}/${TARGET_PREFIX}" \
118             CSTOOL_DIR="${TOOLCHAIN_PATH}" \
119             VERBOSE="true" \
120             XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \
121             LINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \
122             CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \
123             LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \      
124             C6ACCEL_INSTALL_DIR=${C6ACCEL_INSTALL_DIR} \
125             MVTOOL_PREFIX="${TARGET_PREFIX}" \
126             PLATFORM="${DMAIPLATFORM}" 
127         done
130 do_install () {
132     # TODO :: Why do we do this?
133     unset DMAI_INSTALL_DIR
135     install -d ${D}/${installdir}/ti-dmai-apps
136     cd ${S}
137     make PLATFORM="${DMAIPLATFORM}" EXEC_DIR=${D}/${installdir}/ti-dmai-apps install 
138     install -m 0755 ${WORKDIR}/loadmodules-ti-dmai-${DMAIPLATFORM}.sh ${D}/${installdir}/ti-dmai-apps/loadmodules.sh 
140     install -d ${D}${DMAI_INSTALL_DIR_RECIPE}
141     cp -pPrf ${S}/* ${D}${DMAI_INSTALL_DIR_RECIPE}
144 PACKAGE_ARCH = "${MACHINE_ARCH}"
146 PACKAGES += "ti-dmai-apps"
147 FILES_ti-dmai-apps = "${installdir}/ti-dmai-apps/*"
148 INSANE_SKIP_ti-dmai-apps = "1"
150 RDEPENDS_ti-dmai-apps_dm6446    += "ti-codecs-dm6446-server   ti-cmem-module ti-dsplink-module"
151 RDEPENDS_ti-dmai-apps_dm6467    += "ti-codecs-dm6467          ti-cmem-module ti-dsplink-module"
152 RDEPENDS_ti-dmai-apps_omap3     += "ti-codecs-omap3530-server ti-cmem-module ti-dsplink-module ti-lpm-module ti-sdma-module"
153 RDEPENDS_ti-dmai-apps_dm355     += "ti-codecs-dm355           ti-cmem-module ti-dm355mm-module"
154 RDEPENDS_ti-dmai-apps_dm365     += "ti-codecs-dm365           ti-cmem-module ti-dm365mm-module ti-edma-module ti-irq-module"
155 RDEPENDS_ti-dmai-apps_omapl137  += "ti-codecs-omapl137-server ti-cmem-module ti-dsplink-module"
156 RDEPENDS_ti-dmai-apps_omapl138  += "ti-codecs-omapl138-server ti-cmem-module ti-dsplink-module"
158 pkg_postinst_ti-dmai-apps () {
159         ln -sf ${installdir}/ti-codecs-server/*.${DSPSUFFIX} ${installdir}/ti-dmai-apps/