ocaml: Don't embed -L../lib/.libs in final mlguestfs.cma or .cmxa

$ ocamlobjinfo /usr/lib64/ocaml/guestfs/mlguestfs.cma
File /usr/lib64/ocaml/guestfs/mlguestfs.cma
Force custom: no
Extra C object files: -lmlguestfs -L../lib/.libs -lguestfs
...

(and the same in mlguestfs.cmxa).  This was caused because we run
ocamlmklib with this -L parameter so that OCaml tests and examples
will link with the local libguestfs.so (instead of the
system-installed version), but for other reasons that doesn't actually
work either.
This commit is contained in:
Richard W.M. Jones
2025-04-26 09:15:04 +01:00
committed by rwmjones
parent e127edcafc
commit e11583a03a

View File

@@ -67,13 +67,13 @@ stamp-mlguestfs: libguestfsocaml.a $(guestfs_cmm)
-ldopt '$(LDFLAGS)' \ -ldopt '$(LDFLAGS)' \
$(libguestfsocaml_a_OBJECTS) guestfs.cmo \ $(libguestfsocaml_a_OBJECTS) guestfs.cmo \
$(LTLIBINTL) \ $(LTLIBINTL) \
-L../lib/.libs -lguestfs -lguestfs
if HAVE_OCAMLOPT if HAVE_OCAMLOPT
$(OCAMLMKLIB) -o mlguestfs \ $(OCAMLMKLIB) -o mlguestfs \
-ldopt '$(LDFLAGS)' \ -ldopt '$(LDFLAGS)' \
$(libguestfsocaml_a_OBJECTS) guestfs.cmx \ $(libguestfsocaml_a_OBJECTS) guestfs.cmx \
$(LTLIBINTL) \ $(LTLIBINTL) \
-L../lib/.libs -lguestfs -lguestfs
endif endif
touch $@ touch $@