public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvmtool: Allow optional libraries to be forced off
@ 2017-01-19 18:46 Chirantan Ekbote
  2017-01-19 19:00 ` Mike Frysinger
  2017-02-02 18:17 ` Andre Przywara
  0 siblings, 2 replies; 4+ messages in thread
From: Chirantan Ekbote @ 2017-01-19 18:46 UTC (permalink / raw)
  To: kvm; +Cc: dgreid, vapier, Chirantan Ekbote

The makefile currently automatically detects if certain optional
libraries are present on the file system and links with them if they
are.

This isn't always desired though: users may not want to link against
those libraries even if they do exist.  Add new variables that when set
to 0 will force the corresponding optional library off.

Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
---
 Makefile | 43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index eeb54a4..69daa1e 100644
--- a/Makefile
+++ b/Makefile
@@ -250,26 +250,33 @@ ifeq (y,$(ARCH_HAS_FRAMEBUFFER))
 	endif
 endif
 
-ifeq ($(call try-build,$(SOURCE_ZLIB),$(CFLAGS),$(LDFLAGS) -lz),y)
-	CFLAGS_DYNOPT	+= -DCONFIG_HAS_ZLIB
-	LIBS_DYNOPT	+= -lz
-else
-	NOTFOUND	+= zlib
-endif
-ifeq ($(call try-build,$(SOURCE_ZLIB),$(CFLAGS),$(LDFLAGS) -lz -static),y)
-	CFLAGS_STATOPT	+= -DCONFIG_HAS_ZLIB
-	LIBS_STATOPT	+= -lz
-endif
+# Define USE_ZLIB=0 to disable zlib.
+ifneq ($(USE_ZLIB),0)
+	ifeq ($(call try-build,$(SOURCE_ZLIB),$(CFLAGS),$(LDFLAGS) -lz),y)
+		CFLAGS_DYNOPT	+= -DCONFIG_HAS_ZLIB
+		LIBS_DYNOPT	+= -lz
+	else
+		NOTFOUND	+= zlib
+	endif
 
-ifeq ($(call try-build,$(SOURCE_AIO),$(CFLAGS),$(LDFLAGS) -laio),y)
-	CFLAGS_DYNOPT	+= -DCONFIG_HAS_AIO
-	LIBS_DYNOPT	+= -laio
-else
-	NOTFOUND	+= aio
+	ifeq ($(call try-build,$(SOURCE_ZLIB),$(CFLAGS),$(LDFLAGS) -lz -static),y)
+		CFLAGS_STATOPT	+= -DCONFIG_HAS_ZLIB
+		LIBS_STATOPT	+= -lz
+	endif
 endif
-ifeq ($(call try-build,$(SOURCE_AIO),$(CFLAGS),$(LDFLAGS) -laio -static),y)
-	CFLAGS_STATOPT	+= -DCONFIG_HAS_AIO
-	LIBS_STATOPT	+= -laio
+
+# Define USE_AIO=0 to disable libaio.
+ifneq ($(USE_AIO),0)
+	ifeq ($(call try-build,$(SOURCE_AIO),$(CFLAGS),$(LDFLAGS) -laio),y)
+		CFLAGS_DYNOPT	+= -DCONFIG_HAS_AIO
+		LIBS_DYNOPT	+= -laio
+	else
+		NOTFOUND	+= aio
+	endif
+	ifeq ($(call try-build,$(SOURCE_AIO),$(CFLAGS),$(LDFLAGS) -laio -static),y)
+		CFLAGS_STATOPT	+= -DCONFIG_HAS_AIO
+		LIBS_STATOPT	+= -laio
+	endif
 endif
 
 ifeq ($(LTO),1)
-- 
2.11.0.483.g087da7b7c-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-03  4:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19 18:46 [PATCH] kvmtool: Allow optional libraries to be forced off Chirantan Ekbote
2017-01-19 19:00 ` Mike Frysinger
2017-02-02 18:17 ` Andre Przywara
2017-02-03  4:53   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox