meson: detect pcre2 dep

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-01-12 05:47:17 +01:00
parent d8dab75789
commit c4c978a07f
3 changed files with 21 additions and 0 deletions

View File

@ -1064,6 +1064,17 @@ else
endif
conf.set10('HAVE_XKBCOMMON', have)
want_pcre2 = get_option('pcre2')
if want_pcre2 != 'false'
libpcre2 = dependency('libpcre2-8',
required : want_pcre2 == 'true')
have = libpcre2.found()
else
have = false
libpcre2 = []
endif
conf.set10('HAVE_PCRE2', have)
want_glib = get_option('glib')
if want_glib != 'false'
libglib = dependency('glib-2.0',
@ -2693,6 +2704,7 @@ foreach tuple : [
['gnu-efi', have_gnu_efi],
['kmod'],
['xkbcommon'],
['pcre2'],
['blkid'],
['dbus'],
['glib'],

View File

@ -260,6 +260,8 @@ option('lz4', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'lz4 compression support')
option('xkbcommon', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'xkbcommon keymap support')
option('pcre2', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'regexp matching support using pcre2')
option('glib', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'libglib support (for tests only)')
option('dbus', type : 'combo', choices : ['auto', 'true', 'false'],

View File

@ -140,6 +140,12 @@
#define _IDN_FEATURE_ "-IDN"
#endif
#if HAVE_PCRE2
#define _PCRE2_FEATURE_ "+PCRE2"
#else
#define _PCRE2_FEATURE_ "-PCRE2"
#endif
#define _CGROUP_HIEARCHY_ "default-hierarchy=" DEFAULT_HIERARCHY_NAME
#define SYSTEMD_FEATURES \
@ -163,4 +169,5 @@
_KMOD_FEATURE_ " " \
_IDN2_FEATURE_ " " \
_IDN_FEATURE_ " " \
_PCRE2_FEATURE_ " " \
_CGROUP_HIEARCHY_