Lines 1-72
Link Here
|
1 |
--- SConstruct.orig Mon Oct 17 20:45:59 2005 |
1 |
--- SConstruct Fri Apr 14 05:13:03 2006 |
2 |
+++ SConstruct Sat Oct 29 14:30:06 2005 |
2 |
+++ SConstruct Fri Apr 14 16:18:12 2006 |
3 |
@@ -2,6 +2,11 @@ |
3 |
@@ -81,6 +81,7 @@ |
4 |
import os |
4 |
libpath = [LOCALBASE + '/lib', X11BASE + '/lib'] |
5 |
import sys |
|
|
6 |
|
7 |
+################ FreeBSD port variables |
8 |
+LOCALBASE = os.environ['LOCALBASE'] |
9 |
+X11BASE = os.environ['X11BASE'] |
10 |
+SDL_CONFIG = os.environ['SDL_CONFIG'] |
11 |
+ |
12 |
################ global config values |
13 |
version = '0.1.0' |
14 |
if ARGUMENTS.get('version', 0): |
15 |
@@ -67,10 +72,12 @@ |
16 |
else: |
17 |
print "Compiling for Unix/Posix/Linux Environment" |
18 |
env = Environment(ENV = os.environ) |
19 |
- env.Append(CPPPATH = ['/usr/include/SDL', '/usr/include/GL']) |
20 |
- libpath = ['/usr/X11R6/lib'] |
21 |
+ env.Replace(CC = os.environ['CC']) |
22 |
+ env.Replace(CXX = os.environ['CXX']) |
23 |
+ env.Append(CPPPATH = [LOCALBASE + '/include', LOCALBASE + '/include/SDL11', X11BASE + '/include', X11BASE + '/include/GL']) |
24 |
+ libpath = [LOCALBASE + '/lib', X11BASE + '/lib'] |
25 |
gllibs = ['GL', 'GLU'] |
5 |
gllibs = ['GL', 'GLU'] |
26 |
- sdllibs = ['SDL', 'SDL_image'] |
6 |
sdllibs = ['SDL_image'] |
27 |
+ sdllibs = ['SDL_image'] |
7 |
+ extralibs = ['execinfo'] |
28 |
ccflags = '-Wall `sdl-config --cflags`' |
8 |
cpuinfof = os.popen('sysctl -n hw.instruction_sse') |
29 |
if (debug >= 3): |
|
|
30 |
ccflags += ' -g -pg -O3' # profiling |
31 |
@@ -92,31 +99,28 @@ |
32 |
if (cvedit == 1): |
33 |
env.Append(CPPDEFINES = ['CVEDIT']) |
34 |
# check for mmx/sse support |
35 |
- cpuinfof = open('/proc/cpuinfo', 'r') |
36 |
+ cpuinfof = os.popen('sysctl -n hw.instruction_sse') |
37 |
cpuinfol = cpuinfof.readlines() |
9 |
cpuinfol = cpuinfof.readlines() |
38 |
mmxsupported = False |
10 |
mmxsupported = False |
39 |
ssesupported = False |
|
|
40 |
for i in cpuinfol: |
41 |
- if i.startswith('flags'): |
42 |
- m = Split(i) |
43 |
- for j in m: |
44 |
- if j == 'mmx': |
45 |
- mmxsupported = True |
46 |
- elif j == 'sse': |
47 |
- ssesupported = True |
48 |
- break |
49 |
+ if i == '1\n': |
50 |
+ mmxsupported = True |
51 |
+ ssesupported = True |
52 |
if (usex86sse == 0) and (mmxsupported and ssesupported): |
53 |
usex86sse = 1 |
54 |
if usex86sse >= 1: |
55 |
env.Append(CPPDEFINES = ['USE_SSE']) |
56 |
osspecificsrc += ['water_sse.cpp'] |
57 |
print 'Using x86 SSE/MMX optimizations.' |
58 |
- env.Append(CCFLAGS = ccflags) |
59 |
+ env.Replace(CCFLAGS = os.environ['CFLAGS']) |
60 |
+ env.Replace(CXXFLAGS = os.environ['CXXFLAGS'] + ' `' + SDL_CONFIG + ' --cflags`') |
61 |
+ env.Append(LINKFLAGS = '`' + SDL_CONFIG + ' --libs`') |
62 |
datadir = installdatadir |
63 |
- build_dir = 'linux' |
64 |
+ build_dir = 'freebsd' |
65 |
# check for broken libGL, ignore undefined symbols then |
66 |
- if (os.system('grep glBindProgram /usr/include/GL/gl*.h > /dev/null') == 0): |
67 |
- gllibdirs = ['/usr/X11R6/lib/', '/usr/lib/', '/usr/local/lib/'] |
68 |
+ if (os.system('grep glBindProgram ' + X11BASE + '/include/GL/gl*.h > /dev/null') == 0): |
69 |
+ gllibdirs = [X11BASE + '/lib/', '/usr/lib/', LOCALBASE + '/lib/'] |
70 |
gllibdir = '' |
71 |
for i in gllibdirs: |
72 |
if (os.system('test -f '+i+'libGL.so') == 0): |