]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: simplify handling of pkgconfigdatadir=no, pkgconfiglibdir=no
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 20 Dec 2018 20:31:32 +0000 (21:31 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 21 Dec 2018 12:43:20 +0000 (13:43 +0100)
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
src/libsystemd/meson.build
src/libudev/meson.build
src/udev/meson.build

index 450d6f72a92911553b7d215305c245ac120499b2..85021bdc01001926bde720a10d4d613f55e6ef8c 100644 (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',
index 05d4ea0e7f6fef3f6ae9e4cd3b2e22e5a5851d58..67add387e6ba02acfc576c6ad52df9b76dc8e2c0 100644 (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)
index 8d86c341893a10a85f2843c4e46f971ce97e7e88..88189748d3992594f073610c3f14bf0628d01077 100644 (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)
index e378d9190c77d150d300adacfab0f752465748f1..a9d6c6363f20077ca7ebedb50604a78d6b64398a 100644 (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')))