WINCE: Enable building of plugins with normal configure/make

Enables building of plugin .dlls without a custom Makefile.
Also removes generation of scummvm.exe.map from configure script.
This commit is contained in:
CeRiAl 2011-04-28 06:40:54 +08:00 committed by Ismail Khatib
parent 582827df40
commit 6db6d69eed
6 changed files with 42 additions and 6 deletions

View file

@ -21,9 +21,12 @@ MODULE_OBJS := \
../../../gui/Key.o \ ../../../gui/Key.o \
../../../gui/KeysDialog.o \ ../../../gui/KeysDialog.o \
missing/missing.o \ missing/missing.o \
PocketSCUMM.o \
smartLandScale.o smartLandScale.o
ifndef DYNAMIC_MODULES
MODULE_OBJS += PocketSCUMM.o
endif
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. # We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
OBJS := $(MODULE_OBJS) $(OBJS) OBJS := $(MODULE_OBJS) $(OBJS)

View file

@ -63,6 +63,7 @@
#include "backends/mixer/wincesdl/wincesdl-mixer.h" #include "backends/mixer/wincesdl/wincesdl-mixer.h"
#ifdef DYNAMIC_MODULES #ifdef DYNAMIC_MODULES
#include <malloc.h>
#include "backends/plugins/win32/win32-provider.h" #include "backends/plugins/win32/win32-provider.h"
#endif #endif

View file

@ -2,3 +2,10 @@ backends/platform/wince/PocketSCUMM.o: $(srcdir)/backends/platform/wince/PocketS
$(QUIET)$(MKDIR) $(*D) $(QUIET)$(MKDIR) $(*D)
$(WINDRES) $(WINDRESFLAGS) -I$(srcdir)/backends/platform/wince $< $@ $(WINDRES) $(WINDRESFLAGS) -I$(srcdir)/backends/platform/wince $< $@
ifdef DYNAMIC_MODULES
plugins: backends/platform/wince/stub.o backends/platform/wince/PocketSCUMM.o
$(CXX) backends/platform/wince/stub.o backends/platform/wince/PocketSCUMM.o -L. -lscummvm -o scummvm.exe
backends/platform/wince/stub.o: $(srcdir)/backends/platform/wince/stub.cpp
$(CXX) -c $(srcdir)/backends/platform/wince/stub.cpp -o backends/platform/wince/stub.o
endif

View file

@ -22,7 +22,7 @@
#include "common/scummsys.h" #include "common/scummsys.h"
#if defined(DYNAMIC_MODULES) && defined(SDL_BACKEND) #if defined(DYNAMIC_MODULES) && defined(SDL_BACKEND) && !defined(_WIN32_WCE)
#include "backends/plugins/sdl/sdl-provider.h" #include "backends/plugins/sdl/sdl-provider.h"
#include "backends/plugins/dynamic-plugin.h" #include "backends/plugins/dynamic-plugin.h"

View file

@ -70,8 +70,15 @@ public:
#ifndef _WIN32_WCE #ifndef _WIN32_WCE
_dlHandle = LoadLibrary(_filename.c_str()); _dlHandle = LoadLibrary(_filename.c_str());
#else #else
if (!_filename.hasSuffix("scummvm.dll")) // skip loading the core scummvm module if (!_filename.hasSuffix("scummvm.dll") &&
!_filename.hasSuffix("libstdc++-6.dll") &&
!_filename.hasSuffix("libgcc_s_sjlj-1.dll")) {
// skip loading the core scummvm module and runtime dlls
_dlHandle = LoadLibrary(toUnicode(_filename.c_str())); _dlHandle = LoadLibrary(toUnicode(_filename.c_str()));
} else {
// do not generate misleading error message
return false;
}
#endif #endif
if (!_dlHandle) { if (!_dlHandle) {

24
configure vendored Executable file → Normal file
View file

@ -1697,8 +1697,8 @@ case $_host_os in
fi fi
;; ;;
wince) wince)
CXXFLAGS="$CXXFLAGS -O3 -fno-inline-functions -march=armv4 -mtune=xscale" CXXFLAGS="$CXXFLAGS -O3 -fno-inline-functions -march=armv4 -mtune=xscale -D_WIN32_WCE=300 "
DEFINES="$DEFINES -D_WIN32_WCE=300 -D__ARM__ -D_ARM_ -DUNICODE -DFPM_DEFAULT -DNONSTANDARD_PORT" DEFINES="$DEFINES -D__ARM__ -D_ARM_ -DUNICODE -DFPM_DEFAULT -DNONSTANDARD_PORT"
DEFINES="$DEFINES -DWIN32 -Dcdecl= -D__cdecl__=" DEFINES="$DEFINES -DWIN32 -Dcdecl= -D__cdecl__="
;; ;;
# given this is a shell script assume some type of unix # given this is a shell script assume some type of unix
@ -2054,7 +2054,7 @@ if test -n "$_host"; then
add_line_to_config_h "#define USE_WII_KBD" add_line_to_config_h "#define USE_WII_KBD"
;; ;;
wince) wince)
LDFLAGS="$LDFLAGS -Wl,-Map,scummvm.exe.map -Wl,--stack,65536" LDFLAGS="$LDFLAGS -Wl,--stack,65536"
_need_memalign=yes _need_memalign=yes
_arm_asm=yes _arm_asm=yes
_tremolo=yes _tremolo=yes
@ -2317,6 +2317,24 @@ CXXFLAGS += -DDYNAMIC_MODULES
PLUGIN_LDFLAGS := -Wl,--enable-auto-import -shared ./libscummvm.a PLUGIN_LDFLAGS := -Wl,--enable-auto-import -shared ./libscummvm.a
PRE_OBJS_FLAGS := -Wl,--whole-archive PRE_OBJS_FLAGS := -Wl,--whole-archive
POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a
'
;;
wince)
DEFINES="$DEFINES -DUNCACHED_PLUGINS"
HOSTEXEEXT=".dll"
_def_plugin='
#define PLUGIN_PREFIX ""
#define PLUGIN_SUFFIX ".dll"
'
_mak_plugins='
DYNAMIC_MODULES := 1
PLUGIN_PREFIX :=
PLUGIN_SUFFIX := .dll
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
CXXFLAGS += -DDYNAMIC_MODULES
PLUGIN_LDFLAGS := -shared -lscummvm -L.
PRE_OBJS_FLAGS := -Wl,--whole-archive
POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a -shared
' '
;; ;;
ps2) ps2)