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

[PATCH] meson: Check for stdarg.h



As it turns out, one of my previous commits in which I removed
checking for stdarg.h was too aggressive. Long story short, the
readline public headers rely on stdarg.h and what is worse, they
expect us to declare the autotools style of macro (HAVE_STDARG_H)
if the header file exists. If we don't do it then compiling virsh
on macos fails.

See 9ea3424a178 for more info.

Fixes: 85808b73846f93d656b4c81b6ebddd2dc3881bf6
Signed-off-by: Michal Privoznik <mprivozn redhat com>
---
 meson.build | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 1aad385ad1..98f7545495 100644
--- a/meson.build
+++ b/meson.build
@@ -1333,8 +1333,12 @@ if readline_dep.found()
     endif
   endif
 
-  # We need this to avoid compilation issues with modern compilers.
-  # See 9ea3424a178 for a more detailed explanation
+  # We need both of these hacks to avoid compilation issues with modern
+  # compilers. See 9ea3424a178 for a more detailed explanation.
+  if cc.has_header('stdarg.h')
+    conf.set('HAVE_STDARG_H', 1)
+  endif
+
   readline_dep = declare_dependency(
     compile_args: [ '-D_FUNCTION_DEF' ],
     dependencies: [ readline_dep ],
-- 
2.26.2


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