diff options
author | Jordan Williams <jordan@jwillikers.com> | 2024-03-29 14:00:01 -0500 |
---|---|---|
committer | Jordan Williams <jordan@jwillikers.com> | 2024-04-01 07:42:39 -0500 |
commit | 2c5a42b3cbf278461a12872ce7a944ad396d47b5 (patch) | |
tree | d853fe0ca01b9bd99b62aec0e296057f541bec8a | |
parent | 6ff6f5b6ffd9323cc568def2169225dd84bc3a0c (diff) | |
download | util-linux-2c5a42b3cbf278461a12872ce7a944ad396d47b5.tar.gz |
meson: Fix false positive detection of mempcpy on macOS
The has_function check incorrectly detects mempcpy on macOS.
This function is not available on macOS and should not be detected.
Likely, this has to do with Meson's detection of compiler built-ins.
Using a specific prefix and defining _GNU_SOURCE fixes the detection.
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
-rw-r--r-- | meson.build | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 9600ce49f7..1ec913d7b1 100644 --- a/meson.build +++ b/meson.build @@ -569,7 +569,6 @@ funcs = ''' llistxattr llseek newlocale - mempcpy mkostemp move_mount mount_setattr @@ -634,6 +633,9 @@ foreach func: funcs conf.set('HAVE_' + func.to_upper(), have ? 1 : false) endforeach +have_mempcpy = cc.has_function('mempcpy', prefix: '#include <string.h>', args: '-D_GNU_SOURCE') +conf.set('HAVE_MEMPCPY', have_mempcpy ? 1 : false) + have = conf.get('HAVE_FUTIMENS') in [1] and conf.get('HAVE_INOTIFY_INIT1') in [1] conf.set('AGETTY_RELOAD', have ? 1 : false) if not have |