Laszlo Ersek
2021-Sep-08 13:35 UTC
[Libguestfs] [libguestfs PATCH 0/2] generalize ocaml-hivex[-devel] lookup
"daemon/Makefile.am" needs some tweaks for finding such OCaml bindings for hivex that are not installed system-wide. Thanks, Laszlo Laszlo Ersek (2): daemon: generalize ocaml-hivex[-devel] lookup daemon_utils_tests: generalize ocaml-hivex[-devel] lookup daemon/Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.19.1.3.g30247aa5d201
Laszlo Ersek
2021-Sep-08 13:35 UTC
[Libguestfs] [libguestfs PATCH 1/2] 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 at redhat.com> --- daemon/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 6f13bd43cf55..83bf39975e04 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -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 \ -- 2.19.1.3.g30247aa5d201
Laszlo Ersek
2021-Sep-08 13:35 UTC
[Libguestfs] [libguestfs PATCH 2/2] daemon_utils_tests: generalize ocaml-hivex[-devel] lookup
Pass $(HIVEX_LIBS) with -cclib under the "daemon_utils_tests_LINK" target; otherwise the OCaml compiler does not tell the linker where "-lhivex" can be found, and the linking step fails if "-lhivex" is not on a system library path. Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- daemon/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 83bf39975e04..7322bfa5d765 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -453,7 +453,7 @@ daemon_utils_tests_DEPENDENCIES = \ $(top_builddir)/ocaml-link.sh daemon_utils_tests_LINK = \ $(top_builddir)/ocaml-link.sh \ - -cclib '-lutils -lgnu' \ + -cclib '-lutils -lgnu $(HIVEX_LIBS)' \ -- \ $(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLLINKFLAGS) \ $(OCAMLPACKAGES) \ -- 2.19.1.3.g30247aa5d201
Laszlo Ersek
2021-Sep-09 13:24 UTC
[Libguestfs] [libguestfs PATCH 0/2] generalize ocaml-hivex[-devel] lookup
On 09/08/21 15:35, Laszlo Ersek wrote:> "daemon/Makefile.am" needs some tweaks for finding such OCaml bindings > for hivex that are not installed system-wide. > > Thanks, > Laszlo > > Laszlo Ersek (2): > daemon: generalize ocaml-hivex[-devel] lookup > daemon_utils_tests: generalize ocaml-hivex[-devel] lookup > > daemon/Makefile.am | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >Merged as commit range ceb034c92cbb..523b0180d8cf. Thanks! Laszlo