From cfdad284c65f39594bdba8bae4260ac2d21ade82 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 19 Dec 2017 19:06:56 +0100 Subject: [PATCH] Move gcrypt-util to basic/ We were including gcrypt-util.[ch] by hand in the few places where it was used. Create a convenience library to avoid compiling the same files multiple times. v2: - use a separate static library instead of mergin into libbasic --- meson.build | 18 ++++++------------ src/basic/meson.build | 10 ++++++++++ src/shared/meson.build | 5 ++--- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 95d99df56..6883d4a7a 100644 --- a/meson.build +++ b/meson.build @@ -1407,10 +1407,7 @@ includes = include_directories('src/basic', add_project_arguments('-include', 'config.h', language : 'c') #if 0 /// UNNEEDED by elogind -# gcrypt_util_sources = files('src/shared/gcrypt-util.h', -# 'src/shared/gcrypt-util.c') #endif // 0 - subdir('po') #if 0 /// UNNEEDED by elogind # subdir('catalog') @@ -1441,15 +1438,14 @@ subdir('src/login') # libsystemd = shared_library( # 'systemd', # journal_internal_sources, -# gcrypt_util_sources, # version : libsystemd_version, # include_directories : includes, # link_args : ['-shared', # '-Wl,--version-script=' + libsystemd_sym_path], -# link_with : libbasic, +# link_with : [libbasic, +# libbasic_gcrypt], # link_whole : libsystemd_static, # dependencies : [threads, -# libgcrypt, # librt, # libxz, # liblz4], @@ -1717,11 +1713,10 @@ test_dlopen = executable( # if conf.get('ENABLE_RESOLVE') == 1 # executable('systemd-resolved', # systemd_resolved_sources, -# gcrypt_util_sources, # include_directories : includes, -# link_with : [libshared], +# link_with : [libshared, +# libbasic_gcrypt], # dependencies : [threads, -# libgcrypt, # libgpg_error, # libm, # libidn], @@ -1731,11 +1726,10 @@ test_dlopen = executable( # # exe = executable('systemd-resolve', # systemd_resolve_sources, -# gcrypt_util_sources, # include_directories : includes, -# link_with : [libshared], +# link_with : [libshared, +# libbasic_gcrypt], # dependencies : [threads, -# libgcrypt, # libgpg_error, # libm, # libidn], diff --git a/src/basic/meson.build b/src/basic/meson.build index 78aba8257..d4f0503a0 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -461,3 +461,13 @@ libbasic = static_library( libselinux], c_args : ['-fvisibility=default'], install : false) + +# A convenience library that is separate from libbasic to avoid +# unnecessary linking to libgcrypt. +libbasic_gcrypt = static_library( + 'basic-gcrypt', + 'gcrypt-util.c', + 'gcrypt-util.h', + include_directories : includes, + dependencies : [libgcrypt], + c_args : ['-fvisibility=default']) diff --git a/src/shared/meson.build b/src/shared/meson.build index 2b5d14d2c..1bc098bf8 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -57,8 +57,6 @@ # firewall-util.h # fstab-util.c # fstab-util.h -# gcrypt-util.c -# gcrypt-util.h # generator.c # generator.h # gpt.h @@ -208,7 +206,8 @@ libshared = shared_library( # libudev_sources, # '-Wl,--version-script=' + libshared_sym_path], # link_whole : [libshared_static, -# libbasic], +# libbasic, +# libbasic_gcrypt], #else libelogind_internal_sources, #endif // 0 -- 2.30.2