From 3d3075e3098cc2c316e90b4b3d47f9cb6958cf6a Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Thu, 20 Dec 2018 21:31:32 +0100 Subject: meson: simplify handling of pkgconfigdatadir=no, pkgconfiglibdir=no The idea was that those vars could be configured to 'no' to not install the .pc files, or they could be set to '', and then they would be built but not installed. This was inherited from the autoconf build system. This couldn't work because '' is replaced by the default value. Also, having this level of control doesn't seem necessary, since creating those files is very quick. Skipping with 'no' was implemented only for systemd.pc and not the other .pc files. Let's simplify things and skip installation if the target dir is configured as 'no' for all .pc files. --- src/core/meson.build | 21 +++++++-------------- src/libsystemd/meson.build | 7 +++---- src/libudev/meson.build | 7 +++---- src/udev/meson.build | 7 +++---- 4 files changed, 16 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/core/meson.build b/src/core/meson.build index 450d6f72a9..85021bdc01 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -173,26 +173,19 @@ systemd_shutdown_sources = files(''' '''.split()) in_files = [['macros.systemd', rpmmacrosdir], - ['triggers.systemd', ''], + ['system.conf', pkgsysconfdir], ['systemd.pc', pkgconfigdatadir], - ['system.conf', pkgsysconfdir]] + ['triggers.systemd', '']] foreach item : in_files file = item[0] dir = item[1] - # If 'no', disable generation completely. - # If '', generate, but do not install. - if dir != 'no' - gen = configure_file( - input : file + '.in', - output : file, - configuration : substs) - if dir != '' - install_data(gen, - install_dir : dir) - endif - endif + configure_file( + input : file + '.in', + output : file, + configuration : substs, + install_dir : dir == 'no' ? '' : dir) endforeach install_data('org.freedesktop.systemd1.conf', diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build index 05d4ea0e7f..67add387e6 100644 --- a/src/libsystemd/meson.build +++ b/src/libsystemd/meson.build @@ -109,9 +109,8 @@ libsystemd_static = static_library( libsystemd_sym = 'src/libsystemd/libsystemd.sym' -libsystemd_pc = configure_file( +configure_file( input : 'libsystemd.pc.in', output : 'libsystemd.pc', - configuration : substs) -install_data(libsystemd_pc, - install_dir : pkgconfiglibdir) + configuration : substs, + install_dir : pkgconfiglibdir == 'no' ? '' : pkgconfiglibdir) diff --git a/src/libudev/meson.build b/src/libudev/meson.build index 8d86c34189..88189748d3 100644 --- a/src/libudev/meson.build +++ b/src/libudev/meson.build @@ -22,9 +22,8 @@ libudev_sym_path = meson.current_source_dir() + '/libudev.sym' install_headers('libudev.h') libudev_h_path = '@0@/libudev.h'.format(meson.current_source_dir()) -libudev_pc = configure_file( +configure_file( input : 'libudev.pc.in', output : 'libudev.pc', - configuration : substs) -install_data(libudev_pc, - install_dir : pkgconfiglibdir) + configuration : substs, + install_dir : pkgconfiglibdir == 'no' ? '' : pkgconfiglibdir) diff --git a/src/udev/meson.build b/src/udev/meson.build index e378d9190c..a9d6c6363f 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -187,12 +187,11 @@ endforeach install_data('udev.conf', install_dir : join_paths(sysconfdir, 'udev')) -udev_pc = configure_file( +configure_file( input : 'udev.pc.in', output : 'udev.pc', - configuration : substs) -install_data(udev_pc, - install_dir : pkgconfigdatadir) + configuration : substs, + install_dir : pkgconfigdatadir == 'no' ? '' : pkgconfigdatadir) meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(sysconfdir, 'udev/rules.d'))) -- cgit v1.2.3