All pastes #2128183 Raw Edit

Mine

public text v1 · immutable
#2128183 ·published 2012-03-14 18:56 UTC
rendered paste body
--- g_src/SConscript.old	2012-03-14 17:59:30.000000000 +0100
+++ g_src/SConscript	2012-03-14 19:17:06.000000000 +0100
@@ -1,6 +1,7 @@
 # -*- mode: python -*-
 from sys import platform
 import os
+import SCons.Util
 
 src_dll = ["basics.cpp","command_line.cpp","enabler.cpp","files.cpp",
            "find_files_posix.cpp","graphics.cpp","init.cpp","interface.cpp",
@@ -12,8 +13,8 @@
 
 dll  = '#libs/libgraphics.so'
 
-optimize = False
-debug = True
+optimize = True
+debug = False
 profile = False
 
 clang = False
@@ -45,54 +46,45 @@
       env["SHLINKCOM"]="llvm-link $SOURCES | llc | g++ -shared -xassembler -fPIC -o $TARGET - $SHLINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS"
       env["LINKCOM"]="llvm-link $SOURCES | llc | g++ -xassembler -o $TARGET - $LINKFLAGS $_LIBDIRFLAGS $_LIBFLAGS"
 
-
 # Init variables, and make sure they're around for appending to
 # These variables are the ones used by the actual compilation. We construct
 # them from ccflags/libs in varying ways depending on which compiler is used,
 # below.
-env['CPPPATH']=["#g_src/fmodexinclude"]
 env['CCFLAGS']=["-Dunix"]
 env['CXXFLAGS'].append("-std=gnu++0x")
-env['LIBS']=["SDL_image","z","SDL_ttf"]
+env['LIBS']=["ncursesw","SDL_image","z","SDL_ttf"]
 # If there's a library in the libs folder it will get linked over a system one.
-env['LIBPATH']=["#libs"]
-if not M64:
-   env['LIBPATH'].append("/usr/lib32")
-env['LINKFLAGS']=["-Wl,--as-needed",'-Wl,-rpath=\$$ORIGIN/libs']
-
-# GLEW
-env["CPPPATH"].append('#g_src/glext')
-env["CCFLAGS"].append('-DGLEW_STATIC') # Should only be needed on windows, but can't hurt.
+
+env['LINKFLAGS']=["-Wl,--as-needed",'-Wl,-rpath=\$$ORIGIN/libs','-lSDL','-lSDL_image','-lsndfile','-lz']
 
 # Generic unix, including Linux
-if not clang and not M64:
-   env['ASFLAGS']="--32"
-   env['LINKFLAGS'].append("-m32")
-   env["CCFLAGS"].append("-m32")
 env.ParseConfig('pkg-config gtk+-2.0 --cflags --libs')
 env.ParseConfig('pkg-config openal --cflags')
 env.ParseConfig('pkg-config sndfile --cflags')
 env.ParseConfig('pkg-config sdl --cflags --libs')
 env.ParseConfig('pkg-config glu --cflags --libs')
 
-
 if profile:
    env["CCFLAGS"].append("-pg")
    env['LINKFLAGS'].append("-pg")
 
 if optimize:
    if not clang:
-      if not debug:
-         env["CCFLAGS"]+=["-fomit-frame-pointer"]
-      if not M64:
-         env["CCFLAGS"]+=["-O3","-march=pentium3","-mfpmath=sse"]
-      else:
-         env["CCFLAGS"]+=["-O3"]
+      env["CCFLAGS"]+=["-O3"]   
+      if os.environ.has_key('CC'):
+         env['CC'] = os.environ['CC']
+      if os.environ.has_key('CFLAGS'):
+         env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
+      if os.environ.has_key('CXX'):
+         env['CXX'] = os.environ['CXX']
+      if os.environ.has_key('CXXFLAGS'):
+         env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
+      if os.environ.has_key('LDFLAGS'):
+         env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
    else:
       env["CCFLAGS"].append("-O2") # Only to reduce WPO time
 
 if debug:
-   env["CCFLAGS"].append("-ggdb")
    env["CCFLAGS"].append("-DDEBUG")
    
 # Finally, do the build