]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - meson.build
buildsys: warn on usage of alloca()
[thirdparty/util-linux.git] / meson.build
index cfb76aafff847531da489cf6f05280491fcfbaa4..9034c32ce64d0d72061bbc2024bf397215e77773 100644 (file)
@@ -79,7 +79,7 @@ have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/moun
 conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false)
 conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false)
 
-have_struct_statx = cc.sizeof('struct statx', prefix : '#include <linux/stat.h>') > 0
+have_struct_statx = cc.sizeof('struct statx', prefix : '#include <sys/stat.h>') > 0
 conf.set('HAVE_STRUCT_STATX', have_struct_statx ? 1 : false)
 
 build_libmount = not get_option('build-libmount').disabled()
@@ -177,7 +177,6 @@ headers = '''
         linux/nsfs.h
         linux/mount.h
         linux/pr.h
-        linux/stat.h
         linux/securebits.h
         linux/tiocl.h
         linux/version.h
@@ -640,7 +639,7 @@ have = cc.has_member('struct stat', 'st_mtim.tv_nsec',
 conf.set('HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', have ? 1 : false)
 
 have = cc.has_member('struct statx', 'stx_mnt_id',
-                     prefix : '#include <linux/stat.h>')
+                     prefix : '#include <sys/stat.h>')
 conf.set('HAVE_STRUCT_STATX_STX_MNT_ID', have ? 1 : false)
 
 # replacement for AC_STRUCT_TIMEZONE
@@ -877,6 +876,8 @@ compiler_flags = [
   '-Wunused-parameter',
   '-Wunused-result',
   '-Wunused-variable',
+  '-Wvla',
+  '-Walloca',
 ]
 foreach compiler_flag : compiler_flags
   if cc.has_argument(compiler_flag)
@@ -2633,7 +2634,8 @@ exe = executable(
   'uuidgen',
   uuidgen_sources,
   include_directories : includes,
-  link_with : [lib_uuid],
+  link_with : [lib_common,
+               lib_uuid],
   install_dir : usrbin_exec_dir,
   install : true)
 if not is_disabler(exe)