Skip to content

Commit

Permalink
Date: Wed, 01 Mar 2006 10:14:31 +0000
Browse files Browse the repository at this point in the history
From: "alan buckley"
Subject: Re: Updating SDL for RISC OS

I've attached a zip file with three diffs to get SDL to build on RISC OS.

configure.in.diff and makedeps.sh.diff have been modified so that they
can build the assembler file in video/riscos. You may want to double
check these as I don't know a lot about unix shell programming.
(I've tested them cross-compiling on cygwin).

sdlsysthread.diff is the changes required to SDL_systhread.c for RISC
OS. As you suspected with these changes in place you can delete the
RISC OS specific threading code in thread/riscos.

I've also renamed SDL_riscosASM.s to SDL_riscosASM.S, but I'm never
quite sure how to rename files in CVS, so if you could to this it would
be appreciated.
  • Loading branch information
slouken committed Mar 2, 2006
1 parent 00ad7e9 commit 3737127
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build-scripts/makedep.sh
Expand Up @@ -67,6 +67,12 @@ __EOF__
\$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) $src -o \$@
__EOF__
;;
S) cat >>${output}.new <<__EOF__
\$(LIBTOOL) --mode=compile \$(CC) -c $src -o \$@
__EOF__
;;
*) echo "Unknown file extension: $ext";;
Expand Down
2 changes: 2 additions & 0 deletions configure.in
Expand Up @@ -2325,6 +2325,7 @@ case "$target" in
if test x$enable_video = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
have_video=yes
fi
# Set up files for the joystick library
Expand Down Expand Up @@ -2388,6 +2389,7 @@ OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`

SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.o,g'`
Expand Down
15 changes: 15 additions & 0 deletions src/thread/pthread/SDL_systhread.c
Expand Up @@ -34,6 +34,13 @@ static int sig_list[] = {
SIGVTALRM, SIGPROF, 0
};

#ifdef __RISCOS__
/* RISC OS needs to know the main thread for
* it's timer and event processing. */
int riscos_using_threads = 0;
Uint32 riscos_main_thread = 0; /* Thread running events */
#endif


static void *RunThread(void *data)
{
Expand All @@ -58,6 +65,14 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
SDL_SetError("Not enough resources to create thread");
return(-1);
}

#ifdef __RISCOS__
if (riscos_using_threads == 0) {
riscos_using_threads = 1;
riscos_main_thread = SDL_ThreadID();
}
#endif

return(0);
}

Expand Down
File renamed without changes.

0 comments on commit 3737127

Please sign in to comment.