]> git.proxmox.com Git - mirror_lxc.git/commitdiff
build: check for FS_CONFIG_* header symbol in sys/mount.h
authorChristian Brauner <brauner@kernel.org>
Tue, 9 Aug 2022 15:19:40 +0000 (17:19 +0200)
committerChristian Brauner (Microsoft) <christian.brauner@ubuntu.com>
Tue, 9 Aug 2022 15:20:46 +0000 (17:20 +0200)
Fixes: #4176
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
meson.build
src/lxc/mount_utils.h

index e9995423366a09b8b3b477993dd464eb8cde1182..9f8a5de60cbe094860b1866d31b233cf87b5723d 100644 (file)
@@ -639,8 +639,7 @@ if cc.sizeof('struct mount_attr', prefix: decl_headers, args: '-D_GNU_SOURCE') >
     found_types += 'struct mount_attr (sys/mount.h)'
 else
     srcconf.set10('HAVE_' + 'struct mount_attr'.underscorify().to_upper(), false)
-    missing_types += 'struct mount_attr (sys/mount.h)'
-endif
+    missing_types += 'struct mount_attr (sys/mount.h)' endif
 
 ## Types.
 decl_headers = '''
@@ -656,6 +655,62 @@ else
     missing_types += 'struct mount_attr (linux/mount.h)'
 endif
 
+if cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG')
+    srcconf.set10('HAVE_' + 'FSCONFIG_SET_FLAG'.underscorify().to_upper(), true)
+    found_types += 'FSCONFIG_SET_FLAG'
+else
+    srcconf.set10('HAVE_' + 'FSCONFIG_SET_FLAG'.underscorify().to_upper(), false)
+    missing_types += 'FSCONFIG_SET_FLAG'
+endif
+
+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_STRING')
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_STRING'.underscorify().to_upper(), true)
+    found_types += 'FS_CONFIG_SET_STRING'
+else
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_STRING'.underscorify().to_upper(), false)
+    missing_types += 'FS_CONFIG_SET_STRING'
+endif
+
+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_BINARY')
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_BINARY'.underscorify().to_upper(), true)
+    found_types += 'FS_CONFIG_SET_BINARY'
+else
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_BINARY'.underscorify().to_upper(), false)
+    missing_types += 'FS_CONFIG_SET_BINARY'
+endif
+
+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_PATH_EMPTY')
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_EMPTY'.underscorify().to_upper(), true)
+    found_types += 'FS_CONFIG_SET_PATH_EMPTY'
+else
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_EMPTY'.underscorify().to_upper(), false)
+    missing_types += 'FS_CONFIG_SET_PATH_EMPTY'
+endif
+
+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_PATH_FD')
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_FD'.underscorify().to_upper(), true)
+    found_types += 'FS_CONFIG_SET_PATH_FD'
+else
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_FD'.underscorify().to_upper(), false)
+    missing_types += 'FS_CONFIG_SET_PATH_FD'
+endif
+
+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_CMD_CREATE')
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_CREATE'.underscorify().to_upper(), true)
+    found_types += 'FS_CONFIG_SET_CMD_CREATE'
+else
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_CREATE'.underscorify().to_upper(), false)
+    missing_types += 'FS_CONFIG_SET_CMD_CREATE'
+endif
+
+if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_CMD_RECONFIGURE')
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_RECONFIGURE'.underscorify().to_upper(), true)
+    found_types += 'FS_CONFIG_SET_CMD_RECONFIGURE'
+else
+    srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_RECONFIGURE'.underscorify().to_upper(), false)
+    missing_types += 'FS_CONFIG_SET_CMD_RECONFIGURE'
+endif
+
 ## Headers.
 foreach ident: [
     ['bpf',               '''#include <sys/syscall.h>
index ea392672d864ff23995862502f4ef4f8ce042ec1..fd34739459ceefee9e2568ec9cf7633e86a9f66f 100644 (file)
@@ -82,37 +82,53 @@ struct lxc_rootfs;
 #endif
 
 /* fsconfig() commands */
+#if !HAVE_FSCONFIG_SET_FLAG
 #ifndef FSCONFIG_SET_FLAG
 #define FSCONFIG_SET_FLAG 0 /* Set parameter, supplying no value */
 #endif
+#endif
 
+#if !HAVE_FSCONFIG_SET_STRING
 #ifndef FSCONFIG_SET_STRING
 #define FSCONFIG_SET_STRING 1 /* Set parameter, supplying a string value */
 #endif
+#endif
 
+#if !HAVE_FSCONFIG_SET_BINARY
 #ifndef FSCONFIG_SET_BINARY
 #define FSCONFIG_SET_BINARY 2 /* Set parameter, supplying a binary blob value */
 #endif
+#endif
 
+#if !HAVE_FSCONFIG_SET_PATH
 #ifndef FSCONFIG_SET_PATH
 #define FSCONFIG_SET_PATH 3 /* Set parameter, supplying an object by path */
 #endif
+#endif
 
+#if !HAVE_FSCONFIG_SET_PATH_EMPTY
 #ifndef FSCONFIG_SET_PATH_EMPTY
 #define FSCONFIG_SET_PATH_EMPTY 4 /* Set parameter, supplying an object by (empty) path */
 #endif
+#endif
 
+#if !HAVE_FSCONFIG_SET_FD
 #ifndef FSCONFIG_SET_FD
 #define FSCONFIG_SET_FD 5 /* Set parameter, supplying an object by fd */
 #endif
+#endif
 
+#if !HAVE_FSCONFIG_CMD_CREATE
 #ifndef FSCONFIG_CMD_CREATE
 #define FSCONFIG_CMD_CREATE 6 /* Invoke superblock creation */
 #endif
+#endif
 
+#if !FSCONFIG_CMD_RECONFIGURE
 #ifndef FSCONFIG_CMD_RECONFIGURE
 #define        FSCONFIG_CMD_RECONFIGURE 7      /* Invoke superblock reconfiguration */
 #endif
+#endif
 
 /* fsmount() flags */
 #ifndef FSMOUNT_CLOEXEC