--- 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', 'LOCALBASE', '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(LOCALBASE + '/include') + LINKFLAGS += '-L' + LOCALBASE + '/lib ' + '-L' + LOCALBASE + '/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()