daemon: generalize ocaml-hivex[-devel] lookup

"ocamlc -where" is supposed to "print the location of the standard library
and exit". While this directory contains core OCaml C header files, it
does not contain hivex-related C header files. Trim "guestfsd_CPPFLAGS"
accordingly.

Furthermore, the hivex module for OCaml may exist elsewhere than under the
OCaml standard library directory. Invoke "ocamlfind query hivex" to find
this module. This is what AC_CHECK_OCAML_PKG(hivex) does too, in
"m4/guestfs-ocaml.m4" and "m4/ocaml.m4".

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20210908133542.19002-2-lersek@redhat.com>
Acked-by: Richard W.M. Jones <rjones@redhat.com>
This commit is contained in:
Laszlo Ersek
2021-09-08 15:35:41 +02:00
parent ceb034c92c
commit 53e03eefae

View File

@@ -215,7 +215,7 @@ guestfsd_SOURCES = \
guestfsd_LDFLAGS = \
-L$(shell $(OCAMLC) -where) \
-L$(shell $(OCAMLC) -where)/hivex \
-L$(shell $(OCAMLFIND) query hivex) \
-L../common/mlutils \
-L../common/mlstdutils \
-L../bundled/ocaml-augeas \
@@ -246,7 +246,6 @@ guestfsd_LDADD = \
guestfsd_CPPFLAGS = \
-DCAML_NAME_SPACE \
-I$(shell $(OCAMLC) -where) \
-I$(shell $(OCAMLC) -where)/hivex \
-I$(top_srcdir)/gnulib/lib \
-I$(top_builddir)/gnulib/lib \
-I$(top_srcdir)/lib \