# Fix compliation error about 'XKeysymToString' by linking X11 explicitly
# Thanks Antonio Ospite!
Import('env')
config_string = 'pkg-config --cflags --libs x11'
if env['PLATFORM'] == 'darwin':
  config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
env.ParseConfig(config_string)
Export('env')

source_list =  Split("""
input.cpp
config.cpp
sdl.cpp
sdl-joystick.cpp
sdl-sound.cpp
sdl-throttle.cpp
sdl-video.cpp
unix-netplay.cpp
""")

Import('env')
if 'GL' in env['LIBS']:
  source_list.append('sdl-opengl.cpp')

for x in range(len(source_list)):
  source_list[x] = 'drivers/sdl/' + source_list[x]
Return('source_list')
