Skip to content

Commit

Permalink
ocaml: Fix and enable parallel builds.
Browse files Browse the repository at this point in the history
We only have to serialize the two calls to ocamlmklib, since both will
try to create a file called 'libmlguestfs.a'.  Apart from that,
parallel builds here should be fine.
  • Loading branch information
rwmjones committed Mar 28, 2013
1 parent b13c935 commit dce94f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -266,6 +266,7 @@ Makefile.in
/ocaml/guestfs.mli
/ocamlinit-stamp
/ocaml/META
/ocaml/stamp-mlguestfs
/ocaml/t/guestfs_005_load.bc
/ocaml/t/guestfs_005_load.opt
/ocaml/t/guestfs_010_basic.bc
Expand Down
17 changes: 10 additions & 7 deletions ocaml/Makefile.am
Expand Up @@ -53,15 +53,22 @@ noinst_DATA = mlguestfs.cma mlguestfs.cmxa META
# library; we link with the object files that it generates.
noinst_LIBRARIES = libguestfsocaml.a

mlguestfs.cma: libguestfsocaml.a guestfs.cmo
# Note that both calls to ocamlmklib below will create
# 'libmlguestfs.a' and if run at the same time, they will stomp on or
# corrupt each others copy. Hence we have to serialize the calls.

CLEANFILES += stamp-mlguestfs

mlguestfs.cma mlguestfs.cmxa: stamp-mlguestfs

stamp-mlguestfs: libguestfsocaml.a guestfs.cmo guestfs.cmx
$(OCAMLMKLIB) -o mlguestfs \
$(libguestfsocaml_a_OBJECTS) guestfs.cmo \
-L$(top_builddir)/src/.libs -lguestfs

mlguestfs.cmxa: libguestfsocaml.a guestfs.cmx
$(OCAMLMKLIB) -o mlguestfs \
$(libguestfsocaml_a_OBJECTS) guestfs.cmx \
-L$(top_builddir)/src/.libs -lguestfs
touch $@

libguestfsocaml_a_CPPFLAGS = \
-DGUESTFS_PRIVATE=1 \
Expand Down Expand Up @@ -235,7 +242,3 @@ install-data-hook:
CLEANFILES += $(noinst_DATA)

endif

# Tell version 3.79 and up of GNU make to not build goals in this
# directory in parallel. (Possible solution for RHBZ#502309).
.NOTPARALLEL:

0 comments on commit dce94f3

Please sign in to comment.