Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / packages / dsplink / dsplink.inc
1 DESCRIPTION = "DSP Link for TI ARM/DSP processors"
2
3 DEPENDS = "virtual/kernel perl-native"
4 RDEPENDS_${PN}-module = "update-modules"
5 RRECOMMENDS_${PN} = "${PN}-module"
6
7 inherit module
8
9 S = "${WORKDIR}/dsplink_1_60/dsplink"
10
11 # Needed for buildscripts
12 export DSPLINK="${S}"
13
14 require ti-paths.inc
15
16 DSPLINKPLATFORM ?= "DAVINCI"
17 DSPLINKPLATFORM_omap5912osk = "OMAP"
18 DSPLINKPLATFORM_beagleboard = "OMAP3530"
19 DSPLINKPLATFORM_davinci-sffsdr = "DAVINCI"
20 DSPLINKPLATFORM_davinci-dvevm = "DAVINCI"
21
22 DSPLINKDSP ?= "C64XX"
23
24 DSPLINKSOC ?= "DM6446"
25 DSPLINKSOC_beagleboard = "3530"
26
27 DSPCFG ?= "DM6446GEMSHMEM"
28 DSPCFG_beagleboard ?= "OMAP3530SHMEM"
29
30 GPPOS ?= "DAVINCILSP"
31 GPPOS_beagleboard = "OMAPLSP"
32
33 export DSPLINKPLATFORM 
34 export DSPLINKDSP
35 export DSPLINKSOC
36 export DSPCFG
37 export GPPOS
38
39 do_configure () {
40         # Run perl script to create appropriate makefiles (v1.60 and up)
41         perl config/bin/dsplinkcfg.pl --platform=${DSPLINKPLATFORM} --nodsp=1 --dspcfg_0=${DSPCFG} --dspos_0=DSPBIOS5XX  --gppos=${GPPOS} --comps=ponslrm
42 }
43
44 PARALLEL_MAKE = ""
45
46 do_compile () {
47         unset DISPLAY
48         sed -i -e s:armv7a:armv7-a:g make/Linux/omap3530_2.6.mk || true
49
50         # export various settings to override the defaults in the makefiles     
51         export DSP_BASE_CGTOOLS=${TITOOLSDIR}/${TICGTOOLSDIR}
52         export DSP_BASE_BIOS=${TITOOLSDIR}/${TIBIOSDIR}
53         export DSP_BASE_RTDX=${TITOOLSDIR}/${TIBIOSDIR}/packages/ti/rtdx
54         export GPPTOOL_DIR=${CROSS_DIR}
55         export LINUXKERNEL_INSTALL_DIR=${STAGING_KERNEL_DIR}
56         export LINK_INSTALL_DIR=${DSPLINK}
57         export VARIANT=${DSPLINKSOC}
58         export PLATFORM=${DSPLINKPLATFORM}
59         export BASE_TOOLCHAIN=${CROSS_DIR}
60         export BASE_CGTOOLS=${BASE_TOOLCHAIN}/bin
61         # 'OSINC_PLATFORM' is used in both the dsp and gpp sides...     
62         export OSINC_PLATFORM1=${CROSS_DIR}/lib/gcc/${TARGET_SYS}/$(${TARGET_PREFIX}gcc -dumpversion)/include
63         export OSINC_TARGET=${BASE_TOOLCHAIN}/target/usr/include
64
65         # 'ARCHIVER' is being used in the dsp side of the build as well as gpp
66         export ARCHIVER_AR=${TARGET_PREFIX}ar
67         export BASE_SABIOS=${DSP_BASE_BIOS}
68         
69         make -e -f ${WORKDIR}/Makefile.dsplink
70 }
71
72 do_install () {
73         install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp
74         cp ${S}/gpp/BUILD/EXPORT/RELEASE/dsplinkk.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/drivers/dsp/
75
76         install -d ${D}/${bindir}
77 #       install ${S}/gpp/BUILD/EXPORT/RELEASE/loopgpp           ${D}/${bindir}
78         install ${S}/gpp/BUILD/EXPORT/RELEASE/messagegpp        ${D}/${bindir}
79         install ${S}/gpp/BUILD/EXPORT/RELEASE/messagemultigpp   ${D}/${bindir}
80         install ${S}/gpp/BUILD/EXPORT/RELEASE/mpcsxfergpp       ${D}/${bindir}
81         install ${S}/gpp/BUILD/EXPORT/RELEASE/mplistgpp         ${D}/${bindir}
82         install ${S}/gpp/BUILD/EXPORT/RELEASE/readwritegpp      ${D}/${bindir}
83         install ${S}/gpp/BUILD/EXPORT/RELEASE/ringiogpp         ${D}/${bindir}
84         install ${S}/gpp/BUILD/EXPORT/RELEASE/scalegpp          ${D}/${bindir}
85
86         install -d ${D}/${datadir}/dsplink
87         for i in $(find ${S}/dsp/BUILD/ -name "*.out") ; do
88                 install ${i}  ${D}/${datadir}/dsplink
89         done    
90
91         install -d ${D}/${libdir}
92         install -m 0755 ${S}/gpp/BUILD/EXPORT/RELEASE/dsplink.lib  ${D}/${libdir}
93 }
94
95
96 # Coded Engine and friends need a complete tree, so stage it all
97 do_stage() {
98         install -d ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/dsplink
99         cp -pPr ${S}/* ${STAGING_DIR}/${MULTIMACH_TARGET_SYS}/dsplink/ 
100 }
101
102 pkg_postinst_${PN}-module () {
103         if [ -n "$D" ]; then
104                 exit 1
105         fi
106         depmod -a
107         update-modules || true
108 }
109
110 pkg_postrm_${PN}-module () {
111         update-modules || true
112 }
113
114 PACKAGES =+ "${PN}-module"
115 FILES_${PN}-module  = "${sysconfdir} /lib/modules"
116 FILES_${PN} = "${bindir}/* ${datadir}/dsplink/*"
117
118 INHIBIT_PACKAGE_STRIP = "1"
119
120 PACKAGE_ARCH = "${MACHINE_ARCH}" 
121