Configuring packages

The Yocto build system provides the PACKAGECONFIG variable to help in the configuration of packages by defining a number of features. Your recipe defines the individual features as follows:

PACKAGECONFIG ??= "feature" 
PACKAGECONFIG[feature] = "--with-feature,--without-feature,build-deps-feature,rt-deps-feature" 

The PACKAGECONFIG variable contains a space-separated list of feature names, and it can be extended or overridden in bbappend files; have a look at the following example:

PACKAGECONFIG_append = " feature1 feature2" 

To extend or override it from a distribution or local configuration file, you would use the following syntax:

PACKAGECONFIG_pn-<package_name> = "feature1 feature2" 
PACKAGECONFIG_append_pn-<package_name> = " feature1 feature2" 

Following that, we characterize each feature with four ordered arguments:

  • Extra configuration arguments (for EXTRA_OECONF) when the feature is enabled
  • Extra configuration arguments (for EXTRA_OECONF) when the feature is disabled
  • Extra build dependencies (for DEPENDS) when the feature is enabled
  • Extra runtime dependencies (for RDEPENDS) when the feature is enabled

The four arguments are optional, but the ordering needs to be maintained by leaving the surrounding commas.

For example, the wpa-supplicant recipe defines two features, gnutls and openssl, but only enables gnutls by default, as seen here:

PACKAGECONFIG ??= "gnutls" 
PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt" 
PACKAGECONFIG[openssl] = ",,openssl" 
..................Content has been hidden....................

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