docs/README-porting.md
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Thu, 21 May 2015 21:25:14 +0200
changeset 9609 897b25f560d0
parent 9316 f4d22285caec
child 9824 d5a7d25c5b22
permissions -rw-r--r--
Fixed undefined key access in test program.
     1 Porting
     2 =======
     3 
     4 * Porting To A New Platform
     5 
     6   The first thing you have to do when porting to a new platform, is look at
     7 include/SDL_platform.h and create an entry there for your operating system.
     8 The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
     9 Ideally SDL_platform.h will be able to auto-detect the system it's building
    10 on based on C preprocessor symbols.
    11 
    12 There are two basic ways of building SDL at the moment:
    13 
    14 1. The "UNIX" way:  ./configure; make; make install
    15 
    16    If you have a GNUish system, then you might try this.  Edit configure.in,
    17    take a look at the large section labelled:
    18 	"Set up the configuration based on the host platform!"
    19    Add a section for your platform, and then re-run autogen.sh and build!
    20 
    21 2. Using an IDE:
    22 
    23    If you're using an IDE or other non-configure build system, you'll probably
    24    want to create a custom SDL_config.h for your platform.  Edit SDL_config.h,
    25    add a section for your platform, and create a custom SDL_config_{platform}.h,
    26    based on SDL_config.h.minimal and SDL_config.h.in
    27 
    28    Add the top level include directory to the header search path, and then add
    29    the following sources to the project:
    30 	src/*.c
    31 	src/atomic/*.c
    32 	src/audio/*.c
    33 	src/cpuinfo/*.c
    34 	src/events/*.c
    35 	src/file/*.c
    36 	src/haptic/*.c
    37 	src/joystick/*.c
    38 	src/power/*.c
    39 	src/render/*.c
    40 	src/stdlib/*.c
    41 	src/thread/*.c
    42 	src/timer/*.c
    43 	src/video/*.c
    44 	src/audio/disk/*.c
    45 	src/audio/dummy/*.c
    46 	src/video/dummy/*.c
    47 	src/haptic/dummy/*.c
    48 	src/joystick/dummy/*.c
    49 	src/main/dummy/*.c
    50 	src/thread/generic/*.c
    51 	src/timer/dummy/*.c
    52 	src/loadso/dummy/*.c
    53 
    54 
    55 Once you have a working library without any drivers, you can go back to each
    56 of the major subsystems and start implementing drivers for your platform.
    57 
    58 If you have any questions, don't hesitate to ask on the SDL mailing list:
    59 	http://www.libsdl.org/mailing-list.php
    60 
    61 Enjoy!
    62 	Sam Lantinga				(slouken@libsdl.org)
    63