Mercurial > sdl-ios-xcode
view src/hermes/HeadX86.h @ 4134:31c7c57af8a4 SDL-1.2
Updates for building on Windows CE using mingw32ce cross compiler:
http://sourceforge.net/mailarchive/forum.php?thread_name 0703291652.38437.jwalt%40garni.ch&forum_name=cegcc-devel
Hi!
I just managed to compile SDL for Windows CE using the "mingw32ce"
configuration of http://cegcc.sourceforge.net. Test programs work as expected
(except for those using signals -- no POSIX on mingw32ce), and I didn't yet
encounter any problem.
While it was a pain to get everything compiled and running, the changes to
SDL are actually quite small (see attached SDL-ce.diff).
Unfortunately, the win32 headers shipped with cegcc are not 100% correct, and
it feels quite messy to work around them in SDL code, so those headers will
also need to be patched. (Attachment: win32api-ce.diff)
Since I had to apply the libtool patch from the cegcc patch, I have also ad ded
my copy of aclocal.m4 for SDL. I had to modify the cegcc libtool patch to
use "lt_cv_deplibs_check_method=pass_all" for mingw32ce, otherwise libtool
would not recognize the import libraries as valid for dynamic linking.
All these changes should not affect non-WinCE builds, so they could be
included in mainline SDL.
If you need some docs, you can use this description for a cross-compilation
README:
1) get cegcc from http://cegcc.sourceforge.net
2) build and install the "mingw32ce" variant (see cegcc installation docs)
3) patch w32api-headers (if not yet included in cegcc)
4) setup environment (customize the first three lines as you like):
PREFIX=/opt/mingw32ce
TARGET=arm-wince-mingw32ce
BUILD=`uname -m`-pc-linux-gnu
export PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PREFIX/local/bin:$PATH"
export CFLAGS="${CFLAGS:- -O2 -g} -I$PREFIX/local/include"
export CPPFLAGS="${CPPFLAGS:- -O2 -g} -I$PREFIX/local/include"
export CXXFLAGS="${CXXFLAGS:- -O2 -g} -I$PREFIX/local/include"
export LDFLAGS="${LDFLAGS:- -O2 -g} -L$PREFIX/local/lib"
export HOST_CC="gcc"
export CC="$PREFIX/bin/$TARGET-gcc"
export CXX="$PREFIX/bin/$TARGET-g++"
export LD="$PREFIX/bin/$TARGET-ld"
export AS="$PREFIX/bin/$TARGET-as"
export AR="$PREFIX/bin/$TARGET-ar"
export RANLIB="$PREFIX/bin/$TARGET-ranlib"
export CONFIG_SHELL="/bin/sh"
5) build and install
./configure --target=$TARGET --host=$TARGET --build=$BUILD
make
make install
6) use (4) and (5) for any SDL-using software you want to cross-compile
7) copy $PREFIX/local/bin/SDL-1-2-0.dll into your executable directory on the WinCE machine
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 03 Jan 2008 06:19:07 +0000 |
parents | bb5ace455586 |
children | 782fd950bd46 c121d94672cb 39b9405d3cb6 |
line wrap: on
line source
/* Header definitions for the x86 routines for the HERMES library Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at) This source code is licensed under the GNU LGPL Please refer to the file COPYING.LIB contained in the distribution for licensing conditions */ #ifndef __HERMES_HEAD_X86__ #define __HERMES_HEAD_X86__ #ifdef X86_ASSEMBLER /* If you can't stand IFDEFS, then close your eyes now, please :) */ /* Ok, we start with normal function definitions */ #ifdef __cplusplus extern "C" { #endif void STACKCALL ConvertX86(HermesConverterInterface *); void STACKCALL ClearX86_32(HermesClearInterface *); void STACKCALL ClearX86_24(HermesClearInterface *); void STACKCALL ClearX86_16(HermesClearInterface *); void STACKCALL ClearX86_8(HermesClearInterface *); int STACKCALL Hermes_X86_CPU(); void ConvertX86p32_32BGR888(); void ConvertX86p32_32RGBA888(); void ConvertX86p32_32BGRA888(); void ConvertX86p32_24RGB888(); void ConvertX86p32_24BGR888(); void ConvertX86p32_16RGB565(); void ConvertX86p32_16BGR565(); void ConvertX86p32_16RGB555(); void ConvertX86p32_16BGR555(); void ConvertX86p32_8RGB332(); void ConvertX86p16_32RGB888(); void ConvertX86p16_32BGR888(); void ConvertX86p16_32RGBA888(); void ConvertX86p16_32BGRA888(); void ConvertX86p16_24RGB888(); void ConvertX86p16_24BGR888(); void ConvertX86p16_16BGR565(); void ConvertX86p16_16RGB555(); void ConvertX86p16_16BGR555(); void ConvertX86p16_8RGB332(); void CopyX86p_4byte(); void CopyX86p_3byte(); void CopyX86p_2byte(); void CopyX86p_1byte(); void ConvertX86pI8_32(); void ConvertX86pI8_24(); void ConvertX86pI8_16(); extern int ConvertX86p16_32RGB888_LUT_X86[512]; extern int ConvertX86p16_32BGR888_LUT_X86[512]; extern int ConvertX86p16_32RGBA888_LUT_X86[512]; extern int ConvertX86p16_32BGRA888_LUT_X86[512]; #ifdef __cplusplus } #endif /* Now fix up the ELF underscore problem */ #if defined(__ELF__) && defined(__GNUC__) #ifdef __cplusplus extern "C" { #endif extern int _Hermes_X86_CPU(); extern void _ConvertX86(HermesConverterInterface *); extern void _ConvertX86p32_32BGR888(); extern void _ConvertX86p32_32RGBA888(); extern void _ConvertX86p32_32BGRA888(); extern void _ConvertX86p32_24RGB888(); extern void _ConvertX86p32_24BGR888(); extern void _ConvertX86p32_16RGB565(); extern void _ConvertX86p32_16BGR565(); extern void _ConvertX86p32_16RGB555(); extern void _ConvertX86p32_16BGR555(); extern void _ConvertX86p32_8RGB332(); extern void _ConvertX86p16_16BGR565(); extern void _ConvertX86p16_16RGB555(); extern void _ConvertX86p16_16BGR555(); extern void _ConvertX86p16_8RGB332(); #define Hermes_X86_CPU _Hermes_X86_CPU #define ConvertX86 _ConvertX86 #define ConvertX86p32_32BGR888 _ConvertX86p32_32BGR888 #define ConvertX86p32_32RGBA888 _ConvertX86p32_32RGBA888 #define ConvertX86p32_32BGRA888 _ConvertX86p32_32BGRA888 #define ConvertX86p32_24RGB888 _ConvertX86p32_24RGB888 #define ConvertX86p32_24BGR888 _ConvertX86p32_24BGR888 #define ConvertX86p32_16RGB565 _ConvertX86p32_16RGB565 #define ConvertX86p32_16BGR565 _ConvertX86p32_16BGR565 #define ConvertX86p32_16RGB555 _ConvertX86p32_16RGB555 #define ConvertX86p32_16BGR555 _ConvertX86p32_16BGR555 #define ConvertX86p32_8RGB332 _ConvertX86p32_8RGB332 #define ConvertX86p16_16BGR565 _ConvertX86p16_16BGR565 #define ConvertX86p16_16RGB555 _ConvertX86p16_16RGB555 #define ConvertX86p16_16BGR555 _ConvertX86p16_16BGR555 #define ConvertX86p16_8RGB332 _ConvertX86p16_8RGB332 #ifdef __cplusplus } #endif #endif /* ELF & GNU */ /* Make it run with WATCOM C */ #ifdef __WATCOMC__ #pragma warning 601 9 #pragma aux Hermes_X86_CPU "_*" #pragma aux ConvertX86 "_*" modify [EAX EBX ECX EDX ESI EDI] #pragma aux ClearX86_32 "_*" modify [EAX EBX ECX EDX ESI EDI] #pragma aux ClearX86_24 "_*" modify [EAX EBX ECX EDX ESI EDI] #pragma aux ClearX86_16 "_*" modify [EAX EBX ECX EDX ESI EDI] #pragma aux ClearX86_8 "_*" modify [EAX EBX ECX EDX ESI EDI] #pragma aux ConvertX86p32_32BGR888 "_*" #pragma aux ConvertX86p32_32RGBA888 "_*" #pragma aux ConvertX86p32_32BGRA888 "_*" #pragma aux ConvertX86p32_24RGB888 "_*" #pragma aux ConvertX86p32_24BGR888 "_*" #pragma aux ConvertX86p32_16RGB565 "_*" #pragma aux ConvertX86p32_16BGR565 "_*" #pragma aux ConvertX86p32_16RGB555 "_*" #pragma aux ConvertX86p32_16BGR555 "_*" #pragma aux ConvertX86p32_8RGB332 "_*" #pragma aux ConvertX86p16_32RGB888 "_*" #pragma aux ConvertX86p16_32BGR888 "_*" #pragma aux ConvertX86p16_32RGBA888 "_*" #pragma aux ConvertX86p16_32BGRA888 "_*" #pragma aux ConvertX86p16_24RGB888 "_*" #pragma aux ConvertX86p16_24BGR888 "_*" #pragma aux ConvertX86p16_16BGR565 "_*" #pragma aux ConvertX86p16_16RGB555 "_*" #pragma aux ConvertX86p16_16BGR555 "_*" #pragma aux ConvertX86p16_8RGB332 "_*" #pragma aux CopyX86p_4byte "_*" #pragma aux CopyX86p_3byte "_*" #pragma aux CopyX86p_2byte "_*" #pragma aux CopyX86p_1byte "_*" #pragma aux ConvertX86pI8_32 "_*" #pragma aux ConvertX86pI8_24 "_*" #pragma aux ConvertX86pI8_16 "_*" #pragma aux ConvertX86p16_32RGB888_LUT_X86 "_*" #pragma aux ConvertX86p16_32BGR888_LUT_X86 "_*" #pragma aux ConvertX86p16_32RGBA888_LUT_X86 "_*" #pragma aux ConvertX86p16_32BGRA888_LUT_X86 "_*" #endif /* __WATCOMC__ */ #endif /* X86_ASSEMBLER */ #endif