]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
sdl: move version logic from source code to makefile
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 11 Nov 2014 09:13:08 +0000 (10:13 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 16 Dec 2014 13:15:27 +0000 (14:15 +0100)
Compile sdl.c / sdl2.c depending on CONFIG_SDLABI instead of
compiling both and have version #ifdefs in the source code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
ui/Makefile.objs
ui/sdl.c
ui/sdl2.c

index 801cba26757a61eb1302cf70635dd7d4e263687d..b25e85f68ef436ef30e5d71ccfbd03ae33a280fb 100644 (file)
@@ -16,7 +16,12 @@ common-obj-$(CONFIG_CURSES) += curses.o
 common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
 common-obj-$(CONFIG_GTK) += gtk.o x_keymap.o
 
-sdl.mo-objs := sdl.o sdl_zoom.o sdl2.o
+ifeq ($(CONFIG_SDLABI),1.2)
+sdl.mo-objs := sdl.o sdl_zoom.o
+endif
+ifeq ($(CONFIG_SDLABI),2.0)
+sdl.mo-objs := sdl2.o
+endif
 sdl.mo-cflags := $(SDL_CFLAGS)
 
 gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
index 94c1d9dc3abca1a64fc3b70f185d78bad6271382..3e9d81076b9bcb9120c18b4e912571d529842cc9 100644 (file)
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -26,8 +26,6 @@
 #undef WIN32_LEAN_AND_MEAN
 
 #include <SDL.h>
-
-#if SDL_MAJOR_VERSION == 1
 #include <SDL_syswm.h>
 
 #include "qemu-common.h"
@@ -958,4 +956,3 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
 
     atexit(sdl_cleanup);
 }
-#endif
index 1ad74baafcd567649edf4f8e93ae90d888fafc4a..45f23b15e0fc14fd13225fc468d0a0b5e6bf0d9f 100644 (file)
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -27,8 +27,6 @@
 #undef WIN32_LEAN_AND_MEAN
 
 #include <SDL.h>
-
-#if SDL_MAJOR_VERSION == 2
 #include <SDL_syswm.h>
 
 #include "qemu-common.h"
@@ -912,4 +910,3 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
 
     atexit(sdl_cleanup);
 }
-#endif