ocaml: INSTALL_OCAMLLIB Makefile parameter

Add INSTALL_OCAMLLIB parameter for allowing ocaml install to a user
defined path. If not defined, fallback to `ocamlc -where`.

Signed-off-by: Antonio Caggiano <quic_acaggian@quicinc.com>
This commit is contained in:
Antonio Caggiano
2024-08-13 14:54:12 +02:00
committed by Richard W.M. Jones
parent e17d794d11
commit bbc58ed8fb
2 changed files with 12 additions and 7 deletions

View File

@@ -210,3 +210,8 @@ OCAML_WARN_ERROR="-warn-error +C+D+E+F+L+M+P+S+U+V+Y+Z+X+52-3-6 -w -6"
AC_SUBST([OCAML_WARN_ERROR])
OCAML_FLAGS="-g -annot $safe_string_option"
AC_SUBST([OCAML_FLAGS])
if test "x$INSTALL_OCAMLLIB" = "x"; then
INSTALL_OCAMLLIB=$OCAMLLIB
fi
AC_SUBST([INSTALL_OCAMLLIB])

View File

@@ -185,16 +185,16 @@ data_hook_files += *.cmx *.cmxa
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*
mkdir -p $(DESTDIR)$(INSTALL_OCAMLLIB)
mkdir -p $(DESTDIR)$(INSTALL_OCAMLLIB)/stublibs
rm -rf $(DESTDIR)$(INSTALL_OCAMLLIB)/guestfs
rm -rf $(DESTDIR)$(INSTALL_OCAMLLIB)/stublibs/dllmlguestfs.so*
$(OCAMLFIND) install \
-ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
-ldconf ignore -destdir $(DESTDIR)$(INSTALL_OCAMLLIB) \
guestfs \
$(data_hook_files)
rm -f $(DESTDIR)$(OCAMLLIB)/guestfs/bindtests.*
rm $(DESTDIR)$(OCAMLLIB)/guestfs/libguestfsocaml.a
rm -f $(DESTDIR)$(INSTALL_OCAMLLIB)/guestfs/bindtests.*
rm $(DESTDIR)$(INSTALL_OCAMLLIB)/guestfs/libguestfsocaml.a
CLEANFILES += $(noinst_DATA) $(check_DATA)