ui/curses: build as module
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 1 Mar 2018 10:05:45 +0000 (11:05 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 5 Mar 2018 07:44:11 +0000 (08:44 +0100)
Also drop curses libs from libs_softmmu.  Add CURSES_{CFLAGS,LIBS}
variables so we can use them for linking the curses module.

Also make target/unicore32/helper.o depend on curses which uses curses
directly for some reason ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180301100547.18962-12-kraxel@redhat.com

configure
target/unicore32/Makefile.objs
ui/Makefile.objs

index ad36320a4c711ad02f1fff9fdc41aca40a6e9620..e651533466a71b1488ccb6152ec9434d4cfde359 100755 (executable)
--- a/configure
+++ b/configure
@@ -3280,8 +3280,6 @@ EOF
       unset IFS
       if compile_prog "$curses_inc" "$curses_lib" ; then
         curses_found=yes
-        QEMU_CFLAGS="$curses_inc $QEMU_CFLAGS"
-        libs_softmmu="$curses_lib $libs_softmmu"
         break
       fi
     done
@@ -6050,7 +6048,9 @@ if test "$cocoa" = "yes" ; then
   echo "CONFIG_COCOA=y" >> $config_host_mak
 fi
 if test "$curses" = "yes" ; then
-  echo "CONFIG_CURSES=y" >> $config_host_mak
+  echo "CONFIG_CURSES=m" >> $config_host_mak
+  echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak
+  echo "CURSES_LIBS=$curses_lib" >> $config_host_mak
 fi
 if test "$pipe2" = "yes" ; then
   echo "CONFIG_PIPE2=y" >> $config_host_mak
index 6b41b1e9ef4c61f8da90c06aefa15793cf216f4e..35d8bf530d87326ca766fba0804f0dfab8ace6f2 100644 (file)
@@ -2,3 +2,7 @@ obj-y += translate.o op_helper.o helper.o cpu.o
 obj-y += ucf64_helper.o
 
 obj-$(CONFIG_SOFTMMU) += softmmu.o
+
+# Huh? Uses curses directly instead of using ui/console.h interfaces ...
+helper.o-cflags := $(CURSES_CFLAGS)
+helper.o-libs := $(CURSES_LIBS)
index 49223b0573a1d872351f042a00afb6ba7324da03..a37232762b990f598c20ecf2531ef17bb9f43856 100644 (file)
@@ -13,7 +13,6 @@ common-obj-$(CONFIG_LINUX) += input-linux.o
 common-obj-$(CONFIG_SPICE) += spice-core.o spice-input.o spice-display.o
 common-obj-$(CONFIG_SDL) += sdl.mo
 common-obj-$(CONFIG_COCOA) += cocoa.o
-common-obj-$(CONFIG_CURSES) += curses.o
 common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
 common-obj-$(call lnot,$(CONFIG_VNC)) += vnc-stubs.o
 
@@ -39,6 +38,11 @@ gtk.mo-objs := gtk.o
 gtk.mo-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
 gtk.mo-libs := $(GTK_LIBS) $(VTE_LIBS)
 
+common-obj-$(CONFIG_CURSES) += curses.mo
+curses.mo-objs := curses.o
+curses.mo-cflags := $(CURSES_CFLAGS)
+curses.mo-libs := $(CURSES_LIBS)
+
 ifeq ($(CONFIG_OPENGL),y)
 common-obj-y += shader.o
 common-obj-y += console-gl.o