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.42-start~459^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c5a42b3cbf278461a12872ce7a944ad396d47b5;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 --- diff --git a/meson.build b/meson.build index 9600ce49f..1ec913d7b 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 ', 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