README-porting.txt
changeset 7222 2435b221d77d
parent 6987 7084af936d82
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/README-porting.txt	Sun May 26 11:06:17 2013 -0700
     1.3 @@ -0,0 +1,61 @@
     1.4 +
     1.5 +* Porting To A New Platform
     1.6 +
     1.7 +  The first thing you have to do when porting to a new platform, is look at
     1.8 +include/SDL_platform.h and create an entry there for your operating system.
     1.9 +The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
    1.10 +Ideally SDL_platform.h will be able to auto-detect the system it's building
    1.11 +on based on C preprocessor symbols.
    1.12 +
    1.13 +There are two basic ways of building SDL at the moment:
    1.14 +
    1.15 +1. The "UNIX" way:  ./configure; make; make install
    1.16 +
    1.17 +   If you have a GNUish system, then you might try this.  Edit configure.in,
    1.18 +   take a look at the large section labelled:
    1.19 +	"Set up the configuration based on the target platform!"
    1.20 +   Add a section for your platform, and then re-run autogen.sh and build!
    1.21 +
    1.22 +2. Using an IDE:
    1.23 +
    1.24 +   If you're using an IDE or other non-configure build system, you'll probably
    1.25 +   want to create a custom SDL_config.h for your platform.  Edit SDL_config.h,
    1.26 +   add a section for your platform, and create a custom SDL_config_{platform}.h,
    1.27 +   based on SDL_config.h.minimal and SDL_config.h.in
    1.28 +
    1.29 +   Add the top level include directory to the header search path, and then add
    1.30 +   the following sources to the project:
    1.31 +	src/*.c
    1.32 +	src/atomic/*.c
    1.33 +	src/audio/*.c
    1.34 +	src/cpuinfo/*.c
    1.35 +	src/events/*.c
    1.36 +	src/file/*.c
    1.37 +	src/haptic/*.c
    1.38 +	src/joystick/*.c
    1.39 +	src/power/*.c
    1.40 +	src/render/*.c
    1.41 +	src/stdlib/*.c
    1.42 +	src/thread/*.c
    1.43 +	src/timer/*.c
    1.44 +	src/video/*.c
    1.45 +	src/audio/disk/*.c
    1.46 +	src/audio/dummy/*.c
    1.47 +	src/video/dummy/*.c
    1.48 +	src/haptic/dummy/*.c
    1.49 +	src/joystick/dummy/*.c
    1.50 +	src/main/dummy/*.c
    1.51 +	src/thread/generic/*.c
    1.52 +	src/timer/dummy/*.c
    1.53 +	src/loadso/dummy/*.c
    1.54 +
    1.55 +
    1.56 +Once you have a working library without any drivers, you can go back to each
    1.57 +of the major subsystems and start implementing drivers for your platform.
    1.58 +
    1.59 +If you have any questions, don't hesitate to ask on the SDL mailing list:
    1.60 +	http://www.libsdl.org/mailing-list.php
    1.61 +
    1.62 +Enjoy!
    1.63 +	Sam Lantinga				(slouken@libsdl.org)
    1.64 +