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