From: Aleksa Sarai Date: Fri, 28 Oct 2022 01:50:41 +0000 (+1100) Subject: build: use cc.get_define to detect FS_CONFIG_* symbols X-Git-Tag: v6.0.0~86^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f321cd610ad8bfc65fbae7a869db12933fb71b46;p=thirdparty%2Flxc.git build: use cc.get_define to detect FS_CONFIG_* symbols For some reason, openSUSE has a very strange layout in sys/mount.h where the definition of all of the FS_CONFIG_* idents are present but are ifdef'd out in such a way that they will never be defined in an actual build: #define FSOPEN_CLOEXEC 0x00000001 /* ... */ #ifndef FSOPEN_CLOEXEC enum fsconfig_command { FSCONFIG_SET_FLAG = 0, /* Set parameter, supplying no value */ # define FSCONFIG_SET_FLAG FSCONFIG_SET_FLAG /* ... */ }; #endif Unfortunately, while cc.has_header_symbol is faster, it cannot handle this which results in compilation errors on openSUSE because the FS_CONFIG_* symbols are actually not defined when compiling even though the ident is present in the header. Switching to cc.get_define fixes this issue. Fixes: cbabe8abf11e ("build: check for FS_CONFIG_* header symbol in sys/mount.h") Signed-off-by: Aleksa Sarai --- diff --git a/meson.build b/meson.build index 8390ee1a4..78da3680a 100644 --- a/meson.build +++ b/meson.build @@ -674,7 +674,7 @@ else missing_types += 'struct mount_attr (sys/mount.h)' endif ## Check if sys/mount.h defines the fsconfig commands -if cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG') +if cc.get_define('FSCONFIG_SET_FLAG', prefix: decl_headers) != '' srcconf.set10('HAVE_' + 'FSCONFIG_SET_FLAG'.underscorify().to_upper(), true) found_types += 'FSCONFIG_SET_FLAG (sys/mount.h)' else @@ -682,7 +682,7 @@ else missing_types += 'FSCONFIG_SET_FLAG (sys/mount.h)' endif -if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_STRING') +if cc.get_define('FS_CONFIG_SET_STRING', prefix: decl_headers) != '' srcconf.set10('HAVE_' + 'FS_CONFIG_SET_STRING'.underscorify().to_upper(), true) found_types += 'FS_CONFIG_SET_STRING (sys/mount.h)' else @@ -690,7 +690,7 @@ else missing_types += 'FS_CONFIG_SET_STRING (sys/mount.h)' endif -if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_BINARY') +if cc.get_define('FS_CONFIG_SET_BINARY', prefix: decl_headers) != '' srcconf.set10('HAVE_' + 'FS_CONFIG_SET_BINARY'.underscorify().to_upper(), true) found_types += 'FS_CONFIG_SET_BINARY (sys/mount.h)' else @@ -698,7 +698,7 @@ else missing_types += 'FS_CONFIG_SET_BINARY (sys/mount.h)' endif -if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_PATH_EMPTY') +if cc.get_define('FS_CONFIG_SET_PATH_EMPTY', prefix: decl_headers) != '' srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_EMPTY'.underscorify().to_upper(), true) found_types += 'FS_CONFIG_SET_PATH_EMPTY (sys/mount.h)' else @@ -706,7 +706,7 @@ else missing_types += 'FS_CONFIG_SET_PATH_EMPTY (sys/mount.h)' endif -if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_PATH_FD') +if cc.get_define('FS_CONFIG_SET_PATH_FD', prefix: decl_headers) != '' srcconf.set10('HAVE_' + 'FS_CONFIG_SET_PATH_FD'.underscorify().to_upper(), true) found_types += 'FS_CONFIG_SET_PATH_FD (sys/mount.h)' else @@ -714,7 +714,7 @@ else missing_types += 'FS_CONFIG_SET_PATH_FD (sys/mount.h)' endif -if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_CMD_CREATE') +if cc.get_define('FS_CONFIG_SET_CMD_CREATE', prefix: decl_headers) != '' srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_CREATE'.underscorify().to_upper(), true) found_types += 'FS_CONFIG_SET_CMD_CREAT (sys/mount.h)' else @@ -722,7 +722,7 @@ else missing_types += 'FS_CONFIG_SET_CMD_CREATE (sys/mount.h)' endif -if cc.has_header_symbol('sys/mount.h', 'FS_CONFIG_SET_CMD_RECONFIGURE') +if cc.get_define('FS_CONFIG_SET_CMD_RECONFIGURE', prefix: decl_headers) != '' srcconf.set10('HAVE_' + 'FS_CONFIG_SET_CMD_RECONFIGURE'.underscorify().to_upper(), true) found_types += 'FS_CONFIG_SET_CMD_RECONFIGURE (sys/mount.h)' else