[Libguestfs] [PATCH 1/3] hivex: Use OCaml bytecode compiler for caml_raise_with_args check

Richard W.M. Jones rjones at redhat.com
Thu May 12 08:00:52 UTC 2011


On Thu, May 12, 2011 at 12:04:18AM +0200, bengen at hilluzination.de wrote:
> From: Hilko Bengen <bengen at hilluzination.de>
> 
> On installations where no native OCaml compiler is available, the
> test program can't be compiled and so we get this message:
> 
> ,----
> | checking for function caml_raise_with_args... not found
> `----
> 
> This breaks building of the OCaml bindings.
> 
> ,----
> | gcc -std=gnu99 -I.. -I/usr/lib/ocaml -I../ocaml -I../lib   -g -O2 -fPIC -Wall -c hivex_c.c
> | hivex_c.c:52: error: static declaration of 'caml_raise_with_args' follows non-static declaration
> | /usr/lib/ocaml/caml/fail.h:30: note: previous declaration of 'caml_raise_with_args' was here
> | make[2]: *** [hivex_c.o] Error 1
> `----
> 
> (Successfully tested on Debian/unstable on alpha)
> ---
>  configure.ac |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 5805ddd..ef19543 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -192,9 +192,9 @@ if test "x$OCAMLC" != "xno"; then
>      echo "char $f (); char foo() { return $f (); }" > conftest.c
>      rm -f conftest_ml.ml
>      touch conftest_ml.ml
> -    if $OCAMLOPT -c conftest.c 2>/dev/null && \
> -       $OCAMLOPT -c conftest_ml.ml 2>/dev/null && \
> -       $OCAMLOPT conftest.o conftest_ml.cmx -o conftest 2>/dev/null ; then
> +    if $OCAMLC -c conftest.c 2>/dev/null && \
> +       $OCAMLC -c conftest_ml.ml 2>/dev/null && \
> +       $OCAMLC conftest.o conftest_ml.cmo -o conftest 2>/dev/null ; then
>          AC_DEFINE([HAVE_CAML_RAISE_WITH_ARGS],[1],
>                    [Defined if function caml_raise_with_args exists.])
>          AC_MSG_RESULT([found])
> -- 
> 1.7.5.1
> 
> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs

ACK.  I'll push this later today.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list