]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - meson.build
flock: initialize timevals [-Werror=maybe-uninitialized]
[thirdparty/util-linux.git] / meson.build
index 5c59c4400cc20cc0fa0f40fc36a2d8b39913183b..5007ceb2abeed61f23578bf43dd15ee4bd1158ab 100644 (file)
@@ -1,7 +1,11 @@
 project('util-linux', 'c',
         version : run_command('tools/git-version-gen', check: true).stdout(),
-        meson_version: '>=0.57.0',
-        license : 'GPLv2+')
+        meson_version: '>=0.60.0',
+        license : 'GPLv2+',
+        default_options : [
+          'c_std=c99',
+          'cpp_std=c++11',
+        ])
 
 fs = import('fs')
 pkgconfig = import('pkgconfig')
@@ -172,6 +176,7 @@ headers = '''
        linux/fiemap.h
        linux/gsmmux.h
         linux/if_alg.h
+        linux/landlock.h
         linux/kcmp.h
         linux/net_namespace.h
         linux/nsfs.h
@@ -535,6 +540,9 @@ funcs = '''
         getsgnam
         inotify_init
         jrand48
+        landlock_create_ruleset
+        landlock_add_rule
+        landlock_restrict_self
         lchown
         lgetxattr
         llistxattr
@@ -553,6 +561,8 @@ funcs = '''
         posix_fadvise
         prctl
         qsort_r
+        reallocarray
+        renameat2
         rpmatch
         scandirat
         setprogname
@@ -671,6 +681,19 @@ int main(void) {
 have = cc.compiles(code, name : 'using tzname[]')
 conf.set('HAVE_TZNAME', have ? 1 : false)
 
+have = cc.sizeof('time_t', prefix : '#include <time.h>')
+if have < 8
+  add_global_arguments('-D_TIME_BITS=64', language : 'c')
+  have = cc.sizeof('time_t', args : '-D_TIME_BITS=64', prefix : '#include <time.h>')
+  if have < 8
+    if get_option('allow-32bit-time')
+      warning('Could not make time_t 64bits wide')
+    else
+      error('Could not make time_t 64bits wide')
+    endif
+  endif
+endif
+
 socket_libs = []
 if not cc.has_function('socket')
   socket_libs += cc.find_library('socket', required : true)
@@ -838,15 +861,15 @@ conf.set('ONLY_LISTED_SHELLS', have ? 1 : false)
 have = get_option('use-tty-group')
 conf.set('USE_TTY_GROUP', have ? 1 : false)
 
+bison = find_program('bison')
+flex = find_program('flex')
+
 build_hwclock = not get_option('build-hwclock').disabled()
-bison = find_program('bison', required: build_hwclock)
 bison_gen = generator(
   bison,
   output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
   arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
 
-
-
 meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
 meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
 
@@ -2446,7 +2469,7 @@ exe = executable(
   link_with : [lib_common],
   dependencies : [lib_systemd],
   install_dir : usrbin_exec_dir,
-  install_mode : 'rwxr-sr-x',
+  install_mode : [ 'rwxr-sr-x', 'root', 'tty' ],
   install : opt,
   build_by_default : opt)
 if opt
@@ -2466,7 +2489,7 @@ exe = executable(
   link_with : [lib_common],
   dependencies : [lib_systemd],
   install_dir : usrbin_exec_dir,
-  install_mode : 'rwxr-sr-x',
+  install_mode : [ 'rwxr-sr-x', 'root', 'tty' ],
   install : opt,
   build_by_default : opt)
 if opt
@@ -2616,6 +2639,7 @@ exe = executable(
   link_with : [lib_common,
                lib_blkid,
                lib_mount,
+               lib_tcolors,
                lib_smartcols],
   dependencies : lib_udev,
   install : true)
@@ -2971,6 +2995,21 @@ if not is_disabler(exe)
   bashcompletions += ['lsclocks']
 endif
 
+if conf.get('HAVE_RENAMEAT2').to_string() == '1'
+exe = executable(
+  'exch',
+  exch_sources,
+  include_directories : includes,
+  link_with : [lib_common],
+  install_dir : usrbin_exec_dir,
+  install : true)
+if not is_disabler(exe)
+  exes += exe
+  manadocs += ['misc-utils/exch.1.adoc']
+  bashcompletions += ['exch']
+endif
+endif
+
 ############################################################
 
 opt = not get_option('build-schedutils').disabled()
@@ -3220,8 +3259,7 @@ endif
 
 ############################################################
 
-libfdisk_tests_cflags = ['-DTEST_PROGRAM',
-                         '-Wno-unused']
+libfdisk_tests_cflags = ['-DTEST_PROGRAM']
 libfdisk_tests_ldadd = [lib_fdisk_static, lib_uuid, lib_blkid]
 
 exe = executable(
@@ -3290,13 +3328,11 @@ if not is_disabler(exe)
   exes += exe
 endif
 
-sample_fdisk_cflags = ['-Wno-unused']
 sample_fdisk_ldadd = [lib_common, lib_fdisk]
 
 exe = executable(
   'sample-fdisk-mkpart',
   'libfdisk/samples/mkpart.c',
-  c_args : sample_fdisk_cflags,
   include_directories : lib_fdisk_includes,
   link_with : sample_fdisk_ldadd)
 if not is_disabler(exe)
@@ -3306,7 +3342,6 @@ endif
 exe = executable(
   'sample-fdisk-mkpart-fullspec',
   'libfdisk/samples/mkpart-fullspec.c',
-  c_args : sample_fdisk_cflags,
   include_directories : lib_fdisk_includes,
   link_with : sample_fdisk_ldadd)
 if not is_disabler(exe)
@@ -3462,6 +3497,15 @@ if not is_disabler(exe)
   exes += exe
 endif
 
+exe = executable(
+  'sample-scols-continuous-json',
+  'libsmartcols/samples/continuous-json.c',
+  include_directories : includes,
+  link_with : [lib_smartcols, lib_common])
+if not is_disabler(exe)
+  exes += exe
+endif
+
 exe = executable(
   'sample-scols-maxout',
   'libsmartcols/samples/maxout.c',