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