[glib/glib-2-58: 50/55] Fix build failure on systems without spawn.h



commit 6f3241f010a6a67c841477f73592ba3e4ea94895
Author: Ryan Schmidt <git ryandesign com>
Date:   Mon Sep 24 01:36:35 2018 -0500

    Fix build failure on systems without spawn.h

 configure.ac  | 1 +
 glib/gspawn.c | 3 +++
 meson.build   | 1 +
 3 files changed, 5 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index 93a8d4c96..206169320 100644
--- a/configure.ac
+++ b/configure.ac
@@ -639,6 +639,7 @@ AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/vfstab.h sys/mntctl.h fstab.h])
 AC_CHECK_HEADERS([linux/magic.h])
 AC_CHECK_HEADERS([termios.h])
 AC_CHECK_HEADERS([alloca.h])
+AC_CHECK_HEADERS([spawn.h])
 
 # Some versions of MSC lack these
 AC_CHECK_HEADERS([dirent.h sys/time.h])
diff --git a/glib/gspawn.c b/glib/gspawn.c
index 5d0c29d70..23ade06ae 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -30,7 +30,10 @@
 #include <string.h>
 #include <stdlib.h>   /* for fdwalk */
 #include <dirent.h>
+
+#ifdef HAVE_SPAWN_H
 #include <spawn.h>
+#endif /* HAVE_SPAWN_H */
 
 #ifdef HAVE_CRT_EXTERNS_H
 #include <crt_externs.h> /* for _NSGetEnviron */
diff --git a/meson.build b/meson.build
index 87c55f45d..2ba3cb052 100644
--- a/meson.build
+++ b/meson.build
@@ -227,6 +227,7 @@ headers = [
   'poll.h',
   'pwd.h',
   'sched.h',
+  'spawn.h',
   'stdint.h',
   'stdlib.h',
   'string.h',


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