mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
ocaml: Allow 'make install' to be run twice.
'ocamlfind install' doesn't like to install the same package if it is already installed. It will give errors like: ocamlfind: Package guestfs is already installed or: ocamlfind: Conflict with file: /usr/lib64/ocaml/guestfs/mlguestfs.cmxa Fix this by removing the old installed files before running 'ocamlfind install'. An alternative would be to use 'ocamlfind uninstall', but this seems more direct.
This commit is contained in:
@@ -190,7 +190,9 @@ depend: .depend
|
||||
|
||||
SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
|
||||
|
||||
# Do the installation by hand, because we want to run ocamlfind.
|
||||
# Run ocamlfind to perform the install. ocamlfind refuses to install
|
||||
# the package if it is already installed, so remove the old package
|
||||
# first.
|
||||
data_hook_files = META *.so *.a *.cma *.cmi $(srcdir)/*.mli
|
||||
if HAVE_OCAMLOPT
|
||||
data_hook_files += *.cmx *.cmxa
|
||||
@@ -199,6 +201,8 @@ endif
|
||||
install-data-hook:
|
||||
mkdir -p $(DESTDIR)$(OCAMLLIB)
|
||||
mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
|
||||
rm -rf $(DESTDIR)$(OCAMLLIB)/guestfs
|
||||
rm -rf $(DESTDIR)$(OCAMLLIB)/stublibs/dllmlguestfs.so*
|
||||
$(OCAMLFIND) install \
|
||||
-ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
|
||||
guestfs \
|
||||
|
||||
@@ -100,7 +100,9 @@ endif
|
||||
|
||||
v2v_test_harness.cmi: $(top_builddir)/ocaml/guestfs.cmi
|
||||
|
||||
# Do the installation by hand, because we want to run ocamlfind.
|
||||
# Run ocamlfind to perform the install. ocamlfind refuses to install
|
||||
# the package if it is already installed, so remove the old package
|
||||
# first.
|
||||
data_hook_files = META *.so *.a *.cmi $(srcdir)/*.mli
|
||||
if !HAVE_OCAMLOPT
|
||||
data_hook_files += *.cmo *.cma
|
||||
@@ -111,6 +113,8 @@ endif
|
||||
install-data-hook:
|
||||
mkdir -p $(DESTDIR)$(OCAMLLIB)
|
||||
mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
|
||||
rm -rf $(DESTDIR)$(OCAMLLIB)/v2v_test_harness
|
||||
rm -rf $(DESTDIR)$(OCAMLLIB)/stublibs/dllv2v_test_harness.so*
|
||||
$(OCAMLFIND) install \
|
||||
-ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
|
||||
v2v_test_harness \
|
||||
|
||||
Reference in New Issue
Block a user