build: Require <caml/unixsupport.h>

Require <caml/unixsupport.h> (an OCaml header file) and remove
alternate defintions of ‘Nothing’ and ‘unix_error’ which are defined
in this header file.

We require OCaml >= 3.11 which has this header file, so there is no
need to test for it or provide alternative definitions.

Thanks: Pino Toscano.
This commit is contained in:
Richard W.M. Jones
2017-07-18 18:40:55 +01:00
parent 318ca68408
commit ffdcb7cfeb
8 changed files with 1 additions and 49 deletions

View File

@@ -33,13 +33,7 @@
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
#ifdef HAVE_CAML_UNIXSUPPORT_H
#include <caml/unixsupport.h>
#else
#define Nothing ((value) 0)
extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
#endif
#include "index-struct.h"
#include "index-parse.h"

View File

@@ -34,6 +34,7 @@
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
#include <caml/unixsupport.h>
#include "guestfs.h"
#include "guestfs-utils.h"
@@ -44,13 +45,6 @@
#include <lzma.h>
#endif
#ifdef HAVE_CAML_UNIXSUPPORT_H
#include <caml/unixsupport.h>
#else
#define Nothing ((value) 0)
extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
#endif
#if defined (HAVE_LIBLZMA) && \
defined (HAVE_LZMA_INDEX_STREAM_FLAGS) && \
defined (HAVE_LZMA_INDEX_STREAM_PADDING)

View File

@@ -27,13 +27,7 @@
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
#ifdef HAVE_CAML_UNIXSUPPORT_H
#include <caml/unixsupport.h>
#else
#define Nothing ((value) 0)
extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
#endif
#include "guestfs.h"
#include "guestfs-utils.h"

View File

@@ -40,13 +40,7 @@
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
#ifdef HAVE_CAML_UNIXSUPPORT_H
#include <caml/unixsupport.h>
#else
#define Nothing ((value) 0)
extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
#endif
extern value guestfs_int_mllib_dev_t_makedev (value majv, value minv);
extern value guestfs_int_mllib_dev_t_major (value devv);

View File

@@ -56,12 +56,6 @@ AM_CONDITIONAL([HAVE_OCAMLOPT],
AM_CONDITIONAL([HAVE_OCAMLDOC],
[test "x$OCAMLDOC" != "xno"])
dnl Check for <caml/unixsupport.h> header.
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I`$OCAMLC -where`"
AC_CHECK_HEADERS([caml/unixsupport.h],[],[],[#include <caml/mlvalues.h>])
CPPFLAGS="$old_CPPFLAGS"
OCAML_PKG_gettext=no
OCAML_PKG_libvirt=no
OCAML_PKG_oUnit=no

View File

@@ -27,13 +27,7 @@
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
#ifdef HAVE_CAML_UNIXSUPPORT_H
#include <caml/unixsupport.h>
#else
#define Nothing ((value) 0)
extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
#endif
#include <guestfs.h>

View File

@@ -34,13 +34,7 @@
#include <caml/mlvalues.h>
#include <caml/printexc.h>
#include <caml/signals.h>
#ifdef HAVE_CAML_UNIXSUPPORT_H
#include <caml/unixsupport.h>
#else
#define Nothing ((value) 0)
extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
#endif
#include "guestfs-c.h"

View File

@@ -28,13 +28,7 @@
#include <caml/fail.h>
#include <caml/memory.h>
#include <caml/mlvalues.h>
#ifdef HAVE_CAML_UNIXSUPPORT_H
#include <caml/unixsupport.h>
#else
#define Nothing ((value) 0)
extern void unix_error (int errcode, char * cmdname, value arg) Noreturn;
#endif
#include "qemuopts.h"