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
This commit is contained in:
parent
2d4ceca8a5
commit
34e221a58b
18
meson.build
18
meson.build
|
@ -1235,9 +1235,6 @@ includes = include_directories('src/basic',
|
||||||
|
|
||||||
add_project_arguments('-include', 'config.h', language : 'c')
|
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('po')
|
||||||
subdir('catalog')
|
subdir('catalog')
|
||||||
subdir('src/systemd')
|
subdir('src/systemd')
|
||||||
|
@ -1258,15 +1255,14 @@ libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sy
|
||||||
libsystemd = shared_library(
|
libsystemd = shared_library(
|
||||||
'systemd',
|
'systemd',
|
||||||
journal_internal_sources,
|
journal_internal_sources,
|
||||||
gcrypt_util_sources,
|
|
||||||
version : libsystemd_version,
|
version : libsystemd_version,
|
||||||
include_directories : includes,
|
include_directories : includes,
|
||||||
link_args : ['-shared',
|
link_args : ['-shared',
|
||||||
'-Wl,--version-script=' + libsystemd_sym_path],
|
'-Wl,--version-script=' + libsystemd_sym_path],
|
||||||
link_with : libbasic,
|
link_with : [libbasic,
|
||||||
|
libbasic_gcrypt],
|
||||||
link_whole : libsystemd_static,
|
link_whole : libsystemd_static,
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
libgcrypt,
|
|
||||||
librt,
|
librt,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4],
|
liblz4],
|
||||||
|
@ -1507,11 +1503,10 @@ endif
|
||||||
if conf.get('ENABLE_RESOLVE') == 1
|
if conf.get('ENABLE_RESOLVE') == 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,
|
||||||
|
libbasic_gcrypt],
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
libgcrypt,
|
|
||||||
libgpg_error,
|
libgpg_error,
|
||||||
libm,
|
libm,
|
||||||
libidn],
|
libidn],
|
||||||
|
@ -1521,11 +1516,10 @@ if conf.get('ENABLE_RESOLVE') == 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,
|
||||||
|
libbasic_gcrypt],
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
libgcrypt,
|
|
||||||
libgpg_error,
|
libgpg_error,
|
||||||
libm,
|
libm,
|
||||||
libidn],
|
libidn],
|
||||||
|
|
|
@ -306,3 +306,13 @@ libbasic = static_library(
|
||||||
libselinux],
|
libselinux],
|
||||||
c_args : ['-fvisibility=default'],
|
c_args : ['-fvisibility=default'],
|
||||||
install : false)
|
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'])
|
||||||
|
|
|
@ -56,8 +56,6 @@ shared_sources = '''
|
||||||
firewall-util.h
|
firewall-util.h
|
||||||
fstab-util.c
|
fstab-util.c
|
||||||
fstab-util.h
|
fstab-util.h
|
||||||
gcrypt-util.c
|
|
||||||
gcrypt-util.h
|
|
||||||
generator.c
|
generator.c
|
||||||
generator.h
|
generator.h
|
||||||
gpt.h
|
gpt.h
|
||||||
|
@ -175,7 +173,8 @@ libshared = shared_library(
|
||||||
link_args : ['-shared',
|
link_args : ['-shared',
|
||||||
'-Wl,--version-script=' + libshared_sym_path],
|
'-Wl,--version-script=' + libshared_sym_path],
|
||||||
link_whole : [libshared_static,
|
link_whole : [libshared_static,
|
||||||
libbasic],
|
libbasic,
|
||||||
|
libbasic_gcrypt],
|
||||||
c_args : ['-fvisibility=default'],
|
c_args : ['-fvisibility=default'],
|
||||||
dependencies : libshared_deps,
|
dependencies : libshared_deps,
|
||||||
install : true,
|
install : true,
|
||||||
|
|
Loading…
Reference in New Issue