]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
networkd: use socket activation when starting networkd
[thirdparty/systemd.git] / meson.build
index 0c012b69fe1f81ac15fa1058be8378eba809f308..cd2b02488b373fa24b0f33dc1072a2b7e6495f62 100644 (file)
@@ -676,13 +676,17 @@ conf.set_quoted('DEFAULT_NET_NAMING_SCHEME', default_net_naming_scheme)
 
 time_epoch = get_option('time-epoch')
 if time_epoch == -1
-        source_date_epoch = run_command('sh', ['-c', 'echo "$SOURCE_DATE_EPOCH"']).stdout().strip()
-        if source_date_epoch != ''
-                time_epoch = source_date_epoch.to_int()
-        else
+        time_epoch = run_command('sh', ['-c', 'echo "$SOURCE_DATE_EPOCH"']).stdout().strip()
+        if time_epoch == '' and git.found() and run_command('test', '-e', '.git').returncode() == 0
+                # If we're in a git repository, use the creation time of the latest git tag.
+                latest_tag = run_command('git', 'describe', '--abbrev=0', '--tags').stdout().strip()
+                time_epoch = run_command('git', 'log', '-1', '--format=%at', latest_tag).stdout()
+        endif
+        if time_epoch == ''
                 NEWS = files('NEWS')
-                time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout().to_int()
+                time_epoch = run_command(stat, '-c', '%Y', NEWS).stdout()
         endif
+        time_epoch = time_epoch.to_int()
 endif
 conf.set('TIME_EPOCH', time_epoch)
 
@@ -787,7 +791,7 @@ tty_gid = get_option('tty-gid')
 conf.set('TTY_GID', tty_gid)
 substs.set('TTY_GID', tty_gid)
 
-# Ensure provided GID argument is numeric, otherwise fallback to default assignment
+# Ensure provided GID argument is numeric, otherwise fall back to default assignment
 users_gid = get_option('users-gid')
 substs.set('USERS_GID', users_gid < 0 ? '-' : users_gid)
 
@@ -886,6 +890,7 @@ libmount = dependency('mount',
 want_libfdisk = get_option('fdisk')
 if want_libfdisk != 'false' and not skip_deps
         libfdisk = dependency('fdisk',
+                              version : '>= 2.33',
                               required : want_libfdisk == 'true')
         have = libfdisk.found()
 else
@@ -1410,42 +1415,43 @@ else
 endif
 conf.set10('ENABLE_REMOTE', have)
 
-foreach term : ['utmp',
-                'hibernate',
-                'environment-d',
+foreach term : ['analyze',
+                'backlight',
                 'binfmt',
                 'coredump',
-                'pstore',
-                'resolve',
-                'logind',
+                'efi',
+                'environment-d',
+                'firstboot',
+                'gshadow',
+                'hibernate',
                 'hostnamed',
+                'hwdb',
+                'idn',
+                'ima',
+                'initrd',
+                'ldconfig',
                 'localed',
+                'logind',
                 'machined',
-                'portabled',
-                'userdb',
                 'networkd',
-                'timedated',
-                'timesyncd',
-                'firstboot',
-                'randomseed',
-                'backlight',
-                'vconsole',
+                'nss-myhostname',
+                'nss-systemd',
+                'portabled',
+                'pstore',
                 'quotacheck',
+                'randomseed',
+                'resolve',
+                'rfkill',
+                'smack',
                 'sysusers',
+                'timedated',
+                'timesyncd',
                 'tmpfiles',
-                'hwdb',
-                'rfkill',
-                'xdg-autostart',
-                'ldconfig',
-                'efi',
                 'tpm',
-                'ima',
-                'smack',
-                'gshadow',
-                'idn',
-                'initrd',
-                'nss-myhostname',
-                'nss-systemd']
+                'userdb',
+                'utmp',
+                'vconsole',
+                'xdg-autostart']
         have = get_option(term)
         name = 'ENABLE_' + term.underscorify().to_upper()
         conf.set10(name, have)
@@ -1619,8 +1625,15 @@ install_libsystemd_static = static_library(
                         libgcrypt],
         c_args : libsystemd_c_args + (static_libsystemd_pic ? [] : ['-fno-PIC']))
 
-# Generate autosuspend rules
+############################################################
+
+autosuspend_update_sh = find_program('tools/autosuspend-update.sh')
+hwdb_update_sh = find_program('tools/hwdb-update.sh')
 make_autosuspend_rules_py = find_program('tools/make-autosuspend-rules.py')
+make_directive_index_py = find_program('tools/make-directive-index.py')
+make_man_index_py = find_program('tools/make-man-index.py')
+syscall_names_update_sh = find_program('tools/syscall-names-update.sh')
+xml_helper_py = find_program('tools/xml_helper.py')
 
 ############################################################
 
@@ -1762,7 +1775,7 @@ public_programs += executable(
                         libmount,
                         libblkid],
         install_rpath : rootlibexecdir,
-        install : get_option('analyze'))
+        install : conf.get('ENABLE_ANALYZE'))
 
 executable(
         'systemd-journald',
@@ -1795,11 +1808,11 @@ public_programs += executable(
         include_directories : includes,
         link_with : [libshared],
         dependencies : [threads,
-                        libqrencode,
+                        libdl,
                         libxz,
                         liblz4,
-                        libpcre2,
-                        libzstd],
+                        libzstd,
+                        libdl],
         install_rpath : rootlibexecdir,
         install : true,
         install_dir : rootbindir)
@@ -1894,8 +1907,7 @@ if conf.get('HAVE_BLKID') == 1
                 include_directories : includes,
                 link_with : [libshared],
                 install_rpath : rootlibexecdir,
-                install : true,
-                install_dir : rootlibexecdir)
+                install : true)
 endif
 
 if conf.get('ENABLE_RESOLVE') == 1
@@ -2170,8 +2182,7 @@ if conf.get('ENABLE_HOMED') == 1
                 link_with : [libshared],
                 dependencies : [threads,
                                 libcrypt,
-                                libopenssl,
-                                libpwquality],
+                                libopenssl],
                 install_rpath : rootlibexecdir,
                 install : true,
                 install_dir : rootlibexecdir)
@@ -2186,7 +2197,7 @@ if conf.get('ENABLE_HOMED') == 1
                                 libopenssl,
                                 libp11kit,
                                 libfido2,
-                                libpwquality],
+                                libdl],
                 install_rpath : rootlibexecdir,
                 install : true,
                 install_dir : rootbindir)
@@ -2664,6 +2675,7 @@ if conf.get('ENABLE_REPART') == 1
                 install_rpath : rootlibexecdir,
                 install : true,
                 install_dir : rootbindir)
+        public_programs += exe
 
         if want_tests != 'false'
                 test('test-repart',
@@ -3080,7 +3092,7 @@ executable(
         link_with : [libshared],
         dependencies : [libaudit],
         install_rpath : rootlibexecdir,
-        install : true,
+        install : (conf.get('ENABLE_UTMP') == 1),
         install_dir : rootlibexecdir)
 
 if conf.get('HAVE_KMOD') == 1
@@ -3325,12 +3337,6 @@ run_target(
 
 ############################################################
 
-make_directive_index_py = find_program('tools/make-directive-index.py')
-make_man_index_py = find_program('tools/make-man-index.py')
-xml_helper_py = find_program('tools/xml_helper.py')
-hwdb_update_sh = find_program('tools/hwdb-update.sh')
-autosuspend_update_sh = find_program('tools/autosuspend-update.sh')
-
 subdir('sysctl.d')
 subdir('sysusers.d')
 subdir('tmpfiles.d')
@@ -3678,7 +3684,7 @@ foreach tuple : [
         ['link-networkd-shared',  get_option('link-networkd-shared')],
         ['link-timesyncd-shared', get_option('link-timesyncd-shared')],
         ['kernel-install',        get_option('kernel-install')],
-        ['systemd-analyze',       get_option('analyze')],
+        ['systemd-analyze',  conf.get('ENABLE_ANALYZE') == 1],
 ]
 
         if tuple.length() >= 2