]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - meson.build
include/fileutils: remove duplicated include
[thirdparty/util-linux.git] / meson.build
index 50405e2b4c5af33d353bd99294999e67f646abf5..f0ebe074144e96624aa0e519ce2ac0d287a59593 100644 (file)
@@ -23,6 +23,7 @@ docdir = join_paths(prefixdir, get_option('datadir'), 'doc', 'util-linux')
 mandir = join_paths(prefixdir, get_option('mandir'))
 runstatedir = '/run'
 execprefixdir = prefixdir
+sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))
 usrbin_exec_dir = join_paths(execprefixdir, bindir)
 usrsbin_exec_dir = join_paths(execprefixdir, sbindir)
 bash_completion = dependency('bash-completion', required : get_option('build-bash-completion'))
@@ -57,6 +58,7 @@ conf.set_quoted('LIBBLKID_DATE', libblkid_date)
 conf.set('bindir', bindir)
 conf.set('sbindir', sbindir)
 conf.set('runstatedir', runstatedir)
+conf.set('sysconfdir', sysconfdir)
 conf.set('usrsbin_execdir', usrsbin_exec_dir)
 conf.set('docdir', docdir)
 conf.set_quoted('_PATH_SYSCONFSTATICDIR', sysconfstaticdir)
@@ -75,9 +77,14 @@ build_libuuid = not get_option('build-libuuid').disabled()
 conf.set('HAVE_LIBUUID', build_libuuid ? 1 : false)
 summary('libuuid', build_libuuid ? 'enabled' : 'disabled', section : 'components')
 
+have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0
+conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false)
+conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false)
+
 build_libmount = not get_option('build-libmount').disabled()
 conf.set('HAVE_LIBMOUNT', build_libmount ? 1 : false)
 conf.set('USE_LIBMOUNT_SUPPORT_NAMESPACES', 1)
+conf.set('USE_LIBMOUNT_MOUNTFD_SUPPORT', have_mountfd_api ? 1 : false)
 summary('libmount', build_libmount ? 'enabled' : 'disabled', section : 'components')
 
 build_libsmartcols = not get_option('build-libsmartcols').disabled()
@@ -164,6 +171,7 @@ headers = '''
        linux/gsmmux.h
         linux/net_namespace.h
         linux/nsfs.h
+        linux/stat.h
         linux/securebits.h
         linux/tiocl.h
         linux/version.h
@@ -374,7 +382,7 @@ lib_econf = dependency(
 conf.set('HAVE_LIBECONF', lib_econf.found() ? 1 : false)
 
 lib_audit = dependency(
-  'libaudit',
+  'audit',
   required : get_option('audit'))
 conf.set('HAVE_LIBAUDIT', lib_audit.found() ? 1 : false)
 
@@ -478,7 +486,12 @@ funcs = '''
         errx
         explicit_bzero
         fmemopen
+        fnmatch
         fseeko
+        fsconfig
+        fsmount
+        fsopen
+        fspick
         fsync
         utimensat
         getdomainname
@@ -497,8 +510,11 @@ funcs = '''
         newlocale
         mempcpy
         mkostemp
+        move_mount
+        mount_setattr
         nanosleep
         ntp_gettime
+        open_tree
         personality
         pidfd_open
         pidfd_send_signal
@@ -516,6 +532,7 @@ funcs = '''
         sched_setscheduler
         sigqueue
         srandom
+        statx
         strnchr
         strndup
         strnlen
@@ -579,6 +596,11 @@ have = cc.has_member('struct tm', 'tm_gmtoff',
                      ''')
 conf.set('HAVE_TM_GMTOFF', have ? 1 : false)
 
+
+
+have = cc.sizeof('enum fsconfig_command', prefix : '#include <linux/mount.h>') > 0
+conf.set('HAVE_ENUM_FSCONFIG_COMMAND', have ? 1 : false)
+
 have = cc.has_member('struct termios', 'c_line',
                      prefix : '#include <termios.h>')
 conf.set('HAVE_STRUCT_TERMIOS_C_LINE', have ? 1 : false)
@@ -670,6 +692,9 @@ int main(void) {
 have = cc.compiles(code, name : 'using __progname')
 conf.set('HAVE___PROGNAME', have ? 1 : false)
 
+have_opal_get_status= cc.has_header_symbol('linux/sed-opal.h', 'IOC_OPAL_GET_STATUS')
+conf.set('HAVE_OPAL_GET_STATUS', have_opal_get_status ? 1 : false)
+
 build_plymouth_support = get_option('build-plymouth-support')
 have_tiocglcktrmios = cc.has_header_symbol(
   'sys/ioctl.h', 'TIOCGLCKTRMIOS',
@@ -751,6 +776,9 @@ if systemd.found()
   systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
 endif
 
+sysvinit = get_option('sysvinit').enabled()
+sysvinitrcdir = sysconfdir + '/init.d'
+
 chfn_chsh_password = get_option('chfn-chsh-password') or lib_user.found()
 conf.set('CHFN_CHSH_PASSWORD', chfn_chsh_password ? 1 : false)
 
@@ -792,6 +820,7 @@ compiler_flags = [
   '-Wmissing-prototypes',
   '-Wnested-externs',
   '-Wno-missing-field-initializers',
+  '-Wold-style-definition',
   '-Wpointer-arith',
   '-Wredundant-decls',
   '-Wsign-compare',
@@ -856,6 +885,7 @@ exe = executable(
 exe2 = executable(
   'chsh',
   'login-utils/chsh.c',
+  'lib/shells.c',
   chfn_chsh_sources,
   include_directories : includes,
   link_with : lib_common,
@@ -939,7 +969,7 @@ exe = executable(
   'login-utils/su.c',
   'login-utils/su-common.c',
   'login-utils/su-common.h',
-  'lib/logindefs.c',
+  'lib/shells.c',
   pty_session_c,
   monotonic_c,
   include_directories : includes,
@@ -974,7 +1004,6 @@ opt = not get_option('build-lslogins').disabled()
 exe = executable(
   'lslogins',
   'login-utils/lslogins.c',
-  'lib/logindefs.c',
   include_directories : includes,
   link_with : [lib_common,
                lib_smartcols,
@@ -1015,7 +1044,7 @@ exe = executable(
   'login-utils/runuser.c',
   'login-utils/su-common.c',
   'login-utils/su-common.h',
-  'lib/logindefs.c',
+  'lib/shells.c',
   pty_session_c,
   monotonic_c,
   include_directories : includes,
@@ -1412,6 +1441,16 @@ exes += exe
 manadocs += ['sys-utils/blkzone.8.adoc']
 bashcompletions += ['blkzone']
 
+exe = executable(
+  'blkpr',
+  blkpr_sources,
+  include_directories : includes,
+  link_with : [lib_common],
+  install_dir : sbindir,
+  install : true)
+exes += exe
+manadocs += ['sys-utils/blkpr.8.adoc']
+
 exe = executable(
   'ldattach',
   ldattach_sources,
@@ -1438,6 +1477,7 @@ exe = executable(
   'setarch',
   setarch_sources,
   include_directories : includes,
+  link_with : [lib_common],
   install_dir : usrbin_exec_dir,
   install : true)
 exes += exe
@@ -2448,6 +2488,7 @@ exe = executable(
   'namei',
   namei_sources,
   include_directories : includes,
+  dependencies : [lib_selinux],
   install_dir : usrbin_exec_dir,
   install : true)
 exes += exe
@@ -2629,6 +2670,15 @@ if not is_disabler(exe)
   exes += exe
 endif
 
+exe = executable(
+  'test_blkid_fuzz_sample',
+  'libblkid/src/fuzz.c',
+  include_directories: includes,
+  link_with: lib_blkid)
+if not is_disabler(exe)
+  exes += exe
+endif
+
 ############################################################
 
 exe = executable(
@@ -2777,6 +2827,19 @@ if not is_disabler(exe)
   bashcompletions += ['fadvise']
 endif
 
+exe = executable(
+  'waitpid',
+  waitpid_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/waitpid.1.adoc']
+  bashcompletions += ['waitpid']
+endif
+
 ############################################################
 
 opt = not get_option('build-schedutils').disabled()
@@ -2928,6 +2991,8 @@ exe = executable(
   'test_sysfs',
   'lib/sysfs.c',
   'lib/path.c',
+  'lib/buffer.c',
+  'lib/mbsalign.c',
   'lib/fileutils.c',
   have_cpu_set_t ? 'lib/cpuset.c' : [],
   c_args : ['-DTEST_PROGRAM_SYSFS'],
@@ -3303,9 +3368,12 @@ if asciidoctor.found()
          '-a', 'package-docdir=' + docdir,
          '--base-dir=' + meson.current_source_dir(),
           '--destination-dir=' + meson.current_build_dir(),
+          '--load-path', '@SOURCE_ROOT@/tools',
+          '--require', 'asciidoctor-includetracker',
          '@INPUT@'],
       input : input,
       output : [page],
+      depfile : page + '.deps',
       install: true,
       install_dir : mandirn)
   endforeach