]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add functions check
authorPavel Hrdina <phrdina@redhat.com>
Fri, 10 Jul 2020 07:48:30 +0000 (09:48 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:26:59 +0000 (09:26 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
meson.build

index 125857b5d55512faf27dc7ce1d3d99ee43dee876..7fa89b9e2cc1df1799b1569f465a2e4195322b0e 100644 (file)
@@ -207,38 +207,6 @@ LIBVIRT_CHECK_YAJL
 
 AC_CHECK_SIZEOF([long])
 
-dnl Availability of various common functions (non-fatal if missing),
-dnl and various less common threadsafe functions
-AC_CHECK_FUNCS_ONCE([\
-  elf_aux_info \
-  fallocate \
-  getauxval \
-  getegid \
-  geteuid \
-  getgid \
-  getifaddrs \
-  getmntent_r \
-  getpwuid_r \
-  getrlimit \
-  getuid \
-  getutxid \
-  if_indextoname \
-  mmap \
-  newlocale \
-  posix_fallocate \
-  posix_memalign \
-  pipe2 \
-  prlimit \
-  sched_getaffinity \
-  sched_setscheduler \
-  setgroups \
-  setns \
-  setrlimit \
-  symlink \
-  sysctlbyname \
-  unshare \
-  ])
-
 dnl Availability of various common headers (non-fatal if missing).
 AC_CHECK_HEADERS([\
   asm/hwcap.h \
@@ -263,7 +231,6 @@ AC_CHECK_HEADERS([\
 AC_CHECK_HEADERS([net/if.h], [], [], [[#include <sys/socket.h>]])
 dnl Check whether endian provides handy macros.
 AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])
-AC_CHECK_FUNCS([stat stat64 __xstat __xstat64 lstat lstat64 __lxstat __lxstat64])
 
 AC_CHECK_TYPE([struct ifreq],
   [AC_DEFINE([HAVE_STRUCT_IFREQ],[1],
index 5834552c8b9f3879c4c976d2a9260331ac32c8c7..249b7c91dd200fa87d74aa70dec423c8ce66f496 100644 (file)
@@ -630,6 +630,53 @@ libvirt_export_dynamic = cc.first_supported_link_argument([
 ])
 
 
+# check availability of various common functions (non-fatal if missing)
+
+functions = [
+  '__lxstat',
+  '__lxstat64',
+  '__xstat',
+  '__xstat64',
+  'elf_aux_info',
+  'fallocate',
+  'getauxval',
+  'getegid',
+  'geteuid',
+  'getgid',
+  'getifaddrs',
+  'getmntent_r',
+  'getpwuid_r',
+  'getrlimit',
+  'getuid',
+  'getutxid',
+  'if_indextoname',
+  'lstat',
+  'lstat64',
+  'mmap',
+  'newlocale',
+  'pipe2',
+  'posix_fallocate',
+  'posix_memalign',
+  'prlimit',
+  'sched_getaffinity',
+  'sched_setscheduler',
+  'setgroups',
+  'setns',
+  'setrlimit',
+  'stat',
+  'stat64',
+  'symlink',
+  'sysctlbyname',
+  'unshare',
+]
+
+foreach function : functions
+  if cc.has_function(function)
+    conf.set('HAVE_@0@'.format(function.to_upper()), 1)
+  endif
+endforeach
+
+
 # define top include directory
 
 top_inc_dir = include_directories('.')