summaryrefslogtreecommitdiff
path: root/games/gtkradiant/files/patch-SConstruct
blob: 8e8575e0600e60cca67ca9b119967f31af2d1fdb (plain) (blame)
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
74
75
76
77
78
79
80
81
82
83
84
85
--- SConstruct.orig	Fri Feb 10 19:01:20 2006
+++ SConstruct	Tue May 30 22:35:47 2006
@@ -3,7 +3,6 @@
 
 import commands, re, sys, os, pickle, string, popen2
 from makeversion import radiant_makeversion, get_version
-from osx_setup import do_osx_setup
 
 # to access some internal stuff
 import SCons
@@ -11,7 +10,7 @@
 conf_filename='site.conf'
 # there is a default hardcoded value, you can override on command line, those are saved between runs
 # we only handle strings
-serialized=['CC', 'CXX', 'JOBS', 'BUILD', 'SETUP']
+serialized=['CC', 'CXX', 'CCFLAGS', 'CXXFLAGS', 'LINKFLAGS', 'PTHREAD_LIBS', 'LOCALBASE', 'X11BASE', 'JOBS', 'BUILD', 'SETUP']
 
 # help -------------------------------------------
 
@@ -64,14 +63,7 @@
 # TODO: detect Darwin / OSX
 
 # CPU type
-g_cpu = commands.getoutput('uname -m')
-exp = re.compile('.*i?86.*')
-if (g_cpu == 'Power Macintosh' or g_cpu == 'ppc'):
-  g_cpu = 'ppc'
-elif exp.match(g_cpu):
-  g_cpu = 'x86'
-else:
-  g_cpu = 'cpu'
+g_cpu = 'cpu'
 
 # OS
 OS = commands.getoutput('uname')
@@ -172,8 +164,8 @@
 # common flags
 warningFlags = '-W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter '
 warningFlagsCXX = '-Wno-non-virtual-dtor -Wreorder ' # -Wold-style-cast
-CCFLAGS = '' + warningFlags
-CXXFLAGS = '-pipe -DQ_NO_STLPORT ' + warningFlags + warningFlagsCXX
+CCFLAGS += ' '
+CXXFLAGS += ' -pipe -DQ_NO_STLPORT '
 CPPPATH = []
 if (BUILD == 'debug'):
 	CXXFLAGS += '-g -D_DEBUG '
@@ -190,7 +182,6 @@
 	print 'Unknown build configuration ' + BUILD
 	sys.exit( 0 )
 
-LINKFLAGS = ''
 if ( OS == 'Linux' ):
 
   # static
@@ -218,6 +209,12 @@
   CPPPATH.append('/sw/include')
   CPPPATH.append('/usr/X11R6/include')
   LINKFLAGS += '-L/sw/lib -L/usr/lib -L/usr/X11R6/lib '
+elif ( OS == 'FreeBSD' ):
+  CCFLAGS += '-fPIC '
+  CXXFLAGS += '-fPIC '
+  CPPPATH.append(LOCALBASE + '/include')
+  CPPPATH.append(X11BASE + '/include')
+  LINKFLAGS += '-L' + LOCALBASE + '/lib ' + '-L' + X11BASE + '/lib '
 
 CPPPATH.append('libs')
 
@@ -269,6 +266,8 @@
   def usePThread(self):
     if ( OS == 'Darwin' ):
       self['LINKFLAGS'] += '-lpthread -Wl,-stack_size,0x400000 '
+    elif ( OS == 'FreeBSD' ):
+      self['LINKFLAGS'] += PTHREAD_LIBS
     else:
       self['LINKFLAGS'] += '-lpthread '
 
@@ -278,7 +277,7 @@
         print('ERROR: CheckLDD: target %s not found\n' % target[0])
         Exit(1)
     # not using os.popen3 as I want to check the return code
-    ldd = popen2.Popen3('`which ldd` -r %s' % target[0], 1)
+    ldd = popen2.Popen3('`which ldd` %s' % target[0], 1)
     stdout_lines = ldd.fromchild.readlines()
     stderr_lines = ldd.childerr.readlines()
     ldd_ret = ldd.wait()