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
|
#
# dc-qt build file
#
# DOES NOT BUILD THE UI YET!!!
#
# targets:
# no arguments - build
# install - install backend and ui
#
# Arguments:
# PREFIX - where to install, defaults to /usr/local
# release=1 - build with optimiztion, turn off debug
#
import os
env = Environment(CPPPATH = ['#rpcdriver/'], LIBPATH = ['#rpcdriver/'])
# Configure release / debug compiler parameters
release = ARGUMENTS.get('release',0)
if int(release):
env.Append(CXXFLAGS = '-O2')
env.Append(LDFLAGS = '-s')
else:
env.Append(CXXFLAGS = '-g -ggdb -O0 -DDEBUG -Wall')
env.Append(LDFLAGS = '-g -ggdb')
# DistCC rulz.
if 'DISTCC_HOSTS' in os.environ:
env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
env['CC'] = 'distcc %s' % env['CC']
env['CXX'] = 'distcc %s' % env['CXX']
env['ENV']['PATH'] = os.environ['PATH']
env['ENV']['HOME'] = os.environ['HOME']
# Architecture detection
cpu = os.uname()[4]
if cpu=='i386' or cpu=='i486' or cpu=='i586' or cpu=='i686':
env.Append(CXXFLAGS='-DTARGET_I386')
env.Append(CXXFLAGS = '-DHAVE_ASM_ATOMIC_H')
if cpu=='Power Macintosh':
env.Append(CXXFLAGS='-DTARGET_PPC')
env.Append(CXXFLAGS='-DHAVE_ASM_ATOMIC_H')
# x86_64 is the string for amd, handle it here.
if cpu=='x86_64':
env.Append(CXXFLAGS='-m64')
env.Append(CXXFLAGS='-DTARGET_X86_64')
env.Append(CXXFLAGS='-DHAVE_ASM_ATOMIC_H')
# Some misc stuff
env.Append(CXXFLAGS = ['-I.', '-DENABLE_BINRELOC', '-D_FILE_OFFSET_BITS=64'])
prefix = ARGUMENTS.get('PREFIX','/usr/local')
bindir = ARGUMENTS.get('BINDIR', prefix + '/bin' )
Export('env')
SConscript('dcpp/SConscript')
SConscript('backend/SConscript')
SConscript('rpcdriver/SConscript')
env.Install(dir=bindir,source='backend/backend')
env.Install(dir=bindir,source='ui/ui')
env.Alias('install',[bindir])
|