summaryrefslogtreecommitdiff
blob: b072d6722eb8a7f508fe81c7329dd259536cdeb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff --git a/g_src/SConscript b/g_src/SConscript
index b0e6bd1..edfc04b 100644
--- a/g_src/SConscript
+++ b/g_src/SConscript
@@ -1,6 +1,7 @@
 # -*- mode: python -*-
 from sys import platform
 import os
+import SCons.Util
 
 src_dll = ["basics.cpp","command_line.cpp","enabler_sdl.cpp","files.cpp",
            "find_files_posix.cpp","graphics.cpp","init.cpp","interface.cpp",
@@ -17,42 +18,41 @@ profile = False
 # Propagate PATH. We'll just take our chances with non-repeatable builds.
 env = Environment(ENV = {'PATH' : os.environ['PATH']})
 
+if optimize:
+   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'])
+
 # 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['LIBS']=["ncursesw", "SDL_image", "boost_regex"]
+env['LIBS']=["ncursesw", "SDL_image"]
 # If there's a library in the libs folder it will get linked over a system one.
-env['LIBPATH']=["#libs"]
-env['LINKFLAGS']=["-Wl,--as-needed",'-Wl,-rpath=\$$ORIGIN/libs','-Wl,-static','-lSDL','-lSDL_image','-lsndfile','-Wl,-Bdynamic']
-
-# 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,-rpath=\$$ORIGIN/libs','-lSDL','-lSDL_image','-lsndfile','-lz']
 
 # Generic unix, including Linux
-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 --libs')
-env.ParseConfig('pkg-config sndfile --static --cflags')
-env.ParseConfig('pkg-config sdl --static --cflags')
-env.ParseConfig('pkg-config zlib --cflags --libs')
+env.ParseConfig('pkg-config sndfile --cflags')
+env.ParseConfig('pkg-config sdl --cflags')
 env.ParseConfig('pkg-config glu --cflags --libs')
 
-
 if profile:
    env["CCFLAGS"].append("-pg")
    env['LINKFLAGS'].append("-pg")
 
-if optimize:
-   env["CCFLAGS"]+=["-O3","-march=pentium3","-mfpmath=sse"]
-
 if debug:
-   env["CCFLAGS"].append("-ggdb")
    env["CCFLAGS"].append("-DDEBUG")
    
 # Finally, do the build