I want write a recipe in yocto to build my custom component. In that i would like to enable some flags according to machine.
eg:
if machine is x86
my configure command should be like :
./configure --enable-x86
if it is x64
./configure --enable-x64
i am using auto tools for building. please help me in writing recipe as well as "configure.ac" for achieving this.
ps: I am very new to yocto.
EXTRA_OECONF is used to add extra options to the configure script. EXTRA_OEMAKE is used to add extra parameters to the make call.
bb , are the most basic metadata files. These recipe files provide BitBake with the following: Descriptive information about the package. The version of the recipe. Existing Dependencies.
A recipe is a collection of non-executable metadata used by BitBake to set variables or define additional build-time tasks. A recipe contains fields such as the recipe description, the recipe version, the license of the package and the upstream source repository.
You can provide the configure options using EXTRA_OECONF. Here, you can also append values to it based on your architecture.
EXTRA_OECONF_append_x86="--enable-x86"
EXTRA_OECONF_append_x64="--enable-x64"
You can do this only if your architecture (x86/x64) is defined as aprt of OVERRIDE value. Let us see what OVERRIDE value is:
The Yocto bitbake configuration values are defined in poky/meta/conf/bitbake.conf. In that file, there is a variable called OVERRIDE. The sample value for OVERRIDE in bitbake configuration is shown below:
OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable"
When you run bitbake -e and gather the output, the value for OVERRIDE translates into based on your configuration.
OVERRIDES="linux:i586:build-linux:pn-defaultpkgname:x86:qemuall:qemux86:poky:class-target:forcevariable:libc-glibc"
In your setup, if you can see x86/x64 as part of OVERRIDE value then you can define configure options as described earlier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With