kvmtool: Makefile: only enable framebuffer output on x86

The Makefile checks for the libaries needed to display the guest's
framebuffer unconditionally on all architectures.
However currently only x86 supports a guest framebuffer.
Introduce ARCH_HAS_FRAMEBUFFER in the Makefile and check for the
needed libraries only on x86. If other architectures add support for
it later, we can add them easily.
This avoids pulling in unneeded libraries into the lkvm binary, which
breaks copying over binaries into systems with only minimal userland.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
Andre Przywara
2015-06-04 16:33:26 +01:00
committed by Will Deacon
parent 57fa349a97
commit 8618570ee3
+35 -32
View File
@@ -131,6 +131,7 @@ ifeq ($(ARCH),x86)
OTHEROBJS += x86/bios.o
OTHEROBJS += x86/bios/bios-rom.o
ARCH_INCLUDE := x86/include
ARCH_HAS_FRAMEBUFFER := y
endif
# POWER/ppc: Actually only support ppc64 currently.
ifeq ($(ARCH), powerpc)
@@ -210,40 +211,42 @@ else
NOTFOUND += bfd
endif
CFLAGS_GTK3 := $(shell pkg-config --cflags gtk+-3.0 2>/dev/null)
LDFLAGS_GTK3 := $(shell pkg-config --libs gtk+-3.0 2>/dev/null)
ifeq ($(call try-build,$(SOURCE_GTK3),$(CFLAGS) $(CFLAGS_GTK3),$(LDFLAGS_GTK3)),y)
OBJS_DYNOPT += ui/gtk3.o
CFLAGS_DYNOPT += -DCONFIG_HAS_GTK3 $(CFLAGS_GTK3)
LIBS_DYNOPT += $(LDFLAGS_GTK3)
else
NOTFOUND += GTK3
endif
ifeq (y,$(ARCH_HAS_FRAMEBUFFER))
CFLAGS_GTK3 := $(shell pkg-config --cflags gtk+-3.0 2>/dev/null)
LDFLAGS_GTK3 := $(shell pkg-config --libs gtk+-3.0 2>/dev/null)
ifeq ($(call try-build,$(SOURCE_GTK3),$(CFLAGS) $(CFLAGS_GTK3),$(LDFLAGS_GTK3)),y)
OBJS_DYNOPT += ui/gtk3.o
CFLAGS_DYNOPT += -DCONFIG_HAS_GTK3 $(CFLAGS_GTK3)
LIBS_DYNOPT += $(LDFLAGS_GTK3)
else
NOTFOUND += GTK3
endif
ifeq ($(call try-build,$(SOURCE_VNCSERVER),$(CFLAGS),-lvncserver),y)
OBJS_DYNOPT += ui/vnc.o
CFLAGS_DYNOPT += -DCONFIG_HAS_VNCSERVER
LIBS_DYNOPT += -lvncserver
else
NOTFOUND += vncserver
endif
ifeq ($(call try-build,$(SOURCE_VNCSERVER),$(CFLAGS),-lvncserver -static),y)
OBJS_STATOPT += ui/vnc.o
CFLAGS_STATOPT += -DCONFIG_HAS_VNCSERVER
LIBS_STATOPT += -lvncserver
endif
ifeq ($(call try-build,$(SOURCE_VNCSERVER),$(CFLAGS),-lvncserver),y)
OBJS_DYNOPT += ui/vnc.o
CFLAGS_DYNOPT += -DCONFIG_HAS_VNCSERVER
LIBS_DYNOPT += -lvncserver
else
NOTFOUND += vncserver
endif
ifeq ($(call try-build,$(SOURCE_VNCSERVER),$(CFLAGS),-lvncserver -static),y)
OBJS_STATOPT += ui/vnc.o
CFLAGS_STATOPT += -DCONFIG_HAS_VNCSERVER
LIBS_STATOPT += -lvncserver
endif
ifeq ($(call try-build,$(SOURCE_SDL),$(CFLAGS),-lSDL),y)
OBJS_DYNOPT += ui/sdl.o
CFLAGS_DYNOPT += -DCONFIG_HAS_SDL
LIBS_DYNOPT += -lSDL
else
NOTFOUND += SDL
endif
ifeq ($(call try-build,$(SOURCE_SDL),$(CFLAGS),-lSDL -static), y)
OBJS_STATOPT += ui/sdl.o
CFLAGS_STATOPT += -DCONFIG_HAS_SDL
LIBS_STATOPT += -lSDL
ifeq ($(call try-build,$(SOURCE_SDL),$(CFLAGS),-lSDL),y)
OBJS_DYNOPT += ui/sdl.o
CFLAGS_DYNOPT += -DCONFIG_HAS_SDL
LIBS_DYNOPT += -lSDL
else
NOTFOUND += SDL
endif
ifeq ($(call try-build,$(SOURCE_SDL),$(CFLAGS),-lSDL -static), y)
OBJS_STATOPT += ui/sdl.o
CFLAGS_STATOPT += -DCONFIG_HAS_SDL
LIBS_STATOPT += -lSDL
endif
endif
ifeq ($(call try-build,$(SOURCE_ZLIB),$(CFLAGS),-lz),y)