]> git.ipfire.org Git - thirdparty/lxc.git/commit
build: use cc.get_define to detect FS_CONFIG_* symbols
authorAleksa Sarai <cyphar@cyphar.com>
Fri, 28 Oct 2022 01:50:41 +0000 (12:50 +1100)
committerAleksa Sarai <cyphar@cyphar.com>
Sun, 30 Oct 2022 13:07:55 +0000 (00:07 +1100)
commitf321cd610ad8bfc65fbae7a869db12933fb71b46
tree4b5faabb9c9f455e74bd2238f33d7c072d020009
parent5aff4ea371352a230ab2c5ad8edd2e0dd736ee39
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 <cyphar@cyphar.com>
meson.build