2006-05-10 20:35:19 +02:00
|
|
|
--- SConstruct.orig Fri Feb 10 19:01:20 2006
|
2006-05-31 03:51:05 +02:00
|
|
|
+++ SConstruct Tue May 30 22:35:47 2006
|
2006-05-10 20:35:19 +02:00
|
|
|
@@ -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
|
2006-05-31 03:51:05 +02:00
|
|
|
@@ -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']
|
2006-05-10 20:35:19 +02:00
|
|
|
|
2006-05-31 03:51:05 +02:00
|
|
|
# help -------------------------------------------
|
2006-05-10 20:35:19 +02:00
|
|
|
|
2006-05-31 03:51:05 +02:00
|
|
|
@@ -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 @@
|
2006-05-10 20:35:19 +02:00
|
|
|
# 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
|
2006-05-31 03:51:05 +02:00
|
|
|
+CCFLAGS += ' '
|
|
|
|
+CXXFLAGS += ' -pipe -DQ_NO_STLPORT '
|
|
|
|
CPPPATH = []
|
2006-05-10 20:35:19 +02:00
|
|
|
if (BUILD == 'debug'):
|
|
|
|
CXXFLAGS += '-g -D_DEBUG '
|
2006-05-31 03:51:05 +02:00
|
|
|
@@ -190,7 +182,6 @@
|
2006-05-10 20:35:19 +02:00
|
|
|
print 'Unknown build configuration ' + BUILD
|
|
|
|
sys.exit( 0 )
|
|
|
|
|
|
|
|
-LINKFLAGS = ''
|
|
|
|
if ( OS == 'Linux' ):
|
|
|
|
|
|
|
|
# static
|
2006-05-31 03:51:05 +02:00
|
|
|
@@ -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):
|
2006-05-10 20:35:19 +02:00
|
|
|
if ( OS == 'Darwin' ):
|
|
|
|
self['LINKFLAGS'] += '-lpthread -Wl,-stack_size,0x400000 '
|
2006-05-31 03:51:05 +02:00
|
|
|
+ elif ( OS == 'FreeBSD' ):
|
|
|
|
+ self['LINKFLAGS'] += PTHREAD_LIBS
|
2006-05-10 20:35:19 +02:00
|
|
|
else:
|
2006-05-31 03:51:05 +02:00
|
|
|
self['LINKFLAGS'] += '-lpthread '
|
2006-05-10 20:35:19 +02:00
|
|
|
|
2006-05-31 03:51:05 +02:00
|
|
|
@@ -278,7 +277,7 @@
|
2006-05-10 20:35:19 +02:00
|
|
|
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()
|