aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/libsdl
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/libsdl
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
openembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.bz2
openembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.zip
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/libsdl')
-rw-r--r--recipes/libsdl/ballfield_1.0.bb8
-rw-r--r--recipes/libsdl/files/acinclude.m4189
-rw-r--r--recipes/libsdl/files/configure_tweak.patch1167
-rw-r--r--recipes/libsdl/files/directfb_obsolete_calls.patch33
-rw-r--r--recipes/libsdl/files/explicit-extern-C.patch22
-rw-r--r--recipes/libsdl/files/extra-keys.patch53
-rw-r--r--recipes/libsdl/files/fixlibs-1.2.9.patch27
-rw-r--r--recipes/libsdl/files/fixmfour.patch14
-rw-r--r--recipes/libsdl/files/kernel-asm-page.patch13
-rw-r--r--recipes/libsdl/files/kill-stdc++-1.2.9.patch422
-rw-r--r--recipes/libsdl/files/pagesize.patch15
-rw-r--r--recipes/libsdl/files/pygame-1.2.9.patch191
-rw-r--r--recipes/libsdl/files/remove_path.patch18
-rw-r--r--recipes/libsdl/files/sdl-cdfix.patch11
-rw-r--r--recipes/libsdl/libsdl-directfb_1.2.11.bb27
-rw-r--r--recipes/libsdl/libsdl-directfb_1.2.9.bb21
-rw-r--r--recipes/libsdl/libsdl-gfx_2.0.11.bb18
-rw-r--r--recipes/libsdl/libsdl-gfx_2.0.17.bb17
-rw-r--r--recipes/libsdl/libsdl-image-1.2.3/autotools.patch805
-rw-r--r--recipes/libsdl/libsdl-image.inc20
-rw-r--r--recipes/libsdl/libsdl-image_1.2.3.bb14
-rw-r--r--recipes/libsdl/libsdl-image_1.2.6.bb12
-rw-r--r--recipes/libsdl/libsdl-mixer_1.2.6.bb24
-rw-r--r--recipes/libsdl/libsdl-mixer_1.2.8.bb23
-rw-r--r--recipes/libsdl/libsdl-native_1.2.11.bb39
-rw-r--r--recipes/libsdl/libsdl-net-1.2.7/libtool2.patch13
-rw-r--r--recipes/libsdl/libsdl-net_1.2.7.bb21
-rw-r--r--recipes/libsdl/libsdl-qpe-1.2.9/SDL-Akita-1.2.9.patch51
-rw-r--r--recipes/libsdl/libsdl-qpe-1.2.9/acinclude.m4332
-rw-r--r--recipes/libsdl/libsdl-qpe-1.2.9/agawa-piro-mickey-1.2.9.patch2054
-rw-r--r--recipes/libsdl/libsdl-qpe-1.2.9/fix_Makefile.am.patch11
-rw-r--r--recipes/libsdl/libsdl-qpe-1.2.9/fix_configure.in.patch10
-rw-r--r--recipes/libsdl/libsdl-qpe-1.2.9/ipaq-1.2.9.patch140
-rw-r--r--recipes/libsdl/libsdl-qpe-1.2.9/mouse-1.2.9.patch48
-rw-r--r--recipes/libsdl/libsdl-qpe-1.2.9/no-PAGE_SIZE.patch11
-rw-r--r--recipes/libsdl/libsdl-qpe_1.2.9.bb36
-rw-r--r--recipes/libsdl/libsdl-ttf-2.0.3/new-freetype-includes.patch17
-rw-r--r--recipes/libsdl/libsdl-ttf-native_2.0.3.bb10
-rw-r--r--recipes/libsdl/libsdl-ttf_2.0.3.bb16
-rw-r--r--recipes/libsdl/libsdl-x11_1.2.11.bb26
-rw-r--r--recipes/libsdl/libsdl.inc40
-rw-r--r--recipes/libsdl/pushover_0.0.1.bb8
42 files changed, 6047 insertions, 0 deletions
diff --git a/recipes/libsdl/ballfield_1.0.bb b/recipes/libsdl/ballfield_1.0.bb
new file mode 100644
index 0000000000..9b44be5516
--- /dev/null
+++ b/recipes/libsdl/ballfield_1.0.bb
@@ -0,0 +1,8 @@
+DESCRIPTION = "This is a cute little "3D" sprite demo using SDL and SDL_image."
+DEPENDS = "vrtual/libsdl libsdl-image"
+LICENSE = "GPLv2"
+
+SRC_URI = "http://olofson.net/download/ballfield-${PV}.tar.gz"
+
+inherit autotools
+
diff --git a/recipes/libsdl/files/acinclude.m4 b/recipes/libsdl/files/acinclude.m4
new file mode 100644
index 0000000000..ca2df9d5e5
--- /dev/null
+++ b/recipes/libsdl/files/acinclude.m4
@@ -0,0 +1,189 @@
+# Local macros for the SDL configure.in script
+
+dnl Function to link an architecture specific file
+dnl LINK_ARCH_SRC(source_dir, arch, source_file)
+AC_DEFUN([COPY_ARCH_SRC],
+[
+ old="$srcdir/$1/$2/$3"
+ new="$1/$3"
+ if test ! -d $1; then
+ echo "Creating directory $1"
+ mkdir -p $1
+ fi
+ echo "Copying $old -> $new"
+ cat >$new <<__EOF__
+/* WARNING: This file was automatically generated!
+ * Original: $old
+ */
+__EOF__
+ cat >>$new <$old
+])
+
+#
+# --- esd.m4 ---
+#
+# Configure paths for ESD
+# Manish Singh 98-9-30
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
+dnl
+AC_DEFUN([AM_PATH_ESD],
+[dnl
+dnl Get the cflags and libraries from the esd-config script
+dnl
+AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
+ esd_prefix="$withval", esd_prefix="")
+AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
+ esd_exec_prefix="$withval", esd_exec_prefix="")
+AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
+ , enable_esdtest=yes)
+
+ if test x$esd_exec_prefix != x ; then
+ esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
+ if test x${ESD_CONFIG+set} != xset ; then
+ ESD_CONFIG=$esd_exec_prefix/bin/esd-config
+ fi
+ fi
+ if test x$esd_prefix != x ; then
+ esd_args="$esd_args --prefix=$esd_prefix"
+ if test x${ESD_CONFIG+set} != xset ; then
+ ESD_CONFIG=$esd_prefix/bin/esd-config
+ fi
+ fi
+
+ AC_PATH_PROG(ESD_CONFIG, esd-config, no)
+ min_esd_version=ifelse([$1], ,0.2.7,$1)
+ AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
+ no_esd=""
+ if test "$ESD_CONFIG" = "no" ; then
+ no_esd=yes
+ else
+ ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
+ ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
+
+ esd_major_version=`$ESD_CONFIG $esd_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ esd_minor_version=`$ESD_CONFIG $esd_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_esdtest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $ESD_CFLAGS"
+ LIBS="$LIBS $ESD_LIBS"
+dnl
+dnl Now check if the installed ESD is sufficiently new. (Also sanity
+dnl checks the results of esd-config to some extent
+dnl
+ rm -f conf.esdtest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <esd.h>
+
+char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main ()
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ system ("touch conf.esdtest");
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_esd_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_esd_version");
+ exit(1);
+ }
+
+ if (($esd_major_version > major) ||
+ (($esd_major_version == major) && ($esd_minor_version > minor)) ||
+ (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
+ printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
+ printf("*** to point to the correct copy of esd-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+}
+
+],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_esd" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$ESD_CONFIG" = "no" ; then
+ echo "*** The esd-config script installed by ESD could not be found"
+ echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the ESD_CONFIG environment variable to the"
+ echo "*** full path to esd-config."
+ else
+ if test -f conf.esdtest ; then
+ :
+ else
+ echo "*** Could not run ESD test program, checking why..."
+ CFLAGS="$CFLAGS $ESD_CFLAGS"
+ LIBS="$LIBS $ESD_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <esd.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding ESD or finding the wrong"
+ echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means ESD was incorrectly installed"
+ echo "*** or that you have moved ESD since it was installed. In the latter case, you"
+ echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ ESD_CFLAGS=""
+ ESD_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(ESD_CFLAGS)
+ AC_SUBST(ESD_LIBS)
+ rm -f conf.esdtest
+])
+
diff --git a/recipes/libsdl/files/configure_tweak.patch b/recipes/libsdl/files/configure_tweak.patch
new file mode 100644
index 0000000000..90a2888e57
--- /dev/null
+++ b/recipes/libsdl/files/configure_tweak.patch
@@ -0,0 +1,1167 @@
+Index: SDL-1.2.11/configure.in
+===================================================================
+--- SDL-1.2.11.orig/configure.in 2006-06-27 05:48:33.000000000 +0100
++++ SDL-1.2.11/configure.in 2008-02-21 19:48:47.000000000 +0000
+@@ -40,13 +40,13 @@
+ AC_SUBST(LT_AGE)
+
+ dnl Detect the canonical build and host environments
+-AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
++AC_CONFIG_AUX_DIR(./build-scripts)
+ AC_CANONICAL_HOST
+ AC_C_BIGENDIAN
+ if test x$ac_cv_c_bigendian = xyes; then
+- AC_DEFINE(SDL_BYTEORDER, 4321)
++ AC_DEFINE(SDL_BYTEORDER, 4321, "Byte Order")
+ else
+- AC_DEFINE(SDL_BYTEORDER, 1234)
++ AC_DEFINE(SDL_BYTEORDER, 1234, "Byte Order")
+ fi
+
+ dnl Set up the compiler and linker flags
+@@ -107,7 +107,7 @@
+ AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
+ , enable_libc=yes)
+ if test x$enable_libc = xyes; then
+- AC_DEFINE(HAVE_LIBC)
++ AC_DEFINE(HAVE_LIBC,1,"")
+
+ dnl Check for C library headers
+ AC_HEADER_STDC
+@@ -118,7 +118,7 @@
+ if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
+ AC_CHECK_TYPE(int64_t)
+ if test x$ac_cv_type_int64_t = xyes; then
+- AC_DEFINE(SDL_HAS_64BIT_TYPE)
++ AC_DEFINE(SDL_HAS_64BIT_TYPE,1,"")
+ fi
+ have_inttypes=yes
+ fi
+@@ -127,11 +127,11 @@
+ AC_FUNC_ALLOCA
+ AC_FUNC_MEMCMP
+ if test x$ac_cv_func_memcmp_working = xyes; then
+- AC_DEFINE(HAVE_MEMCMP)
++ AC_DEFINE(HAVE_MEMCMP,1,"")
+ fi
+ AC_FUNC_STRTOD
+ if test x$ac_cv_func_strtod = xyes; then
+- AC_DEFINE(HAVE_STRTOD)
++ AC_DEFINE(HAVE_STRTOD,1,"")
+ fi
+ AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep)
+
+@@ -146,40 +146,40 @@
+ AC_CHECK_SIZEOF(long, 4)
+ AC_CHECK_SIZEOF(long long, 8)
+ if test x$ac_cv_sizeof_char = x1; then
+- AC_DEFINE(int8_t, signed char)
+- AC_DEFINE(uint8_t, unsigned char)
++ AC_DEFINE(int8_t, signed char,"")
++ AC_DEFINE(uint8_t, unsigned char,"")
+ fi
+ if test x$ac_cv_sizeof_short = x2; then
+- AC_DEFINE(int16_t, signed short)
+- AC_DEFINE(uint16_t, unsigned short)
++ AC_DEFINE(int16_t, signed short,"")
++ AC_DEFINE(uint16_t, unsigned short,"")
+ else
+ if test x$ac_cv_sizeof_int = x2; then
+- AC_DEFINE(int16_t, signed int)
+- AC_DEFINE(uint16_t, unsigned int)
++ AC_DEFINE(int16_t, signed int,"")
++ AC_DEFINE(uint16_t, unsigned int,"")
+ fi
+ fi
+ if test x$ac_cv_sizeof_int = x4; then
+- AC_DEFINE(int32_t, signed int)
+- AC_DEFINE(uint32_t, unsigned int)
++ AC_DEFINE(int32_t, signed int,"")
++ AC_DEFINE(uint32_t, unsigned int,"")
+ else
+ if test x$ac_cv_sizeof_long = x4; then
+- AC_DEFINE(int32_t, signed long)
+- AC_DEFINE(uint32_t, unsigned long)
++ AC_DEFINE(int32_t, signed long,"")
++ AC_DEFINE(uint32_t, unsigned long,"")
+ fi
+ fi
+ if test x$ac_cv_sizeof_long = x8; then
+- AC_DEFINE(int64_t, signed long)
+- AC_DEFINE(uint64_t, unsigned long)
+- AC_DEFINE(SDL_HAS_64BIT_TYPE)
++ AC_DEFINE(int64_t, signed long,"")
++ AC_DEFINE(uint64_t, unsigned long,"")
++ AC_DEFINE(SDL_HAS_64BIT_TYPE,"")
+ else
+ if test x$ac_cv_sizeof_long_long = x8; then
+- AC_DEFINE(int64_t, signed long long)
+- AC_DEFINE(uint64_t, unsigned long long)
+- AC_DEFINE(SDL_HAS_64BIT_TYPE)
++ AC_DEFINE(int64_t, signed long long,"")
++ AC_DEFINE(uint64_t, unsigned long long,"")
++ AC_DEFINE(SDL_HAS_64BIT_TYPE,"")
+ fi
+ fi
+- AC_DEFINE(size_t, unsigned int)
+- AC_DEFINE(uintptr_t, unsigned long)
++ AC_DEFINE(size_t, unsigned int,"")
++ AC_DEFINE(uintptr_t, unsigned long,"")
+ fi
+
+ # Standard C sources
+@@ -201,67 +201,67 @@
+ AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
+ , enable_audio=yes)
+ if test x$enable_audio != xyes; then
+- AC_DEFINE(SDL_AUDIO_DISABLED)
++ AC_DEFINE(SDL_AUDIO_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(video,
+ AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
+ , enable_video=yes)
+ if test x$enable_video != xyes; then
+- AC_DEFINE(SDL_VIDEO_DISABLED)
++ AC_DEFINE(SDL_VIDEO_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(events,
+ AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
+ , enable_events=yes)
+ if test x$enable_events != xyes; then
+- AC_DEFINE(SDL_EVENTS_DISABLED)
++ AC_DEFINE(SDL_EVENTS_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(joystick,
+ AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
+ , enable_joystick=yes)
+ if test x$enable_joystick != xyes; then
+- AC_DEFINE(SDL_JOYSTICK_DISABLED)
++ AC_DEFINE(SDL_JOYSTICK_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(cdrom,
+ AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
+ , enable_cdrom=yes)
+ if test x$enable_cdrom != xyes; then
+- AC_DEFINE(SDL_CDROM_DISABLED)
++ AC_DEFINE(SDL_CDROM_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(threads,
+ AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
+ , enable_threads=yes)
+ if test x$enable_threads != xyes; then
+- AC_DEFINE(SDL_THREADS_DISABLED)
++ AC_DEFINE(SDL_THREADS_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(timers,
+ AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
+ , enable_timers=yes)
+ if test x$enable_timers != xyes; then
+- AC_DEFINE(SDL_TIMERS_DISABLED)
++ AC_DEFINE(SDL_TIMERS_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(file,
+ AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
+ , enable_file=yes)
+ if test x$enable_file != xyes; then
+- AC_DEFINE(SDL_FILE_DISABLED)
++ AC_DEFINE(SDL_FILE_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(loadso,
+ AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
+ , enable_loadso=yes)
+ if test x$enable_loadso != xyes; then
+- AC_DEFINE(SDL_LOADSO_DISABLED)
++ AC_DEFINE(SDL_LOADSO_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(cpuinfo,
+ AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
+ , enable_cpuinfo=yes)
+ if test x$enable_cpuinfo != xyes; then
+- AC_DEFINE(SDL_CPUINFO_DISABLED)
++ AC_DEFINE(SDL_CPUINFO_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(assembly,
+ AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
+ , enable_assembly=yes)
+ if test x$enable_assembly = xyes; then
+- AC_DEFINE(SDL_ASSEMBLY_ROUTINES)
++ AC_DEFINE(SDL_ASSEMBLY_ROUTINES,1,"")
+ fi
+
+ dnl See if the OSS audio interface is supported
+@@ -289,12 +289,12 @@
+ int arg = SNDCTL_DSP_SETFRAGMENT;
+ ],[
+ have_oss=yes
+- AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H)
++ AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H,1,"")
+ ])
+ fi
+ AC_MSG_RESULT($have_oss)
+ if test x$have_oss = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
++ AC_DEFINE(SDL_AUDIO_DRIVER_OSS,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
+ SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
+ have_audio=yes
+@@ -314,45 +314,7 @@
+ AC_ARG_ENABLE(alsa,
+ AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
+ , enable_alsa=yes)
+- if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
+- AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
+- # Restore all flags from before the ALSA detection runs
+- CFLAGS="$alsa_save_CFLAGS"
+- LDFLAGS="$alsa_save_LDFLAGS"
+- LIBS="$alsa_save_LIBS"
+- if test x$have_alsa = xyes; then
+- AC_ARG_ENABLE(alsa-shared,
+-AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
+- , enable_alsa_shared=yes)
+- if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
+- if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
+- ALSA_LIBS="-L/lib $ALSA_LIBS"
+- elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
+- ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
+- elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
+- ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
+- fi
+- fi
+- alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
+- alsa_lib=`ls -- $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
+- echo "-- $alsa_lib_spec -> $alsa_lib"
+-
+- AC_DEFINE(SDL_AUDIO_DRIVER_ALSA)
+- SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
+- EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
+- if test x$have_loadso != xyes && \
+- test x$enable_alsa_shared = xyes; then
+- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
+- fi
+- if test x$have_loadso = xyes && \
+- test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
+- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
+- else
+- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
+- fi
+- have_audio=yes
+- fi
+- fi
++ enable_alsa=no
+ }
+
+ dnl Check whether we want to use IRIX 6.5+ native audio or not
+@@ -371,7 +333,7 @@
+ AC_MSG_RESULT($have_dmedia)
+ # Set up files for the audio library
+ if test x$have_dmedia = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
++ AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio"
+ have_audio=yes
+@@ -408,7 +370,7 @@
+ AC_MSG_RESULT($have_mme)
+ # Set up files for the audio library
+ if test x$have_mme = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
++ AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS"
+@@ -433,7 +395,7 @@
+ esd_lib=`ls -- $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
+ echo "-- $esd_lib_spec -> $esd_lib"
+
+- AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
++ AC_DEFINE(SDL_AUDIO_DRIVER_ESD,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
+ if test x$have_loadso != xyes && \
+@@ -442,7 +404,7 @@
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_esd_shared = xyes && test x$esd_lib != x; then
+- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
++ AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", "")
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
+ fi
+@@ -485,7 +447,7 @@
+ arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
+ echo "-- $arts_lib_spec -> $arts_lib"
+
+- AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
++ AC_DEFINE(SDL_AUDIO_DRIVER_ARTS,, "")
+ SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
+ if test x$have_loadso != xyes && \
+@@ -494,7 +456,7 @@
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_arts_shared = xyes && test x$arts_lib != x; then
+- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
++ AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib",1,"")
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
+ fi
+@@ -527,7 +489,7 @@
+ fi
+ AC_MSG_RESULT($have_nas)
+ if test x$have_nas = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
++ AC_DEFINE(SDL_AUDIO_DRIVER_NAS,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
+@@ -543,7 +505,7 @@
+ AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
+ , enable_diskaudio=yes)
+ if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_DISK)
++ AC_DEFINE(SDL_AUDIO_DRIVER_DISK,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
+ fi
+ }
+@@ -555,7 +517,7 @@
+ AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
+ , enable_dummyaudio=yes)
+ if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY)
++ AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
+ fi
+ }
+@@ -571,7 +533,7 @@
+ AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
+ if test x$have_mint_falcon_hdr = xyes; then
+ mintaudio=yes
+- AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
++ AC_DEFINE(SDL_AUDIO_DRIVER_MINT,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
+ SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
+ have_audio=yes
+@@ -602,7 +564,7 @@
+ AC_PATH_PROG(NASM, nasm)
+ fi
+ if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
+- AC_DEFINE(SDL_HERMES_BLITTERS)
++ AC_DEFINE(SDL_HERMES_BLITTERS,1,"")
+ SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
+ if test x"$NASMFLAGS" = x; then
+ case $ARCH in
+@@ -713,9 +675,9 @@
+ CFLAGS="$save_CFLAGS"
+
+ if test x$have_gcc_altivec = xyes; then
+- AC_DEFINE(SDL_ALTIVEC_BLITTERS)
++ AC_DEFINE(SDL_ALTIVEC_BLITTERS,1,"")
+ if test x$have_altivec_h_hdr = xyes; then
+- AC_DEFINE(HAVE_ALTIVEC_H)
++ AC_DEFINE(HAVE_ALTIVEC_H,1,"")
+ fi
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
+ fi
+@@ -758,7 +720,7 @@
+
+ if test x$enable_ipod = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
+- AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
++ AC_DEFINE(SDL_VIDEO_DRIVER_IPOD,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
+ fi
+ }
+@@ -792,7 +754,7 @@
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
+ fi
+
+- AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
++ AC_DEFINE(SDL_VIDEO_DRIVER_NANOX,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
+ have_video=yes
+@@ -881,7 +843,7 @@
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
+- AC_DEFINE(SDL_VIDEO_DRIVER_X11)
++ AC_DEFINE(SDL_VIDEO_DRIVER_X11,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
+
+@@ -903,8 +865,8 @@
+ test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
+ echo "-- dynamic libX11 -> $x11_lib"
+ echo "-- dynamic libX11ext -> $x11ext_lib"
+- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
+- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
++ AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib","")
++ AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib","")
+ else
+ enable_x11_shared=no
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
+@@ -921,20 +883,20 @@
+ AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]),
+ , enable_video_dga=yes)
+ if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_DGA)
++ AC_DEFINE(SDL_VIDEO_DRIVER_DGA,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/dga/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-dgamouse,
+ AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]),
+ , enable_video_x11_dgamouse=yes)
+ if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE)
++ AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE,1,"")
+ fi
+ AC_ARG_ENABLE(video-x11-vm,
+ AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
+ , enable_video_x11_vm=yes)
+ if test x$enable_video_x11_vm = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
++ AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-xv,
+@@ -948,14 +910,14 @@
+ AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
+ , enable_video_x11_xinerama=yes)
+ if test x$enable_video_x11_xinerama = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
++ AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-xme,
+ AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]),
+ , enable_video_x11_xme=yes)
+ if test x$enable_video_x11_xme = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
++ AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-xrandr,
+@@ -972,8 +934,8 @@
+ if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
+ echo "-- dynamic libXrender -> $xrender_lib"
+ echo "-- dynamic libXrandr -> $xrandr_lib"
+- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
+- AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
++ AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib","")
++ AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib","")
+ definitely_enable_video_x11_xrandr=yes
+ else
+ AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
+@@ -986,7 +948,7 @@
+ fi
+ fi
+ if test x$definitely_enable_video_x11_xrandr = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
++ AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR,1,"")
+ fi
+ AC_ARG_ENABLE(video-x11-dpms,
+ AC_HELP_STRING([--enable-video-x11-dpms], [enable X11 DPMS extension [[default=yes]]]),
+@@ -998,7 +960,7 @@
+ [#include <X11/Xlib.h>
+ ])
+ if test x$have_dpms_h_hdr = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_X11_DPMS)
++ AC_DEFINE(SDL_VIDEO_DRIVER_X11_DPMS,1,"")
+ fi
+ fi
+ fi
+@@ -1026,7 +988,7 @@
+ ])
+ AC_MSG_RESULT($video_photon)
+ if test x$video_photon = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
++ AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
+ have_video=yes
+@@ -1040,7 +1002,7 @@
+ CheckBWINDOW()
+ {
+ if test x$enable_video = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
++ AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
+ have_video=yes
+ fi
+@@ -1063,7 +1025,7 @@
+ ])
+ AC_MSG_RESULT($have_carbon)
+ if test x$have_carbon = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX)
++ AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c"
+ SOURCES="$SOURCES $srcdir/src/video/macrom/*.c"
+ have_video=yes
+@@ -1092,7 +1054,7 @@
+ AC_MSG_RESULT($have_cocoa)
+ CFLAGS="$save_CFLAGS"
+ if test x$have_cocoa = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ)
++ AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/quartz/*.m"
+ have_video=yes
+ fi
+@@ -1118,7 +1080,7 @@
+ ])
+ AC_MSG_RESULT($video_fbcon)
+ if test x$video_fbcon = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
++ AC_DEFINE(SDL_VIDEO_DRIVER_FBCON,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
+ have_video=yes
+ fi
+@@ -1163,7 +1125,7 @@
+ fi
+
+ if test x$video_directfb = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
++ AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
+@@ -1190,7 +1152,7 @@
+ ])
+ AC_MSG_RESULT($video_ps2gs)
+ if test x$video_ps2gs = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
++ AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
+ have_video=yes
+ fi
+@@ -1215,7 +1177,7 @@
+ ])
+ AC_MSG_RESULT($video_ggi)
+ if test x$video_ggi = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
++ AC_DEFINE(SDL_VIDEO_DRIVER_GGI,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg"
+ have_video=yes
+@@ -1245,7 +1207,7 @@
+ ])
+ AC_MSG_RESULT($video_svga)
+ if test x$video_svga = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
++ AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
+ have_video=yes
+@@ -1277,7 +1239,7 @@
+ ])
+ AC_MSG_RESULT($video_vgl)
+ if test x$video_vgl = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
++ AC_DEFINE(SDL_VIDEO_DRIVER_VGL,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
+ have_video=yes
+@@ -1305,7 +1267,7 @@
+ ])
+ AC_MSG_RESULT($video_wscons)
+ if test x$video_wscons = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
++ AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
+ have_video=yes
+ fi
+@@ -1330,7 +1292,7 @@
+ ])
+ AC_MSG_RESULT($video_aalib)
+ if test x$video_aalib = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
++ AC_DEFINE(SDL_VIDEO_DRIVER_AALIB,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa"
+ have_video=yes
+@@ -1360,7 +1322,7 @@
+ CXXFLAGS="$OLD_CXX"
+ AC_MSG_RESULT($video_qtopia)
+ if test x$video_qtopia = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
++ AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
+ SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS"
+@@ -1389,7 +1351,7 @@
+ ])
+ AC_MSG_RESULT($video_picogui)
+ if test x$video_picogui = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
++ AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
+ SDL_LIBS="$SDL_LIBS -lpgui"
+ have_video=yes
+@@ -1413,7 +1375,7 @@
+ video_xbios=no
+ if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
+ video_xbios=yes
+- AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
++ AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
+ have_video=yes
+ fi
+@@ -1431,7 +1393,7 @@
+ AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
+ if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
+ video_gem=yes
+- AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
++ AC_DEFINE(SDL_VIDEO_DRIVER_GEM,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
+ SDL_LIBS="$SDL_LIBS -lgem"
+ have_video=yes
+@@ -1446,7 +1408,7 @@
+ AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
+ , enable_video_dummy=yes)
+ if test x$enable_video_dummy = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
++ AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
+ have_video=yes
+ fi
+@@ -1472,8 +1434,8 @@
+ ])
+ AC_MSG_RESULT($video_opengl)
+ if test x$video_opengl = xyes; then
+- AC_DEFINE(SDL_VIDEO_OPENGL)
+- AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
++ AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
++ AC_DEFINE(SDL_VIDEO_OPENGL_GLX,1,"")
+ fi
+ fi
+ }
+@@ -1492,7 +1454,7 @@
+ ])
+ AC_MSG_RESULT($video_opengl)
+ if test x$video_opengl = xyes; then
+- AC_DEFINE(SDL_VIDEO_OPENGL)
++ AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
+ fi
+ fi
+@@ -1502,8 +1464,8 @@
+ CheckWIN32GL()
+ {
+ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+- AC_DEFINE(SDL_VIDEO_OPENGL)
+- AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
++ AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
++ AC_DEFINE(SDL_VIDEO_OPENGL_WGL,1,"")
+ fi
+ }
+
+@@ -1511,7 +1473,7 @@
+ CheckBeGL()
+ {
+ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+- AC_DEFINE(SDL_VIDEO_OPENGL)
++ AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
+ fi
+ }
+@@ -1520,7 +1482,7 @@
+ CheckMacGL()
+ {
+ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+- AC_DEFINE(SDL_VIDEO_OPENGL)
++ AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
+ case "$host" in
+ *-*-darwin*)
+ if test x$enable_video_cocoa = xyes; then
+@@ -1552,8 +1514,8 @@
+ OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
+ OSMESA_LIBS=`$OSMESA_CONFIG --libs`
+ fi
+- AC_DEFINE(SDL_VIDEO_OPENGL)
+- AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
++ AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
++ AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA,1,"")
+ SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
+ SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
+
+@@ -1563,7 +1525,7 @@
+ if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
+ # Dynamic linking
+ if test "x$have_osmesa_hdr" = "xyes"; then
+- AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
++ AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC,1,"")
+ fi
+ fi
+ fi
+@@ -1590,7 +1552,7 @@
+ ])
+ AC_MSG_RESULT($use_input_events)
+ if test x$use_input_events = xyes; then
+- AC_DEFINE(SDL_INPUT_LINUXEV)
++ AC_DEFINE(SDL_INPUT_LINUXEV,1,"")
+ fi
+ fi
+ }
+@@ -1612,7 +1574,7 @@
+ ])
+ AC_MSG_RESULT($enable_input_tslib)
+ if test x$enable_input_tslib = xyes; then
+- AC_DEFINE(SDL_INPUT_TSLIB)
++ AC_DEFINE(SDL_INPUT_TSLIB,1,"")
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
+ fi
+ fi
+@@ -1635,7 +1597,7 @@
+ AC_MSG_CHECKING(pth)
+ AC_MSG_RESULT($use_pth)
+ if test "x$use_pth" = xyes; then
+- AC_DEFINE(SDL_THREAD_PTH)
++ AC_DEFINE(SDL_THREAD_PTH,1,"")
+ SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
+ SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
+@@ -1741,7 +1703,7 @@
+
+ # Do futher testing if we have pthread support...
+ if test x$use_pthreads = xyes; then
+- AC_DEFINE(SDL_THREAD_PTHREAD)
++ AC_DEFINE(SDL_THREAD_PTHREAD,1,"")
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
+ SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
+@@ -1763,7 +1725,7 @@
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ ],[
+ has_recursive_mutexes=yes
+- AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
++ AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX,1,"")
+ ])
+ fi
+ if test x$has_recursive_mutexes = xno; then
+@@ -1774,7 +1736,7 @@
+ pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ ],[
+ has_recursive_mutexes=yes
+- AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
++ AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP,1,"")
+ ])
+ fi
+ AC_MSG_RESULT($has_recursive_mutexes)
+@@ -1849,7 +1811,7 @@
+ fi
+
+ if test x$enable_video = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB)
++ AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c"
+ SOURCES="$SOURCES $srcdir/src/video/windib/*.c"
+ have_video=yes
+@@ -1871,7 +1833,7 @@
+ have_directx=yes
+ fi
+ if test x$enable_video = xyes -a x$have_directx = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW)
++ AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW,1,"")
+ SOURCES="$SOURCES $srcdir/src/video/windx5/*.c"
+ have_video=yes
+ fi
+@@ -1904,9 +1866,9 @@
+ AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
+ AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes)
+ if test x$have_dlvsym = xyes; then
+- AC_DEFINE(HAVE_DLVSYM)
++ AC_DEFINE(HAVE_DLVSYM,1,"")
+ fi
+- AC_DEFINE(SDL_LOADSO_DLOPEN)
++ AC_DEFINE(SDL_LOADSO_DLOPEN,1,"")
+ SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
+ have_loadso=yes
+ fi
+@@ -1923,7 +1885,7 @@
+ AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
+ AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
+ if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
+- AC_DEFINE(SDL_LOADSO_LDG)
++ AC_DEFINE(SDL_LOADSO_LDG,1,"")
+ SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
+ SDL_LIBS="$SDL_LIBS -lldg -lgem"
+ have_loadso=yes
+@@ -2049,11 +2011,11 @@
+ have_machine_joystick=yes
+ ])
+ if test x$have_machine_joystick = xyes; then
+- AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
++ AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H,1,"")
+ fi
+ AC_MSG_RESULT($have_machine_joystick)
+
+- AC_DEFINE(SDL_JOYSTICK_USBHID)
++ AC_DEFINE(SDL_JOYSTICK_USBHID,1,"")
+ SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
+@@ -2072,7 +2034,7 @@
+ if test x$enable_clock_gettime = xyes; then
+ AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
+ if test x$have_clock_gettime = xyes; then
+- AC_DEFINE(HAVE_CLOCK_GETTIME)
++ AC_DEFINE(HAVE_CLOCK_GETTIME,1,"")
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
+ fi
+ fi
+@@ -2103,7 +2065,7 @@
+ CheckIPod
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+- AC_DEFINE(SDL_TIMER_UNIX)
++ AC_DEFINE(SDL_TIMER_UNIX,1,"")
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ have_timers=yes
+ fi
+@@ -2166,17 +2128,17 @@
+ if test x$enable_audio = xyes; then
+ case $ARCH in
+ sysv5|solaris|hpux)
+- AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
++ AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
+ have_audio=yes
+ ;;
+ netbsd|openbsd)
+- AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
++ AC_DEFINE(SDL_AUDIO_DRIVER_BSD,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
+ have_audio=yes
+ ;;
+ aix)
+- AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
++ AC_DEFINE(SDL_AUDIO_DRIVER_PAUD,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
+ have_audio=yes
+ ;;
+@@ -2186,7 +2148,7 @@
+ if test x$enable_joystick = xyes; then
+ case $ARCH in
+ linux)
+- AC_DEFINE(SDL_JOYSTICK_LINUX)
++ AC_DEFINE(SDL_JOYSTICK_LINUX,1,"")
+ SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
+ have_joystick=yes
+ ;;
+@@ -2196,32 +2158,32 @@
+ if test x$enable_cdrom = xyes; then
+ case $ARCH in
+ linux|solaris)
+- AC_DEFINE(SDL_CDROM_LINUX)
++ AC_DEFINE(SDL_CDROM_LINUX,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
+ have_cdrom=yes
+ ;;
+ *freebsd*)
+- AC_DEFINE(SDL_CDROM_FREEBSD)
++ AC_DEFINE(SDL_CDROM_FREEBSD,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
+ have_cdrom=yes
+ ;;
+ *openbsd*|*netbsd*)
+- AC_DEFINE(SDL_CDROM_OPENBSD)
++ AC_DEFINE(SDL_CDROM_OPENBSD,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
+ have_cdrom=yes
+ ;;
+ bsdi)
+- AC_DEFINE(SDL_CDROM_BSDI)
++ AC_DEFINE(SDL_CDROM_BSDI,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
+ have_cdrom=yes
+ ;;
+ aix)
+- AC_DEFINE(SDL_CDROM_AIX)
++ AC_DEFINE(SDL_CDROM_AIX,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
+ have_cdrom=yes
+ ;;
+ osf)
+- AC_DEFINE(SDL_CDROM_OSF)
++ AC_DEFINE(SDL_CDROM_OSF,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
+ have_cdrom=yes
+ ;;
+@@ -2229,7 +2191,7 @@
+ fi
+ # Set up files for the thread library
+ if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
+- AC_DEFINE(SDL_THREAD_SPROC)
++ AC_DEFINE(SDL_THREAD_SPROC,1,"")
+ SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+@@ -2237,7 +2199,7 @@
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+- AC_DEFINE(SDL_TIMER_UNIX)
++ AC_DEFINE(SDL_TIMER_UNIX,1,"")
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ have_timers=yes
+ fi
+@@ -2256,20 +2218,20 @@
+ CheckPTHREAD
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
++ AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
+ have_audio=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+- AC_DEFINE(SDL_CDROM_QNX)
++ AC_DEFINE(SDL_CDROM_QNX,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
+ have_cdrom=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+- AC_DEFINE(SDL_TIMER_UNIX)
++ AC_DEFINE(SDL_TIMER_UNIX,1,"")
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ have_timers=yes
+ fi
+@@ -2294,29 +2256,29 @@
+ CheckNASM
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
++ AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
+ if test x$have_directx = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
++ AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
+ fi
+ have_audio=yes
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+- AC_DEFINE(SDL_JOYSTICK_WINMM)
++ AC_DEFINE(SDL_JOYSTICK_WINMM,1,"")
+ SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c"
+ have_joystick=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+- AC_DEFINE(SDL_CDROM_WIN32)
++ AC_DEFINE(SDL_CDROM_WIN32,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
+ have_cdrom=yes
+ fi
+ # Set up files for the thread library
+ if test x$enable_threads = xyes; then
+- AC_DEFINE(SDL_THREAD_WIN32)
++ AC_DEFINE(SDL_THREAD_WIN32,1,"")
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
+@@ -2325,13 +2287,13 @@
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+- AC_DEFINE(SDL_TIMER_WIN32)
++ AC_DEFINE(SDL_TIMER_WIN32,1,"")
+ SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
+ have_timers=yes
+ fi
+ # Set up files for the shared object loading library
+ if test x$enable_loadso = xyes; then
+- AC_DEFINE(SDL_LOADSO_WIN32)
++ AC_DEFINE(SDL_LOADSO_WIN32,1,"")
+ SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
+ have_loadso=yes
+ fi
+@@ -2356,25 +2318,25 @@
+ CheckBeGL
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
++ AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
+ have_audio=yes
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+- AC_DEFINE(SDL_JOYSTICK_BEOS)
++ AC_DEFINE(SDL_JOYSTICK_BEOS,1,"")
+ SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
+ have_joystick=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+- AC_DEFINE(SDL_CDROM_BEOS)
++ AC_DEFINE(SDL_CDROM_BEOS,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
+ have_cdrom=yes
+ fi
+ # Set up files for the thread library
+ if test x$enable_threads = xyes; then
+- AC_DEFINE(SDL_THREAD_BEOS)
++ AC_DEFINE(SDL_THREAD_BEOS,1,"")
+ SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+@@ -2382,13 +2344,13 @@
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+- AC_DEFINE(SDL_TIMER_BEOS)
++ AC_DEFINE(SDL_TIMER_BEOS,1,"")
+ SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
+ have_timers=yes
+ fi
+ # Set up files for the shared object loading library
+ if test x$enable_loadso = xyes; then
+- AC_DEFINE(SDL_LOADSO_BEOS)
++ AC_DEFINE(SDL_LOADSO_BEOS,1,"")
+ SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
+ have_loadso=yes
+ fi
+@@ -2425,7 +2387,7 @@
+ # Set up files for the shared object loading library
+ # (this needs to be done before the dynamic X11 check)
+ if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
+- AC_DEFINE(SDL_LOADSO_DLCOMPAT)
++ AC_DEFINE(SDL_LOADSO_DLCOMPAT,1,"")
+ SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
+ have_loadso=yes
+ fi
+@@ -2443,28 +2405,28 @@
+
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
++ AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
+- AC_DEFINE(SDL_AUDIO_DRIVER_SNDMGR)
++ AC_DEFINE(SDL_AUDIO_DRIVER_SNDMGR,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/macrom/*.c"
+ have_audio=yes
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+- AC_DEFINE(SDL_JOYSTICK_IOKIT)
++ AC_DEFINE(SDL_JOYSTICK_IOKIT,1,"")
+ SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
+ have_joystick=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+- AC_DEFINE(SDL_CDROM_MACOSX)
++ AC_DEFINE(SDL_CDROM_MACOSX,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
+ have_cdrom=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+- AC_DEFINE(SDL_TIMER_UNIX)
++ AC_DEFINE(SDL_TIMER_UNIX,1,"")
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ have_timers=yes
+ fi
+@@ -2500,30 +2462,30 @@
+ # Set up files for the audio library
+ if test x$enable_threads = xyes -a x$enable_pth = xyes; then
+ if test x$enable_audio = xyes; then
+- AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
++ AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO,1,"")
+ SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
+ have_audio=yes
+ fi
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+- AC_DEFINE(SDL_JOYSTICK_MINT)
++ AC_DEFINE(SDL_JOYSTICK_MINT,1,"")
+ SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
+ have_joystick=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+- AC_DEFINE(SDL_CDROM_MINT)
++ AC_DEFINE(SDL_CDROM_MINT,1,"")
+ SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
+ have_cdrom=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ if test x$enable_threads = xyes -a x$enable_pth = xyes; then
+- AC_DEFINE(SDL_TIMER_UNIX)
++ AC_DEFINE(SDL_TIMER_UNIX,1,"")
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ else
+- AC_DEFINE(SDL_TIMER_MINT)
++ AC_DEFINE(SDL_TIMER_MIN,1,""T)
+ SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
+ SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
+ fi
+@@ -2536,20 +2498,20 @@
+ CheckPTHREAD
+ # Set up files for the video library
+ if test x$enable_video = xyes; then
+- AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
++ AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS,1,"")
+ 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
+ if test x$enable_joystick = xyes; then
+- AC_DEFINE(SDL_JOYSTICK_RISCOS)
++ AC_DEFINE(SDL_JOYSTICK_RISCOS,1,"")
+ SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
+ have_joystick=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+- AC_DEFINE(SDL_TIMER_RISCOS)
++ AC_DEFINE(SDL_TIMER_RISCOS,1,"")
+ SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
+ have_timers=yes
+ fi
+@@ -2566,31 +2528,31 @@
+ # Verify that we have all the platform specific files we need
+ if test x$have_joystick != xyes; then
+ if test x$enable_joystick = xyes; then
+- AC_DEFINE(SDL_JOYSTICK_DISABLED)
++ AC_DEFINE(SDL_JOYSTICK_DISABLED,1,"")
+ fi
+ SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
+ fi
+ if test x$have_cdrom != xyes; then
+ if test x$enable_cdrom = xyes; then
+- AC_DEFINE(SDL_CDROM_DISABLED)
++ AC_DEFINE(SDL_CDROM_DISABLED,1,"")
+ fi
+ SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
+ fi
+ if test x$have_threads != xyes; then
+ if test x$enable_threads = xyes; then
+- AC_DEFINE(SDL_THREADS_DISABLED)
++ AC_DEFINE(SDL_THREADS_DISABLED,1,"")
+ fi
+ SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
+ fi
+ if test x$have_timers != xyes; then
+ if test x$enable_timers = xyes; then
+- AC_DEFINE(SDL_TIMERS_DISABLED)
++ AC_DEFINE(SDL_TIMERS_DISABLED,1,"")
+ fi
+ SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
+ fi
+ if test x$have_loadso != xyes; then
+ if test x$enable_loadso = xyes; then
+- AC_DEFINE(SDL_LOADSO_DISABLED)
++ AC_DEFINE(SDL_LOADSO_DISABLED,1,"")
+ fi
+ SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
+ fi
diff --git a/recipes/libsdl/files/directfb_obsolete_calls.patch b/recipes/libsdl/files/directfb_obsolete_calls.patch
new file mode 100644
index 0000000000..f3f422cde3
--- /dev/null
+++ b/recipes/libsdl/files/directfb_obsolete_calls.patch
@@ -0,0 +1,33 @@
+--- tmp/work/armv5te-angstrom-linux-gnueabi/libsdl-directfb-1.2.9-r1/SDL-1.2.9/src/video/directfb/SDL_DirectFB_video.c 2007-02-18 11:40:38.000000000 -0500
++++ SDL/src/video/directfb/SDL_DirectFB_video.c 2007-02-18 11:00:07.000000000 -0500
+@@ -376,7 +376,7 @@
+ {
+ int i;
+ DFBResult ret;
+- DFBCardCapabilities caps;
++ DFBGraphicsDeviceDescription caps;
+ DFBDisplayLayerConfig dlc;
+ struct DirectFBEnumRect *rect;
+ IDirectFB *dfb = NULL;
+@@ -448,7 +448,7 @@
+
+
+ /* Query card capabilities to get the video memory size */
+- dfb->GetCardCapabilities (dfb, &caps);
++ dfb->GetDeviceDescription (dfb, &caps);
+
+ this->info.wm_available = 1;
+ this->info.hw_available = 1;
+diff -u'rNF^function' tmp/work/armv5te-angstrom-linux-gnueabi/libsdl-directfb-1.2.9-r1/SDL-1.2.9/src/video/directfb/SDL_Direct
+/SDL_DirectFB_events.c
+--- tmp/work/armv5te-angstrom-linux-gnueabi/libsdl-directfb-1.2.9-r1/SDL-1.2.9/src/video/directfb/SDL_DirectFB_events.c 2004-0
++++ SDL/src/video/directfb/SDL_DirectFB_events.c 2007-02-18 11:00:07.000000000 -0500
+@@ -161,7 +161,7 @@
+ keymap[DIKI_SHIFT_L - DIKI_UNKNOWN] = SDLK_LSHIFT;
+ keymap[DIKI_SHIFT_R - DIKI_UNKNOWN] = SDLK_RSHIFT;
+ keymap[DIKI_ALT_L - DIKI_UNKNOWN] = SDLK_LALT;
+- keymap[DIKI_ALTGR - DIKI_UNKNOWN] = SDLK_RALT;
++ keymap[DIKI_ALT_R - DIKI_UNKNOWN] = SDLK_RALT;
+ keymap[DIKI_TAB - DIKI_UNKNOWN] = SDLK_TAB;
+ keymap[DIKI_ENTER - DIKI_UNKNOWN] = SDLK_RETURN;
+ keymap[DIKI_SPACE - DIKI_UNKNOWN] = SDLK_SPACE;
diff --git a/recipes/libsdl/files/explicit-extern-C.patch b/recipes/libsdl/files/explicit-extern-C.patch
new file mode 100644
index 0000000000..3dd44bea27
--- /dev/null
+++ b/recipes/libsdl/files/explicit-extern-C.patch
@@ -0,0 +1,22 @@
+--- SDL-1.2.9-orig/src/video/SDL_sysvideo.h.org 2005-04-17 10:40:41.000000000 +0000
++++ SDL-1.2.9-orig/src/video/SDL_sysvideo.h 2007-05-25 07:34:38.000000000 +0000
+@@ -332,6 +332,9 @@
+ SDL_VideoDevice *(*create)(int devindex);
+ } VideoBootStrap;
+
++#ifdef __cplusplus
++extern "C" {
++#endif
+ #ifdef ENABLE_X11
+ extern VideoBootStrap X11_bootstrap;
+ #endif
+@@ -417,6 +420,9 @@
+ #ifdef ENABLE_RISCOS
+ extern VideoBootStrap RISCOS_bootstrap;
+ #endif
++#ifdef __cplusplus
++};
++#endif
+ /* This is the current video device */
+ extern SDL_VideoDevice *current_video;
+
diff --git a/recipes/libsdl/files/extra-keys.patch b/recipes/libsdl/files/extra-keys.patch
new file mode 100644
index 0000000000..f12f0c7efb
--- /dev/null
+++ b/recipes/libsdl/files/extra-keys.patch
@@ -0,0 +1,53 @@
+diff -upr --exclude=configure --exclude=Makefile --exclude=Makefile.in libsdl1.2-1.2.4/include/SDL_keysym.h libsdl1.2-1.2.4-arm/include/SDL_keysym.h
+--- libsdl1.2-1.2.4/include/SDL_keysym.h 2002-03-06 11:23:01.000000000 +0000
++++ libsdl1.2-1.2.4-arm/include/SDL_keysym.h 2002-11-08 20:43:09.000000000 +0000
+@@ -286,6 +286,12 @@ typedef enum {
+ SDLK_EURO = 321, /* Some european keyboards */
+ SDLK_UNDO = 322, /* Atari keyboard has Undo */
+
++ SDLK_RECORD = 322,
++ SDLK_CALENDAR = 323,
++ SDLK_TELEPHONE = 324,
++ SDLK_MAIL = 325,
++ SDLK_START = 326,
++
+ /* Add any other keys here */
+
+ SDLK_LAST
+diff -upr --exclude=configure --exclude=Makefile --exclude=Makefile.in libsdl1.2-1.2.4/src/video/x11/SDL_x11events.c libsdl1.2-1.2.4-arm/src/video/x11/SDL_x11events.c
+--- libsdl1.2-1.2.4/src/video/x11/SDL_x11events.c 2002-03-06 11:23:08.000000000 +0000
++++ libsdl1.2-1.2.4-arm/src/video/x11/SDL_x11events.c 2002-11-08 21:01:41.000000000 +0000
+@@ -34,6 +34,7 @@ static char rcsid =
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+ #include <X11/keysym.h>
++#include <X11/XF86keysym.h>
+ #ifdef __SVR4
+ #include <X11/Sunkeysym.h>
+ #endif
+@@ -655,6 +656,25 @@ SDL_keysym *X11_TranslateKey(Display *di
+ case 0xFF:
+ keysym->sym = MISC_keymap[xsym&0xFF];
+ break;
++ case 0x1008ff:
++ switch (xsym) {
++ case XF86XK_AudioRecord:
++ keysym->sym = SDLK_RECORD;
++ break;
++ case XF86XK_PowerDown:
++ keysym->sym = SDLK_POWER;
++ break;
++ case XF86XK_Calendar:
++ keysym->sym = SDLK_CALENDAR;
++ break;
++ case XF86XK_Mail:
++ keysym->sym = SDLK_MAIL;
++ break;
++ case XF86XK_Start:
++ keysym->sym = SDLK_START;
++ break;
++ }
++ break;
+ default:
+ fprintf(stderr,
+ "X11: Unknown xsym, sym = 0x%04x\n",
diff --git a/recipes/libsdl/files/fixlibs-1.2.9.patch b/recipes/libsdl/files/fixlibs-1.2.9.patch
new file mode 100644
index 0000000000..ebc6ec7769
--- /dev/null
+++ b/recipes/libsdl/files/fixlibs-1.2.9.patch
@@ -0,0 +1,27 @@
+diff -Naur SDL-1.2.9-orig/configure.in SDL-1.2.9/configure.in
+--- SDL-1.2.9-orig/configure.in 2007-03-12 20:56:23.000000000 +0100
++++ SDL-1.2.9/configure.in 2007-03-12 20:59:28.000000000 +0100
+@@ -1593,8 +1593,8 @@
+ AC_MSG_RESULT($video_qtopia)
+ if test x$video_qtopia = xyes; then
+ CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
+- SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
+- SDL_CFLAGS="$SDL_CFLAGS -DQWS"
++ SDL_LIBS="$SDL_LIBS -Wl,-rpath-link -Wl,${QPEDIR}/lib -Wl,-rpath-link -Wl,${QTDIR}/lib"
++ SYSTEM_LIBS="$SYSTEM_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte-mt"
+ VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
+ VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
+ else
+@@ -1908,12 +1908,6 @@
+ CheckAltivec
+ CheckLinuxVersion
+ CheckRPATH
+-
+- # Set up files for the main() stub
+- if test "x$video_qtopia" = "xyes"; then
+- SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
+-
+- fi
+ # Set up files for the audio library
+ # We use the OSS and ALSA API's, not the Sun audio API
+ #if test x$enable_audio = xyes; then
diff --git a/recipes/libsdl/files/fixmfour.patch b/recipes/libsdl/files/fixmfour.patch
new file mode 100644
index 0000000000..0d534bd9a1
--- /dev/null
+++ b/recipes/libsdl/files/fixmfour.patch
@@ -0,0 +1,14 @@
+Index: SDL-1.2.11/sdl.m4
+===================================================================
+--- SDL-1.2.11.orig/sdl.m4 2008-10-18 21:20:13.482478928 +0200
++++ SDL-1.2.11/sdl.m4 2008-10-18 21:20:28.979441480 +0200
+@@ -32,9 +32,6 @@
+ fi
+ fi
+
+- if test "x$prefix" != xNONE; then
+- PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+- fi
+ AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+ min_sdl_version=ifelse([$1], ,0.11.0,$1)
+ AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
diff --git a/recipes/libsdl/files/kernel-asm-page.patch b/recipes/libsdl/files/kernel-asm-page.patch
new file mode 100644
index 0000000000..42bceadfdc
--- /dev/null
+++ b/recipes/libsdl/files/kernel-asm-page.patch
@@ -0,0 +1,13 @@
+diff --git a/src/video/Xext/Xxf86dga/XF86DGA.c b/src/video/Xext/Xxf86dga/XF86DGA.c
+index 4e3d662..de38a3c 100644
+--- a/src/video/Xext/Xxf86dga/XF86DGA.c
++++ b/src/video/Xext/Xxf86dga/XF86DGA.c
+@@ -18,7 +18,7 @@ Copyright (c) 1995,1996 The XFree86 Project, Inc
+ #define HAS_MMAP_ANON
+ #include <sys/types.h>
+ #include <sys/mman.h>
+-#include <asm/page.h> /* PAGE_SIZE */
++#include <unistd.h>
+ #define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
+ #define HAS_GETPAGESIZE
+ #endif /* linux */
diff --git a/recipes/libsdl/files/kill-stdc++-1.2.9.patch b/recipes/libsdl/files/kill-stdc++-1.2.9.patch
new file mode 100644
index 0000000000..884cb2191c
--- /dev/null
+++ b/recipes/libsdl/files/kill-stdc++-1.2.9.patch
@@ -0,0 +1,422 @@
+diff -Naur SDL-1.2.9-orig/acinclude.m4 SDL-1.2.9/acinclude.m4
+--- SDL-1.2.9-orig/acinclude.m4 2004-08-24 08:32:50.000000000 +0200
++++ SDL-1.2.9/acinclude.m4 2007-03-12 20:57:08.000000000 +0100
+@@ -1473,11 +1473,11 @@
+ case $host_os in
+ aix3*)
+ version_type=linux
+- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
++ library_names_spec='${libname}${release}${shrext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+- soname_spec='${libname}${release}${shared_ext}$major'
++ soname_spec='${libname}${release}${shrext}$major'
+ ;;
+
+ aix4* | aix5*)
+@@ -1487,7 +1487,7 @@
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
++ library_names_spec='${libname}${release}${shrext}$major ${libname}${release}${shrext}$versuffix $libname${shrext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+@@ -1513,12 +1513,12 @@
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ soname_spec='${libname}${release}${shrext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+@@ -1531,7 +1531,7 @@
+ ;;
+
+ beos*)
+- library_names_spec='${libname}${shared_ext}'
++ library_names_spec='${libname}${shrext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+@@ -1539,8 +1539,8 @@
+ bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+@@ -1573,14 +1573,14 @@
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+- #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+- soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
++ #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shrext}'
++ soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shrext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+- #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+- soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}'
++ #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shrext}'
++ soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shrext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+@@ -1596,13 +1596,13 @@
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shrext}'
+ ;;
+ esac
+ ;;
+
+ *)
+- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shrext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+@@ -1615,8 +1615,8 @@
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+- soname_spec='${libname}${release}${major}$shared_ext'
++ library_names_spec='${libname}${release}${versuffix}$shrext ${libname}${release}${major}$shrext ${libname}$shrext'
++ soname_spec='${libname}${release}${major}$shrext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
+@@ -1633,8 +1633,8 @@
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname$shrext'
++ soname_spec='${libname}${release}${shrext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+@@ -1646,8 +1646,8 @@
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major ${libname}${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+@@ -1659,12 +1659,12 @@
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext} $libname${shrext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
++ library_names_spec='${libname}${release}${shrext}$versuffix $libname${shrext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+@@ -1688,8 +1688,8 @@
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}${major} ${libname}${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+@@ -1707,8 +1707,8 @@
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+@@ -1722,8 +1722,8 @@
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+@@ -1732,8 +1732,8 @@
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+@@ -1752,8 +1752,8 @@
+ esac
+ need_lib_prefix=no
+ need_version=no
+- soname_spec='${libname}${release}${shared_ext}$major'
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
++ soname_spec='${libname}${release}${shrext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major ${libname}${release}${shrext} $libname${shrext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+@@ -1787,8 +1787,8 @@
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+@@ -1816,8 +1816,8 @@
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major ${libname}${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+@@ -1829,12 +1829,12 @@
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${shrext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major ${libname}${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+@@ -1844,7 +1844,7 @@
+
+ newsos6)
+ version_type=linux
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+@@ -1853,8 +1853,8 @@
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+@@ -1863,7 +1863,7 @@
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${shrext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+@@ -1884,7 +1884,7 @@
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+- library_names_spec='$libname${shared_ext} $libname.a'
++ library_names_spec='$libname${shrext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+@@ -1893,8 +1893,8 @@
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+- soname_spec='${libname}${release}${shared_ext}$major'
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++ soname_spec='${libname}${release}${shrext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+@@ -1902,8 +1902,8 @@
+
+ sco3.2v5*)
+ version_type=osf
+- soname_spec='${libname}${release}${shared_ext}$major'
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++ soname_spec='${libname}${release}${shrext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+@@ -1911,8 +1911,8 @@
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+@@ -1922,7 +1922,7 @@
+
+ sunos4*)
+ version_type=sunos
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${shrext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+@@ -1934,8 +1934,8 @@
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+@@ -1959,16 +1959,16 @@
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+- soname_spec='$libname${shared_ext}.$major'
++ library_names_spec='$libname${shrext}.$versuffix $libname${shrext}.$major $libname${shrext}'
++ soname_spec='$libname${shrext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+ uts4*)
+ version_type=linux
+- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+- soname_spec='${libname}${release}${shared_ext}$major'
++ library_names_spec='${libname}${release}${shrext}$versuffix ${libname}${release}${shrext}$major $libname${shrext}'
++ soname_spec='${libname}${release}${shrext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+@@ -3471,8 +3471,8 @@
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
++ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shrext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shrext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+@@ -3481,7 +3481,7 @@
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shrext 2>&1 | grep "ld"`; rm -f libconftest$shrext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+@@ -3585,7 +3585,7 @@
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
++ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shrext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+@@ -3645,7 +3645,7 @@
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
++ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shrext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+@@ -4596,7 +4596,7 @@
+ # Whether we need a single -rpath flag with a separated argument.
+ hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
++# Set to yes if using DIR/libNAME${shrext} during linking hardcodes DIR into the
+ # resulting binary.
+ hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+diff -Naur SDL-1.2.9-orig/src/main/Makefile.am SDL-1.2.9/src/main/Makefile.am
+--- SDL-1.2.9-orig/src/main/Makefile.am 2007-03-12 20:56:23.000000000 +0100
++++ SDL-1.2.9/src/main/Makefile.am 2007-03-12 20:57:08.000000000 +0100
+@@ -46,3 +46,9 @@
+ (cd $(distdir) && rm -f $(BUILT_SOURCES))
+ cp -rp $(ARCH_SUBDIRS) $(distdir)
+ (cd $(distdir) && rm -rf `find . -name CVS`)
++
++# overwrite USER variables
++CXXLD = $(CC)
++CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
++ $(AM_LDFLAGS) $(LDFLAGS) -o $@
++
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/Makefile.am SDL-1.2.9/src/video/qtopia/Makefile.am
+--- SDL-1.2.9-orig/src/video/qtopia/Makefile.am 2007-03-12 20:56:23.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/Makefile.am 2007-03-12 20:57:08.000000000 +0100
+@@ -17,3 +17,9 @@
+ SDL_sysevents.cc \
+ SDL_sysevents_c.h \
+ SDL_qmain.cc
++
++
++# overwrite USER variables
++CXXLD = $(CC)
++CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
++ $(AM_LDFLAGS) $(LDFLAGS) -o $@
diff --git a/recipes/libsdl/files/pagesize.patch b/recipes/libsdl/files/pagesize.patch
new file mode 100644
index 0000000000..ea9ea9849b
--- /dev/null
+++ b/recipes/libsdl/files/pagesize.patch
@@ -0,0 +1,15 @@
+Remove obsolete non-portable macro.
+
+Index: SDL-1.2.9/src/video/fbcon/SDL_fbvideo.c
+===================================================================
+--- SDL-1.2.9.orig/src/video/fbcon/SDL_fbvideo.c
++++ SDL-1.2.9/src/video/fbcon/SDL_fbvideo.c
+@@ -405,7 +405,7 @@ static int FB_VideoInit(_THIS, SDL_Pixel
+
+ /* Memory map the device, compensating for buggy PPC mmap() */
+ mapped_offset = (((long)finfo.smem_start) -
+- (((long)finfo.smem_start)&~(PAGE_SIZE-1)));
++ (((long)finfo.smem_start)&~(getpagesize()-1)));
+ mapped_memlen = finfo.smem_len+mapped_offset;
+ mapped_mem = mmap(NULL, mapped_memlen,
+ PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
diff --git a/recipes/libsdl/files/pygame-1.2.9.patch b/recipes/libsdl/files/pygame-1.2.9.patch
new file mode 100644
index 0000000000..4073de25bf
--- /dev/null
+++ b/recipes/libsdl/files/pygame-1.2.9.patch
@@ -0,0 +1,191 @@
+diff -Naur SDL-1.2.9-orig/configure.in SDL-1.2.9/configure.in
+--- SDL-1.2.9-orig/configure.in 2005-08-28 08:31:18.000000000 +0200
++++ SDL-1.2.9/configure.in 2007-03-12 20:55:18.000000000 +0100
+@@ -1912,7 +1912,7 @@
+ # Set up files for the main() stub
+ if test "x$video_qtopia" = "xyes"; then
+ SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
+- SDL_LIBS="-lSDLmain $SDL_LIBS"
++
+ fi
+ # Set up files for the audio library
+ # We use the OSS and ALSA API's, not the Sun audio API
+diff -Naur SDL-1.2.9-orig/src/main/Makefile.am SDL-1.2.9/src/main/Makefile.am
+--- SDL-1.2.9-orig/src/main/Makefile.am 2004-02-12 07:21:13.000000000 +0100
++++ SDL-1.2.9/src/main/Makefile.am 2007-03-12 20:55:18.000000000 +0100
+@@ -21,11 +21,7 @@
+ if TARGET_MACOSX
+ MAINLIB_ARCH_SRCS = macosx/SDLMain.m macosx/SDLMain.h
+ else
+-if TARGET_QTOPIA
+-MAINLIB_ARCH_SRCS = qtopia/SDL_qtopia_main.cc
+-else
+ MAINLIB_ARCH_SRCS = dummy/SDL_dummy_main.c
+-endif # !TARGET_QTOPIA
+ endif # !TARGET_MACOSX
+ endif # !TARGET_WIN32
+ libSDLmain_a_SOURCES = $(MAINLIB_ARCH_SRCS)
+diff -Naur SDL-1.2.9-orig/src/main/qtopia/SDL_qtopia_main.cc SDL-1.2.9/src/main/qtopia/SDL_qtopia_main.cc
+--- SDL-1.2.9-orig/src/main/qtopia/SDL_qtopia_main.cc 2003-12-14 07:25:53.000000000 +0100
++++ SDL-1.2.9/src/main/qtopia/SDL_qtopia_main.cc 1970-01-01 01:00:00.000000000 +0100
+@@ -1,47 +0,0 @@
+-
+-/* Include the SDL main definition header */
+-#include "SDL_main.h"
+-#include <stdlib.h>
+-#include <unistd.h>
+-#ifdef main
+-#undef main
+-#endif
+-#ifdef QWS
+-#include <qpe/qpeapplication.h>
+-#include <qapplication.h>
+-#include <qpe/qpeapplication.h>
+-#include <stdlib.h>
+-
+-// Workaround for OPIE to remove taskbar icon. Also fixes
+-// some issues in Qtopia where there are left-over qcop files in /tmp/.
+-// I'm guessing this will also clean up the taskbar in the Sharp version
+-// of Qtopia.
+-static inline void cleanupQCop() {
+- QString appname(qApp->argv()[0]);
+- int slash = appname.findRev("/");
+- if(slash != -1) { appname = appname.mid(slash+1); }
+- QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'";
+- system(cmd.latin1());
+- cmd = "/tmp/qcop-msg-"+appname;
+- unlink(cmd.latin1());
+-}
+-
+-static QPEApplication *app;
+-#endif
+-
+-extern int SDL_main(int argc, char *argv[]);
+-
+-int main(int argc, char *argv[])
+-{
+-#ifdef QWS
+- // This initializes the Qtopia application. It needs to be done here
+- // because it parses command line options.
+- app = new QPEApplication(argc, argv);
+- QWidget dummy;
+- app->showMainWidget(&dummy);
+- atexit(cleanupQCop);
+-#endif
+- // Exit here because if return is used, the application
+- // doesn't seem to quit correctly.
+- exit(SDL_main(argc, argv));
+-}
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/Makefile.am SDL-1.2.9/src/video/qtopia/Makefile.am
+--- SDL-1.2.9-orig/src/video/qtopia/Makefile.am 2002-05-28 21:24:11.000000000 +0200
++++ SDL-1.2.9/src/video/qtopia/Makefile.am 2007-03-12 20:55:18.000000000 +0100
+@@ -15,4 +15,5 @@
+ SDL_syswm.cc \
+ SDL_syswm_c.h \
+ SDL_sysevents.cc \
+- SDL_sysevents_c.h
++ SDL_sysevents_c.h \
++ SDL_qmain.cc
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_qmain.cc SDL-1.2.9/src/video/qtopia/SDL_qmain.cc
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_qmain.cc 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_qmain.cc 2007-03-12 20:55:18.000000000 +0100
+@@ -0,0 +1,99 @@
++/* Include the SDL main definition header */
++#include "SDL_main.h"
++#include <stdlib.h>
++
++#include <sys/types.h>
++#include <fcntl.h>
++#include <unistd.h>
++
++
++#ifdef QWS
++#include <qpe/qpeapplication.h>
++#include <stdlib.h>
++#include <string.h>
++
++
++
++static QWidget *dummyW = 0;
++static QPEApplication *theApp = 0;
++static char **cmdline= 0;
++static int size = 0;
++
++static void parse_cmd_line() {
++ /*
++ * find the number
++ */
++ char buf[1024];
++ int available = 0;
++ char *string_start = 0;
++ int fd = ::open( "/proc/self/cmdline", O_RDONLY );
++ if ( fd < 0 ) {
++ qWarning( "Error getting the cmdline, can't be" );
++ goto error_out;
++ }
++
++ available = ::read( fd, &buf, sizeof(buf) );
++ if ( available <= 0 )
++ goto error_out;
++
++ /*
++ * find out the number of arguments
++ */
++ size = 0;
++ for (int i = 0; i < available; ++i )
++ if ( buf[i] == '\0' )
++ ++size;
++
++ /* now create a the cmdline */
++ cmdline = new char*[size+1];
++ cmdline[size] = '\0'; // parnoid...
++
++ string_start = &buf[0];
++ for ( int i = 0; i < size; ++i ) {
++ /*
++ * find the end of the string
++ */
++ size_t sz = ::strlen(string_start);
++ cmdline[i] = new char[sz+1];
++ memcpy( cmdline[i], string_start, sz+1 );
++ string_start += (sz+1); // +1 for '\0' +1 to set it beyond
++ }
++
++ ::close(fd);
++
++ return;
++
++/* error code */
++error_out:
++ cmdline = new char*[2];
++ cmdline[0] = "unknown_app";
++ cmdline[1] = '\0';
++ size = 1;
++}
++
++static void free_cmd_line() {
++ /*
++ * free each string and then free the array
++ */
++ for ( int i = 0; i < size; ++i )
++ delete [] cmdline[i];
++
++ delete [] cmdline;
++}
++
++static void __attribute__((constructor)) initialize_qpe_app() {
++ parse_cmd_line();
++
++ theApp = new QPEApplication( size, cmdline );
++ dummyW = new QWidget;
++ theApp->showMainWidget(dummyW);
++}
++
++static void __attribute__((destructor)) deinitialize_qpe_app() {
++ free_cmd_line();
++ delete dummyW;
++ delete theApp;
++}
++
++
++#endif
diff --git a/recipes/libsdl/files/remove_path.patch b/recipes/libsdl/files/remove_path.patch
new file mode 100644
index 0000000000..f5bee40bbd
--- /dev/null
+++ b/recipes/libsdl/files/remove_path.patch
@@ -0,0 +1,18 @@
+OE goes to great lengths to set PATH correctly and this just breaks
+things since local sdl-config binaries will suddenly be preferred
+rather than those in staging.
+
+RP - 27/02/2008
+
+Index: SDL-1.2.9/sdl.m4
+===================================================================
+--- SDL-1.2.9.orig/sdl.m4 2008-02-27 10:08:38.000000000 +0000
++++ SDL-1.2.9/sdl.m4 2008-02-27 10:08:51.000000000 +0000
+@@ -33,7 +33,6 @@
+ fi
+
+ AC_REQUIRE([AC_CANONICAL_TARGET])
+- PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+ AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+ min_sdl_version=ifelse([$1], ,0.11.0,$1)
+ AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
diff --git a/recipes/libsdl/files/sdl-cdfix.patch b/recipes/libsdl/files/sdl-cdfix.patch
new file mode 100644
index 0000000000..a6a36483d4
--- /dev/null
+++ b/recipes/libsdl/files/sdl-cdfix.patch
@@ -0,0 +1,11 @@
+--- /tmp/SDL_syscdrom.c 2008-08-11 21:56:58.000000000 +0200
++++ SDL-1.2.11/src/cdrom/linux/SDL_syscdrom.c 2008-08-11 21:57:07.813198000 +0200
+@@ -51,6 +51,8 @@
+ #ifdef __SVR4
+ #include <sys/cdio.h>
+ #endif
++#include <linux/cdrom.h>
++
+
+ /* Define this to use the alternative getmntent() code */
+ #ifndef __SVR4
diff --git a/recipes/libsdl/libsdl-directfb_1.2.11.bb b/recipes/libsdl/libsdl-directfb_1.2.11.bb
new file mode 100644
index 0000000000..3f44f9df3f
--- /dev/null
+++ b/recipes/libsdl/libsdl-directfb_1.2.11.bb
@@ -0,0 +1,27 @@
+require libsdl.inc
+
+DEPENDS = "alsa-lib directfb"
+# extra-keys.patch is missing
+DEFAULT_PREFERENCE = "-1"
+
+PR = "r0"
+
+SRC_URI = "\
+ http://www.libsdl.org/release/SDL-${PV}.tar.gz \
+ file://acinclude.m4 \
+ file://configure_tweak.patch;patch=1 \
+ file://pagesize.patch;patch=1 \
+ file://kernel-asm-page.patch;patch=1 \
+ file://sdl-cdfix.patch;patch=1 \
+ file://fixmfour.patch;patch=1 \
+"
+
+EXTRA_OECONF = "--disable-static --disable-debug --enable-cdrom --enable-threads --enable-timers --enable-endian \
+ --enable-file --enable-oss --enable-alsa --disable-esd --disable-arts \
+ --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+ --disable-mintaudio --disable-nasm --disable-video-x11 --disable-video-dga \
+ --enable-video-fbcon --enable-video-directfb --disable-video-ps2gs \
+ --disable-video-xbios --disable-video-gem --disable-video-dummy \
+ --disable-video-opengl --enable-input-events --enable-pthreads \
+ --disable-video-picogui --disable-video-qtopia --enable-dlopen"
+
diff --git a/recipes/libsdl/libsdl-directfb_1.2.9.bb b/recipes/libsdl/libsdl-directfb_1.2.9.bb
new file mode 100644
index 0000000000..7a9bd88ee2
--- /dev/null
+++ b/recipes/libsdl/libsdl-directfb_1.2.9.bb
@@ -0,0 +1,21 @@
+require libsdl.inc
+
+DEPENDS = "alsa-lib directfb"
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI += "\
+ file://explicit-extern-C.patch;patch=1 \
+ file://acinclude.m4 \
+ file://directfb_obsolete_calls.patch;patch=1 \
+"
+
+CFLAGS_append += " -I${STAGING_INCDIR}/directfb -I${STAGING_INCDIR}/directfb-internal"
+
+EXTRA_OECONF = "--disable-static --disable-debug --enable-cdrom --enable-threads --enable-timers --enable-endian \
+ --enable-file --enable-oss --enable-alsa --disable-esd --disable-arts \
+ --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+ --disable-mintaudio --disable-nasm --disable-video-x11 --disable-video-dga \
+ --enable-video-fbcon --enable-video-directfb --disable-video-ps2gs \
+ --disable-video-xbios --disable-video-gem --disable-video-dummy \
+ --disable-video-opengl --enable-input-events --enable-pthreads \
+ --disable-video-picogui --disable-video-qtopia --enable-dlopen"
diff --git a/recipes/libsdl/libsdl-gfx_2.0.11.bb b/recipes/libsdl/libsdl-gfx_2.0.11.bb
new file mode 100644
index 0000000000..712675771a
--- /dev/null
+++ b/recipes/libsdl/libsdl-gfx_2.0.11.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "Simple DirectMedia Layer graphic primitives library."
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "zlib libpng jpeg virtual/libsdl"
+LICENSE = "LGPL"
+
+SRC_URI = "http://www.ferzkopp.net/~aschiffler/Software/SDL_gfx-2.0/SDL_gfx-${PV}.tar.gz"
+S = "${WORKDIR}/SDL_gfx-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF = "--disable-mmx"
+
+do_stage() {
+ oe_libinstall -so libSDL_gfx ${STAGING_LIBDIR}
+ install -m 0644 *.h ${STAGING_INCDIR}/SDL/
+}
+
diff --git a/recipes/libsdl/libsdl-gfx_2.0.17.bb b/recipes/libsdl/libsdl-gfx_2.0.17.bb
new file mode 100644
index 0000000000..79af40ae1d
--- /dev/null
+++ b/recipes/libsdl/libsdl-gfx_2.0.17.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "Simple DirectMedia Layer graphic primitives library."
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "zlib libpng jpeg virtual/libsdl"
+LICENSE = "LGPL"
+
+SRC_URI = "http://www.ferzkopp.net/~aschiffler/Software/SDL_gfx-2.0/SDL_gfx-${PV}.tar.gz"
+S = "${WORKDIR}/SDL_gfx-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF = "--disable-mmx"
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/libsdl/libsdl-image-1.2.3/autotools.patch b/recipes/libsdl/libsdl-image-1.2.3/autotools.patch
new file mode 100644
index 0000000000..c93a1dd9c3
--- /dev/null
+++ b/recipes/libsdl/libsdl-image-1.2.3/autotools.patch
@@ -0,0 +1,805 @@
+Index: SDL_image-1.2.3/acinclude.m4
+===================================================================
+--- SDL_image-1.2.3.orig/acinclude.m4 2001-11-02 21:39:10.000000000 +0100
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
+@@ -1,608 +0,0 @@
+-# Configure paths for SDL
+-# Sam Lantinga 9/21/99
+-# stolen from Manish Singh
+-# stolen back from Frank Belew
+-# stolen from Manish Singh
+-# Shamelessly stolen from Owen Taylor
+-
+-dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+-dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
+-dnl
+-AC_DEFUN(AM_PATH_SDL,
+-[dnl
+-dnl Get the cflags and libraries from the sdl-config script
+-dnl
+-AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
+- sdl_prefix="$withval", sdl_prefix="")
+-AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
+- sdl_exec_prefix="$withval", sdl_exec_prefix="")
+-AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
+- , enable_sdltest=yes)
+-
+- if test x$sdl_exec_prefix != x ; then
+- sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
+- if test x${SDL_CONFIG+set} != xset ; then
+- SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+- fi
+- fi
+- if test x$sdl_prefix != x ; then
+- sdl_args="$sdl_args --prefix=$sdl_prefix"
+- if test x${SDL_CONFIG+set} != xset ; then
+- SDL_CONFIG=$sdl_prefix/bin/sdl-config
+- fi
+- fi
+-
+- AC_REQUIRE([AC_CANONICAL_TARGET])
+- AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
+- min_sdl_version=ifelse([$1], ,0.11.0,$1)
+- AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
+- no_sdl=""
+- if test "$SDL_CONFIG" = "no" ; then
+- no_sdl=yes
+- else
+- SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
+- SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
+-
+- sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+- sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+- sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+- if test "x$enable_sdltest" = "xyes" ; then
+- ac_save_CFLAGS="$CFLAGS"
+- ac_save_LIBS="$LIBS"
+- CFLAGS="$CFLAGS $SDL_CFLAGS"
+- LIBS="$LIBS $SDL_LIBS"
+-dnl
+-dnl Now check if the installed SDL is sufficiently new. (Also sanity
+-dnl checks the results of sdl-config to some extent
+-dnl
+- rm -f conf.sdltest
+- AC_TRY_RUN([
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include "SDL.h"
+-
+-char*
+-my_strdup (char *str)
+-{
+- char *new_str;
+-
+- if (str)
+- {
+- new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+- strcpy (new_str, str);
+- }
+- else
+- new_str = NULL;
+-
+- return new_str;
+-}
+-
+-int main (int argc, char *argv[])
+-{
+- int major, minor, micro;
+- char *tmp_version;
+-
+- /* This hangs on some systems (?)
+- system ("touch conf.sdltest");
+- */
+- { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+-
+- /* HP/UX 9 (%@#!) writes to sscanf strings */
+- tmp_version = my_strdup("$min_sdl_version");
+- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+- printf("%s, bad version string\n", "$min_sdl_version");
+- exit(1);
+- }
+-
+- if (($sdl_major_version > major) ||
+- (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
+- (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
+- {
+- return 0;
+- }
+- else
+- {
+- printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+- printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+- printf("*** best to upgrade to the required version.\n");
+- printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
+- printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+- printf("*** config.cache before re-running configure\n");
+- return 1;
+- }
+-}
+-
+-],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+- CFLAGS="$ac_save_CFLAGS"
+- LIBS="$ac_save_LIBS"
+- fi
+- fi
+- if test "x$no_sdl" = x ; then
+- AC_MSG_RESULT(yes)
+- ifelse([$2], , :, [$2])
+- else
+- AC_MSG_RESULT(no)
+- if test "$SDL_CONFIG" = "no" ; then
+- echo "*** The sdl-config script installed by SDL could not be found"
+- echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
+- echo "*** your path, or set the SDL_CONFIG environment variable to the"
+- echo "*** full path to sdl-config."
+- else
+- if test -f conf.sdltest ; then
+- :
+- else
+- echo "*** Could not run SDL test program, checking why..."
+- CFLAGS="$CFLAGS $SDL_CFLAGS"
+- LIBS="$LIBS $SDL_LIBS"
+- AC_TRY_LINK([
+-#include <stdio.h>
+-#include "SDL.h"
+-
+-int main(int argc, char *argv[])
+-{ return 0; }
+-#undef main
+-#define main K_and_R_C_main
+-], [ return 0; ],
+- [ echo "*** The test program compiled, but did not run. This usually means"
+- echo "*** that the run-time linker is not finding SDL or finding the wrong"
+- echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
+- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+- echo "*** to the installed location Also, make sure you have run ldconfig if that"
+- echo "*** is required on your system"
+- echo "***"
+- echo "*** If you have an old version installed, it is best to remove it, although"
+- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+- [ echo "*** The test program failed to compile or link. See the file config.log for the"
+- echo "*** exact error that occured. This usually means SDL was incorrectly installed"
+- echo "*** or that you have moved SDL since it was installed. In the latter case, you"
+- echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+- CFLAGS="$ac_save_CFLAGS"
+- LIBS="$ac_save_LIBS"
+- fi
+- fi
+- SDL_CFLAGS=""
+- SDL_LIBS=""
+- ifelse([$3], , :, [$3])
+- fi
+- AC_SUBST(SDL_CFLAGS)
+- AC_SUBST(SDL_LIBS)
+- rm -f conf.sdltest
+-])
+-## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
+-## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
+-## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+-##
+-## This program is free software; you can redistribute it and/or modify
+-## it under the terms of the GNU General Public License as published by
+-## the Free Software Foundation; either version 2 of the License, or
+-## (at your option) any later version.
+-##
+-## This program is distributed in the hope that it will be useful, but
+-## WITHOUT ANY WARRANTY; without even the implied warranty of
+-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-## General Public License for more details.
+-##
+-## You should have received a copy of the GNU General Public License
+-## along with this program; if not, write to the Free Software
+-## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-##
+-## As a special exception to the GNU General Public License, if you
+-## distribute this file as part of a program that contains a
+-## configuration script generated by Autoconf, you may include it under
+-## the same distribution terms that you use for the rest of that program.
+-
+-# serial 40 AC_PROG_LIBTOOL
+-AC_DEFUN(AC_PROG_LIBTOOL,
+-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+-
+-# Save cache, so that ltconfig can load it
+-AC_CACHE_SAVE
+-
+-# Actually configure libtool. ac_aux_dir is where install-sh is found.
+-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+-|| AC_MSG_ERROR([libtool configure failed])
+-
+-# Reload cache, that may have been modified by ltconfig
+-AC_CACHE_LOAD
+-
+-# This can be used to rebuild libtool when needed
+-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+-
+-# Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+-AC_SUBST(LIBTOOL)dnl
+-
+-# Redirect the config.log output again, so that the ltconfig log is not
+-# clobbered by the next message.
+-exec 5>>./config.log
+-])
+-
+-AC_DEFUN(AC_LIBTOOL_SETUP,
+-[AC_PREREQ(2.13)dnl
+-AC_REQUIRE([AC_ENABLE_SHARED])dnl
+-AC_REQUIRE([AC_ENABLE_STATIC])dnl
+-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-AC_REQUIRE([AC_PROG_RANLIB])dnl
+-AC_REQUIRE([AC_PROG_CC])dnl
+-AC_REQUIRE([AC_PROG_LD])dnl
+-AC_REQUIRE([AC_PROG_NM])dnl
+-AC_REQUIRE([AC_PROG_LN_S])dnl
+-dnl
+-
+-case "$target" in
+-NONE) lt_target="$host" ;;
+-*) lt_target="$target" ;;
+-esac
+-
+-# Check for any special flags to pass to ltconfig.
+-libtool_flags="--cache-file=$cache_file"
+-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+-[libtool_flags="$libtool_flags --enable-dlopen"])
+-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+-[libtool_flags="$libtool_flags --enable-win32-dll"])
+-AC_ARG_ENABLE(libtool-lock,
+- [ --disable-libtool-lock avoid locking (might break parallel builds)])
+-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+-
+-# Some flags need to be propagated to the compiler or linker for good
+-# libtool support.
+-case "$lt_target" in
+-*-*-irix6*)
+- # Find out which ABI we are using.
+- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+- if AC_TRY_EVAL(ac_compile); then
+- case "`/usr/bin/file conftest.o`" in
+- *32-bit*)
+- LD="${LD-ld} -32"
+- ;;
+- *N32*)
+- LD="${LD-ld} -n32"
+- ;;
+- *64-bit*)
+- LD="${LD-ld} -64"
+- ;;
+- esac
+- fi
+- rm -rf conftest*
+- ;;
+-
+-*-*-sco3.2v5*)
+- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+- SAVE_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -belf"
+- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+- [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+- CFLAGS="$SAVE_CFLAGS"
+- fi
+- ;;
+-
+-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+-[*-*-cygwin* | *-*-mingw*)
+- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+- AC_CHECK_TOOL(AS, as, false)
+- AC_CHECK_TOOL(OBJDUMP, objdump, false)
+- ;;
+-])
+-esac
+-])
+-
+-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+-AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+-
+-# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+-AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+-
+-# AC_ENABLE_SHARED - implement the --enable-shared flag
+-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN(AC_ENABLE_SHARED, [dnl
+-define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(shared,
+-changequote(<<, >>)dnl
+-<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+-changequote([, ])dnl
+-[p=${PACKAGE-default}
+-case "$enableval" in
+-yes) enable_shared=yes ;;
+-no) enable_shared=no ;;
+-*)
+- enable_shared=no
+- # Look at the argument we got. We use all the common list separators.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_shared=yes
+- fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
+-])
+-
+-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+-AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_SHARED(no)])
+-
+-# AC_ENABLE_STATIC - implement the --enable-static flag
+-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN(AC_ENABLE_STATIC, [dnl
+-define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(static,
+-changequote(<<, >>)dnl
+-<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+-changequote([, ])dnl
+-[p=${PACKAGE-default}
+-case "$enableval" in
+-yes) enable_static=yes ;;
+-no) enable_static=no ;;
+-*)
+- enable_static=no
+- # Look at the argument we got. We use all the common list separators.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_static=yes
+- fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+-])
+-
+-# AC_DISABLE_STATIC - set the default static flag to --disable-static
+-AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_STATIC(no)])
+-
+-
+-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
+-define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(fast-install,
+-changequote(<<, >>)dnl
+-<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+-changequote([, ])dnl
+-[p=${PACKAGE-default}
+-case "$enableval" in
+-yes) enable_fast_install=yes ;;
+-no) enable_fast_install=no ;;
+-*)
+- enable_fast_install=no
+- # Look at the argument we got. We use all the common list separators.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_fast_install=yes
+- fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+-])
+-
+-# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+-AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_FAST_INSTALL(no)])
+-
+-# AC_PROG_LD - find the path to the GNU or non-GNU linker
+-AC_DEFUN(AC_PROG_LD,
+-[AC_ARG_WITH(gnu-ld,
+-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+-AC_REQUIRE([AC_PROG_CC])dnl
+-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-ac_prog=ld
+-if test "$ac_cv_prog_gcc" = yes; then
+- # Check if gcc -print-prog-name=ld gives a path.
+- AC_MSG_CHECKING([for ld used by GCC])
+- ac_prog=`($CC -print-prog-name=ld) 2>&5`
+- case "$ac_prog" in
+- # Accept absolute paths.
+-changequote(,)dnl
+- [\\/]* | [A-Za-z]:[\\/]*)
+- re_direlt='/[^/][^/]*/\.\./'
+-changequote([,])dnl
+- # Canonicalize the path of ld
+- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+- done
+- test -z "$LD" && LD="$ac_prog"
+- ;;
+- "")
+- # If it fails, then pretend we aren't using GCC.
+- ac_prog=ld
+- ;;
+- *)
+- # If it is relative, then search for the first ld in PATH.
+- with_gnu_ld=unknown
+- ;;
+- esac
+-elif test "$with_gnu_ld" = yes; then
+- AC_MSG_CHECKING([for GNU ld])
+-else
+- AC_MSG_CHECKING([for non-GNU ld])
+-fi
+-AC_CACHE_VAL(ac_cv_path_LD,
+-[if test -z "$LD"; then
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+- for ac_dir in $PATH; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+- ac_cv_path_LD="$ac_dir/$ac_prog"
+- # Check to see if the program is GNU ld. I'd rather use --version,
+- # but apparently some GNU ld's only accept -v.
+- # Break only if it was the GNU/non-GNU ld that we prefer.
+- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+- test "$with_gnu_ld" != no && break
+- else
+- test "$with_gnu_ld" != yes && break
+- fi
+- fi
+- done
+- IFS="$ac_save_ifs"
+-else
+- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+-fi])
+-LD="$ac_cv_path_LD"
+-if test -n "$LD"; then
+- AC_MSG_RESULT($LD)
+-else
+- AC_MSG_RESULT(no)
+-fi
+-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+-AC_PROG_LD_GNU
+-])
+-
+-AC_DEFUN(AC_PROG_LD_GNU,
+-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+- ac_cv_prog_gnu_ld=yes
+-else
+- ac_cv_prog_gnu_ld=no
+-fi])
+-])
+-
+-# AC_PROG_NM - find the path to a BSD-compatible name lister
+-AC_DEFUN(AC_PROG_NM,
+-[AC_MSG_CHECKING([for BSD-compatible nm])
+-AC_CACHE_VAL(ac_cv_path_NM,
+-[if test -n "$NM"; then
+- # Let the user override the test.
+- ac_cv_path_NM="$NM"
+-else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+- # Check to see if the nm accepts a BSD-compat flag.
+- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+- # nm: unknown option "B" ignored
+- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- ac_cv_path_NM="$ac_dir/nm -B"
+- break
+- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- ac_cv_path_NM="$ac_dir/nm -p"
+- break
+- else
+- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+- continue # so that we can try to find one that supports BSD flags
+- fi
+- fi
+- done
+- IFS="$ac_save_ifs"
+- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+-fi])
+-NM="$ac_cv_path_NM"
+-AC_MSG_RESULT([$NM])
+-])
+-
+-# AC_CHECK_LIBM - check for math library
+-AC_DEFUN(AC_CHECK_LIBM,
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-LIBM=
+-case "$lt_target" in
+-*-*-beos* | *-*-cygwin*)
+- # These system don't have libm
+- ;;
+-*-ncr-sysv4.3*)
+- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+- AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+- ;;
+-*)
+- AC_CHECK_LIB(m, main, LIBM="-lm")
+- ;;
+-esac
+-])
+-
+-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl convenience library and INCLTDL to the include flags for
+-# the libltdl header and adds --enable-ltdl-convenience to the
+-# configure arguments. Note that LIBLTDL and INCLTDL are not
+-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+-# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+-# with '${top_builddir}/' and INCLTDL will be prefixed with
+-# '${top_srcdir}/' (note the single quotes!). If your package is not
+-# flat and you're not using automake, define top_builddir and
+-# top_srcdir appropriately in the Makefiles.
+-AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+- case "$enable_ltdl_convenience" in
+- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+- "") enable_ltdl_convenience=yes
+- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+- esac
+- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+-])
+-
+-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl installable library and INCLTDL to the include flags for
+-# the libltdl header and adds --enable-ltdl-install to the configure
+-# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
+-# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+-# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+-# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
+-# with '${top_srcdir}/' (note the single quotes!). If your package is
+-# not flat and you're not using automake, define top_builddir and
+-# top_srcdir appropriately in the Makefiles.
+-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+-AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+- AC_CHECK_LIB(ltdl, main,
+- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+- [if test x"$enable_ltdl_install" = xno; then
+- AC_MSG_WARN([libltdl not installed, but installation disabled])
+- else
+- enable_ltdl_install=yes
+- fi
+- ])
+- if test x"$enable_ltdl_install" = x"yes"; then
+- ac_configure_args="$ac_configure_args --enable-ltdl-install"
+- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+- else
+- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+- LIBLTDL="-lltdl"
+- INCLTDL=
+- fi
+-])
+-
+-dnl old names
+-AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+-AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+-AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+-AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+-AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+-AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+-AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+-
+-dnl This is just to silence aclocal about the macro not being used
+-ifelse([AC_DISABLE_FAST_INSTALL])dnl
+Index: SDL_image-1.2.3/m4/sdl.m4
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ SDL_image-1.2.3/m4/sdl.m4 2008-07-24 01:32:20.220875043 +0200
+@@ -0,0 +1,174 @@
++# Configure paths for SDL
++# Sam Lantinga 9/21/99
++# stolen from Manish Singh
++# stolen back from Frank Belew
++# stolen from Manish Singh
++# Shamelessly stolen from Owen Taylor
++
++dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
++dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
++dnl
++AC_DEFUN(AM_PATH_SDL,
++[dnl
++dnl Get the cflags and libraries from the sdl-config script
++dnl
++AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
++ sdl_prefix="$withval", sdl_prefix="")
++AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
++ sdl_exec_prefix="$withval", sdl_exec_prefix="")
++AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
++ , enable_sdltest=yes)
++
++ if test x$sdl_exec_prefix != x ; then
++ sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
++ if test x${SDL_CONFIG+set} != xset ; then
++ SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
++ fi
++ fi
++ if test x$sdl_prefix != x ; then
++ sdl_args="$sdl_args --prefix=$sdl_prefix"
++ if test x${SDL_CONFIG+set} != xset ; then
++ SDL_CONFIG=$sdl_prefix/bin/sdl-config
++ fi
++ fi
++
++ AC_REQUIRE([AC_CANONICAL_TARGET])
++ AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
++ min_sdl_version=ifelse([$1], ,0.11.0,$1)
++ AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
++ no_sdl=""
++ if test "$SDL_CONFIG" = "no" ; then
++ no_sdl=yes
++ else
++ SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
++ SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
++
++ sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
++ sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
++ sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
++ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
++ if test "x$enable_sdltest" = "xyes" ; then
++ ac_save_CFLAGS="$CFLAGS"
++ ac_save_LIBS="$LIBS"
++ CFLAGS="$CFLAGS $SDL_CFLAGS"
++ LIBS="$LIBS $SDL_LIBS"
++dnl
++dnl Now check if the installed SDL is sufficiently new. (Also sanity
++dnl checks the results of sdl-config to some extent
++dnl
++ rm -f conf.sdltest
++ AC_TRY_RUN([
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include "SDL.h"
++
++char*
++my_strdup (char *str)
++{
++ char *new_str;
++
++ if (str)
++ {
++ new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
++ strcpy (new_str, str);
++ }
++ else
++ new_str = NULL;
++
++ return new_str;
++}
++
++int main (int argc, char *argv[])
++{
++ int major, minor, micro;
++ char *tmp_version;
++
++ /* This hangs on some systems (?)
++ system ("touch conf.sdltest");
++ */
++ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
++
++ /* HP/UX 9 (%@#!) writes to sscanf strings */
++ tmp_version = my_strdup("$min_sdl_version");
++ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
++ printf("%s, bad version string\n", "$min_sdl_version");
++ exit(1);
++ }
++
++ if (($sdl_major_version > major) ||
++ (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
++ (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
++ {
++ return 0;
++ }
++ else
++ {
++ printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
++ printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
++ printf("*** best to upgrade to the required version.\n");
++ printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
++ printf("*** to point to the correct copy of sdl-config, and remove the file\n");
++ printf("*** config.cache before re-running configure\n");
++ return 1;
++ }
++}
++
++],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
++ CFLAGS="$ac_save_CFLAGS"
++ LIBS="$ac_save_LIBS"
++ fi
++ fi
++ if test "x$no_sdl" = x ; then
++ AC_MSG_RESULT(yes)
++ ifelse([$2], , :, [$2])
++ else
++ AC_MSG_RESULT(no)
++ if test "$SDL_CONFIG" = "no" ; then
++ echo "*** The sdl-config script installed by SDL could not be found"
++ echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
++ echo "*** your path, or set the SDL_CONFIG environment variable to the"
++ echo "*** full path to sdl-config."
++ else
++ if test -f conf.sdltest ; then
++ :
++ else
++ echo "*** Could not run SDL test program, checking why..."
++ CFLAGS="$CFLAGS $SDL_CFLAGS"
++ LIBS="$LIBS $SDL_LIBS"
++ AC_TRY_LINK([
++#include <stdio.h>
++#include "SDL.h"
++
++int main(int argc, char *argv[])
++{ return 0; }
++#undef main
++#define main K_and_R_C_main
++], [ return 0; ],
++ [ echo "*** The test program compiled, but did not run. This usually means"
++ echo "*** that the run-time linker is not finding SDL or finding the wrong"
++ echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
++ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
++ echo "*** to the installed location Also, make sure you have run ldconfig if that"
++ echo "*** is required on your system"
++ echo "***"
++ echo "*** If you have an old version installed, it is best to remove it, although"
++ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
++ [ echo "*** The test program failed to compile or link. See the file config.log for the"
++ echo "*** exact error that occured. This usually means SDL was incorrectly installed"
++ echo "*** or that you have moved SDL since it was installed. In the latter case, you"
++ echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
++ CFLAGS="$ac_save_CFLAGS"
++ LIBS="$ac_save_LIBS"
++ fi
++ fi
++ SDL_CFLAGS=""
++ SDL_LIBS=""
++ ifelse([$3], , :, [$3])
++ fi
++ AC_SUBST(SDL_CFLAGS)
++ AC_SUBST(SDL_LIBS)
++ rm -f conf.sdltest
++])
+Index: SDL_image-1.2.3/configure.in
+===================================================================
+--- SDL_image-1.2.3.orig/configure.in 2008-07-24 01:34:07.807534207 +0200
++++ SDL_image-1.2.3/configure.in 2008-07-24 01:34:16.960864590 +0200
+@@ -44,6 +44,8 @@
+ AM_INIT_AUTOMAKE(SDL_image, $VERSION)
+ AM_MAINTAINER_MODE
+
++AC_CONFIG_MACRO_DIR([m4])
++
+ dnl Check for tools
+
+ AC_LIBTOOL_WIN32_DLL
diff --git a/recipes/libsdl/libsdl-image.inc b/recipes/libsdl/libsdl-image.inc
new file mode 100644
index 0000000000..b52db71511
--- /dev/null
+++ b/recipes/libsdl/libsdl-image.inc
@@ -0,0 +1,20 @@
+DESCRIPTION = "Simple DirectMedia Layer image library."
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "zlib libpng jpeg virtual/libsdl"
+LICENSE = "LGPL"
+
+SRC_URI = "http://www.libsdl.org/projects/SDL_image/release/SDL_image-${PV}.tar.gz"
+
+S = "${WORKDIR}/SDL_image-${PV}"
+
+inherit autotools
+
+export SDL_CONFIG = "${STAGING_BINDIR_CROSS}/sdl-config"
+
+do_stage() {
+ oe_libinstall -so libSDL_image ${STAGING_LIBDIR}
+ ln -sf libSDL_image.so ${STAGING_LIBDIR}/libSDL_image-1.2.so
+ install -m 0644 SDL_image.h ${STAGING_INCDIR}/SDL/SDL_image.h
+}
+
diff --git a/recipes/libsdl/libsdl-image_1.2.3.bb b/recipes/libsdl/libsdl-image_1.2.3.bb
new file mode 100644
index 0000000000..2da8fce1b6
--- /dev/null
+++ b/recipes/libsdl/libsdl-image_1.2.3.bb
@@ -0,0 +1,14 @@
+require libsdl-image.inc
+
+PR = "r2"
+
+SRC_URI += "\
+ file://autotools.patch;patch=1 \
+"
+
+inherit autotools
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/libsdl/libsdl-image_1.2.6.bb b/recipes/libsdl/libsdl-image_1.2.6.bb
new file mode 100644
index 0000000000..99fd98f508
--- /dev/null
+++ b/recipes/libsdl/libsdl-image_1.2.6.bb
@@ -0,0 +1,12 @@
+require libsdl-image.inc
+PR = "r1"
+
+DEPENDS += "tiff"
+
+do_unpackpost() {
+ # Removing this file fixes a libtool version mismatch.
+ rm acinclude/libtool.m4
+ rm acinclude/sdl.m4
+}
+
+addtask unpackpost after do_unpack before do_patch
diff --git a/recipes/libsdl/libsdl-mixer_1.2.6.bb b/recipes/libsdl/libsdl-mixer_1.2.6.bb
new file mode 100644
index 0000000000..0c29a3c625
--- /dev/null
+++ b/recipes/libsdl/libsdl-mixer_1.2.6.bb
@@ -0,0 +1,24 @@
+DESCRIPTION = "Simple DirectMedia Layer mixer library."
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "virtual/libsdl libmikmod libvorbis"
+LICENSE = "LGPL"
+PR = "r3"
+
+SRC_URI = "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-${PV}.tar.gz"
+S = "${WORKDIR}/SDL_mixer-${PV}"
+
+export SDL_CONFIG = "${STAGING_BINDIR_CROSS}/sdl-config"
+
+inherit autotools
+
+EXTRA_OECONF = "--disable-music-mp3"
+# although we build smpeg... need to find out how
+# to deal with optional dependencies
+
+do_stage() {
+ oe_libinstall -so libSDL_mixer ${STAGING_LIBDIR}
+ ln -sf libSDL_mixer.so ${STAGING_LIBDIR}/libSDL_mixer-1.2.so
+ install -m 0644 SDL_mixer.h ${STAGING_INCDIR}/SDL/SDL_mixer.h
+}
+
diff --git a/recipes/libsdl/libsdl-mixer_1.2.8.bb b/recipes/libsdl/libsdl-mixer_1.2.8.bb
new file mode 100644
index 0000000000..229108f565
--- /dev/null
+++ b/recipes/libsdl/libsdl-mixer_1.2.8.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "Simple DirectMedia Layer mixer library."
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "virtual/libsdl libmikmod libvorbis"
+LICENSE = "LGPL"
+
+PR = "r1"
+
+SRC_URI = "http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-${PV}.tar.gz"
+S = "${WORKDIR}/SDL_mixer-${PV}"
+
+export SDL_CONFIG = "${STAGING_BINDIR_CROSS}/sdl-config"
+
+inherit autotools
+
+EXTRA_OECONF = "--disable-music-mp3"
+# although we build smpeg... need to find out how
+# to deal with optional dependencies
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/libsdl/libsdl-native_1.2.11.bb b/recipes/libsdl/libsdl-native_1.2.11.bb
new file mode 100644
index 0000000000..fb8e12a4c9
--- /dev/null
+++ b/recipes/libsdl/libsdl-native_1.2.11.bb
@@ -0,0 +1,39 @@
+DESCRIPTION = "Simple DirectMedia Layer - native Edition"
+HOMEPAGE = "http://www.libsdl.org"
+SECTION = "libs"
+LICENSE = "LGPL"
+PR = "r2"
+
+SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
+ file://acinclude.m4 \
+ file://kernel-asm-page.patch;patch=1 "
+S = "${WORKDIR}/SDL-${PV}"
+
+inherit autotools binconfig pkgconfig native
+
+PARALLEL_MAKE = ""
+
+EXTRA_OECONF = "--disable-debug --disable-cdrom --enable-threads --enable-timers --enable-endian \
+ --enable-file --disable-oss --disable-alsa --disable-esd --disable-arts \
+ --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+ --disable-mintaudio --disable-nasm --disable-video-x11 --disable-video-dga \
+ --disable-video-fbcon --disable-video-directfb --disable-video-ps2gs \
+ --disable-video-xbios --disable-video-gem --disable-video-dummy \
+ --disable-video-opengl --enable-input-events --enable-pthreads \
+ --disable-video-picogui --disable-video-qtopia --enable-dlopen"
+
+do_configure() {
+ rm -f ${S}/acinclude.m4
+ cp ${WORKDIR}/acinclude.m4 ${S}/
+ gnu-configize
+ oe_runconf
+ cd ${S}
+ # prevent libtool from linking libs against libstdc++, libgcc, ...
+ cat ${TARGET_PREFIX}libtool | sed -e 's/postdeps=".*"/postdeps=""/' > ${TARGET_PREFIX}libtool.tmp
+ mv ${TARGET_PREFIX}libtool.tmp ${TARGET_PREFIX}libtool
+}
+
+do_stage() {
+ autotools_stage_all
+ install -m 0644 build/libSDLmain.a ${STAGING_LIBDIR}
+}
diff --git a/recipes/libsdl/libsdl-net-1.2.7/libtool2.patch b/recipes/libsdl/libsdl-net-1.2.7/libtool2.patch
new file mode 100644
index 0000000000..ea6daf7d48
--- /dev/null
+++ b/recipes/libsdl/libsdl-net-1.2.7/libtool2.patch
@@ -0,0 +1,13 @@
+Index: SDL_net-1.2.7/configure.in
+===================================================================
+--- SDL_net-1.2.7.orig/configure.in 2007-07-20 14:40:02.000000000 +0200
++++ SDL_net-1.2.7/configure.in 2008-07-24 00:41:04.282718579 +0200
+@@ -42,6 +42,8 @@
+ dnl Setup for automake
+ AM_INIT_AUTOMAKE(SDL_net, $VERSION)
+
++dnl got macros
++AC_CONFIG_MACRO_DIR([acinclude])
+ dnl Check for tools
+
+ AC_LIBTOOL_WIN32_DLL
diff --git a/recipes/libsdl/libsdl-net_1.2.7.bb b/recipes/libsdl/libsdl-net_1.2.7.bb
new file mode 100644
index 0000000000..8cbea5bd01
--- /dev/null
+++ b/recipes/libsdl/libsdl-net_1.2.7.bb
@@ -0,0 +1,21 @@
+DESCRIPTION = "Simple DirectMedia Layer networking library."
+SECTION = "libs/network"
+PRIORITY = "optional"
+DEPENDS = "virtual/libsdl"
+LICENSE = "LGPL"
+PR = "r1"
+
+SRC_URI = "http://www.libsdl.org/projects/SDL_net/release/SDL_net-${PV}.tar.gz \
+ file://libtool2.patch;patch=1 \
+ "
+
+S = "${WORKDIR}/SDL_net-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF += "SDL_CONFIG=${STAGING_BINDIR_CROSS}/sdl-config"
+
+do_stage() {
+ autotools_stage_all
+}
+
diff --git a/recipes/libsdl/libsdl-qpe-1.2.9/SDL-Akita-1.2.9.patch b/recipes/libsdl/libsdl-qpe-1.2.9/SDL-Akita-1.2.9.patch
new file mode 100644
index 0000000000..56ffe468e8
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe-1.2.9/SDL-Akita-1.2.9.patch
@@ -0,0 +1,51 @@
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_sysvideo.cc SDL-1.2.9/src/video/qtopia/SDL_sysvideo.cc
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_sysvideo.cc 2007-03-12 20:58:19.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_sysvideo.cc 2007-03-12 20:58:27.000000000 +0100
+@@ -109,6 +109,7 @@
+ MACHINE_SHARP_SLC760,
+ MACHINE_SHARP_SLC860,
+ MACHINE_SHARP_SL6000,
++ MACHINE_SHARP_SLC1000,
+ MACHINE_IPAQ,
+ MACHINE_MAX
+ } machine_t;
+@@ -123,6 +124,7 @@
+ { "Sharp", "SL-C760", 0 },
+ { "Sharp", "SL-C860", 0 },
+ { "Sharp", "SL-6000", 0 },
++ { "Sharp", "SL-C1000", 0 },
+ { "HP", "HP IPAQ", 0 },
+ };
+
+@@ -428,6 +430,8 @@
+ machine = MACHINE_SHARP_SLC760;
+ else if (strstr(buf, "SHARP Boxer") != NULL)
+ machine = MACHINE_SHARP_SLC860;
++ else if (strstr(buf, "SHARP Akita") != NULL)
++ machine = MACHINE_SHARP_SLC1000;
+ else if ( ODevice::inst ( )-> series ( ) == Model_iPAQ )
+ machine = MACHINE_IPAQ;
+ else
+@@ -522,17 +526,18 @@
+ if (machine == MACHINE_SHARP_SLC700 ||
+ machine == MACHINE_SHARP_SLC750 ||
+ machine == MACHINE_SHARP_SLC760 ||
+- machine == MACHINE_SHARP_SLC860 || // 詳しいことわからんけどとりあえず
+- machine == MACHINE_SHARP_SL6000 ) { // 詳しいことわからんけどとりあえず
++ machine == MACHINE_SHARP_SLC860 ||
++ machine == MACHINE_SHARP_SL6000 ||
++ machine == MACHINE_SHARP_SLC1000 ) {
+ is_VGA_machine = true;
+ }else {
+ is_VGA_machine = false;
+ }
+
+- // qte での回転角度を取得
++ // qte
+ QT_GetQteServerSpec(_this, &qteRotation, &isQteQvga);
+
+- // SL-C700 のスタイル
++ // SL-C700
+ bool isInputStyle = false;
+ if (is_VGA_machine) {
+ int status = system("/home/QtPalmtop/bin/chkhinge");
diff --git a/recipes/libsdl/libsdl-qpe-1.2.9/acinclude.m4 b/recipes/libsdl/libsdl-qpe-1.2.9/acinclude.m4
new file mode 100644
index 0000000000..30597ccc45
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe-1.2.9/acinclude.m4
@@ -0,0 +1,332 @@
+# Local macros for the SDL configure.in script
+
+dnl Function to link an architecture specific file
+dnl LINK_ARCH_SRC(source_dir, arch, source_file)
+AC_DEFUN([COPY_ARCH_SRC],
+[
+ old="$srcdir/$1/$2/$3"
+ new="$1/$3"
+ if test ! -d $1; then
+ echo "Creating directory $1"
+ mkdir -p $1
+ fi
+ echo "Copying $old -> $new"
+ cat >$new <<__EOF__
+/* WARNING: This file was automatically generated!
+ * Original: $old
+ */
+__EOF__
+ cat >>$new <$old
+])
+##############################################################################
+dnl Configure Paths for Alsa
+dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
+dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
+dnl Jaroslav Kysela <perex@suse.cz>
+dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
+dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
+dnl enables arguments --with-alsa-prefix=
+dnl --with-alsa-enc-prefix=
+dnl --disable-alsatest
+dnl
+dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
+dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
+dnl
+AC_DEFUN([AM_PATH_ALSA],
+[dnl Save the original CFLAGS, LDFLAGS, and LIBS
+alsa_save_CFLAGS="$CFLAGS"
+alsa_save_LDFLAGS="$LDFLAGS"
+alsa_save_LIBS="$LIBS"
+alsa_found=yes
+
+dnl
+dnl Get the cflags and libraries for alsa
+dnl
+AC_ARG_WITH(alsa-prefix,
+[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)],
+[alsa_prefix="$withval"], [alsa_prefix=""])
+AC_ARG_WITH(alsa-inc-prefix,
+[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)],
+[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
+
+dnl FIXME: this is not yet implemented
+AC_ARG_ENABLE(alsatest,
+[ --disable-alsatest Do not try to compile and run a test Alsa program],
+[enable_alsatest="$enableval"],
+[enable_alsatest=yes])
+
+dnl Add any special include directories
+AC_MSG_CHECKING(for ALSA CFLAGS)
+if test "$alsa_inc_prefix" != "" ; then
+ ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
+ CFLAGS="$CFLAGS -I$alsa_inc_prefix"
+fi
+AC_MSG_RESULT($ALSA_CFLAGS)
+
+dnl add any special lib dirs
+AC_MSG_CHECKING(for ALSA LDFLAGS)
+if test "$alsa_prefix" != "" ; then
+ ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
+ LDFLAGS="$LDFLAGS $ALSA_LIBS"
+fi
+
+dnl add the alsa library
+ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
+LIBS=`echo $LIBS | sed 's/-lm//'`
+LIBS=`echo $LIBS | sed 's/-ldl//'`
+LIBS=`echo $LIBS | sed 's/-lpthread//'`
+LIBS=`echo $LIBS | sed 's/ //'`
+LIBS="$ALSA_LIBS $LIBS"
+AC_MSG_RESULT($ALSA_LIBS)
+
+dnl Check for a working version of libasound that is of the right version.
+min_alsa_version=ifelse([$1], ,0.1.1,$1)
+AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
+no_alsa=""
+ alsa_min_major_version=`echo $min_alsa_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ alsa_min_minor_version=`echo $min_alsa_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ alsa_min_micro_version=`echo $min_alsa_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+AC_LANG_SAVE
+AC_LANG_C
+AC_TRY_COMPILE([
+#include <alsa/asoundlib.h>
+], [
+/* ensure backward compatibility */
+#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
+#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
+#endif
+#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
+#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
+#endif
+#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
+#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
+#endif
+
+# if(SND_LIB_MAJOR > $alsa_min_major_version)
+ exit(0);
+# else
+# if(SND_LIB_MAJOR < $alsa_min_major_version)
+# error not present
+# endif
+
+# if(SND_LIB_MINOR > $alsa_min_minor_version)
+ exit(0);
+# else
+# if(SND_LIB_MINOR < $alsa_min_minor_version)
+# error not present
+# endif
+
+# if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
+# error not present
+# endif
+# endif
+# endif
+exit(0);
+],
+ [AC_MSG_RESULT(found.)],
+ [AC_MSG_RESULT(not present.)
+ ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
+ alsa_found=no]
+)
+AC_LANG_RESTORE
+
+dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
+if test "x$enable_alsatest" = "xyes"; then
+AC_CHECK_LIB([asound], [snd_ctl_open],,
+ [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
+ alsa_found=no]
+)
+fi
+if test "x$alsa_found" = "xyes" ; then
+ ifelse([$2], , :, [$2])
+ LIBS=`echo $LIBS | sed 's/-lasound//g'`
+ LIBS=`echo $LIBS | sed 's/ //'`
+ LIBS="-lasound $LIBS"
+fi
+if test "x$alsa_found" = "xno" ; then
+ ifelse([$3], , :, [$3])
+ CFLAGS="$alsa_save_CFLAGS"
+ LDFLAGS="$alsa_save_LDFLAGS"
+ LIBS="$alsa_save_LIBS"
+ ALSA_CFLAGS=""
+ ALSA_LIBS=""
+fi
+
+dnl That should be it. Now just export out symbols:
+AC_SUBST(ALSA_CFLAGS)
+AC_SUBST(ALSA_LIBS)
+])
+
+#
+# --- esd.m4 ---
+#
+# Configure paths for ESD
+# Manish Singh 98-9-30
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
+dnl
+AC_DEFUN([AM_PATH_ESD],
+[dnl
+dnl Get the cflags and libraries from the esd-config script
+dnl
+AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
+ esd_prefix="$withval", esd_prefix="")
+AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
+ esd_exec_prefix="$withval", esd_exec_prefix="")
+AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
+ , enable_esdtest=yes)
+
+ if test x$esd_exec_prefix != x ; then
+ esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
+ if test x${ESD_CONFIG+set} != xset ; then
+ ESD_CONFIG=$esd_exec_prefix/bin/esd-config
+ fi
+ fi
+ if test x$esd_prefix != x ; then
+ esd_args="$esd_args --prefix=$esd_prefix"
+ if test x${ESD_CONFIG+set} != xset ; then
+ ESD_CONFIG=$esd_prefix/bin/esd-config
+ fi
+ fi
+
+ AC_PATH_PROG(ESD_CONFIG, esd-config, no)
+ min_esd_version=ifelse([$1], ,0.2.7,$1)
+ AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
+ no_esd=""
+ if test "$ESD_CONFIG" = "no" ; then
+ no_esd=yes
+ else
+ ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
+ ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
+
+ esd_major_version=`$ESD_CONFIG $esd_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ esd_minor_version=`$ESD_CONFIG $esd_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_esdtest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $ESD_CFLAGS"
+ LIBS="$LIBS $ESD_LIBS"
+dnl
+dnl Now check if the installed ESD is sufficiently new. (Also sanity
+dnl checks the results of esd-config to some extent
+dnl
+ rm -f conf.esdtest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <esd.h>
+
+char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main ()
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ system ("touch conf.esdtest");
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_esd_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_esd_version");
+ exit(1);
+ }
+
+ if (($esd_major_version > major) ||
+ (($esd_major_version == major) && ($esd_minor_version > minor)) ||
+ (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
+ printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
+ printf("*** to point to the correct copy of esd-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+}
+
+],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_esd" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$ESD_CONFIG" = "no" ; then
+ echo "*** The esd-config script installed by ESD could not be found"
+ echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the ESD_CONFIG environment variable to the"
+ echo "*** full path to esd-config."
+ else
+ if test -f conf.esdtest ; then
+ :
+ else
+ echo "*** Could not run ESD test program, checking why..."
+ CFLAGS="$CFLAGS $ESD_CFLAGS"
+ LIBS="$LIBS $ESD_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <esd.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding ESD or finding the wrong"
+ echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means ESD was incorrectly installed"
+ echo "*** or that you have moved ESD since it was installed. In the latter case, you"
+ echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ ESD_CFLAGS=""
+ ESD_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(ESD_CFLAGS)
+ AC_SUBST(ESD_LIBS)
+ rm -f conf.esdtest
+])
+
diff --git a/recipes/libsdl/libsdl-qpe-1.2.9/agawa-piro-mickey-1.2.9.patch b/recipes/libsdl/libsdl-qpe-1.2.9/agawa-piro-mickey-1.2.9.patch
new file mode 100644
index 0000000000..d7c561402f
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe-1.2.9/agawa-piro-mickey-1.2.9.patch
@@ -0,0 +1,2054 @@
+diff -Naur SDL-1.2.9-orig/src/video/fbcon/SDL_fbevents.c SDL-1.2.9/src/video/fbcon/SDL_fbevents.c
+--- SDL-1.2.9-orig/src/video/fbcon/SDL_fbevents.c 2005-01-04 20:04:14.000000000 +0100
++++ SDL-1.2.9/src/video/fbcon/SDL_fbevents.c 2007-03-12 20:54:14.000000000 +0100
+@@ -60,7 +60,13 @@
+ #ifndef GPM_NODE_FIFO
+ #define GPM_NODE_FIFO "/dev/gpmdata"
+ #endif
++#define POINTERCAL "/etc/pointercal"
+
++static struct SDL_cal {
++ long ok;
++ long a, b, c, d, e, f, s;
++ long rotate;
++} cal = { 0 };
+
+ /* The translation tables from a console scancode to a SDL keysym */
+ #define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
+@@ -317,6 +323,7 @@
+ MOUSE_MS,
+ MOUSE_BM,
+ MOUSE_ELO,
++ TS_SLC7X0,
+ NUM_MOUSE_DRVS
+ } mouse_drv = MOUSE_NONE;
+
+@@ -500,6 +507,9 @@
+ mousedev = getenv("SDL_MOUSEDEV");
+ mouse_fd = -1;
+
++ const char *sdl_rot_flag;
++ sdl_rot_flag = getenv("SDL_FBROT");
++
+ /* ELO TOUCHSCREEN SUPPORT */
+
+ if( (mousedrv != NULL) && (strcmp(mousedrv, "ELO") == 0) ) {
+@@ -601,9 +611,39 @@
+ mouse_drv = MOUSE_MS;
+ }
+ }
++ /* Default to a SLC7X0 touch screen */
++ if ( mouse_fd < 0 ) {
++ mousedev = "/dev/ts";
++ mouse_fd = open(mousedev, O_RDONLY, 0);
++ if ( mouse_fd >= 0 ) {
++ FILE *pcal;
++ cal.ok = 0;
++ pcal = fopen(POINTERCAL, "r");
++ if(pcal == NULL){
++ fprintf(stderr, "Warning: cannot open " POINTERCAL ".\n");
++ }else{
++ int n;
++ n = fscanf(pcal, "%d %d %d %d %d %d %d",
++ &cal.a, &cal.b, &cal.c, &cal.d, &cal.e, &cal.f, &cal.s);
++ if(n != 7){
++ fprintf(stderr, "Warning: " POINTERCAL " is unknown format.\n");
++ }else{
++ cal.ok = 1;
++ }
++ fclose(pcal);
++ }
++ if ( sdl_rot_flag == NULL ) {
++ cal.rotate = 0;
++ } else {
++ cal.rotate = atoi(sdl_rot_flag);
++ }
++ mouse_drv = TS_SLC7X0;
++ }
++ }
+ if ( mouse_fd < 0 ) {
+ mouse_drv = MOUSE_NONE;
+ }
++
+ return(mouse_fd);
+ }
+
+@@ -678,6 +718,10 @@
+ packetsize = ELO_PACKET_SIZE;
+ relative = 0;
+ break;
++ case TS_SLC7X0:
++ packetsize = 8;
++ relative = 0;
++ break;
+ case NUM_MOUSE_DRVS:
+ /* Uh oh.. */
+ packetsize = 0;
+@@ -810,6 +854,25 @@
+ */
+
+ case MOUSE_ELO:
++ case TS_SLC7X0:
++ /* Get current mouse state */
++ button = ((mousebuf[i+1] << 8)+mousebuf[i])/500;
++ dx = (mousebuf[i+3] << 8)+mousebuf[i+2];
++ dy = (mousebuf[i+5] << 8)+mousebuf[i+4];
++ if(cal.ok){
++ long X, Y;
++ X = (cal.a * dx + cal.b * dy + cal.c) / cal.s;
++ Y = (cal.d * dx + cal.e * dy + cal.f) / cal.s;
++ dx = X;
++ dy = Y;
++ }
++ if(cal.rotate == 3){
++ int tmp;
++ tmp=dx;
++ dx = dy;
++ dy = 480-tmp;
++ }
++ break;
+ case NUM_MOUSE_DRVS:
+ /* Uh oh.. */
+ dx = 0;
+diff -Naur SDL-1.2.9-orig/src/video/fbcon/SDL_fbvideo.c SDL-1.2.9/src/video/fbcon/SDL_fbvideo.c
+--- SDL-1.2.9-orig/src/video/fbcon/SDL_fbvideo.c 2005-02-12 19:03:54.000000000 +0100
++++ SDL-1.2.9/src/video/fbcon/SDL_fbvideo.c 2007-03-12 20:54:14.000000000 +0100
+@@ -51,7 +51,7 @@
+ #include "SDL_fbmatrox.h"
+ #include "SDL_fbriva.h"
+
+-
++/* #define FBCON_DEBUG 1 */
+ #if defined(i386) && defined(FB_TYPE_VGA_PLANES)
+ #define VGA16_FBCON_SUPPORT
+ #ifndef FB_AUX_VGA_PLANES_VGA4
+@@ -76,9 +76,11 @@
+ { 0, 0, 720, 576 }, /* PAL */
+ { 0, 0, 720, 480 }, /* NTSC */
+ { 0, 0, 640, 480 }, /* 16 bpp: 0x111, or 273 */
++ { 0, 0, 480, 640 },
+ { 0, 0, 640, 400 }, /* 8 bpp: 0x100, or 256 */
+ { 0, 0, 512, 384 },
+ { 0, 0, 320, 240 },
++ { 0, 0, 240, 320 },
+ { 0, 0, 320, 200 }
+ };
+ static const struct {
+@@ -112,9 +114,11 @@
+ */
+ { 320, 200, 79440, 16, 16, 20, 4, 48, 1, 0, 2 }, /* 70 Hz */
+ { 320, 240, 63492, 16, 16, 16, 4, 48, 2, 0, 2 }, /* 72 Hz */
++ { 240, 320, 63492, 16, 16, 16, 4, 48, 3, 0, 2 }, /* 72 Hz */
+ { 512, 384, 49603, 48, 16, 16, 1, 64, 3, 0, 0 }, /* 78 Hz */
+ { 640, 400, 31746, 96, 32, 41, 1, 64, 3, 2, 0 }, /* 85 Hz */
+ { 640, 480, 31746, 120, 16, 16, 1, 64, 3, 0, 0 }, /* 75 Hz */
++ { 480, 640, 31746, 120, 16, 16, 1, 64, 4, 0, 0 }, /* 75 Hz */
+ { 768, 576, 26101, 144, 16, 28, 6, 112, 4, 0, 0 }, /* 60 Hz */
+ { 800, 600, 20000, 64, 56, 23, 37, 120, 6, 3, 0 }, /* 72 Hz */
+ { 960, 720, 17686, 144, 24, 28, 8, 112, 4, 0, 0 }, /* 60 Hz */
+@@ -152,6 +156,10 @@
+ struct fb_var_screeninfo *vinfo);
+ static void FB_RestorePalette(_THIS);
+
++static char *console_fd_buf;
++static char *mapped_mem_fb;
++static int rotation_flag;
++
+ /* FB driver bootstrap functions */
+
+ static int FB_Available(void)
+@@ -241,18 +249,30 @@
+
+ mode_okay = 0;
+ vinfo->bits_per_pixel = (index+1)*8;
+- vinfo->xres = *w;
+- vinfo->xres_virtual = *w;
+- vinfo->yres = *h;
+- vinfo->yres_virtual = *h;
++ if ((rotation_flag == 0) || (rotation_flag == 2)) {
++ vinfo->xres = *w;
++ vinfo->xres_virtual = *w;
++ vinfo->yres = *h;
++ vinfo->yres_virtual = *h;
++ } else {
++ vinfo->xres = *h;
++ vinfo->xres_virtual = *h;
++ vinfo->yres = *w;
++ vinfo->yres_virtual = *w;
++ }
+ vinfo->activate = FB_ACTIVATE_TEST;
+ if ( ioctl(console_fd, FBIOPUT_VSCREENINFO, vinfo) == 0 ) {
+ #ifdef FBCON_DEBUG
+ fprintf(stderr, "Checked mode %dx%d at %d bpp, got mode %dx%d at %d bpp\n", *w, *h, (index+1)*8, vinfo->xres, vinfo->yres, vinfo->bits_per_pixel);
+ #endif
+ if ( (((vinfo->bits_per_pixel+7)/8)-1) == index ) {
+- *w = vinfo->xres;
+- *h = vinfo->yres;
++ if ((rotation_flag == 0) || (rotation_flag == 2)) {
++ *w = vinfo->xres;
++ *h = vinfo->yres;
++ } else {
++ *h = vinfo->xres;
++ *w = vinfo->yres;
++ }
+ mode_okay = 1;
+ }
+ }
+@@ -332,6 +352,7 @@
+ unsigned int current_w;
+ unsigned int current_h;
+ const char *SDL_fbdev;
++ const char *SDL_rot_flag;
+
+ /* Initialize the library */
+ SDL_fbdev = getenv("SDL_FBDEV");
+@@ -344,6 +365,14 @@
+ return(-1);
+ }
+
++ SDL_rot_flag = getenv("SDL_FBROT");
++ if ( SDL_rot_flag == NULL ) {
++ rotation_flag = 0;
++ } else {
++ rotation_flag = atoi(SDL_rot_flag);
++ }
++
++
+ #ifndef DISABLE_THREADS
+ /* Create the hardware surface lock mutex */
+ hw_lock = SDL_CreateMutex();
+@@ -407,13 +436,33 @@
+ mapped_offset = (((long)finfo.smem_start) -
+ (((long)finfo.smem_start)&~(PAGE_SIZE-1)));
+ mapped_memlen = finfo.smem_len+mapped_offset;
+- mapped_mem = mmap(NULL, mapped_memlen,
+- PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
+- if ( mapped_mem == (char *)-1 ) {
+- SDL_SetError("Unable to memory map the video hardware");
+- mapped_mem = NULL;
+- FB_VideoQuit(this);
+- return(-1);
++ if (rotation_flag == 0) {
++ mapped_mem = mmap(NULL, mapped_memlen,
++ PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
++ if ( mapped_mem == (char *)-1 ) {
++ SDL_SetError("Unable to memory map the video hardware");
++ mapped_mem = NULL;
++ FB_VideoQuit(this);
++ return(-1);
++ }
++ } else {
++
++ console_fd_buf = (char *)malloc(640*480*2);
++
++ if (console_fd_buf == NULL){
++ SDL_SetError("Unable to memory for buffer");
++ return(-1);
++ }
++
++ mapped_mem_fb = mmap(NULL, mapped_memlen,
++ PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
++ if ( mapped_mem_fb == (char *)-1 ) {
++ SDL_SetError("Unable to memory map the video hardware");
++ mapped_mem_fb = NULL;
++ FB_VideoQuit(this);
++ return(-1);
++ }
++ mapped_mem = console_fd_buf;
+ }
+
+ /* Determine the current screen depth */
+@@ -555,6 +604,7 @@
+
+ /* Various screen update functions available */
+ static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
++static void FB_RotationUpdate(_THIS, int numrects, SDL_Rect *rects);
+ #ifdef VGA16_FBCON_SUPPORT
+ static void FB_VGA16Update(_THIS, int numrects, SDL_Rect *rects);
+ #endif
+@@ -725,7 +775,7 @@
+ Uint32 Bmask;
+ char *surfaces_mem;
+ int surfaces_len;
+-
++
+ /* Set the terminal into graphics mode */
+ if ( FB_EnterGraphicsMode(this) < 0 ) {
+ return(NULL);
+@@ -734,6 +784,8 @@
+ /* Restore the original palette */
+ FB_RestorePalette(this);
+
++ flags &= ~SDL_DOUBLEBUF;
++
+ /* Set the video mode and get the final screen format */
+ if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
+ SDL_SetError("Couldn't get console screen info");
+@@ -748,13 +800,24 @@
+ vinfo.activate = FB_ACTIVATE_NOW;
+ vinfo.accel_flags = 0;
+ vinfo.bits_per_pixel = bpp;
+- vinfo.xres = width;
+- vinfo.xres_virtual = width;
+- vinfo.yres = height;
+- if ( flags & SDL_DOUBLEBUF ) {
+- vinfo.yres_virtual = height*2;
++ if ((rotation_flag == 0) || (rotation_flag == 2)) {
++ vinfo.xres = width;
++ vinfo.xres_virtual = width;
++ vinfo.yres = height;
++ if ( flags & SDL_DOUBLEBUF ) {
++ vinfo.yres_virtual = height*2;
++ } else {
++ vinfo.yres_virtual = height;
++ }
+ } else {
+- vinfo.yres_virtual = height;
++ vinfo.xres = height;
++ vinfo.xres_virtual = height;
++ vinfo.yres = width;
++ if ( flags & SDL_DOUBLEBUF ) {
++ vinfo.yres_virtual = width*2;
++ } else {
++ vinfo.yres_virtual = width;
++ }
+ }
+ vinfo.xoffset = 0;
+ vinfo.yoffset = 0;
+@@ -776,6 +839,15 @@
+ return(NULL);
+ }
+ }
++ vinfo.xres = width;
++ vinfo.xres_virtual = width;
++ vinfo.yres = height;
++ if ( flags & SDL_DOUBLEBUF ) {
++ vinfo.yres_virtual = height*2;
++ } else {
++ vinfo.yres_virtual = height;
++ }
++
+ } else {
+ int maxheight;
+
+@@ -821,7 +893,9 @@
+ SDL_SetError("Couldn't get console hardware info");
+ return(NULL);
+ }
+-
++#ifdef FBCON_DEBUG
++ print_finfo(&finfo);
++#endif
+ /* Save hardware palette, if needed */
+ FB_SavePalette(this, &finfo, &vinfo);
+
+@@ -829,7 +903,11 @@
+ current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
+ current->w = vinfo.xres;
+ current->h = vinfo.yres;
+- current->pitch = finfo.line_length;
++ if ((rotation_flag == 0) || (rotation_flag == 2) ) {
++ current->pitch = finfo.line_length;
++ } else {
++ current->pitch = vinfo.xres*2;
++ }
+ current->pixels = mapped_mem+mapped_offset;
+
+ /* Set up the information for hardware surfaces */
+@@ -863,7 +941,7 @@
+ }
+
+ /* Set the update rectangle function */
+- this->UpdateRects = FB_DirectUpdate;
++ this->UpdateRects = FB_RotationUpdate;
+
+ /* We're done */
+ return(current);
+@@ -1123,6 +1201,89 @@
+ return;
+ }
+
++static void FB_RotationUpdate(_THIS, int numrects, SDL_Rect *rects)
++{
++ unsigned short *pDst;
++ unsigned short *pSrc;
++ unsigned int width;
++ unsigned int height;
++ unsigned int srcYAdd;
++ unsigned int dstXAdd;
++ unsigned int dstYSub;
++ unsigned int i;
++ unsigned int dstH;
++ unsigned int dstW;
++
++#ifdef FBCON_DEBUG
++ fprintf(stderr,"rotation_flag = %d \n",rotation_flag);
++#endif
++ switch (rotation_flag) {
++ case 0:
++ break;
++ case 1:
++ memcpy(mapped_mem_fb,mapped_mem,640*480*2);
++ break;
++ case 2:
++ memcpy(mapped_mem_fb,mapped_mem,640*480*2);
++ break;
++ case 3:
++ dstW=cache_vinfo.xres;
++ dstH=cache_vinfo.yres;
++#ifdef FBCON_DEBUG
++ fprintf(stderr,"dstH = %d : dstW = %d : rects->x = %d : rects->y = %d\n",dstH,dstW);
++ fprintf(stderr,"rects->x = %d : rects->y = %d : rects->w = %d : rects->h = %d\n",rects->x,rects->y,rects->w,rects->h);
++#endif
++ while (numrects) {
++ if (rects->w != dstW || rects->h != dstH) {
++ pSrc = mapped_mem + (rects->x + rects->y * dstW)*2;
++ pDst = mapped_mem_fb + (dstH-1+rects->x * dstH - rects->y)*2;
++
++ width = rects->w;
++ height = rects->h;
++
++ srcYAdd = dstW - rects->w;
++ dstXAdd = dstH;
++ dstYSub = (dstH * rects->w) + 1;
++
++ while (height--) {
++ i = width;
++ while (i--) {
++ *pDst = *pSrc ++;
++ pDst += dstXAdd;
++ }
++ pSrc += srcYAdd;
++ pDst -= dstYSub;
++ }
++
++ } else {
++ pDst=mapped_mem_fb+dstH*2-2;
++ pSrc=mapped_mem;
++ height=dstH;
++ width=dstW;
++ dstXAdd=height;
++ dstYSub=dstW*dstH+1;
++
++ while (height--) {
++ i = width;
++ while (i--) {
++ *pDst = *pSrc ++;
++ pDst += dstXAdd;
++ }
++ pDst -= dstYSub;
++ }
++ }
++ numrects--;
++ rects++;
++ }
++ break;
++ default:
++ break;
++ }
++
++
++
++}
++
+ #ifdef VGA16_FBCON_SUPPORT
+ /* Code adapted with thanks from the XFree86 VGA16 driver! :) */
+ #define writeGr(index, value) \
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_QWin.cc SDL-1.2.9/src/video/qtopia/SDL_QWin.cc
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_QWin.cc 2004-01-04 17:49:26.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_QWin.cc 2007-03-12 20:54:14.000000000 +0100
+@@ -1,3 +1,4 @@
++
+ /*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2004 Sam Lantinga
+@@ -27,15 +28,24 @@
+
+ #include "SDL_QWin.h"
+ #include <qapplication.h>
++#include <qpe/qpeapplication.h>
+ #include <qdirectpainter_qws.h>
+
++extern int fb_hwrot;
++extern int fb_direct;
++extern bool is_VGA_machine;
++static int mouse_button_mode=1;
++
+ screenRotationT screenRotation = SDL_QT_NO_ROTATION;
+
+ SDL_QWin::SDL_QWin(const QSize& size)
+ : QWidget(0, "SDL_main"), my_painter(0), my_image(0),
+ my_inhibit_resize(false), my_mouse_pos(-1,-1), my_flags(0),
+- my_has_fullscreen(false), my_locked(0)
++ my_has_fullscreen(false), my_locked(0),
++ rotation_(0), qteRotation_(0), keyRotation_(0), qteKeyRotation_(0),
++ isSLA300InputFix_(0)
+ {
++ for (int i = 0; i < 5; i++) curAxis_[i] = 0;
+ setBackgroundMode(NoBackground);
+ }
+
+@@ -84,6 +94,7 @@
+ }
+
+ void SDL_QWin::setMousePos(const QPoint &pos) {
++#if 0
+ if(my_image->width() == height()) {
+ if (screenRotation == SDL_QT_ROTATION_90)
+ my_mouse_pos = QPoint(height()-pos.y(), pos.x());
+@@ -92,6 +103,66 @@
+ } else {
+ my_mouse_pos = pos;
+ }
++#else
++ QPoint realPos;
++
++ if (is_VGA_machine) {
++ realPos = pos;
++ my_mouse_pos = realPos;
++ }else {
++ switch (qteRotation_) {
++ case 0:
++ realPos = pos;
++ break;
++ case 1:
++ realPos.setX(pos.y());
++ realPos.setY(fbSize_.height() - 1 - pos.x());
++ break;
++ case 2:
++ realPos.setX(fbSize_.width() - 1 - pos.x());
++ realPos.setY(fbSize_.height() - 1 - pos.y());
++ break;
++ case 3:
++ realPos.setX(fbSize_.width() - 1 - pos.y());
++ realPos.setY(pos.x());
++ break;
++ };
++
++ // fprintf(stderr, "setMousePos: realPos(%d, %d)\n", realPos.x(), realPos.y());
++
++ int borderWidth = (fbSize_.width() - my_image->width()) >> 1;
++ int borderHeight = (fbSize_.height() - my_image->height()) >> 1;
++ if ( rotation_ & 1 ){
++ borderWidth = (fbSize_.height() - my_image->width()) >> 1;
++ borderHeight = (fbSize_.width() - my_image->height()) >> 1;
++ }
++ realPos.setX(realPos.x() - borderWidth);
++ realPos.setY(realPos.y() - borderHeight);
++
++ fprintf(stderr, "setMousePos: realPos2(%d, %d)\n", realPos.x(), realPos.y());
++
++ switch (rotation_) {
++ case 0:
++ my_mouse_pos = realPos;
++ break;
++ case 1:
++ my_mouse_pos.setX(realPos.y());
++ my_mouse_pos.setY(my_image->height() - 1 - realPos.x());
++ break;
++ case 2:
++ my_mouse_pos.setX(my_image->width() - 1 - realPos.x());
++ my_mouse_pos.setY(my_image->height() - 1 - realPos.y());
++ break;
++ case 3:
++ my_mouse_pos.setX(realPos.y());//my_image->width() - 1 - realPos.y());
++ my_mouse_pos.setY(my_image->height() - realPos.x());
++ break;
++ }
++ }
++
++// fprintf(stderr, "setMousePos: mymousePos(%d, %d)\n", (short)my_mouse_pos.x(), (short)my_mouse_pos.y());
++
++#endif
+ }
+
+ void SDL_QWin::mouseMoveEvent(QMouseEvent *e) {
+@@ -113,269 +184,318 @@
+ void SDL_QWin::mousePressEvent(QMouseEvent *e) {
+ mouseMoveEvent(e);
+ Qt::ButtonState button = e->button();
+- SDL_PrivateMouseButton(SDL_PRESSED,
+- (button & Qt::LeftButton) ? 1 :
+- ((button & Qt::RightButton) ? 2 : 3),
++ SDL_PrivateMouseButton(SDL_PRESSED,mouse_button_mode,
+ my_mouse_pos.x(), my_mouse_pos.y());
+ }
+
+ void SDL_QWin::mouseReleaseEvent(QMouseEvent *e) {
+ setMousePos(e->pos());
+ Qt::ButtonState button = e->button();
+- SDL_PrivateMouseButton(SDL_RELEASED,
+- (button & Qt::LeftButton) ? 1 :
+- ((button & Qt::RightButton) ? 2 : 3),
++ SDL_PrivateMouseButton(SDL_RELEASED,mouse_button_mode,
+ my_mouse_pos.x(), my_mouse_pos.y());
+ my_mouse_pos = QPoint(-1, -1);
+ }
+
+-static inline void
+-gs_fastRotateBlit_3 ( unsigned short *fb,
+- unsigned short *bits,
+- const QRect& rect )
++#ifndef __i386__
++
++static void
++blitRotate3(Uint16 *dstBits, const QSize& dstSize,
++ const Uint16 *srcBits, const QSize& srcSize,
++ const QRect& srcBlitRect);
++
++static void
++blitRotate0(Uint16 *dstBits, const QSize& dstSize,
++ const Uint16 *srcBits, const QSize& srcSize,
++ const QRect& srcBlitRect)
+ {
+- // FIXME: this only works correctly for 240x320 displays
+- int startx, starty;
+- int width, height;
+-
+- startx = rect.left() >> 1;
+- starty = rect.top() >> 1;
+- width = ((rect.right() - rect.left()) >> 1) + 2;
+- height = ((rect.bottom() - rect.top()) >> 1) + 2;
+-
+- if((startx+width) > 120) {
+- width = 120 - startx; // avoid horizontal overflow
+- }
+- if((starty+height) > 160) {
+- height = 160 - starty; // avoid vertical overflow
+- }
+-
+- ulong *sp1, *sp2, *dp1, *dp2;
+- ulong stop, sbot, dtop, dbot;
+-
+- sp1 = (ulong*)bits + startx + starty*240;
+- sp2 = sp1 + 120;
+- dp1 = (ulong *)fb + (159 - starty) + startx*320;
+- dp2 = dp1 + 160;
+- int rowadd = (-320*width) - 1;
+- int rowadd2 = 240 - width;
+- // transfer in cells of 2x2 pixels in words
+- for (int y=0; y<height; y++) {
+- for (int x=0; x<width; x++) {
+- // read source pixels
+- stop = *sp1;
+- sbot = *sp2;
+- // rotate pixels
+- dtop = (sbot & 0xffff) + ((stop & 0xffff)<<16);
+- dbot = ((sbot & 0xffff0000)>>16) + (stop & 0xffff0000);
+- // write to framebuffer
+- *dp1 = dtop;
+- *dp2 = dbot;
+- // update source ptrs
+- sp1++; sp2++;
+- // update dest ptrs - 2 pix at a time
+- dp1 += 320;
+- dp2 += 320;
+- }
+- // adjust src ptrs - skip a row as we work in pairs
+- sp1 += rowadd2;
+- sp2 += rowadd2;
+- // adjust dest ptrs for rotation
+- dp1 += rowadd;
+- dp2 += rowadd;
++ srcBits += srcBlitRect.left() + srcBlitRect.top() * srcSize.width();
++ dstBits += ((dstSize.width() - srcSize.width()) >> 1)
++ + (((dstSize.height() - srcSize.height()) >> 1) * dstSize.width());
++ dstBits += srcBlitRect.left() + srcBlitRect.top() * dstSize.width();
++ int w = srcBlitRect.width() << 1;
++ int h = srcBlitRect.height();
++
++ while (h--) {
++ memcpy(dstBits, srcBits, w);
++ dstBits += dstSize.width();
++ srcBits += srcSize.width();
+ }
+ }
+
+-static inline void
+-gs_fastRotateBlit_1 ( unsigned short *fb,
+- unsigned short *bits,
+- const QRect& rect ) {
+- // FIXME: this only works correctly for 240x320 displays
+- int startx, starty;
+- int width, height;
+-
+- startx = rect.left() >> 1;
+- starty = rect.top() >> 1;
+- width = ((rect.right() - rect.left()) >> 1) + 2;
+- height = ((rect.bottom() - rect.top()) >> 1) + 2;
+-
+- if((startx+width) > 120) {
+- width = 120 - startx; // avoid horizontal overflow
+- }
+- if((starty+height) > 160) {
+- height = 160 - starty; // avoid vertical overflow
+- }
+-
+- ulong *sp1, *sp2, *dp1, *dp2;
+- ulong stop, sbot, dtop, dbot;
+- fb += 320*239; // Move "fb" to top left corner
+- sp1 = (ulong*)bits + startx + starty*240;
+- sp2 = sp1 + 120;
+- dp1 = (ulong*)fb - startx * 320 - starty;
+- dp2 = dp1 - 160;
+- int rowadd = (320*width) + 1;
+- int rowadd2 = 240 - width;
+- // transfer in cells of 2x2 pixels in words
+- for (int y=0; y<height; y++) {
+- for (int x=0; x<width; x++) {
+- // read
+- stop = *sp1;
+- sbot = *sp2;
+- // rotate
+- dtop = (stop & 0xffff) + ((sbot & 0xffff)<<16);
+- dbot = ((stop & 0xffff0000)>>16) + (sbot & 0xffff0000);
+- // write
+- *dp1 = dtop;
+- *dp2 = dbot;
+- // update source ptrs
+- sp1++; sp2++;
+- // update dest ptrs - 2 pix at a time
+- dp1 -= 320;
+- dp2 -= 320;
+- }
+- // adjust src ptrs - skip a row as we work in pairs
+- sp1 += rowadd2;
+- sp2 += rowadd2;
+- // adjust dest ptrs for rotation
+- dp1 += rowadd;
+- dp2 += rowadd;
+- }
++static void
++blitRotate1(Uint16 *dstBits, const QSize& dstSize,
++ const Uint16 *srcBits, const QSize& srcSize,
++ const QRect& srcBlitRect)
++{
++// fprintf(stdout, "SDL_QT_ROTATION (1) is not implemented.\n");
++ blitRotate3(dstBits, dstSize, srcBits, srcSize, srcBlitRect);
+ }
+
+-// desktop, SL-A300 etc
+-bool SDL_QWin::repaintRotation0(const QRect& rect) {
+- if(my_image->width() == width()) {
+- uchar *fb = (uchar*)my_painter->frameBuffer();
+- uchar *buf = (uchar*)my_image->bits();
+- if(rect == my_image->rect()) {
+- memcpy(fb, buf, width()*height()*2);
+- } else {
+- int h = rect.height();
+- int wd = rect.width()<<1;
+- int fblineadd = my_painter->lineStep();
+- int buflineadd = my_image->bytesPerLine();
+- fb += (rect.left()<<1) + rect.top() * my_painter->lineStep();
+- buf += (rect.left()<<1) + rect.top() * my_image->bytesPerLine();
+- while(h--) {
+- memcpy(fb, buf, wd);
+- fb += fblineadd;
+- buf += buflineadd;
+- }
++static void
++blitRotate2(Uint16 *dstBits, const QSize& dstSize,
++ const Uint16 *srcBits, const QSize& srcSize,
++ QRect srcBlitRect)
++{
++// if (srcBlitRect.left() & 1)
++// srcBlitRect.setLeft(srcBlitRect.left() - 1);
++// if (srcBlitRect.right() & 1)
++// srcBlitRect.setRight(srcBlitRect.right() - 1);
++
++ int dstBorderLeftRight = (dstSize.width() - srcSize.width()) >>1;
++ int dstBorderTopBottom = (dstSize.height() - srcSize.height()) >>1;
++ int dstStartOffsetX = dstSize.width() - dstBorderLeftRight - 2;
++ int dstStartOffsetY = dstSize.height() - dstBorderTopBottom - 1;
++ int left = srcBlitRect.left() & ~(int)1; // to be 32bit aligned
++ srcBits += left + srcBlitRect.top() * srcSize.width();
++ dstBits += dstStartOffsetY * dstSize.width() + dstStartOffsetX;
++ dstBits -= left;
++ dstBits -= srcBlitRect.top() * dstSize.width();
++
++ Uint32 *pSrc = (Uint32 *)srcBits;
++ Uint32 *pDst = (Uint32 *)dstBits;
++
++ int width = srcBlitRect.width(), width2 = srcBlitRect.width(), w;
++ if ( srcBlitRect.left() & 1 ){
++ width--; width2++;
++ }
++ if ( (srcBlitRect.left()+srcBlitRect.width()) & 1 ){
++ width--; width2++;
++ }
++ width >>= 1;
++ int height = srcBlitRect.height();
++ int srcYAdd = srcSize.width() - width2;
++ int dstYSub = dstSize.width() - width2;
++
++ while (height--) {
++ w = width;
++ if (srcBlitRect.left() & 1){
++ *((Uint16 *)pDst) = *(((Uint16 *)pSrc) + 1);
++ pDst--; pSrc++;
+ }
+- } else {
+- return false; // FIXME: Landscape
++ while (w--) {
++ *pDst-- = (*pSrc << 16) | (*pSrc >> 16);
++ ++pSrc;
++ }
++ if ((srcBlitRect.left()+srcBlitRect.width()) & 1){
++ *(((Uint16 *)pDst) + 1) = *((Uint16 *)pSrc);
++ pDst--; pSrc++;
++ }
++ pSrc += srcYAdd;
++ pDst -= dstYSub;
+ }
+-#ifdef __i386__
+- my_painter->fillRect( rect, QBrush( Qt::NoBrush ) );
+-#endif
+- return true;
+ }
+
+-
+-// Sharp Zaurus SL-5500 etc
+-bool SDL_QWin::repaintRotation3(const QRect& rect) {
+- if(my_image->width() == width()) {
+- ushort *fb = (ushort*)my_painter->frameBuffer();
+- ushort *buf = (ushort*)my_image->bits();
+- gs_fastRotateBlit_3(fb, buf, rect);
++#define BLIT_ROTATE_3_MOV32
++
++static void
++blitRotate3(Uint16 *dstBits, const QSize& dstSize,
++ const Uint16 *srcBits, const QSize& srcSize,
++ const QRect& srcBlitRect)
++{
++ if (srcBlitRect.width() != dstSize.height() ||
++ srcBlitRect.height() != dstSize.width()) {
++ // partial update
++ const Uint16 *pSrc = srcBits +
++ (srcBlitRect.left() + srcBlitRect.top() * srcSize.width());
++
++ int dstBorderLeftRight = (dstSize.width() - srcSize.height()) >>1;
++ int dstBorderTopBottom = (dstSize.height() - srcSize.width()) >>1;
++ int dstStartOffsetX = dstSize.width() - dstBorderLeftRight - 1;
++ int dstStartOffsetY = dstBorderTopBottom;
++ Uint16 *pDst = dstBits +
++ (dstStartOffsetY * dstSize.width() + dstStartOffsetX);
++ pDst += srcBlitRect.left() * dstSize.width();
++ pDst -= srcBlitRect.top();
++
++ int width = srcBlitRect.width(), height = srcBlitRect.height(), w;
++ int srcYAdd = srcSize.width() - srcBlitRect.width();
++ int dstXAdd = dstSize.width();
++ int dstYSub = (dstSize.width() * srcBlitRect.width()) + 1;
++
++#if 0
++ fprintf(stderr, "---- Blit begin\n");
++ fprintf(stderr, "srcSize.width: %d srcSize.height:%d\n",
++ srcSize.width(), srcSize.height());
++ fprintf(stderr, "srcBlitRect.left:%d srcBlitRect.right:%d srcBlitRect.top:%d srcBlitRect.bottom:%d srcBlitRect.width:%d srcBlitRect.height:%d\n",
++ srcBlitRect.left(), srcBlitRect.right(), srcBlitRect.top(), srcBlitRect.bottom(), srcBlitRect.width(), srcBlitRect.height());
++
++ fprintf(stderr, "dstSize.width: %d dstSize.height:%d\n",
++ dstSize.width(), dstSize.height());
++ fprintf(stderr, "dstBorderLeftRight:%d dstBorderTopBottom:%d dstStartOffsetX:%d dstStartOffsetY:%d\n",
++ dstBorderLeftRight, dstBorderTopBottom, dstStartOffsetX, dstStartOffsetY);
++ fprintf(stderr, "srcYAdd:%d dstXAdd:%d dstYSub:%d\n", srcYAdd, dstXAdd, dstYSub);
++#endif
++
++ while (height--) {
++ w = width;
++ while (w--) {
++ *pDst = *pSrc ++;
++ pDst += dstXAdd;
++ }
++ pSrc += srcYAdd;
++ pDst -= dstYSub;
++ }
++ // fprintf(stderr, "---- Blit end\n");
+ } else {
+- // landscape mode
+- if (screenRotation == SDL_QT_ROTATION_90) {
+- uchar *fb = (uchar*)my_painter->frameBuffer();
+- uchar *buf = (uchar*)my_image->bits();
+- if(rect == my_image->rect()) {
+- memcpy(fb, buf, width()*height()*2);
+- } else {
+- int h = rect.height();
+- int wd = rect.width()<<1;
+- int fblineadd = my_painter->lineStep();
+- int buflineadd = my_image->bytesPerLine();
+- fb += (rect.left()<<1) + rect.top() * my_painter->lineStep();
+- buf += (rect.left()<<1) + rect.top() * my_image->bytesPerLine();
+- while(h--) {
+- memcpy(fb, buf, wd);
+- fb += fblineadd;
+- buf += buflineadd;
+- }
++ // full update
++#if !defined(BLIT_ROTATE_3_MOV32)
++ const Uint16 *src = srcBits;
++ Uint16 *dst = dstBits + (dstSize.width() - 1);
++ int w = srcBlitRect.width();
++ int h = srcBlitRect.height();
++ int i, dstSub = dstSize.width() * w + 1;
++ int dstAdd = dstSize.width();
++
++ while (h--) {
++ i = w;
++ while (i--) {
++ *dst = *src ++;
++ dst += dstAdd;
+ }
+- } else if (screenRotation == SDL_QT_ROTATION_270) {
+- int h = rect.height();
+- int wd = rect.width();
+- int fblineadd = my_painter->lineStep() - (rect.width() << 1);
+- int buflineadd = my_image->bytesPerLine() - (rect.width() << 1);
+- int w;
+-
+- uchar *fb = (uchar*)my_painter->frameBuffer();
+- uchar *buf = (uchar*)my_image->bits();
+-
+- fb += ((my_painter->width() - (rect.top() + rect.height())) *
+- my_painter->lineStep()) + ((my_painter->height() - ((rect.left() +
+- rect.width()))) << 1);
+-
+- buf += my_image->bytesPerLine() * (rect.top() + rect.height()) -
+- (((my_image->width() - (rect.left() + rect.width())) << 1) + 2);
+-
+- while(h--) {
+- w = wd;
+- while(w--) *((unsigned short*)fb)++ = *((unsigned short*)buf)--;
+- fb += fblineadd;
+- buf -= buflineadd;
++ dst -= dstSub;
++ }
++#else // BLIT_ROTATE_3_MOV32
++ Uint32 *src1 = (Uint32 *)(srcBits);
++ Uint32 *src2 = (Uint32 *)(srcBits + srcSize.width());
++ Uint32 *dst1 = (Uint32 *)(dstBits + (dstSize.width() - 2));
++ Uint32 *dst2 = (Uint32 *)(dstBits + (dstSize.width() + dstSize.width() - 2));
++ int w = srcBlitRect.width() >> 3;
++ int h = srcBlitRect.height() >> 1;
++ int i, dstSub = ((dstSize.width() * srcBlitRect.width()) >> 1) + 1;
++ int dstAdd = dstSize.width();
++
++ Uint32 a, b;
++ while (h--) {
++ i = w;
++ while (i--) {
++ a = *src1 ++;
++ b = *src2 ++;
++ *dst1 = (a << 16) | (b & 0xFFFF);
++ *dst2 = (a & 0xFFFF0000) | (b >> 16);
++ dst1 += dstAdd;
++ dst2 += dstAdd;
++
++ a = *src1 ++;
++ b = *src2 ++;
++ *dst1 = (a << 16) | (b & 0xFFFF);
++ *dst2 = (a & 0xFFFF0000) | (b >> 16);
++ dst1 += dstAdd;
++ dst2 += dstAdd;
++
++ a = *src1 ++;
++ b = *src2 ++;
++ *dst1 = (a << 16) | (b & 0xFFFF);
++ *dst2 = (a & 0xFFFF0000) | (b >> 16);
++ dst1 += dstAdd;
++ dst2 += dstAdd;
++
++ a = *src1 ++;
++ b = *src2 ++;
++ *dst1 = (a << 16) | (b & 0xFFFF);
++ *dst2 = (a & 0xFFFF0000) | (b >> 16);
++ dst1 += dstAdd;
++ dst2 += dstAdd;
+ }
++ src1 += srcSize.width() >> 1;
++ src2 += srcSize.width() >> 1;
++ dst1 -= dstSub;
++ dst2 -= dstSub;
+ }
++#endif // BLIT_ROTATE_3_MOV32
+ }
+- return true;
+ }
+
+-// ipaq 3800...
+-bool SDL_QWin::repaintRotation1(const QRect& rect) {
+- if(my_image->width() == width()) {
+- ushort *fb = (ushort*)my_painter->frameBuffer();
+- ushort *buf = (ushort*)my_image->bits();
+- gs_fastRotateBlit_1(fb, buf, rect);
+- } else {
+- return false; // FIXME: landscape mode
+- }
+- return true;
+-}
++#endif // __i386__
+
+ void SDL_QWin::repaintRect(const QRect& rect) {
+ if(!my_painter || !rect.width() || !rect.height()) {
+ return;
+ }
+-
+- if(QPixmap::defaultDepth() == 16) {
+- switch(my_painter->transformOrientation()) {
+- case 3:
+- if(repaintRotation3(rect)) { return; }
++#ifndef __i386__
++ if (QPixmap::defaultDepth() == 16 && my_painter->numRects() >= 0) {
++ Uint16 *fb = (Uint16*)my_painter->frameBuffer();
++ Uint16 *buf = (Uint16*)my_image->bits();
++ switch (rotation_) {
++ case 0:
++ blitRotate0(fb, fbSize_,
++ buf, QSize(my_image->width(), my_image->height()),
++ rect);
+ break;
+ case 1:
+- if(repaintRotation1(rect)) { return; }
++ blitRotate1(fb, fbSize_,
++ buf, QSize(my_image->width(), my_image->height()),
++ rect);
+ break;
+- case 0:
+- if(repaintRotation0(rect)) { return; }
++ case 2:
++ blitRotate2(fb, fbSize_,
++ buf, QSize(my_image->width(), my_image->height()),
++ rect);
++ break;
++ case 3:
++ blitRotate3(fb, fbSize_,
++ buf, QSize(my_image->width(), my_image->height()),
++ rect);
+ break;
+ }
+- }
+- my_painter->drawImage(rect.topLeft(), *my_image, rect);
++ } else {
++#endif // __i386__
++ QDirectPainter pp(this);
++ pp.drawImage(rect.topLeft(), *my_image, rect);
++// pp.end();
++#ifndef __i386__
++ }
++#endif // __i386__
+ }
+
+ // This paints the current buffer to the screen, when desired.
+ void SDL_QWin::paintEvent(QPaintEvent *ev) {
+- if(my_image) {
++ if(my_image && isVisible() && isActiveWindow()) {
++ // TODO: better handling
+ lockScreen(true);
+ repaintRect(ev->rect());
+ unlockScreen();
+ }
+ }
+
++int SDL_QWin::ApplyKeyRotation(int key)
++{
++ int c;
++ int sdlScancode[] = { SDLK_LEFT, SDLK_DOWN, SDLK_RIGHT, SDLK_UP };
++
++ switch (key) {
++ case Qt::Key_Left:
++ c = 0;
++ break;
++ case Qt::Key_Down:
++ c = 1;
++ break;
++ case Qt::Key_Right:
++ c = 2;
++ break;
++ case Qt::Key_Up:
++ c = 3;
++ break;
++ default:
++ return 0;
++ }
++
++// c = (c + qteKeyRotation_) & 3;
++// return sdlScancode[(c - keyRotation_) & 3];
++ return sdlScancode[(c + qteKeyRotation_ - keyRotation_) & 3];
++}
++
+ /* Function to translate a keyboard transition and queue the key event
+ * This should probably be a table although this method isn't exactly
+ * slow.
+ */
+ void SDL_QWin::QueueKey(QKeyEvent *e, int pressed)
+-{
++{
++ if (e->isAutoRepeat())
++ return;
++
+ SDL_keysym keysym;
+ int scancode = e->key();
++
+ /* Set the keysym information */
+ if(scancode >= 'A' && scancode <= 'Z') {
+ // Qt sends uppercase, SDL wants lowercase
+@@ -396,26 +516,12 @@
+ case Qt::Key_Home: scancode = SDLK_HOME; break;
+ case Qt::Key_End: scancode = SDLK_END; break;
+ // We want the control keys to rotate with the screen
+- case Qt::Key_Left:
+- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_UP;
+- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_DOWN;
+- else scancode = SDLK_LEFT;
+- break;
+- case Qt::Key_Up:
+- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_RIGHT;
+- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_LEFT;
+- else scancode = SDLK_UP;
+- break;
+- case Qt::Key_Right:
+- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_DOWN;
+- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_UP;
+- else scancode = SDLK_RIGHT;
+- break;
++ case Qt::Key_Left:
++ case Qt::Key_Up:
++ case Qt::Key_Right:
+ case Qt::Key_Down:
+- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_LEFT;
+- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_RIGHT;
+- else scancode = SDLK_DOWN;
+- break;
++ scancode = ApplyKeyRotation(scancode);
++ break;
+ case Qt::Key_Prior: scancode = SDLK_PAGEUP; break;
+ case Qt::Key_Next: scancode = SDLK_PAGEDOWN; break;
+ case Qt::Key_Shift: scancode = SDLK_LSHIFT; break;
+@@ -434,9 +540,18 @@
+ case Qt::Key_F7: scancode = SDLK_F7; break;
+ case Qt::Key_F8: scancode = SDLK_F8; break;
+ case Qt::Key_F9: scancode = SDLK_F9; break;
+- case Qt::Key_F10: scancode = SDLK_F10; break;
+- case Qt::Key_F11: scancode = SDLK_F11; break;
+- case Qt::Key_F12: scancode = SDLK_F12; break;
++ case Qt::Key_F10:
++ scancode = SDLK_F10;
++ mouse_button_mode=1;
++ break;
++ case Qt::Key_F11:
++ scancode = SDLK_F11;
++ mouse_button_mode=3;
++ break;
++ case Qt::Key_F12:
++ scancode = SDLK_F12;
++ mouse_button_mode=2;
++ break;
+ case Qt::Key_F13: scancode = SDLK_F13; break;
+ case Qt::Key_F14: scancode = SDLK_F14; break;
+ case Qt::Key_F15: scancode = SDLK_F15; break;
+@@ -452,13 +567,14 @@
+ // david@hedbor.org
+ scancode = SDLK_RETURN;
+ break;
++
+ default:
+ scancode = SDLK_UNKNOWN;
+ break;
+ }
+- keysym.sym = static_cast<SDLKey>(scancode);
++ keysym.sym = static_cast<SDLKey>(scancode);
+ } else {
+- keysym.sym = static_cast<SDLKey>(scancode);
++ keysym.sym = static_cast<SDLKey>(scancode);
+ }
+ keysym.scancode = scancode;
+ keysym.mod = KMOD_NONE;
+@@ -478,11 +594,82 @@
+ // pressed = 1;
+ // }
+
++ if (isSLA300InputFix_ &&
++ (keysym.sym == SDLK_SPACE || (keysym.sym >= 273 && keysym.sym <= 276))) {
++ if (keysym.sym >= 273) curAxis_[keysym.sym-273] = pressed;
++ else curAxis_[4] = pressed;
++ }
++
+ /* Queue the key event */
+ if ( pressed ) {
+- SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
++ /* fprintf(stderr, "press %d\n", keysym.sym); */
++ SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
++ if (isSLA300InputFix_ &&
++ (keysym.sym >= 273 && keysym.sym <= 276)) {
++ if (keysym.sym == SDLK_UP) {
++ if (curAxis_[1]) {
++ keysym.sym = SDLK_DOWN;
++ keysym.scancode = Qt::Key_Down;
++ curAxis_[1] = 0;
++ /* fprintf(stderr, "force release %d\n", keysym.sym); */
++ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++ }
++ }
++ else if (keysym.sym == SDLK_DOWN) {
++ if (curAxis_[0]) {
++ keysym.sym = SDLK_UP;
++ keysym.scancode = Qt::Key_Up;
++ curAxis_[0] = 0;
++ /* fprintf(stderr, "force release %d\n", keysym.sym); */
++ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++ }
++ }
++ else if (keysym.sym == SDLK_RIGHT) {
++ if (curAxis_[3]) {
++ keysym.sym = SDLK_LEFT;
++ keysym.scancode = Qt::Key_Left;
++ curAxis_[3] = 0;
++ /* fprintf(stderr, "force release %d\n", keysym.sym); */
++ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++ }
++ }
++ else if (keysym.sym == SDLK_LEFT) {
++ if (curAxis_[2]) {
++ keysym.sym = SDLK_RIGHT;
++ keysym.scancode = Qt::Key_Right;
++ curAxis_[2] = 0;
++ /* fprintf(stderr, "force release %d\n", keysym.sym); */
++ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++ }
++ }
++ }
+ } else {
+- SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++ /* fprintf(stderr, "release %d\n", keysym.sym); */
++ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++
++ if (isSLA300InputFix_ &&
++ (keysym.sym == SDLK_SPACE ||
++ (keysym.sym >= 273 && keysym.sym <= 276))) {
++ for (int i = 0; i < 4; i++) {
++ if (curAxis_[i]) {
++ int sym = i+273;
++ keysym.sym = static_cast<SDLKey>(sym);
++ if (sym == SDLK_UP) keysym.scancode = Qt::Key_Up;
++ else if (sym == SDLK_RIGHT) keysym.scancode = Qt::Key_Right;
++ else if (sym == SDLK_DOWN) keysym.scancode = Qt::Key_Down;
++ else if (sym == SDLK_LEFT) keysym.scancode = Qt::Key_Left;
++ curAxis_[i] = 0;
++ /* fprintf(stderr, "force release %d\n", keysym.sym); */
++ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++ }
++ }
++ if (curAxis_[4]) {
++ keysym.scancode = keysym.sym = SDLK_SPACE;
++ curAxis_[4] = 0;
++ /* fprintf(stderr, "force release %d\n", keysym.sym); */
++ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++ }
++ }
+ }
+ }
+
+@@ -524,7 +711,7 @@
+ my_locked--; // decrease lock refcount;
+ }
+ if(!my_locked && my_painter) {
+- my_painter->end();
++// my_painter->end();
+ delete my_painter;
+ my_painter = 0;
+ }
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_QWin.h SDL-1.2.9/src/video/qtopia/SDL_QWin.h
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_QWin.h 2004-01-04 17:49:26.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_QWin.h 2007-03-12 20:54:14.000000000 +0100
+@@ -1,3 +1,4 @@
++
+ /*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2004 Sam Lantinga
+@@ -52,6 +53,7 @@
+ class SDL_QWin : public QWidget
+ {
+ void QueueKey(QKeyEvent *e, int pressed);
++ int ApplyKeyRotation(int key);
+ public:
+ SDL_QWin(const QSize& size);
+ virtual ~SDL_QWin();
+@@ -71,7 +73,7 @@
+ y = my_offset.y();
+ }
+ QImage *image(void) { return my_image; }
+-
++
+ void setWFlags(WFlags flags) {
+ QWidget::setWFlags(flags);
+ my_flags = flags;
+@@ -83,6 +85,15 @@
+ bool lockScreen(bool force=false);
+ void unlockScreen();
+ void repaintRect(const QRect& rect);
++ void setScreenRotation(int sdlr, int qter) {
++ rotation_ = sdlr; qteRotation_ = qter;
++ }
++ void setKeyRotation(int sdlr, int qter) {
++ keyRotation_ = sdlr; qteKeyRotation_ = qter;
++ }
++ void setFBSize(QSize& s) { fbSize_ = s; }
++// void setSLC700InputFix(bool isEnable) { isSLC700InputFix_ = isEnable; }
++ void setSLA300InputFix(bool isEnable) { isSLA300InputFix_ = isEnable; }
+ protected:
+ /* Handle resizing of the window */
+ virtual void resizeEvent(QResizeEvent *e);
+@@ -95,10 +106,8 @@
+ void paintEvent(QPaintEvent *ev);
+ void keyPressEvent(QKeyEvent *e) { QueueKey(e, 1); }
+ void keyReleaseEvent(QKeyEvent *e) { QueueKey(e, 0); }
++
+ private:
+- bool repaintRotation0(const QRect& rect);
+- bool repaintRotation1(const QRect& rect);
+- bool repaintRotation3(const QRect& rect);
+ void enableFullscreen();
+ QDirectPainter *my_painter;
+ QImage *my_image;
+@@ -108,6 +117,12 @@
+ WFlags my_flags;
+ WFlags my_has_fullscreen;
+ unsigned int my_locked;
++ int rotation_, qteRotation_;
++ int keyRotation_, qteKeyRotation_;
++ QSize fbSize_;
++// bool isSLC700InputFix_;
++ bool isSLA300InputFix_;
++ int curAxis_[5]; // 0: up, 1: down, 2: right, 3: left, 4: center
+ };
+
+ #endif /* _SDL_QWin_h */
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_sysmouse.cc SDL-1.2.9/src/video/qtopia/SDL_sysmouse.cc
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_sysmouse.cc 2004-01-04 17:49:26.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_sysmouse.cc 2007-03-12 20:54:14.000000000 +0100
+@@ -60,6 +60,7 @@
+ void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+ {
+ SDL_Win->setMousePos(QPoint(x, y));
++ SDL_PrivateMouseMotion( 0, 0, x, y );
+ }
+
+ }; /* Extern C */
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_sysvideo.cc SDL-1.2.9/src/video/qtopia/SDL_sysvideo.cc
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_sysvideo.cc 2004-01-04 17:49:26.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_sysvideo.cc 2007-03-12 20:54:14.000000000 +0100
+@@ -1,3 +1,4 @@
++
+ /*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2004 Sam Lantinga
+@@ -29,17 +30,32 @@
+
+ #include <stdlib.h>
+ #include <string.h>
++#include <stdarg.h>
++#include <fcntl.h>
++#include <sys/ioctl.h>
+
+ #include <stdio.h>
+ #include <unistd.h>
++#include <sys/types.h>
++#include <sys/wait.h>
++#include <linux/fb.h>
++#include <sys/mman.h>
++#include <asm/page.h>
+
+ #include <qapplication.h>
+ #include <qpe/qpeapplication.h>
++#include <qpe/qcopenvelope_qws.h>
++#include <qgfx_qws.h>
++#include <qwindowsystem_qws.h>
++#include <qwidget.h>
++#include <qwidgetlist.h>
++#include <qdirectpainter_qws.h>
+
+ #include "SDL.h"
+ #include "SDL_timer.h"
+
+ #include "SDL_QWin.h"
++#include "SDL_sysvideo.h"
+
+ extern "C" {
+
+@@ -51,14 +67,67 @@
+ #include "SDL_lowvideo.h"
+
+ //#define QTOPIA_DEBUG
++#define QTOPIA_LOG
+ #define QT_HIDDEN_SIZE 32 /* starting hidden window size */
+
++#ifdef QTOPIA_LOG
++ static FILE *st_logfp = NULL;
++#endif
++ static inline void LOG(char *fmt, ...)
++ {
++#ifdef QTOPIA_LOG
++ va_list ap;
++
++ va_start(ap, fmt);
++ vfprintf(st_logfp, fmt, ap);
++ if (st_logfp != stderr) {
++ fflush(st_logfp);
++ vfprintf(stderr, fmt, ap);
++ }
++ va_end(ap);
++#endif
++ }
++
++ typedef struct machine_spec {
++ const char *manif;
++ const char *name;
++ int qpe_server_rotation;
++ int init_screen_rot;
++ int init_key_rot;
++ } machine_spec_t;
++
++ typedef enum {
++ MACHINE_SHARP_SL5000D,
++ MACHINE_SHARP_SL5500,
++ MACHINE_SHARP_SLA300,
++ MACHINE_SHARP_SLB500,
++ MACHINE_SHARP_SLC700,
++ MACHINE_SHARP_SLC750,
++ MACHINE_SHARP_SLC760,
++ MACHINE_SHARP_SLC860,
++ MACHINE_SHARP_SL6000,
++ MACHINE_MAX
++ } machine_t;
++
++ static const machine_spec_t st_machine_spec[] = {
++ { "Sharp", "SL-5000D", 0 },
++ { "Sharp", "SL-5500", 0 },
++ { "Sharp", "SL-A300", 0 },
++ { "Sharp", "SL-B500", 0 },
++ { "Sharp", "SL-C700", 0 },
++ { "Sharp", "SL-C750", 0 },
++ { "Sharp", "SL-C760", 0 },
++ { "Sharp", "SL-C860", 0 },
++ { "Sharp", "SL-6000", 0 },
++ };
++
+ /* Name of the environment variable used to invert the screen rotation or not:
+ Possible values:
+- !=0 : Screen is 270 rotated
+- 0: Screen is 90 rotated*/
+-#define SDL_QT_ROTATION_ENV_NAME "SDL_QT_INVERT_ROTATION"
+-
++ !=0 : Screen is 270- rotated
++ 0: Screen is 90- rotated*/
++#define SDL_QT_ROTATION_ENV_NAME "SDL_QT_ROTATION"
++#define SDL_QT_INVERT_ROTATION_ENV_NAME "SDL_QT_INVERT_ROTATION"
++
+ /* Initialization/Query functions */
+ static int QT_VideoInit(_THIS, SDL_PixelFormat *vformat);
+ static SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+@@ -78,6 +147,20 @@
+ static int QT_IconifyWindow(_THIS);
+ static SDL_GrabMode QT_GrabInput(_THIS, SDL_GrabMode mode);
+
++ static int console_fd;
++ struct fb_var_screeninfo saved_vinfo;
++ int fb_hwrot;
++ int fb_direct;
++ static int isKHloaded;
++ bool is_VGA_machine;
++
++#define W100FB_CONFIG 0x57415200 /* WAL\00 */
++#define W100INIT_ITEM 0
++#define W100INIT_ALL 1
++#define W100INIT_ITEM_WITH_VAL 2
++#define W100FB_CONFIG_EX 0x57415202 /* WAL\02 */
++
++
+ /* FB driver bootstrap functions */
+
+ static int QT_Available(void)
+@@ -222,13 +305,34 @@
+
+ int QT_VideoInit(_THIS, SDL_PixelFormat *vformat)
+ {
+- /* Initialize the QPE Application */
++ const char *SDL_fbdev;
++ struct fb_var_screeninfo vinfo;
++
++ /* Initialize the QPE Application */
+ /* Determine the screen depth */
+ vformat->BitsPerPixel = QPixmap::defaultDepth();
+
+ // For now we hardcode the current depth because anything else
+ // might as well be emulated by SDL rather than by Qtopia.
+-
++
++ //frame buffer device open.
++ SDL_fbdev = getenv("SDL_FBDEV");
++ if ( SDL_fbdev == NULL ) {
++ SDL_fbdev = "/dev/fb0";
++ }
++ console_fd = open(SDL_fbdev, O_RDWR, 0);
++ if ( console_fd < 0 ) {
++ SDL_SetError("Unable to open %s", SDL_fbdev);
++ return(-1);
++ }
++
++ if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
++ SDL_SetError("Couldn't get console pixel format");
++ QT_VideoQuit(_this);
++ return(-1);
++ }
++ saved_vinfo = vinfo;
++
+ QSize desktop_size = qApp->desktop()->size();
+ QT_AddMode(_this, ((vformat->BitsPerPixel+7)/8)-1,
+ desktop_size.width(), desktop_size.height());
+@@ -241,7 +345,24 @@
+ /* Fill in some window manager capabilities */
+ _this->info.wm_available = 0;
+
+- /* We're done! */
++#ifdef QTOPIA_LOG
++ st_logfp = fopen("/tmp/sdl-qt-debug", "w");
++ if (!st_logfp)
++ st_logfp = stderr;
++#endif
++
++ QT_GrabInput(_this, SDL_GRAB_ON);
++/*
++ {
++ QCopEnvelope e("QPE/KeyHelper", "repeater(int)");
++ e << 2;
++ }
++*/
++ isKHloaded=(fopen("/home/zaurus/Settings/keyhelper_SDL.xml","r") != NULL) ? 1 : 0;
++ if (isKHloaded) {
++ system("qcop QPE/KeyHelper \"reload(QString)\" keyhelper_SDL.xml"); //QcopEnvelope can't use.
++ LOG("keyhelper_SDL.xml loaded\n");
++ }
+ return(0);
+ }
+
+@@ -264,6 +385,7 @@
+
+ /* Various screen update functions available */
+ static void QT_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
++ static void QT_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+
+ static int QT_SetFullScreen(_THIS, SDL_Surface *screen, int fullscreen)
+@@ -276,47 +398,428 @@
+ return -1;
+ }
+
++ static machine_t QT_GetMachine(_THIS)
++ {
++ FILE *fp;
++ machine_t machine = MACHINE_SHARP_SL5000D;
++ char buf[1024];
++
++
++ fp = fopen("/proc/cpuinfo", "rb");
++ if (fp) {
++ if (fread(buf, 1, sizeof(buf), fp) > 0) {
++ LOG("QT_GetMachine: /proc/cpuinfo is %s\n", buf);
++ if (strstr(buf, "SHARP Tosa") != NULL)
++ machine = MACHINE_SHARP_SL6000;
++ else if (strstr(buf, "Collie") != NULL)
++ machine = MACHINE_SHARP_SL5500;
++ else if (strstr(buf, "SHARP Poodle") != NULL)
++ machine = MACHINE_SHARP_SLB500;
++ else if (strstr(buf, "SHARP Corgi") !=NULL)
++ machine = MACHINE_SHARP_SLC700;
++ else if (strstr(buf, "SHARP Shepherd") !=NULL)
++ machine = MACHINE_SHARP_SLC750;
++ else if (strstr(buf, "SHARP Husky") !=NULL)
++ machine = MACHINE_SHARP_SLC760;
++ else if (strstr(buf, "SHARP Boxer") != NULL)
++ machine = MACHINE_SHARP_SLC860;
++ }
++ fclose(fp);
++ } else {
++ LOG("QT_GetMachine: Couldn't read /proc/deviceinfo/product.\n");
++ LOG(" Now set machine variable to default (SL-5000D)\n");
++ }
++
++ LOG(" detected machine is '%s %s'\n",
++ st_machine_spec[machine].manif, st_machine_spec[machine].name);
++ return machine;
++ }
++
++ static void QT_GetQteServerSpec(_THIS, int *rotation, bool *isQvga)
++ {
++ const char *user;
++ char buf[FILENAME_MAX];
++ FILE *fp;
++ int rot = 0, is_qvga = 0;
++
++ user = getenv("USER");
++ snprintf(buf, sizeof(buf), "/tmp/qtembedded-%s/QtEmbedded-0.spec",
++ user ? user : "root");
++ LOG("QT_GetRotation: Read spec from '%s'\n", buf);
++
++ fp = fopen(buf, "rb");
++ if (fp) {
++ int size;
++ if ((size = fread(buf, 1, sizeof(buf) - 1, fp)) > 0) {
++ buf[size] = '\0';
++ LOG(" spec is '%s'\n", buf);
++ // get rotation value
++ if (strstr(buf, "Rot")) {
++ rot = atoi(strstr(buf, "Rot") + 3);
++ rot /= 90;
++ if (rot < 0 || rot > 3) {
++ rot = 0;
++ }
++ } else
++ rot = 0;
++
++ // get qvga mode in SL-C700
++ if (strstr(buf, "Qvga"))
++ is_qvga = 1;
++ }
++ fclose(fp);
++ }
++
++ LOG(" Rot=%d, Qvga=%d\n", rot, is_qvga);
++
++ if (rotation)
++ *rotation = rot;
++ if (isQvga)
++ *isQvga = is_qvga;
++ }
++
+ /* FIXME: check return values and cleanup here */
+ SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+ {
+-
+ QImage *qimage;
+- QSize desktop_size = qApp->desktop()->size();
++ QSize qteSize = qApp->desktop()->size();
++ QSize fbSize;
++ QSize userSize;
++ int fb_xres;
++ int fb_yres;
++ struct fb_var_screeninfo vinfo;
++ struct fb_fix_screeninfo finfo;
++ int tmp_ioctl_data;
++ char fb_size_fix = ' ';
++ bool isW100patch_kernel = false;
++ int numFb_Size;
++
++ int mapped_memlen;
++ int mapped_offset;
++ void *mapped_mem;
++ int fb_offset;
++
++
++ machine_t machine = QT_GetMachine(_this);
++ machine_spec_t machineSpec = st_machine_spec[machine];
++ int qteRotation, userRotation, sdlRotation;
++ int qteKeyRotation, sdlKeyRotation;
++ bool isQteQvga;
++
++ if (machine == MACHINE_SHARP_SLC700 ||
++ machine == MACHINE_SHARP_SLC750 ||
++ machine == MACHINE_SHARP_SLC760 ||
++ machine == MACHINE_SHARP_SLC860 || // 詳しいことわからんけどとりあえず
++ machine == MACHINE_SHARP_SL6000 ) { // 詳しいことわからんけどとりあえず
++ is_VGA_machine = true;
++ }else {
++ is_VGA_machine = false;
++ }
++
++ // qte での回転角度を取得
++ QT_GetQteServerSpec(_this, &qteRotation, &isQteQvga);
++
++ // SL-C700 のスタイル
++ bool isInputStyle = false;
++ if (is_VGA_machine) {
++ int status = system("/home/QtPalmtop/bin/chkhinge");
++ if (WEXITSTATUS(status) != 2)
++ isInputStyle = true;
++ LOG("QT_SetVideoMode: SL-C700 Style is %s\n",
++ isInputStyle ? "Input style" : "View style");
++ }
+
+
+- current->flags = 0; //SDL_FULLSCREEN; // We always run fullscreen.
++ // specity screen setting
++ if (is_VGA_machine) {
++
++ // w100 rotation pached kernel check
++ isW100patch_kernel = (fopen("/proc/driver/w100/rotation","r") != NULL) ? true : false;
++ LOG("Your Kernel is %s\n",isW100patch_kernel ? "Special Kernel" : "Normal Kernel");
++
++ const char *envFb_Size = getenv("SDL_FB_SIZE");
++ if (envFb_Size !=NULL) {
++ numFb_Size=sscanf(envFb_Size,"%dx%d%c",&fb_xres,&fb_yres,&fb_size_fix);
++ } else {
++ numFb_Size=0;
++ }
+
+- if(width <= desktop_size.width()
+- && height <= desktop_size.height()) {
+- current->w = desktop_size.width();
+- current->h = desktop_size.height();
+- } else if(width <= desktop_size.height() && height <= desktop_size.width()) {
+- // Landscape mode
+- char * envString = getenv(SDL_QT_ROTATION_ENV_NAME);
+- int envValue = envString ? atoi(envString) : 0;
+- screenRotation = envValue ? SDL_QT_ROTATION_270 : SDL_QT_ROTATION_90;
+- current->h = desktop_size.width();
+- current->w = desktop_size.height();
++ if (numFb_Size >=2) {
++
++ // specity screen mode
++ if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
++ SDL_SetError("Couldn't get console pixel format");
++ QT_VideoQuit(_this);
++ return(NULL);
++ }
++
++ vinfo.xres = fb_xres;
++ vinfo.xres_virtual = fb_xres;
++ vinfo.yres = fb_yres;
++ vinfo.yres_virtual = fb_yres;
++
++ if (fb_size_fix == '@') {
++ width = fb_xres;
++ height = fb_yres;
++ }
++
++ if ( ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo) < 0 ) {
++ SDL_SetError("Couldn't set console screen info");
++ return(NULL);
++ }
++
++
++ if (isW100patch_kernel) {
++ qteSize.setWidth(vinfo.xres);
++ qteSize.setHeight(vinfo.yres);
++ qteRotation=0;
++ }else if(vinfo.xres == 320){
++ qteSize.setWidth(vinfo.xres);
++ qteSize.setHeight(vinfo.yres);
++ qteRotation=2;
++ }else {
++ qteSize.setWidth(vinfo.yres);
++ qteSize.setHeight(vinfo.xres);
++ qteRotation=3;
++ }
++
++ if (isW100patch_kernel && (vinfo.xres == 320) && (vinfo.yres == 240)) {
++ tmp_ioctl_data=121;
++ ioctl(console_fd, W100FB_CONFIG_EX, &tmp_ioctl_data);
++ fb_hwrot=1;
++ }
++
++ LOG("FBVideoMode: %dx%d%c\n", vinfo.xres, vinfo.yres,fb_size_fix );
++
++ }else {
++
++ // auto screen mode
++ if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
++ SDL_SetError("Couldn't get console pixel format");
++ QT_VideoQuit(_this);
++ return(NULL);
++ }
++
++ if (isW100patch_kernel && (isInputStyle == false) && (vinfo.xres == 240) && (vinfo.yres == 320)) {
++ vinfo.xres = 240;
++ vinfo.xres_virtual = 240;
++ vinfo.yres = 320;
++ vinfo.yres_virtual = 320;
++ qteRotation=0;
++ }else if ((width <= 320) && (height <= 240)) {
++ vinfo.xres = 320;
++ vinfo.xres_virtual = 320;
++ vinfo.yres = 240;
++ vinfo.yres_virtual = 240;
++ }else if (isW100patch_kernel && (isInputStyle == true)){
++ vinfo.xres = 640;
++ vinfo.xres_virtual = 640;
++ vinfo.yres = 480;
++ vinfo.yres_virtual = 480;
++ qteRotation=0;
++ }else {
++ vinfo.xres = 480;
++ vinfo.xres_virtual = 480;
++ vinfo.yres = 640;
++ vinfo.yres_virtual = 640;
++ }
++
++ if ( ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo) < 0 ) {
++ SDL_SetError("Couldn't set console screen info");
++ return(NULL);
++ }
++
++ if (isW100patch_kernel) {
++ qteSize.setWidth(vinfo.xres);
++ qteSize.setHeight(vinfo.yres);
++ qteRotation=0;
++ fb_direct=1;
++ }else if(vinfo.xres == 320){
++ qteSize.setWidth(vinfo.xres);
++ qteSize.setHeight(vinfo.yres);
++ qteRotation=2;
++ }else {
++ qteSize.setWidth(vinfo.yres);
++ qteSize.setHeight(vinfo.xres);
++ qteRotation=3;
++ }
++
++ if (isW100patch_kernel && (vinfo.xres == 320) && (vinfo.yres == 240)) {
++ tmp_ioctl_data=121;
++ ioctl(console_fd, W100FB_CONFIG_EX, &tmp_ioctl_data);
++ fb_hwrot=1;
++ qteRotation=0;
++ }
++
++ LOG("FBVideoMode: %dx%d%c\n", vinfo.xres, vinfo.yres,fb_size_fix );
++ }
++ }
++
++ // direct paint setting
++ const char *envFb_Direct = getenv("SDL_FB_DIRECT");
++ if (envFb_Direct !=NULL)
++ fb_direct = envFb_Direct ? atoi(envFb_Direct) : -1;
++
++ if (fb_direct == 1){
++ if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
++ SDL_SetError("Couldn't get console hardware info");
++ QT_VideoQuit(_this);
++ return(NULL);
++ }
++ if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
++ SDL_SetError("Couldn't get console pixel format");
++ QT_VideoQuit(_this);
++ return(NULL);
++ }
++ LOG("Direct paint mode\n");
++ }
++
++ // hack for SL-5500
++ if (machine == MACHINE_SHARP_SL5500)
++ qteRotation = 3;
++
++ // SL-B500 用ハック(とりあえず、ね)
++ if (machine == MACHINE_SHARP_SLB500)
++ qteRotation = 3;
++
++ // 生フレームバッファのサイズを得る
++ if (qteRotation & 1) {
++ fbSize.setWidth(qteSize.height());
++ fbSize.setHeight(qteSize.width());
++ } else {
++ fbSize = qteSize;
++ }
++
++ //
++ const char *envRotStr = getenv(SDL_QT_ROTATION_ENV_NAME);
++ userRotation = envRotStr ? atoi(envRotStr) : -1;
++ if ((userRotation >= 0 ? userRotation : qteRotation) & 1) {
++ userSize.setWidth(fbSize.height());
++ userSize.setHeight(fbSize.width());
++ } else {
++ userSize = fbSize;
++ }
++
++ if (width <= userSize.width() && height <= userSize.height()) {
++ // 環境変数で回転角度が指定されていれば、それを最優先する
++ if (userRotation >= 0)
++ sdlRotation = userRotation;
++ else {
++ // で、その指定が無いのであれば qte の回転角度に合わせるだけ
++ // なんだけど、SL-C700 ではちょい複雑。
++ if (is_VGA_machine && (fbSize.width() == 320) && (fbSize.height() == 240)) {
++ if (isInputStyle)
++ sdlRotation = 2;
++ else
++ sdlRotation = qteRotation;
++ } else {
++ sdlRotation = qteRotation;
++ }
++ }
++ } else if (width <= fbSize.width() && height <= fbSize.height()) {
++ sdlRotation = 0;
++ if (is_VGA_machine && (fbSize.width() == 320) && (fbSize.height() == 240) && isInputStyle)
++ sdlRotation = 2;
++ } else if (width <= fbSize.height() && height <= fbSize.width()) {
++ sdlRotation = 1;
+ } else {
+ SDL_SetError("Unsupported resolution, %dx%d\n", width, height);
++ return NULL;
+ }
++
++ if (fb_hwrot == 1)
++ sdlRotation = 0;
++
++ if (getenv(SDL_QT_INVERT_ROTATION_ENV_NAME) != NULL) {
++ sdlRotation = (sdlRotation + 2) & 3;
++ }
++
++ LOG("QT_SetVideoMode: argSize=%dx%d\n", width, height);
++ LOG("QT_SetVideoMode: qteSize=%dx%d\n",
++ qteSize.width(), qteSize.height());
++ LOG("QT_SetVideoMode: fbSize=%dx%d\n",
++ fbSize.width(), fbSize.height());
++ LOG("QT_SetVideoMode: qteRotation=%d\n", qteRotation);
++ LOG("QT_SetVideoMode: userRotation=%d\n", userRotation);
++ LOG("QT_SetVideoMode: sdlRotation=%d\n", sdlRotation);
++
++ current->flags = 0;//SDL_FULLSCREEN; // We always run fullscreen.
++ current->w = width;
++ current->h = height;
++ SDL_Win->setScreenRotation(sdlRotation, qteRotation);
++ SDL_Win->setFBSize(fbSize);
++
++ if (machine == MACHINE_SHARP_SLA300)
++ SDL_Win->setSLA300InputFix(true);
++
++ // keyboard rotation
++ qteKeyRotation = qteRotation;
++// fprintf(stderr, "%d\n", (machine == MACHINE_SHARP_SLC700));
++// fprintf(stderr, "%d\n", isQteQvga);
++ if (isQteQvga && is_VGA_machine)
++ qteKeyRotation = 3;
++ else if (machine == MACHINE_SHARP_SLB500)
++ qteKeyRotation = 3;
++
++ if (isQteQvga && fb_hwrot == 1)
++ qteKeyRotation = 1;
++
++ sdlKeyRotation = sdlRotation;
++
++ SDL_Win->setKeyRotation(sdlKeyRotation, qteKeyRotation);
++
++ LOG("QT_SetVideoMode: qteKeyRotation=%d\n", qteKeyRotation);
++ LOG("QT_SetVideoMode: sdlKeyRotation=%d\n", sdlKeyRotation);
++
+ if ( flags & SDL_OPENGL ) {
+ SDL_SetError("OpenGL not supported");
+ return(NULL);
+- }
++ }
+ /* Create the QImage framebuffer */
+- qimage = new QImage(current->w, current->h, bpp);
+- if (qimage->isNull()) {
+- SDL_SetError("Couldn't create screen bitmap");
+- delete qimage;
+- return(NULL);
++
++ // frame buffer memory mapping
++ if (fb_direct == 1) {
++ current->pitch = finfo.line_length;
++ current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
++ mapped_offset = (((long)finfo.smem_start) -
++ (((long)finfo.smem_start)&~(PAGE_SIZE-1)));
++ mapped_memlen = finfo.smem_len+mapped_offset;
++ if(console_fd >0 ) {
++ mapped_mem = mmap(NULL, mapped_memlen,PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
++ fb_offset=(vinfo.xres-width)+(vinfo.yres-height)*vinfo.xres;
++ current->pixels = (void *)((int )mapped_mem+fb_offset);
++ _this->UpdateRects = QT_DirectUpdate;
++ } else {
++ qimage = new QImage(current->w, current->h, bpp);
++ if (qimage->isNull()) {
++ SDL_SetError("Couldn't create screen bitmap");
++ delete qimage;
++ return(NULL);
++ }
++ current->pixels = (void *)qimage->bits();
++ _this->UpdateRects = QT_NormalUpdate;
++ SDL_Win->setImage(qimage);
++// SDL_Win->setFullscreen(true); //comment to non update taskbar
++ }
++ } else {
++ qimage = new QImage(current->w, current->h, bpp);
++ if (qimage->isNull()) {
++ SDL_SetError("Couldn't create screen bitmap");
++ delete qimage;
++ return(NULL);
++ }
++ current->pitch = qimage->bytesPerLine();
++ current->pixels = (void *)qimage->bits();
++ _this->UpdateRects = QT_NormalUpdate;
++ SDL_Win->setImage(qimage);
++// SDL_Win->setFullscreen(true); //comment to non update taskbar
++
+ }
+- current->pitch = qimage->bytesPerLine();
+- current->pixels = (void *)qimage->bits();
+- SDL_Win->setImage(qimage);
+- _this->UpdateRects = QT_NormalUpdate;
+- SDL_Win->setFullscreen(true);
++
++
++ // fprintf(stderr,"QT_SetVideoMode() qImage:%dx%d %d\n",
++ // qimage->width(), qimage->height(), qimage->bytesPerLine());
+ /* We're done */
+ return(current);
+ }
+@@ -361,13 +864,19 @@
+ {
+ if(SDL_Win->lockScreen()) {
+ for(int i=0; i<numrects; ++i ) {
+- QRect rect(rects[i].x, rects[i].y,
+- rects[i].w, rects[i].h);
+- SDL_Win->repaintRect(rect);
++ QRect rect(rects[i].x, rects[i].y,
++ rects[i].w, rects[i].h);
++ SDL_Win->repaintRect(rect);
+ }
+ SDL_Win->unlockScreen();
+ }
+ }
++
++ static void QT_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
++ {
++
++ }
++
+ /* Is the system palette settable? */
+ int QT_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+ {
+@@ -383,10 +892,36 @@
+ // -- David Hedbor
+ // delete SDL_Win;
+ // SDL_Win = 0;
++
++ if ( console_fd > 0 ) {
++ /* Restore the original video mode and palette */
++ if (fb_hwrot == 1) {
++ int tmp_ioctl_data=120;
++ ioctl(console_fd, W100FB_CONFIG_EX, &tmp_ioctl_data);
++ }
++
++ ioctl(console_fd, FBIOPUT_VSCREENINFO, &saved_vinfo);
++
++ /* We're all done with the framebuffer */
++ close(console_fd);
++ console_fd = -1;
++ }
++
+ _this->screen->pixels = NULL;
+ QT_GrabInput(_this, SDL_GRAB_OFF);
++/*
++ {
++ QCopEnvelope e("QPE/KeyHelper", "repeater(int)");
++ e << 1;
++ }
++*/
++ if (isKHloaded)
++ system("qcop QPE/KeyHelper \"reload()\""); //QcopEnvelope can't use.
++
+ }
+
++
++
+ static int QT_IconifyWindow(_THIS) {
+ SDL_Win->hide();
+
diff --git a/recipes/libsdl/libsdl-qpe-1.2.9/fix_Makefile.am.patch b/recipes/libsdl/libsdl-qpe-1.2.9/fix_Makefile.am.patch
new file mode 100644
index 0000000000..7ad33fb6a5
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe-1.2.9/fix_Makefile.am.patch
@@ -0,0 +1,11 @@
+--- SDL-1.2.9.vanilla/Makefile.am 2009-02-24 19:53:25.000000000 +0100
++++ SDL-1.2.9/Makefile.am 2009-02-24 19:54:14.000000000 +0100
+@@ -85,7 +85,7 @@
+ cd src && $(MAKE) install-libLTLIBRARIES
+
+ # Run ldconfig after installing the library:
+-install-hook:
++install-exec-hook:
+ -ldconfig
+
+ # Grab the test programs for the distribution:
diff --git a/recipes/libsdl/libsdl-qpe-1.2.9/fix_configure.in.patch b/recipes/libsdl/libsdl-qpe-1.2.9/fix_configure.in.patch
new file mode 100644
index 0000000000..19e1afd6ee
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe-1.2.9/fix_configure.in.patch
@@ -0,0 +1,10 @@
+--- SDL-1.2.9.vanilla/configure.in 2009-02-24 19:53:25.000000000 +0100
++++ SDL-1.2.9/configure.in 2009-02-24 20:08:10.000000000 +0100
+@@ -1,6 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+ AC_INIT(README)
+
++AM_PROG_AS
+ dnl Set various version strings - taken gratefully from the GTk sources
+ #
+ # Making releases:
diff --git a/recipes/libsdl/libsdl-qpe-1.2.9/ipaq-1.2.9.patch b/recipes/libsdl/libsdl-qpe-1.2.9/ipaq-1.2.9.patch
new file mode 100644
index 0000000000..0ad182bae6
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe-1.2.9/ipaq-1.2.9.patch
@@ -0,0 +1,140 @@
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/Makefile.am SDL-1.2.9/src/video/qtopia/Makefile.am
+--- SDL-1.2.9-orig/src/video/qtopia/Makefile.am 2007-03-12 20:57:23.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/Makefile.am 2007-03-12 20:58:02.000000000 +0100
+@@ -22,4 +22,4 @@
+ # overwrite USER variables
+ CXXLD = $(CC)
+ CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
+- $(AM_LDFLAGS) $(LDFLAGS) -o $@
++ $(AM_LDFLAGS) $(LDFLAGS) -lopiecore2 -o $@
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_QWin.cc SDL-1.2.9/src/video/qtopia/SDL_QWin.cc
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_QWin.cc 2007-03-12 20:57:00.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_QWin.cc 2007-03-12 20:58:02.000000000 +0100
+@@ -29,8 +29,11 @@
+ #include "SDL_QWin.h"
+ #include <qapplication.h>
+ #include <qpe/qpeapplication.h>
++#include <opie2/odevice.h>
+ #include <qdirectpainter_qws.h>
+
++using namespace Opie::Core;
++
+ extern int fb_hwrot;
+ extern int fb_direct;
+ extern bool is_VGA_machine;
+@@ -545,18 +548,32 @@
+ case Qt::Key_F7: scancode = SDLK_F7; break;
+ case Qt::Key_F8: scancode = SDLK_F8; break;
+ case Qt::Key_F9:
+- scancode = SDLK_F9;
+- mouse_button_mode=1;
++ if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) {
++ scancode = SDLK_y; }
++ else {
++ scancode = SDLK_F9;
++ mouse_button_mode=1; }
+ break;
+ case Qt::Key_F10:
+- scancode = SDLK_F10;
+- mouse_button_mode=2;
++ if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) {
++ scancode = SDLK_LALT; }
++ else {
++ scancode = SDLK_F10;
++ mouse_button_mode=2; }
+ break;
+ case Qt::Key_F11: scancode = SDLK_F11; break;
+- case Qt::Key_F12: scancode = SDLK_F12; break;
++ case Qt::Key_F12:
++ if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) {
++ scancode = SDLK_RETURN; }
++ else {
++ scancode = SDLK_F12; }
++ break;
+ case Qt::Key_F13:
+- scancode = SDLK_F13;
+- mouse_button_mode=3;
++ if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) {
++ scancode = SDLK_ESCAPE; }
++ else {
++ scancode = SDLK_F13;
++ mouse_button_mode=3; }
+ break;
+ case Qt::Key_F14: scancode = SDLK_F14; break;
+ case Qt::Key_F15: scancode = SDLK_F15; break;
+@@ -573,6 +590,9 @@
+ scancode = SDLK_RETURN;
+ break;
+
++ // To use record button on ipaq
++ case Qt::Key_F24: scancode = SDLK_LSHIFT; break;
++
+ default:
+ scancode = SDLK_UNKNOWN;
+ break;
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_sysvideo.cc SDL-1.2.9/src/video/qtopia/SDL_sysvideo.cc
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_sysvideo.cc 2007-03-12 20:55:07.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_sysvideo.cc 2007-03-12 20:58:02.000000000 +0100
+@@ -45,6 +45,7 @@
+ #include <qapplication.h>
+ #include <qpe/qpeapplication.h>
+ #include <qpe/qcopenvelope_qws.h>
++#include <opie2/odevice.h>
+ #include <qgfx_qws.h>
+ #include <qwindowsystem_qws.h>
+ #include <qwidget.h>
+@@ -66,6 +67,8 @@
+ #include "SDL_syswm_c.h"
+ #include "SDL_lowvideo.h"
+
++using namespace Opie::Core;
++
+ //#define QTOPIA_DEBUG
+ #define QTOPIA_LOG
+ #define QT_HIDDEN_SIZE 32 /* starting hidden window size */
+@@ -106,6 +109,7 @@
+ MACHINE_SHARP_SLC760,
+ MACHINE_SHARP_SLC860,
+ MACHINE_SHARP_SL6000,
++ MACHINE_IPAQ,
+ MACHINE_MAX
+ } machine_t;
+
+@@ -119,6 +123,7 @@
+ { "Sharp", "SL-C760", 0 },
+ { "Sharp", "SL-C860", 0 },
+ { "Sharp", "SL-6000", 0 },
++ { "HP", "HP IPAQ", 0 },
+ };
+
+ /* Name of the environment variable used to invert the screen rotation or not:
+@@ -423,6 +428,13 @@
+ machine = MACHINE_SHARP_SLC760;
+ else if (strstr(buf, "SHARP Boxer") != NULL)
+ machine = MACHINE_SHARP_SLC860;
++ else if ( ODevice::inst ( )-> series ( ) == Model_iPAQ )
++ machine = MACHINE_IPAQ;
++ else
++ {
++ machine = MACHINE_SHARP_SL5000D;
++ LOG("Can't detect machine defaulting to SL5000D");
++ }
+ }
+ fclose(fp);
+ } else {
+@@ -679,6 +691,15 @@
+ if (machine == MACHINE_SHARP_SL5500)
+ qteRotation = 3;
+
++ // HP IPaq
++ if ( ODevice::inst( )-> series ( ) == Model_iPAQ ) {
++ qteRotation = 3;
++ }
++ if ( ODevice::inst ( )-> model ( ) == Model_iPAQ_H38xx ) {
++ qteRotation = 1;
++ }
++
++
+ // SL-B500 用ハック(とりあえず、ね)
+ if (machine == MACHINE_SHARP_SLB500)
+ qteRotation = 3;
diff --git a/recipes/libsdl/libsdl-qpe-1.2.9/mouse-1.2.9.patch b/recipes/libsdl/libsdl-qpe-1.2.9/mouse-1.2.9.patch
new file mode 100644
index 0000000000..7f88956d94
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe-1.2.9/mouse-1.2.9.patch
@@ -0,0 +1,48 @@
+diff -Naur SDL-1.2.9-orig/src/video/qtopia/SDL_QWin.cc SDL-1.2.9/src/video/qtopia/SDL_QWin.cc
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_QWin.cc 2007-03-12 20:55:07.000000000 +0100
++++ SDL-1.2.9/src/video/qtopia/SDL_QWin.cc 2007-03-12 20:56:36.000000000 +0100
+@@ -169,7 +169,12 @@
+ Qt::ButtonState button = e->button();
+ int sdlstate = 0;
+ if( (button & Qt::LeftButton)) {
+- sdlstate |= SDL_BUTTON_LMASK;
++ if (mouse_button_mode == 3)
++ sdlstate |= SDL_BUTTON_RMASK;
++ else if (mouse_button_mode == 2)
++ sdlstate |= SDL_BUTTON_MMASK;
++ else
++ sdlstate |= SDL_BUTTON_LMASK;
+ }
+ if( (button & Qt::RightButton)) {
+ sdlstate |= SDL_BUTTON_RMASK;
+@@ -539,20 +544,20 @@
+ case Qt::Key_F6: scancode = SDLK_F6; break;
+ case Qt::Key_F7: scancode = SDLK_F7; break;
+ case Qt::Key_F8: scancode = SDLK_F8; break;
+- case Qt::Key_F9: scancode = SDLK_F9; break;
+- case Qt::Key_F10:
+- scancode = SDLK_F10;
++ case Qt::Key_F9:
++ scancode = SDLK_F9;
+ mouse_button_mode=1;
+ break;
+- case Qt::Key_F11:
+- scancode = SDLK_F11;
+- mouse_button_mode=3;
+- break;
+- case Qt::Key_F12:
+- scancode = SDLK_F12;
++ case Qt::Key_F10:
++ scancode = SDLK_F10;
+ mouse_button_mode=2;
+ break;
+- case Qt::Key_F13: scancode = SDLK_F13; break;
++ case Qt::Key_F11: scancode = SDLK_F11; break;
++ case Qt::Key_F12: scancode = SDLK_F12; break;
++ case Qt::Key_F13:
++ scancode = SDLK_F13;
++ mouse_button_mode=3;
++ break;
+ case Qt::Key_F14: scancode = SDLK_F14; break;
+ case Qt::Key_F15: scancode = SDLK_F15; break;
+ case Qt::Key_Super_L: scancode = SDLK_LSUPER; break;
diff --git a/recipes/libsdl/libsdl-qpe-1.2.9/no-PAGE_SIZE.patch b/recipes/libsdl/libsdl-qpe-1.2.9/no-PAGE_SIZE.patch
new file mode 100644
index 0000000000..856aaf2472
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe-1.2.9/no-PAGE_SIZE.patch
@@ -0,0 +1,11 @@
+--- SDL-1.2.9-orig/src/video/qtopia/SDL_sysvideo.cc.org 2007-05-25 07:07:32.000000000 +0000
++++ SDL-1.2.9-orig/src/video/qtopia/SDL_sysvideo.cc 2007-05-25 07:24:48.000000000 +0000
+@@ -809,7 +809,7 @@
+ current->pitch = finfo.line_length;
+ current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
+ mapped_offset = (((long)finfo.smem_start) -
+- (((long)finfo.smem_start)&~(PAGE_SIZE-1)));
++ (((long)finfo.smem_start)&~(getpagesize()-1)));
+ mapped_memlen = finfo.smem_len+mapped_offset;
+ if(console_fd >0 ) {
+ mapped_mem = mmap(NULL, mapped_memlen,PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
diff --git a/recipes/libsdl/libsdl-qpe_1.2.9.bb b/recipes/libsdl/libsdl-qpe_1.2.9.bb
new file mode 100644
index 0000000000..711a05d656
--- /dev/null
+++ b/recipes/libsdl/libsdl-qpe_1.2.9.bb
@@ -0,0 +1,36 @@
+require libsdl.inc
+
+PR="r1"
+
+SECTION = "opie/libs"
+DEPENDS = "virtual/libqpe1 libopie2"
+
+SRC_URI += "\
+ file://agawa-piro-mickey-1.2.9.patch;patch=1 \
+ file://pygame-1.2.9.patch;patch=1 \
+ file://mouse-1.2.9.patch;patch=1 \
+ file://kill-stdc++-1.2.9.patch;patch=1 \
+ file://ipaq-1.2.9.patch;patch=1 \
+ file://SDL-Akita-1.2.9.patch;patch=1 \
+ file://fixlibs-1.2.9.patch;patch=1 \
+ file://explicit-extern-C.patch;patch=1 \
+ file://no-PAGE_SIZE.patch;patch=1 \
+ file://fix_Makefile.am.patch;patch=1 \
+ file://fix_configure.in.patch;patch=1 \
+"
+
+EXTRA_OECONF = "--disable-static --disable-debug --enable-cdrom --enable-threads --enable-timers --enable-endian \
+ --enable-file --enable-oss --disable-alsa --disable-esd --disable-arts \
+ --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+ --disable-mintaudio --disable-nasm --disable-video-x11 --disable-video-dga \
+ --enable-video-fbcon --disable-video-directfb --disable-video-ps2gs \
+ --disable-video-xbios --disable-video-gem --disable-video-dummy \
+ --disable-video-opengl --enable-input-events --enable-pthreads \
+ --disable-video-picogui --enable-video-qtopia --enable-dlopen"
+
+do_compile_prepend() {
+ if [ "${PALMTOP_USE_MULTITHREADED_QT}" == "yes" ]
+ then
+ sed -i s,-lqte\([^-]\),-lqte-mt, src/Makefile
+ fi
+}
diff --git a/recipes/libsdl/libsdl-ttf-2.0.3/new-freetype-includes.patch b/recipes/libsdl/libsdl-ttf-2.0.3/new-freetype-includes.patch
new file mode 100644
index 0000000000..856c9947ee
--- /dev/null
+++ b/recipes/libsdl/libsdl-ttf-2.0.3/new-freetype-includes.patch
@@ -0,0 +1,17 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- SDL_ttf-2.0.3/SDL_ttf.c~new-freetype-includes 2001-06-21 07:22:00.000000000 +0200
++++ SDL_ttf-2.0.3/SDL_ttf.c 2004-01-21 23:07:04.000000000 +0100
+@@ -4,6 +4,9 @@
+ #include <string.h>
+ #include <assert.h>
+
++#include <ft2build.h>
++#include FT_FREETYPE_H
++
+ #include <freetype/freetype.h>
+ #include <freetype/ftoutln.h>
+ #include <freetype/ttnameid.h>
diff --git a/recipes/libsdl/libsdl-ttf-native_2.0.3.bb b/recipes/libsdl/libsdl-ttf-native_2.0.3.bb
new file mode 100644
index 0000000000..0c37f4c5a1
--- /dev/null
+++ b/recipes/libsdl/libsdl-ttf-native_2.0.3.bb
@@ -0,0 +1,10 @@
+require libsdl-ttf_${PV}.bb
+inherit native
+
+DEPENDS = "libsdl-native"
+FILESPATH = "${FILE_DIRNAME}/libsdl-ttf-${PV}:${FILE_DIRNAME}/libsdl-ttf:${FILE_DIRNAME}/files"
+
+EXTRA_OECONF = "--disable-sdltest --with-sdl-prefix=${STAGING_LIBDIR}/.."
+
+export SDL_CONFIG = "${STAGING_BINDIR}/sdl-config"
+
diff --git a/recipes/libsdl/libsdl-ttf_2.0.3.bb b/recipes/libsdl/libsdl-ttf_2.0.3.bb
new file mode 100644
index 0000000000..250fb698ce
--- /dev/null
+++ b/recipes/libsdl/libsdl-ttf_2.0.3.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Simple DirectMedia Layer truetype font library."
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "virtual/libsdl freetype"
+LICENSE = "LGPL"
+PR = "r1"
+
+SRC_URI = "http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-${PV}.tar.gz \
+ file://new-freetype-includes.patch;patch=1"
+S = "${WORKDIR}/SDL_ttf-${PV}"
+
+inherit autotools
+
+do_stage() {
+ autotools_stage_all
+}
diff --git a/recipes/libsdl/libsdl-x11_1.2.11.bb b/recipes/libsdl/libsdl-x11_1.2.11.bb
new file mode 100644
index 0000000000..ab349d6306
--- /dev/null
+++ b/recipes/libsdl/libsdl-x11_1.2.11.bb
@@ -0,0 +1,26 @@
+require libsdl.inc
+
+# extra-keys.patch is missing
+DEFAULT_PREFERENCE = "-1"
+
+PR = "r7"
+
+SRC_URI = "\
+ http://www.libsdl.org/release/SDL-${PV}.tar.gz \
+ file://acinclude.m4 \
+ file://configure_tweak.patch;patch=1 \
+ file://pagesize.patch;patch=1 \
+ file://kernel-asm-page.patch;patch=1 \
+ file://sdl-cdfix.patch;patch=1 \
+ file://fixmfour.patch;patch=1 \
+"
+
+EXTRA_OECONF = "--disable-static --disable-debug --enable-cdrom --enable-threads --enable-timers --enable-endian \
+ --enable-file --enable-oss --enable-alsa --disable-esd --disable-arts \
+ --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+ --disable-mintaudio --disable-nasm --enable-video-x11 --disable-video-dga \
+ --enable-video-fbcon --disable-video-directfb --disable-video-ps2gs \
+ --disable-video-xbios --disable-video-gem --disable-video-dummy \
+ --enable-video-opengl --enable-input-events --enable-pthreads \
+ --disable-video-picogui --disable-video-qtopia --enable-dlopen"
+
diff --git a/recipes/libsdl/libsdl.inc b/recipes/libsdl/libsdl.inc
new file mode 100644
index 0000000000..5653925d68
--- /dev/null
+++ b/recipes/libsdl/libsdl.inc
@@ -0,0 +1,40 @@
+DESCRIPTION = "Simple DirectMedia Layer - X11 Edition"
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "alsa-lib mesa virtual/libx11 libxext"
+DEPENDS_avr32 = "alsa-lib virtual/libx11 libxext"
+PROVIDES = "virtual/libsdl"
+LICENSE = "LGPL"
+
+SRC_URI = "\
+ http://www.libsdl.org/release/SDL-${PV}.tar.gz \
+ file://extra-keys.patch;patch=1 \
+ file://pagesize.patch;patch=1 \
+ file://remove_path.patch;patch=1 \
+ file://acinclude.m4"
+S = "${WORKDIR}/SDL-${PV}"
+
+inherit autotools binconfig pkgconfig
+
+EXTRA_OECONF = "<overwrite me>"
+
+FILES_${PN} = "${libdir}/lib*.so.*"
+FILES_${PN}-dev += "${bindir}/*config"
+
+do_configure_prepend() {
+ rm -f ${S}/acinclude.m4
+ cp ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+do_configure_append () {
+ cd ${S}
+
+ # prevent libtool from linking libs against libstdc++, libgcc, ...
+ cat ${TARGET_PREFIX}libtool | sed -e 's/postdeps=".*"/postdeps=""/' > ${TARGET_PREFIX}libtool.tmp
+ mv ${TARGET_PREFIX}libtool.tmp ${TARGET_PREFIX}libtool
+}
+
+do_stage() {
+ autotools_stage_all
+ rm ${STAGING_LIBDIR}/libSDL.la
+}
diff --git a/recipes/libsdl/pushover_0.0.1.bb b/recipes/libsdl/pushover_0.0.1.bb
new file mode 100644
index 0000000000..8645f10a7f
--- /dev/null
+++ b/recipes/libsdl/pushover_0.0.1.bb
@@ -0,0 +1,8 @@
+DESCRIPTION = "Pushover is a fun puzzle game originally published by Ocean in 1992. In this game you control an ant that can walk along platforms that are connected with ladders. On those platforms are dominos that need to fall according to some rules."
+LICENSE = "GPLv3"
+DEPENDS = "lua5.1 libsdl-x11 libsdl-mixer libsdl-ttf"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pushover/pushover-${PV}.tar.gz"
+
+inherit autotools
+