From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz1Jj-0000Bu-De for qemu-devel@nongnu.org; Thu, 11 Dec 2014 05:50:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz1Jd-0007Sl-1S for qemu-devel@nongnu.org; Thu, 11 Dec 2014 05:49:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz1Jc-0007Sf-Og for qemu-devel@nongnu.org; Thu, 11 Dec 2014 05:49:48 -0500 From: Gerd Hoffmann Date: Thu, 11 Dec 2014 11:49:24 +0100 Message-Id: <1418294973-21790-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1418294973-21790-1-git-send-email-kraxel@redhat.com> References: <1418294973-21790-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 01/10] sdl: move version logic from source code to makefile List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori 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 --- ui/Makefile.objs | 7 ++++++- ui/sdl.c | 3 --- ui/sdl2.c | 3 --- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/Makefile.objs b/ui/Makefile.objs index 801cba2..b25e85f 100644 --- a/ui/Makefile.objs +++ b/ui/Makefile.objs @@ -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) diff --git a/ui/sdl.c b/ui/sdl.c index 94c1d9d..3e9d810 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -26,8 +26,6 @@ #undef WIN32_LEAN_AND_MEAN #include - -#if SDL_MAJOR_VERSION == 1 #include #include "qemu-common.h" @@ -958,4 +956,3 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) atexit(sdl_cleanup); } -#endif diff --git a/ui/sdl2.c b/ui/sdl2.c index 1ad74ba..45f23b1 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -27,8 +27,6 @@ #undef WIN32_LEAN_AND_MEAN #include - -#if SDL_MAJOR_VERSION == 2 #include #include "qemu-common.h" @@ -912,4 +910,3 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) atexit(sdl_cleanup); } -#endif -- 1.8.3.1