[libvirt PATCH 025/351] meson: add functions check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 configure.ac | 33 ---------------------------------
 meson.build  | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 33 deletions(-)

diff --git a/configure.ac b/configure.ac
index 07b86d8b944..904c2a0fdcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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([\
   ])
 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],
diff --git a/meson.build b/meson.build
index b5430012a79..eb71a66cdf2 100644
--- a/meson.build
+++ b/meson.build
@@ -617,6 +617,53 @@ libvirt_export_dynamic = cc.first_supported_link_argument([
 ])
 
 
+# check availability of various common functions (non-fatal i 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('.')
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux