Enable SDL thread support

This patch enables the use of threads and locking mechanisms in SDL
applications. The 'pthread' libary is used as backend. Not all features
are currently supported.

Fixes #185.
This commit is contained in:
Christian Prochaska 2012-04-19 18:05:04 +02:00 committed by Norman Feske
parent 7a369bc74d
commit 48d547e2fd
2 changed files with 10 additions and 4 deletions

View File

@ -22,6 +22,7 @@ SRC_CC = SDL_genode_fb_video.cc \
INC_DIR += $(REP_DIR)/include/SDL \
$(REP_DIR)/src/lib/sdl \
$(REP_DIR)/src/lib/sdl/thread \
$(REP_DIR)/src/lib/sdl/video
# main files
@ -43,8 +44,10 @@ SRC_C += SDL_getenv.c \
# thread subsystem
SRC_C += SDL_thread.c \
SDL_systhread.c \
SDL_syscond.c \
SDL_sysmutex.c \
SDL_syssem.c
INC_DIR += $(SDL_DIR)/src/thread
# cpuinfo subsystem
SRC_C += SDL_cpuinfo.c
@ -101,7 +104,7 @@ SRC_C += SDL_joystick.c \
INC_DIR += $(SDL_DIR)/src/joystick
# we need libc
LIBS = libc
LIBS = libc pthread
# dim build noise for contrib code
CC_OPT_SDL_RLEaccel += -Wno-unused-but-set-variable
@ -114,6 +117,9 @@ vpath % $(REP_DIR)/src/lib/sdl
vpath % $(REP_DIR)/src/lib/sdl/video
# contribution pathes
vpath SDL_syscond.c $(SDL_DIR)/src/thread/generic
vpath SDL_sysmutex.c $(SDL_DIR)/src/thread/generic
vpath %.c $(SDL_DIR)/src
vpath %.c $(SDL_DIR)/src/stdlib
vpath %.c $(SDL_DIR)/src/video
@ -121,7 +127,7 @@ vpath %.c $(SDL_DIR)/src/video/dummy
vpath %.c $(SDL_DIR)/src/audio
vpath %.c $(SDL_DIR)/src/audio/dummy
vpath %.c $(SDL_DIR)/src/thread
vpath %.c $(SDL_DIR)/src/thread/generic
vpath %.c $(SDL_DIR)/src/thread/pthread
vpath %.c $(SDL_DIR)/src/timer
vpath %.c $(SDL_DIR)/src/timer/dummy
vpath %.c $(SDL_DIR)/src/events

View File

@ -50,8 +50,8 @@
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
#define SDL_LOADSO_DISABLED 1
/* Enable the stub thread support (src/thread/generic/\*.c) */
#define SDL_THREADS_DISABLED 1
/* Enable thread support */
#define SDL_THREAD_PTHREAD 1
/* Enable dummy timer support */
#define SDL_TIMER_DUMMY 1