Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to give options for "configure" using yocto recipes?

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.

like image 855
A R Avatar asked Sep 23 '14 12:09

A R


People also ask

What is Extra_oeconf?

EXTRA_OECONF is used to add extra options to the configure script. EXTRA_OEMAKE is used to add extra parameters to the make call.

What is .BB file in Yocto?

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.

What is recipe in Yocto Project?

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.


1 Answers

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.

like image 60
Ashok Vairavan Avatar answered Oct 06 '22 02:10

Ashok Vairavan