xref: /OK3568_Linux_fs/yocto/poky/meta/classes/gettext.bbclass (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyundef gettext_dependencies(d):
2*4882a593Smuzhiyun    if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
3*4882a593Smuzhiyun        return ""
4*4882a593Smuzhiyun    if d.getVar('USE_NLS') == 'no':
5*4882a593Smuzhiyun        return "gettext-minimal-native"
6*4882a593Smuzhiyun    return "gettext-native"
7*4882a593Smuzhiyun
8*4882a593Smuzhiyundef gettext_oeconf(d):
9*4882a593Smuzhiyun    if d.getVar('USE_NLS') == 'no':
10*4882a593Smuzhiyun        return '--disable-nls'
11*4882a593Smuzhiyun    # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
12*4882a593Smuzhiyun    if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
13*4882a593Smuzhiyun        return '--disable-nls'
14*4882a593Smuzhiyun    return "--enable-nls"
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunBASEDEPENDS:append = " ${@gettext_dependencies(d)}"
17*4882a593SmuzhiyunEXTRA_OECONF:append = " ${@gettext_oeconf(d)}"
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun# Without this, msgfmt from gettext-native will not find ITS files
20*4882a593Smuzhiyun# provided by target recipes (for example, polkit.its).
21*4882a593SmuzhiyunGETTEXTDATADIRS:append:class-target = ":${STAGING_DATADIR}/gettext"
22*4882a593Smuzhiyunexport GETTEXTDATADIRS
23