Meson: Always fallback to proxy-libintl subproject

An implementation of gettext is required, but it's not always needed
e.g. for CI builds.

https://bugzilla.gnome.org/show_bug.cgi?id=796264
This commit is contained in:
Xavier Claessens 2018-05-20 00:08:19 -04:00
parent ed4ff31567
commit 5d0a99105d

View File

@ -1687,17 +1687,23 @@ else
endif
endif
# Only used on non-glibc targets
libintl = cc.find_library('intl', required : false)
if host_system == 'windows' and not libintl.found()
# Used only when the gettext library is not available (MSVC, not MinGW)
libintl = subproject('proxy-libintl').get_variable('intl_dep')
glib_conf.set('HAVE_DCGETTEXT', 1)
# First check in libc, fallback to libintl, and as last chance build
# proxy-libintl subproject.
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
# implementations. This could be extended if issues are found in some platforms.
if cc.has_function('ngettext')
libintl = []
else
glib_conf.set('HAVE_DCGETTEXT', cc.has_header_symbol('libintl.h', 'dcgettext'))
libintl = cc.find_library('intl', required : false)
if not libintl.found()
libintl = subproject('proxy-libintl').get_variable('intl_dep')
endif
endif
# We require gettext to always be present
glib_conf.set('HAVE_DCGETTEXT', 1)
glib_conf.set('HAVE_GETTEXT', 1)
glib_conf.set_quoted('GLIB_LOCALE_DIR', join_paths(glib_datadir, 'locale'))
# xgettext is optional (on Windows for instance)
xgettext = find_program('xgettext', required : false)