From: Yu Watanabe Date: Fri, 23 Jun 2023 02:21:40 +0000 (+0900) Subject: meson: move declaration of cryptsetup token modules X-Git-Tag: v255-rc1~867^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07e43306b365150a07a5637786a2514ed3f711f4;p=thirdparty%2Fsystemd.git meson: move declaration of cryptsetup token modules --- diff --git a/meson.build b/meson.build index 3753d190947..48fda2a225f 100644 --- a/meson.build +++ b/meson.build @@ -2215,7 +2215,6 @@ subdir('src/libsystemd') subdir('src/shared') subdir('src/udev') subdir('src/libudev') -subdir('src/cryptsetup/cryptsetup-tokens') libsystemd = shared_library( 'systemd', @@ -2300,62 +2299,6 @@ install_libudev_static = static_library( c_args : static_libudev_pic ? [] : ['-fno-PIC'], pic : static_libudev_pic) -if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1 - if conf.get('HAVE_TPM2') == 1 - shared_library( - 'cryptsetup-token-systemd-tpm2', - cryptsetup_token_systemd_tpm2_sources, - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + cryptsetup_token_sym_path], - link_with : [lib_cryptsetup_token_common, - libshared], - dependencies : [libcryptsetup, - tpm2, - userspace], - link_depends : cryptsetup_token_sym, - install_rpath : pkglibdir, - install : true, - install_dir : libcryptsetup_plugins_dir) - endif - - if conf.get('HAVE_LIBFIDO2') == 1 - shared_library( - 'cryptsetup-token-systemd-fido2', - cryptsetup_token_systemd_fido2_sources, - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + cryptsetup_token_sym_path], - link_with : [lib_cryptsetup_token_common, - libshared], - dependencies : [libcryptsetup, - libfido2, - userspace], - link_depends : cryptsetup_token_sym, - install_rpath : pkglibdir, - install : true, - install_dir : libcryptsetup_plugins_dir) - endif - - if conf.get('HAVE_P11KIT') == 1 - shared_library( - 'cryptsetup-token-systemd-pkcs11', - cryptsetup_token_systemd_pkcs11_sources, - include_directories : includes, - link_args : ['-shared', - '-Wl,--version-script=' + cryptsetup_token_sym_path], - link_with : [lib_cryptsetup_token_common, - libshared], - dependencies : [libcryptsetup, - libp11kit, - userspace], - link_depends : cryptsetup_token_sym, - install_rpath : pkglibdir, - install : true, - install_dir : libcryptsetup_plugins_dir) - endif -endif - ############################################################ executable_template = { diff --git a/src/cryptsetup/cryptsetup-tokens/meson.build b/src/cryptsetup/cryptsetup-tokens/meson.build index e7b7fbab119..120621eaee3 100644 --- a/src/cryptsetup/cryptsetup-tokens/meson.build +++ b/src/cryptsetup/cryptsetup-tokens/meson.build @@ -1,8 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -cryptsetup_token_sym = files('cryptsetup-token.sym') -cryptsetup_token_sym_path = meson.current_source_dir() / 'cryptsetup-token.sym' - lib_cryptsetup_token_common = static_library( 'cryptsetup-token-common', 'cryptsetup-token-util.c', @@ -25,3 +22,54 @@ cryptsetup_token_systemd_pkcs11_sources = files( 'cryptsetup-token-systemd-pkcs11.c', 'luks2-pkcs11.c', ) + +template = { + 'include_directories' : includes, + 'link_with' : [ + lib_cryptsetup_token_common, + libshared, + ], + 'link_depends' : files('cryptsetup-token.sym'), + 'install_rpath' : pkglibdir, + 'install' : true, + 'install_dir' : libcryptsetup_plugins_dir, +} + +modules += [ + template + { + 'name' : 'cryptsetup-token-systemd-tpm2', + 'conditions' : [ + 'HAVE_LIBCRYPTSETUP_PLUGINS', + 'HAVE_TPM2', + ], + 'sources' : cryptsetup_token_systemd_tpm2_sources, + 'dependencies' : [ + libcryptsetup, + tpm2, + ], + }, + template + { + 'name' : 'cryptsetup-token-systemd-fido2', + 'conditions' : [ + 'HAVE_LIBCRYPTSETUP_PLUGINS', + 'HAVE_LIBFIDO2', + ], + 'sources' : cryptsetup_token_systemd_fido2_sources, + 'dependencies' : [ + libcryptsetup, + libfido2, + ], + }, + template + { + 'name' : 'cryptsetup-token-systemd-pkcs11', + 'conditions' : [ + 'HAVE_LIBCRYPTSETUP_PLUGINS', + 'HAVE_P11KIT', + ], + 'sources' : cryptsetup_token_systemd_pkcs11_sources, + 'dependencies' : [ + libcryptsetup, + libp11kit, + ], + }, +] diff --git a/src/cryptsetup/meson.build b/src/cryptsetup/meson.build index 45c4154c956..2a8e43a33a4 100644 --- a/src/cryptsetup/meson.build +++ b/src/cryptsetup/meson.build @@ -1,5 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later +subdir('cryptsetup-tokens') + systemd_cryptsetup_sources = files( 'cryptsetup-keyfile.c', 'cryptsetup.c',