1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-27 07:22:31 +03:00

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-12-20 21:31:32 +01:00
parent e1ca734edd
commit 3d3075e309
4 changed files with 16 additions and 26 deletions

View File

@ -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',

View File

@ -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)

View File

@ -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)

View File

@ -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')))