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: lxc-5.0.2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a330126b45c7c3b6fcf0f9ba6c1eda7bdb4e508a;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 9fefe1642..275408756 100644 --- a/meson.build +++ b/meson.build @@ -673,7 +673,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 @@ -681,7 +681,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 @@ -689,7 +689,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 @@ -697,7 +697,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 @@ -705,7 +705,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 @@ -713,7 +713,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 @@ -721,7 +721,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