Why flag ?

  • If the code changes has to be enabled only on certain scenarios or only applicable for specific boards , then we have to define the flag .

Defining a new flag 

  • The flag has to be defined in ccsp_common.inc file
  • There are two ways to define the flag

                      1. Having the flag enabled always
                      2. Enabling only for specific board or on specific condition

Having the flag enabled always 

  • Go to ccsp_common.inc file
  • Add the flag under "CFLAGS_append +="  
  • Syntax

    CFLAGS_append +=  " <FLAG> "
  • Sample 

  • By this method, the flag is always set to 1 (true)
  • Now add the flag at required pieces of code

Enabling only for specific board or on specific condition

  • Add the flag using DISTRO_FEATURE in ccsp_common.inc file as below
  • Syntax 

    CFLAGS_append += " ${@bb.utils.contains('DISTRO_FEATURES', '<keyword>', '<FLAG>', '', d)}"
  • Now to enable the flag for the specific platform , invoke from platform specific machine conf file 
  • Syntax

    DISTRO_FEATURES_append = " ........ <keyword> "
  • Sample
     In ccsp_common.inc


     In raspberrypi-rdk-broadband.conf

           This enables RDK_REF_PLATFORM_ flag for rpi platform . 

  • Using DISTRO method 
  1. the package enable/disable for the specific platform can be controlled 
  2. installation of file based on feature availability 
  3. Functionality of feature can be controlled

          


  • No labels