sg3-utils: add newer buildable version
[openembedded.git] / recipes / ti / ti-codec-engine.inc
1 DESCRIPTION = "Codec Engine for TI ARM/DSP processors"
2 HOMEPAGE = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ce"
3 SECTION = "devel"
4 LICENSE = "BSD"
5
6 # TODO :: Add Codec Engine Library Rebuild
7 # TODO :: Add Examples APP_LOCAL build as well?
8 # TODO :: Check DEPENDS - are the DSP side packages required for ARM-only products?
9
10 require ti-paths.inc
11 require ti-staging.inc
12
13 PROVIDES += "ti-codec-engine-examples"
14
15 PR = "${MACHINE_KERNEL_PR}"
16 PR_append = "a"
17
18 S = "${WORKDIR}/codec_engine_${PV}"
19
20 SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ce/${PV}/exports/codec_engine_${PV},lite.tar.gz;name=cetarball "
21
22 DEPENDS = "ti-framework-components ti-xdais ti-xdctools ti-linuxutils"
23 DEPENDS_append_dm6446   = " ti-dspbios ti-dsplink ti-local-power-manager ti-cgt6x ti-biosutils ti-edma3lld"
24 DEPENDS_append_dm6467   = " ti-dspbios ti-dsplink ti-cgt6x ti-biosutils ti-edma3lld"
25 DEPENDS_append_omap3    = " ti-dspbios ti-dsplink ti-local-power-manager ti-cgt6x ti-biosutils ti-edma3lld"
26 DEPENDS_append_omapl137 = " ti-dspbios ti-dsplink ti-cgt6x ti-biosutils ti-edma3lld"
27 DEPENDS_append_omapl138 = " ti-dspbios ti-dsplink ti-cgt6x ti-biosutils ti-edma3lld"
28
29 # SOC_FAMILY configuration
30
31 # Define DEVICES variable
32 CEEXAMPLESDEVICES_dm6446     = "DM6446"
33 CEEXAMPLESDEVICES_dm6467     = "DM6467"
34 CEEXAMPLESDEVICES_omap3      = "OMAP3530"
35 CEEXAMPLESDEVICES_dm355      = "DM355"
36 CEEXAMPLESDEVICES_dm365      = "DM365"
37 CEEXAMPLESDEVICES_omapl137   = "OMAPL137"
38 CEEXAMPLESDEVICES_omapl138   = "OMAPL138"
39 CEEXAMPLESDEVICES           ?= "<UNDEFINED_CEEXAMPLESDEVICES>"
40
41 # Define GPPOS variable
42 CEEXAMPLESGPPOS_dm6446       = "LINUX_GCC"
43 CEEXAMPLESGPPOS_dm6467       = "LINUX_GCC"
44 CEEXAMPLESGPPOS_omap3        = "LINUX_GCC"
45 CEEXAMPLESGPPOS_dm355        = "LINUX_GCC"
46 CEEXAMPLESGPPOS_dm365        = "LINUX_GCC"
47 CEEXAMPLESGPPOS_omapl137     = "LINUX_GCC"
48 CEEXAMPLESGPPOS_omapl138     = "LINUX_GCC"
49 CEEXAMPLESGPPOS             ?= "<UNDEFINED_CEEXAMPLESGPPOS>"
50
51 # Define PROGRAM variable
52 CEEXAMPLESPROGRAMS_dm6446    = "APP_CLIENT DSP_SERVER"
53 CEEXAMPLESPROGRAMS_dm6467    = "APP_CLIENT DSP_SERVER"
54 CEEXAMPLESPROGRAMS_omap3     = "APP_CLIENT DSP_SERVER"
55 CEEXAMPLESPROGRAMS_dm355     = "APP_LOCAL"
56 CEEXAMPLESPROGRAMS_dm365     = "APP_LOCAL"
57 CEEXAMPLESPROGRAMS_omapl137  = "APP_CLIENT DSP_SERVER"
58 CEEXAMPLESPROGRAMS_omapl138  = "APP_CLIENT DSP_SERVER"
59 CEEXAMPLESPROGRAMS          ?= "<UNDEFINED_CEEXAMPLESPROGRAMS>"
60
61 do_configure() {
62
63     # No way to pass this via ENV?
64     sed -i  \
65         -e s:arm-none-linux-gnueabi-:${TARGET_PREFIX}:g \
66         ${S}/examples/xdcpaths.mak
67 }
68
69 do_prepsources() {
70
71         for i in codecs extensions servers apps ; do
72                 cd ${S}/examples/ti/sdo/ce/examples/$i
73                 make DEVICES="${CEEXAMPLESDEVICES}" \
74                      GPPOS="${CEEXAMPLESGPPOS}" \
75                      PROGRAMS="${CEEXAMPLESPROGRAMS}" \
76                      CE_INSTALL_DIR="${S}" \
77                      XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" \
78                      BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}" \
79                      BIOSUTILS_INSTALL_DIR="${BIOSUTILS_INSTALL_DIR}" \
80                      DSPLINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \
81                      XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \
82                      FC_INSTALL_DIR="${FC_INSTALL_DIR}" \
83                      CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \
84                      LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \
85                      EDMA3_LLD_INSTALL_DIR="${EDMA3_LLD_INSTALL_DIR}" \
86                      CGTOOLS_V5T="${TOOLCHAIN_PATH}" \
87                      CGTOOLS_C64P="${CODEGEN_INSTALL_DIR}" \
88                      CGTOOLS_C674="${CODEGEN_INSTALL_DIR}" \
89                      clean
90                      # '.make' target was used in CE < 2.26, but its no longer
91                      # supported in CE >= 2.26. Now we are moved to >=2.26 
92                      # hence commenting out the .make target.
93                      # .make clean
94         done
95 }
96
97 addtask prepsources after do_configure before do_compile
98
99 do_compile () {
100
101         for i in codecs extensions servers apps ; do
102                 cd ${S}/examples/ti/sdo/ce/examples/$i
103                 make DEVICES="${CEEXAMPLESDEVICES}" \
104                      GPPOS="${CEEXAMPLESGPPOS}" \
105                      PROGRAMS="${CEEXAMPLESPROGRAMS}" \
106                      CE_INSTALL_DIR="${S}" \
107                      XDC_INSTALL_DIR="${XDC_INSTALL_DIR}" \
108                      BIOS_INSTALL_DIR="${BIOS_INSTALL_DIR}" \
109                      BIOSUTILS_INSTALL_DIR="${BIOSUTILS_INSTALL_DIR}" \
110                      DSPLINK_INSTALL_DIR="${LINK_INSTALL_DIR}" \
111                      XDAIS_INSTALL_DIR="${XDAIS_INSTALL_DIR}" \
112                      FC_INSTALL_DIR="${FC_INSTALL_DIR}" \
113                      CMEM_INSTALL_DIR="${CMEM_INSTALL_DIR}" \
114                      LPM_INSTALL_DIR="${LPM_INSTALL_DIR}" \
115                      EDMA3_LLD_INSTALL_DIR="${EDMA3_LLD_INSTALL_DIR}" \
116                      CGTOOLS_V5T="${TOOLCHAIN_PATH}" \
117                      CGTOOLS_C64P="${CODEGEN_INSTALL_DIR}" \
118                      CGTOOLS_C674="${CODEGEN_INSTALL_DIR}" \
119                      all
120         done
121 }
122
123 do_install() {
124
125         install -d ${D}/${installdir}/ti-codec-engine-examples
126         if [ -e ${S}/examples/apps/system_files/${CEEXAMPLESDEVICES}/loadmodules.sh ]; then
127                 cp ${S}/examples/apps/system_files/${CEEXAMPLESDEVICES}/loadmodules.sh ${D}/${installdir}/ti-codec-engine-examples
128         elif [ -e ${WORKDIR}/loadmodules.sh ]; then
129                 cp ${WORKDIR}/loadmodules.sh ${D}/${installdir}/ti-codec-engine-examples
130         fi
131
132         cd ${S}/examples/ti/sdo/ce/examples
133
134         # Install the apps, servers and test data, mirroring the source directory structure
135         #  - Put the servers inside the same folder as the executable
136         #  - TODO - Check nested dirs (e.g. dualcpu_separateconfig)
137
138         # Put all servers in separate tree.
139         for i in $(find . -name "*.${DSPSUFFIX}"); do
140                 install -d ${D}/${installdir}/ti-codec-engine-examples/servers/`dirname ${i} | cut -f3 -d /`
141                 install ${i} ${D}/${installdir}/ti-codec-engine-examples/servers/`dirname ${i} | cut -f3 -d /`
142         done
143
144         for i in $(find . -name "*.xv5T"); do
145                 install -d ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
146                 install ${i} ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
147         done
148
149         for i in $(find . -name "*.dat"); do
150                 install -d ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
151                 install ${i} ${D}/${installdir}/ti-codec-engine-examples/`dirname ${i} | cut -f3 -d /`
152         done
153
154         # For each directory, softlink to the app server, except special cases
155         cd ${D}/${installdir}/ti-codec-engine-examples
156         for i in $(find . -type d | grep -v servers); do
157                 {
158                 pwd
159                 cd ${D}/${installdir}/ti-codec-engine-examples/$i
160                 if [ $(basename $i) = "audio1_ires" ] ; then 
161                         ln -s ../servers/audio1_ires/audio1_ires.${DSPSUFFIX}
162                 elif [ $(basename $i) = "server_api_example" ] ; then
163                         ln -s ../servers/server_api_example/audio_copy.${DSPSUFFIX}
164                 elif [ $(basename $i) != "." ] ; then
165                         ln -s ../servers/all_codecs/all.${DSPSUFFIX}
166                 else
167                         echo Skipping $i
168                 fi
169                 }
170         done
171
172         # Install/Stage the Source Tree
173         install -d ${D}${CE_INSTALL_DIR_RECIPE}
174         cp -pPrf ${S}/* ${D}${CE_INSTALL_DIR_RECIPE}
175 }
176
177 PACKAGES += "ti-codec-engine-examples"
178
179 RDEPENDS_ti-codec-engine-examples                 = " ti-cmem-module"
180 RDEPENDS_ti-codec-engine-examples_append_dm6446   = " ti-dsplink-module ti-lpm-module"
181 RDEPENDS_ti-codec-engine-examples_append_dm6467   = " ti-dsplink-module"
182 RDEPENDS_ti-codec-engine-examples_append_omap3    = " ti-dsplink-module ti-lpm-module"
183 RDEPENDS_ti-codec-engine-examples_append_omapl137 = " ti-dsplink-module"
184 RDEPENDS_ti-codec-engine-examples_append_omapl138 = " ti-dsplink-module"
185 FILES_ti-codec-engine-examples = "${installdir}/ti-codec-engine-examples/*"
186 INSANE_SKIP_ti-codec-engine-examples = True
187