It works... All the static entries had to be determined dynamically.... well: maybe...
[supertux.git] / SConstruct
index cdbf0ff..f5a250e 100644 (file)
@@ -3,18 +3,52 @@
 # See http://www.scons.org/ for more information about what SCons is and how it
 # may help you... :-)
 # I've never done anything with SCons before. Quite obviously this script is in
-# a non-working state!! Maybe someone with more knowledge of the materia who
-# thinks that SCons might be better suited than make can take over....
+# a non-working state!! Maybe someone with more knowledge of the materia can
+# take over....
 #                                              - Benjamin P. 'litespeed' Jung -
 #
 
+# TODO: such static entries are obviously not what we want.
+# Using e.g. 'sdl-config' to obtain parameters would be muuuuuch
+# better.
 
-# TODO: such a static entry is obviously not what we want.
-#       Using 'sdl-config --prefix' to obtain parameters would be muuuuuch
-#       better.
-SDL_INCLUDE_PATH='/usr/include/SDL'
 
-libsupertux_src=[
+DATA_PREFIX = '\\\"/usr/local/share/supertux\\\"'
+LOCALEDIR = '\\\"/usr/local/share/locale\\\"'
+
+CCFLAGS = [
+  '-O2',
+  '-DDATA_PREFIX=' + DATA_PREFIX,
+  '-DLOCALEDIR=' + LOCALEDIR
+]
+
+CPPPATH = ['/usr/include/SDL', '/usr/include/X11', 'src', 'lib', 'intl', '.']
+
+LIBPATH = [
+  'lib',
+  '/lib',
+  '/usr/lib',
+  '/usr/lib/X11',
+  '/usr/local/lib'
+]
+
+LIBS = [
+  'supertux',
+  'SDL',
+  'SDL_gfx',
+  'SDL_image',
+  'SDL_mixer',
+  'SDL_sound',
+  'pthread',
+  'm',
+  'dl',
+  'asound',
+  'GL',
+  'GLU'
+]
+  
+
+libsupertux_src = [
   'lib/app/globals.cpp',
   'lib/app/setup.cpp',
   'lib/audio/musicref.cpp',
@@ -39,7 +73,7 @@ libsupertux_src=[
   'lib/video/surface.cpp'
 ]
 
-supertux_src=[
+supertux_src = [
   'src/background.cpp',
   'src/badguy.cpp',
   'src/badguy_specs.cpp',
@@ -71,22 +105,19 @@ supertux_src=[
   'src/worldmap.cpp'
 ]
                        
-SharedLibrary(
-  target="lib/supertux",
-  source=libsupertux_src,
-  CPPPATH=SDL_INCLUDE_PATH
-)
 
 StaticLibrary(
-  target="lib/supertux",
-  source=libsupertux_src,
-  CPPPATH=SDL_INCLUDE_PATH
+  target = 'lib/supertux',
+  source = libsupertux_src,
+  CPPPATH = CPPPATH,
+  CCFLAGS = CCFLAGS
 )
 
 Program(
-  target="src/supertux",
-  source=supertux_src,
-  CPPPATH=[SDL_INCLUDE_PATH, 'lib', 'intl', '.'],
-  LIBPATH='lib',
-  LIBS='supertux'
+  target = 'src/supertux',
+  source = supertux_src,
+  CPPPATH = CPPPATH,
+  CCFLAGS = CCFLAGS,
+  LIBPATH = LIBPATH,
+  LIBS = LIBS
 )