[Libguestfs] [PATCH] Correctly build febootstrap on systems without native OCaml compiler

Richard W.M. Jones rjones at redhat.com
Thu Aug 25 18:42:11 UTC 2011


On Thu, Aug 25, 2011 at 08:02:36PM +0200, Hilko Bengen wrote:
> On those systems "$(OCAMLFIND) $(OCAMLBEST)" was resolved as
> "ocamlfind byte" which did not work.
> ---
>  Makefile.am |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 109d2c8..4dc6f12 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -56,18 +56,18 @@ SOURCES_ML = $(filter %.ml,$(SOURCES))
>  BOBJECTS = $(SOURCES_ML:.ml=.cmo)
>  XOBJECTS = $(SOURCES_ML:.ml=.cmx)
>  
> -if !HAVE_OCAMLOPT
> -OBJECTS = $(BOBJECTS)
> -else
> -OBJECTS = $(XOBJECTS)
> -endif
> -
>  OCAMLPACKAGES = -package unix,str
>  OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
>  
> -febootstrap: $(OBJECTS)
> -	$(OCAMLFIND) $(OCAMLBEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) -linkpkg \
> +if !HAVE_OCAMLOPT
> +febootstrap: $(BOBJECTS)
> +	$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -linkpkg \
> +	  $^ -o $@
> +else
> +febootstrap: $(XOBJECTS)
> +	$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -linkpkg \
>  	  $^ -o $@
> +endif

I just tested the original, and as you say the link command becomes:

  ocamlfind byte -warn-error CDEFLMPSUVXYZ -package unix,str -linkpkg \
    config.cmo febootstrap_cmdline.cmo febootstrap_utils.cmo febootstrap_package_handlers.cmo febootstrap_yum_rpm.cmo febootstrap_debian.cmo febootstrap_pacman.cmo febootstrap.cmo -o febootstrap
  Usage: ocamlfind query        [-help | other options] <package_name> ...
     or: ocamlfind ocamlc       [-help | other options] <file> ...
     or: ocamlfind ocamlcp      [-help | other options] <file> ...
     or: ocamlfind ocamlmktop   [-help | other options] <file> ...
  [...]

which corresponds to the documentation, and _zack and I wrote those
OCaml m4 macros, so I guess I should have known :-)

I've pushed a slightly different version of the patch, and I tested
that it works with and without the native compiler.

Thanks,

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list