summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--documentation/ref-manual/variables.rst42
1 files changed, 36 insertions, 6 deletions
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index 59fd1b70ae..0e11ab2f68 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -5925,13 +5925,11 @@ system and gives an overview of their function and contents.
5925 omit any argument you like but must retain the separating commas. The 5925 omit any argument you like but must retain the separating commas. The
5926 order is important and specifies the following: 5926 order is important and specifies the following:
5927 5927
5928 #. Extra arguments that should be added to the configure script 5928 #. Extra arguments that should be added to :term:`PACKAGECONFIG_CONFARGS`
5929 argument list (:term:`EXTRA_OECONF` or 5929 if the feature is enabled.
5930 :term:`PACKAGECONFIG_CONFARGS`) if
5931 the feature is enabled.
5932 5930
5933 #. Extra arguments that should be added to :term:`EXTRA_OECONF` or 5931 #. Extra arguments that should be added to :term:`PACKAGECONFIG_CONFARGS`
5934 :term:`PACKAGECONFIG_CONFARGS` if the feature is disabled. 5932 if the feature is disabled.
5935 5933
5936 #. Additional build dependencies (:term:`DEPENDS`) 5934 #. Additional build dependencies (:term:`DEPENDS`)
5937 that should be added if the feature is enabled. 5935 that should be added if the feature is enabled.
@@ -5989,6 +5987,38 @@ system and gives an overview of their function and contents.
5989 5987
5990 PACKAGECONFIG:append:pn-recipename = " f4" 5988 PACKAGECONFIG:append:pn-recipename = " f4"
5991 5989
5990 Consider the following example of a :ref:`ref-classes-cmake` recipe with a systemd service
5991 in which :term:`PACKAGECONFIG` is used to transform the systemd service
5992 into a feature that can be easily enabled or disabled via :term:`PACKAGECONFIG`::
5993
5994 example.c
5995 example.service
5996 CMakeLists.txt
5997
5998 The ``CMakeLists.txt`` file contains::
5999
6000 if(WITH_SYSTEMD)
6001 install(FILES ${PROJECT_SOURCE_DIR}/example.service DESTINATION /etc/systemd/systemd)
6002 endif(WITH_SYSTEMD)
6003
6004 In order to enable the installation of ``example.service`` we need to
6005 ensure that ``-DWITH_SYSTEMD=ON`` is passed to the ``cmake`` command
6006 execution. Recipes that have ``CMakeLists.txt`` generally inherit the
6007 :ref:`ref-classes-cmake` class, that runs ``cmake`` with
6008 :term:`EXTRA_OECMAKE`, which :term:`PACKAGECONFIG_CONFARGS` will be
6009 appended to. Now, knowing that :term:`PACKAGECONFIG_CONFARGS` is
6010 automatically filled with either the first or second element of
6011 :term:`PACKAGECONFIG` flag value, the recipe would be like::
6012
6013 inherit cmake
6014 PACKAGECONFIG = "systemd"
6015 PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,-DWITH_SYSTEMD=OFF"
6016
6017 A side note to this recipe is to check if ``systemd`` is in fact the used :term:`INIT_MANAGER`
6018 or not::
6019
6020 PACKAGECONFIG = "${@'systemd' if d.getVar('INIT_MANAGER') == 'systemd' else ''}"
6021
5992 :term:`PACKAGECONFIG_CONFARGS` 6022 :term:`PACKAGECONFIG_CONFARGS`
5993 A space-separated list of configuration options generated from the 6023 A space-separated list of configuration options generated from the
5994 :term:`PACKAGECONFIG` setting. 6024 :term:`PACKAGECONFIG` setting.