From: Jordan Williams Date: Fri, 29 Mar 2024 19:00:01 +0000 (-0500) Subject: meson: Fix false positive detection of mempcpy on macOS X-Git-Tag: v2.40.1-rc1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e93a2ce5f7c41731d0f07ac6a3638d9f981d707;p=thirdparty%2Futil-linux.git 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 (cherry picked from commit 2c5a42b3cbf278461a12872ce7a944ad396d47b5) --- diff --git a/meson.build b/meson.build index f46356ac6..77f6dd845 100644 --- a/meson.build +++ b/meson.build @@ -565,7 +565,6 @@ funcs = ''' llistxattr llseek newlocale - mempcpy mkostemp move_mount mount_setattr @@ -630,6 +629,9 @@ foreach func: funcs conf.set('HAVE_' + func.to_upper(), have ? 1 : false) endforeach +have_mempcpy = cc.has_function('mempcpy', prefix: '#include ', 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