blob: be2ef3b311481f0daba5e6f5f3424fff1983826c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001def gettext_dependencies(d):
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002 if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003 return ""
Brad Bishop6e60e8b2018-02-01 10:27:11 -05004 if d.getVar('USE_NLS') == 'no':
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005 return "gettext-minimal-native"
Brad Bishop316dfdd2018-06-25 12:45:53 -04006 return "gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007
8def gettext_oeconf(d):
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009 if d.getVar('USE_NLS') == 'no':
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010 return '--disable-nls'
11 # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012 if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013 return '--disable-nls'
14 return "--enable-nls"
15
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016BASEDEPENDS_append = " ${@gettext_dependencies(d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017EXTRA_OECONF_append = " ${@gettext_oeconf(d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018
19# Without this, msgfmt from gettext-native will not find ITS files
20# provided by target recipes (for example, polkit.its).
21GETTEXTDATADIRS_append_class-target = ":${STAGING_DATADIR}/gettext"
22export GETTEXTDATADIRS