[Libguestfs] [PATCH 01/11] java: link libguestfs_jni against libutils

Pino Toscano
Fri, 03 Mar 2017 14:32:55 -0000

The JNI library uses CLEANUP_FREE macros, whose functions are built in
the internal libutils.  Currently, trying to use functions that use
CLEANUP_FREE variables will cause the java execution to stop with a
symbol lookup error (for guestfs_int_cleanup_free).
---
 java/Makefile.am | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/Makefile.am b/java/Makefile.am
index 06d0fc7..ea64f55 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -115,7 +115,9 @@ libguestfs_jni_la_CFLAGS = \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
 	$(JNI_CFLAGS)

-libguestfs_jni_la_LIBADD = $(top_builddir)/lib/libguestfs.la
+libguestfs_jni_la_LIBADD = \
+	$(top_builddir)/common/utils/libutils.la \
+	$(top_builddir)/lib/libguestfs.la

 libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO) -shared

--
2.9.3