How to do it...

Yocto recipes inherit base.bbclass and hence their default behavior is to look for a Makefile, makefile, or GNUmakefile and use GNU make to build the package. If your package already contains a Makefile, then all you need to worry about are the arguments that need to be passed to make. make arguments can be passed using the EXTRA_OEMAKE variable, and a do_install override that calls the oe_runmake install needs to be provided, otherwise an empty install is run. For example, the mingetty recipe is based on a Makefile and looks as follows:

SUMMARY = "Compact getty terminal handler for virtual consoles only"             
SECTION = "console/utils"                                                        
HOMEPAGE = "http://sourceforge.net/projects/mingetty/"                           
LICENSE = "GPLv2"                                                                
PR = "r3"                                                                        
  

LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e" SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz"
SRC_URI[md5sum] = "2a75ad6487ff271424ffc00a64420990" SRC_URI[sha256sum] = "0f55c90ba4faa913d91ef99cbf5cb2eb4dbe2780314c3bb17953f849c8cddd17"
# substitute our CFLAGS for "-O2 -Wall -W -pipe" # EXTRA_OEMAKE = "CC='${CC}' CFLAGS='${CFLAGS} -D_GNU_SOURCE'"
do_install(){ install -d ${D}${mandir}/man8 ${D}/${base_sbindir} oe_runmake install DESTDIR=${D} }
inherit update-alternatives ALTERNATIVE_${PN} = "getty" ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" ALTERNATIVE_TARGET[getty] = "${base_sbindir}/mingetty" ALTERNATIVE_PRIORITY = "10"
The update-alternatives class used in the previous recipe is a helper class that manages the alternative system for multiple providers for the same command. To use it the following variables need to be provided:

ALTERNATIVE_{PN}: A list of all the commands in the package that need alternative providers.
ALTERNATIVE_LINK_NAME[<command>]: Path for the alternative command, defaults to ${bindir}/<command>
ALTERNATIVE_TARGET: Sets a default link for all commands. Individual default links can be specified with ALTERNATIVE_TARGET[<command>].
ALTERNATIVE_PRIORITY: Sets a default priority for all commands. Individual priorities can be specified by ALTERNATIVE_PRIORITY[<command>].
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset