mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
build: Allow OCaml programs using libguestfs to be compiled against build dir.
You have to use: ../libguestfs/run ./configure ../libguestfs/run make Use of the second ../libguestfs/run against make is unfortunate but I believe it's unavoidable due to the way that ocamlfind works.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -379,6 +379,7 @@ Makefile.in
|
||||
/ocaml/examples/guestfs-ocaml.3
|
||||
/ocaml/examples/inspect_vm
|
||||
/ocaml/examples/stamp-guestfs-ocaml.pod
|
||||
/ocaml/guestfs
|
||||
/ocaml/guestfs-c-actions.c
|
||||
/ocaml/guestfs-c-errnos.c
|
||||
/ocaml/guestfs.ml
|
||||
|
||||
@@ -197,4 +197,21 @@ install-data-hook:
|
||||
|
||||
CLEANFILES += $(noinst_DATA) $(check_DATA)
|
||||
|
||||
endif
|
||||
# This "tricks" ocamlfind into allowing us to compile other OCaml
|
||||
# programs against a locally compiled copy of the libguestfs sources.
|
||||
# ocamlfind needs to see a directory called ‘guestfs’ which contains
|
||||
# ‘META’. The current directory is called ‘ocaml’, but if we make
|
||||
# this symlink then we can create the required directory structure.
|
||||
#
|
||||
# Note if you just want to use this, make sure you use
|
||||
# ‘../libguestfs/run make’ in your other program and everything should
|
||||
# just work.
|
||||
CLEANFILES += guestfs
|
||||
|
||||
all-local: guestfs
|
||||
|
||||
guestfs:
|
||||
rm -f $@
|
||||
$(LN_S) . $@
|
||||
|
||||
endif HAVE_OCAML
|
||||
|
||||
2
run.in
2
run.in
@@ -227,6 +227,8 @@ export MALLOC_PERTURB_=$random_val
|
||||
# local libguestfs.
|
||||
prepend PKG_CONFIG_PATH "$b/lib/local"
|
||||
export PKG_CONFIG_PATH
|
||||
prepend OCAMLPATH "$b/ocaml"
|
||||
export OCAMLPATH
|
||||
|
||||
# Do we have libtool? If we have it then we can use it to make
|
||||
# running valgrind simpler. However don't depend on it.
|
||||
|
||||
Reference in New Issue
Block a user