On 30/3/20 10:38 pm, Samuel Thibault wrote:
> Damien Zammit, le lun. 30 mars 2020 22:22:12 +1100, a ecrit:
>> I don't think block-rump.c needs a separate library, what do you think?
> 
> Indeed, the way you did seems well-contained.

Thanks.  See patch for configure.ac/Makefile changes to make rumpdisk optional.

For some reason --without-librump still creates the Makefile for rumpdisk,
but the test for rump does not occur, ie I still see:

...
config.status: creating rumpdisk/Makefile
...

Damien
>From 7b7907511fe5d5b32ac3fe3a48eb0a031c8effc8 Mon Sep 17 00:00:00 2001
From: Damien Zammit <dam...@zamaudio.com>
Date: Wed, 1 Apr 2020 15:44:22 +1100
Subject: [PATCH] rumpdisk: Make optional based on configure --with-librump

---
 Makefile     |  5 ++++-
 configure.ac | 14 ++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 0e23c5b2..fa80398d 100644
--- a/Makefile
+++ b/Makefile
@@ -47,9 +47,12 @@ prog-subdirs = auth proc exec term \
 	       devnode \
 	       eth-multiplexer \
 	       acpi \
-	       rumpdisk \
 	       shutdown
 
+ifeq ($(HAVE_LIBRUMP),yes)
+prog-subdirs += rumpdisk
+endif
+
 ifeq ($(HAVE_SUN_RPC),yes)
 prog-subdirs += nfs nfsd
 endif
diff --git a/configure.ac b/configure.ac
index 897a9146..3b275e26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -243,6 +243,20 @@ AS_IF([test "x$with_libz" != xno], [
 ])
 AC_SUBST([HAVE_LIBZ])
 
+AC_ARG_WITH([librump],
+  [AS_HELP_STRING([--without-librump], [disable librump])], , [with_librump=yes])
+
+AC_DEFUN([LIBRUMP_FAIL], [
+  AC_MSG_FAILURE([Please install required libraries or use --without-librump.])
+])
+AS_IF([test "x$with_librump" != xno], [
+  AC_CHECK_HEADER([rump/rump.h],
+    [AC_DEFINE(HAVE_RUMP_RUMP_H)],
+    [LIBRUMP_FAIL])
+  AC_CHECK_LIB(rump, rump_init, [HAVE_LIBRUMP=yes], [LIBRUMP_FAIL])
+])
+AC_SUBST([HAVE_LIBRUMP])
+
 AC_ARG_ENABLE(boot-store-types,
 [  --enable-boot-store-types=TYPES...
 			  list of store types included in statically
-- 
2.25.1

Reply via email to