meson: fix gcrypt config option
Also detect libgpg-error. Require both to be present for HAVE_CRYPT, even though libgpg-error is only used in src/resolve. If one is available, the other should be too, so it doesn't seem worth the trouble to make two separate conditions.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
36f0387efc
commit
76c8741060
+20
-6
@@ -899,14 +899,21 @@ else
|
|||||||
libdbus = []
|
libdbus = []
|
||||||
endif
|
endif
|
||||||
|
|
||||||
want_libgcrypt = get_option('libgcrypt')
|
want_gcrypt = get_option('gcrypt')
|
||||||
if want_libgcrypt != 'false'
|
if want_gcrypt != 'false'
|
||||||
libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'true')
|
libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
|
||||||
if libgcrypt.found()
|
libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
|
||||||
conf.set('HAVE_LIBGCRYPT', 1)
|
|
||||||
|
if libgcrypt.found() and libgpg_error.found()
|
||||||
|
conf.set('HAVE_GCRYPT', 1)
|
||||||
|
else
|
||||||
|
# link to neither of the libs if one is not found
|
||||||
|
libgcrypt = []
|
||||||
|
libgpg_error = []
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
libgcrypt = []
|
libgcrypt = []
|
||||||
|
libgpg_error = []
|
||||||
endif
|
endif
|
||||||
|
|
||||||
want_importd = get_option('importd')
|
want_importd = get_option('importd')
|
||||||
@@ -915,7 +922,7 @@ if want_importd != 'false'
|
|||||||
conf.get('HAVE_ZLIB', 0) == 1 and
|
conf.get('HAVE_ZLIB', 0) == 1 and
|
||||||
conf.get('HAVE_BZIP2', 0) == 1 and
|
conf.get('HAVE_BZIP2', 0) == 1 and
|
||||||
conf.get('HAVE_XZ', 0) == 1 and
|
conf.get('HAVE_XZ', 0) == 1 and
|
||||||
conf.get('HAVE_LIBGCRYPT', 0) == 1)
|
conf.get('HAVE_GCRYPT', 0) == 1)
|
||||||
if have_deps
|
if have_deps
|
||||||
conf.set('ENABLE_IMPORTD', 1)
|
conf.set('ENABLE_IMPORTD', 1)
|
||||||
elif want_importd == 'true'
|
elif want_importd == 'true'
|
||||||
@@ -1060,6 +1067,7 @@ libsystemd = shared_library(
|
|||||||
'-Wl,--version-script=' + libsystemd_sym_path],
|
'-Wl,--version-script=' + libsystemd_sym_path],
|
||||||
link_with : [libbasic],
|
link_with : [libbasic],
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
|
libgcrypt,
|
||||||
librt,
|
librt,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4],
|
liblz4],
|
||||||
@@ -1305,9 +1313,12 @@ endif
|
|||||||
if conf.get('ENABLE_RESOLVED', 0) == 1
|
if conf.get('ENABLE_RESOLVED', 0) == 1
|
||||||
executable('systemd-resolved',
|
executable('systemd-resolved',
|
||||||
systemd_resolved_sources,
|
systemd_resolved_sources,
|
||||||
|
gcrypt_util_sources,
|
||||||
include_directories : includes,
|
include_directories : includes,
|
||||||
link_with : [libshared],
|
link_with : [libshared],
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
|
libgcrypt,
|
||||||
|
libgpg_error,
|
||||||
libm,
|
libm,
|
||||||
libidn],
|
libidn],
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
@@ -1316,9 +1327,12 @@ if conf.get('ENABLE_RESOLVED', 0) == 1
|
|||||||
|
|
||||||
exe = executable('systemd-resolve',
|
exe = executable('systemd-resolve',
|
||||||
systemd_resolve_sources,
|
systemd_resolve_sources,
|
||||||
|
gcrypt_util_sources,
|
||||||
include_directories : includes,
|
include_directories : includes,
|
||||||
link_with : [libshared],
|
link_with : [libshared],
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
|
libgcrypt,
|
||||||
|
libgpg_error,
|
||||||
libm,
|
libm,
|
||||||
libidn],
|
libidn],
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
|
|||||||
+2
-2
@@ -197,8 +197,8 @@ option('libiptc', type : 'combo', choices : ['auto', 'true', 'false'],
|
|||||||
description : 'libiptc support')
|
description : 'libiptc support')
|
||||||
option('qrencode', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('qrencode', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
description : 'libqrencode support')
|
description : 'libqrencode support')
|
||||||
option('libgcrypt', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('gcrypt', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
description : 'libgcrypt support')
|
description : 'gcrypt support')
|
||||||
option('gnutls', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('gnutls', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
description : 'gnutls support')
|
description : 'gnutls support')
|
||||||
option('elfutils', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('elfutils', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
|
|||||||
@@ -20,6 +20,17 @@ journal_internal_sources = files('''
|
|||||||
sd-journal.c
|
sd-journal.c
|
||||||
'''.split())
|
'''.split())
|
||||||
|
|
||||||
|
if conf.get('HAVE_GCRYPT', 0) == 1
|
||||||
|
journal_internal_sources += files('''
|
||||||
|
journal-authenticate.c
|
||||||
|
journal-authenticate.h
|
||||||
|
fsprg.c
|
||||||
|
fsprg.h
|
||||||
|
'''.split())
|
||||||
|
|
||||||
|
journal_internal_sources += gcrypt_util_sources
|
||||||
|
endif
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
audit_type_includes = [config_h,
|
audit_type_includes = [config_h,
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ tests += [
|
|||||||
'src/shared/test-tables.h'],
|
'src/shared/test-tables.h'],
|
||||||
[],
|
[],
|
||||||
[libgcrypt,
|
[libgcrypt,
|
||||||
|
libgpg_error,
|
||||||
libm],
|
libm],
|
||||||
'ENABLE_RESOLVED'],
|
'ENABLE_RESOLVED'],
|
||||||
|
|
||||||
@@ -155,6 +156,7 @@ tests += [
|
|||||||
dns_type_headers],
|
dns_type_headers],
|
||||||
[],
|
[],
|
||||||
[libgcrypt,
|
[libgcrypt,
|
||||||
|
libgpg_error,
|
||||||
libm],
|
libm],
|
||||||
'ENABLE_RESOLVED'],
|
'ENABLE_RESOLVED'],
|
||||||
|
|
||||||
@@ -163,6 +165,7 @@ tests += [
|
|||||||
dns_type_headers],
|
dns_type_headers],
|
||||||
[],
|
[],
|
||||||
[libgcrypt,
|
[libgcrypt,
|
||||||
|
libgpg_error,
|
||||||
libm],
|
libm],
|
||||||
'ENABLE_RESOLVED'],
|
'ENABLE_RESOLVED'],
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ libshared = shared_library(
|
|||||||
libcap,
|
libcap,
|
||||||
libacl,
|
libacl,
|
||||||
libcryptsetup,
|
libcryptsetup,
|
||||||
|
libgcrypt,
|
||||||
libiptc,
|
libiptc,
|
||||||
libseccomp,
|
libseccomp,
|
||||||
libselinux,
|
libselinux,
|
||||||
|
|||||||
Reference in New Issue
Block a user