From ecb8618cb723bed6eb054f25c4ee1d2822adabb5 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 4 May 2011 23:19:22 +0200 Subject: BUILD: Unify build & configure rules for SDL based backends --- backends/platform/dingux/module.mk | 10 +++--- backends/platform/gp2x/module.mk | 3 ++ backends/platform/gph/module.mk | 2 +- backends/platform/linuxmoto/module.mk | 4 +-- backends/platform/openpandora/module.mk | 9 +++--- backends/platform/samsungtv/module.mk | 3 ++ configure | 54 +++++++++++---------------------- 7 files changed, 37 insertions(+), 48 deletions(-) diff --git a/backends/platform/dingux/module.mk b/backends/platform/dingux/module.mk index 2247625a04..b924fec1cf 100644 --- a/backends/platform/dingux/module.mk +++ b/backends/platform/dingux/module.mk @@ -4,8 +4,10 @@ MODULE_OBJS := \ main.o \ dingux.o -MODULE_DIRS += \ - backends/platform/dingux/ +# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. +MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) +OBJS := $(MODULE_OBJS) $(OBJS) +MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) -# We don't use the rules.mk here on purpose -OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS) +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/gp2x/module.mk b/backends/platform/gp2x/module.mk index 837ad99d7b..4846f162cb 100644 --- a/backends/platform/gp2x/module.mk +++ b/backends/platform/gp2x/module.mk @@ -10,3 +10,6 @@ MODULE_OBJS := \ MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) OBJS := $(MODULE_OBJS) $(OBJS) MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) + +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/gph/module.mk b/backends/platform/gph/module.mk index a9951494d1..d8a1a6cd8d 100644 --- a/backends/platform/gph/module.mk +++ b/backends/platform/gph/module.mk @@ -11,4 +11,4 @@ OBJS := $(MODULE_OBJS) $(OBJS) MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) # Hack to ensure the SDL backend is built so we can use OSystem_SDL. --include $(srcdir)/backends/platform/sdl/module.mk \ No newline at end of file +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/linuxmoto/module.mk b/backends/platform/linuxmoto/module.mk index c604d69da1..4c81aac3f2 100644 --- a/backends/platform/linuxmoto/module.mk +++ b/backends/platform/linuxmoto/module.mk @@ -10,5 +10,5 @@ MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) OBJS := $(MODULE_OBJS) $(OBJS) MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) -# HACK: The linuxmoto backend is based on the SDL one, so we load that, too. -include $(srcdir)/backends/platform/sdl/module.mk +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/openpandora/module.mk b/backends/platform/openpandora/module.mk index 8e60b87aa6..5bd568e1c4 100755 --- a/backends/platform/openpandora/module.mk +++ b/backends/platform/openpandora/module.mk @@ -5,11 +5,10 @@ MODULE_OBJS := \ op-backend.o \ op-main.o -MODULE_DIRS += \ - backends/platform/openpandora/ - -# We don't use the rules.mk here on purpose -OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS) +# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. +MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) +OBJS := $(MODULE_OBJS) $(OBJS) +MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) # Hack to ensure the SDL backend is built so we can use OSystem_SDL. -include $(srcdir)/backends/platform/sdl/module.mk diff --git a/backends/platform/samsungtv/module.mk b/backends/platform/samsungtv/module.mk index 36ad75da6d..cba09db74c 100644 --- a/backends/platform/samsungtv/module.mk +++ b/backends/platform/samsungtv/module.mk @@ -8,3 +8,6 @@ MODULE_OBJS := \ MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) OBJS := $(MODULE_OBJS) $(OBJS) MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) + +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk diff --git a/configure b/configure index 5519a0a862..367289ee12 100755 --- a/configure +++ b/configure @@ -2192,12 +2192,7 @@ case $_backend in LIBS="$LIBS -lronin -lm" ;; dingux) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - DEFINES="$DEFINES -DSDL_BACKEND -DDINGUX" - LDFLAGS="$LDFLAGS " - MODULES="$MODULES backends/platform/sdl" + DEFINES="$DEFINES -DDINGUX" ;; ds) # TODO ds @@ -2206,28 +2201,15 @@ case $_backend in INCLUDES="$INCLUDES "'-Ibackends/platform/ds/arm9/data' ;; gp2x) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - LDFLAGS="$LDFLAGS" - DEFINES="$DEFINES -DSDL_BACKEND" ;; gph) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - LDFLAGS="$LDFLAGS" - DEFINES="$DEFINES -DSDL_BACKEND" ;; iphone) OBJCFLAGS="$OBJCFLAGS --std=c99" LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES -framework QuartzCore -framework GraphicsServices -framework CoreFoundation -framework Foundation -framework AudioToolbox -framework CoreAudio" ;; linuxmoto) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - DEFINES="$DEFINES -DSDL_BACKEND -DLINUXMOTO" + DEFINES="$DEFINES -DLINUXMOTO" ;; n64) INCLUDES="$INCLUDES "'-I$(N64SDK)/include' @@ -2240,11 +2222,6 @@ case $_backend in DEFINES="$DEFINES -DUSE_NULL_DRIVER" ;; openpandora) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - LDFLAGS="$LDFLAGS" - DEFINES="$DEFINES -DSDL_BACKEND" ;; ps2) # TODO ps2 @@ -2261,18 +2238,8 @@ case $_backend in LIBS="$LIBS -lpng -Wl,-Map,mapfile.txt" ;; samsungtv) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - DEFINES="$DEFINES -DSDL_BACKEND -DSAMSUNGTV" + DEFINES="$DEFINES -DSAMSUNGTV" LDFLAGS="$LDFLAGS -shared -fpic" - MODULES="$MODULES backends/platform/sdl" - ;; - sdl) - find_sdlconfig - INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" - LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" - DEFINES="$DEFINES -DSDL_BACKEND" ;; webos) # There is no sdl-config in the WebOS PDK so we don't use find_sdlconfig here. @@ -2296,6 +2263,8 @@ case $_backend in LIBS="$LIBS -static -lSDL" DEFINES="$DEFINES -DSDL_BACKEND" ;; + sdl) + ;; *) echo "support for $_backend backend not implemented in configure script yet" exit 1 @@ -2303,6 +2272,19 @@ case $_backend in esac MODULES="$MODULES backends/platform/$_backend" +# +# Setup SDL specifics for SDL based backends +# +case $_backend in + dingux | gp2x | gph | linuxmoto | openpandora | samsungtv | sdl) + find_sdlconfig + INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" + LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" + DEFINES="$DEFINES -DSDL_BACKEND" + ;; +esac + + # # Enable 16bit support only for backends which support it # -- cgit v1.2.3