From: Zbigniew Jędrzejewski-Szmek Date: Tue, 19 Dec 2017 18:06:56 +0000 (+0100) Subject: Move gcrypt-util to basic/ X-Git-Tag: v237~158^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34e221a58bb3f4d5d58fe238a6a5e5a5df30d4ff;p=platform%2Fupstream%2Fsystemd.git 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 --- diff --git a/meson.build b/meson.build index 8ea3c03..fa0b0ab 100644 --- a/meson.build +++ b/meson.build @@ -1235,9 +1235,6 @@ includes = include_directories('src/basic', add_project_arguments('-include', 'config.h', language : 'c') -gcrypt_util_sources = files('src/shared/gcrypt-util.h', - 'src/shared/gcrypt-util.c') - subdir('po') subdir('catalog') subdir('src/systemd') @@ -1258,15 +1255,14 @@ libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sy 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], @@ -1507,11 +1503,10 @@ endif 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], @@ -1521,11 +1516,10 @@ if conf.get('ENABLE_RESOLVE') == 1 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/shared/gcrypt-util.c b/src/basic/gcrypt-util.c similarity index 100% rename from src/shared/gcrypt-util.c rename to src/basic/gcrypt-util.c diff --git a/src/shared/gcrypt-util.h b/src/basic/gcrypt-util.h similarity index 100% rename from src/shared/gcrypt-util.h rename to src/basic/gcrypt-util.h diff --git a/src/basic/meson.build b/src/basic/meson.build index 43a2e11..fce1d21 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build @@ -306,3 +306,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 a9ad217..7402e75 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -56,8 +56,6 @@ shared_sources = ''' firewall-util.h fstab-util.c fstab-util.h - gcrypt-util.c - gcrypt-util.h generator.c generator.h gpt.h @@ -175,7 +173,8 @@ libshared = shared_library( link_args : ['-shared', '-Wl,--version-script=' + libshared_sym_path], link_whole : [libshared_static, - libbasic], + libbasic, + libbasic_gcrypt], c_args : ['-fvisibility=default'], dependencies : libshared_deps, install : true,