forked from bartvdbraak/blender
0bd7934be7
- Code has been changed to reflect this (ie. deprecated functions are not anymore used) * clean up the C and C++ compiler flags mess. - in the environment construction of BlenderLib all the compile flag governing options have been split in the *C*, *CC* and *CXX* containing equivalents. C is for C compiler only flags. CC is for C and C++ compiler flags and CXX is for C++ compiler only flags. All the platform default config files need to be double checked and fixed wherever it looks necessary. Either DIY, or send me a note with needed changes. - a start for the BlenderLib parameter list has been made - all the SConscripts need to be checked and modified to hand in flags properly. * A theeth request: make -jN settable in the config file. - I give you BF_NUMJOBS, which is set to 1 by default. In your user-config.py, set BF_NUMJOBS=4 to have 4 parallel jobs handled. Yay.
147 lines
4.6 KiB
Python
147 lines
4.6 KiB
Python
#!/usr/bin/env python
|
|
#
|
|
# I think it is quite straight-forward to add new platforms,
|
|
# just look at the old makefile and at the existing platforms.
|
|
#
|
|
# This SConstruct creates a configuration file which can be
|
|
# used for tweaking a build.
|
|
#
|
|
# For more about SConstruct, see <http://www.scons.org/>.
|
|
#
|
|
|
|
import os
|
|
import os.path
|
|
import sys
|
|
import re
|
|
import time
|
|
import string
|
|
from distutils import sysconfig
|
|
|
|
Import('env')
|
|
|
|
defines = []
|
|
cflags = []
|
|
debug_flags = []
|
|
extra_flags = []
|
|
release_flags = []
|
|
warn_flags = []
|
|
platform_libs = []
|
|
platform_libpath = []
|
|
platform_linkflags = []
|
|
|
|
ourplatform = env['OURPLATFORM']
|
|
if ourplatform == 'win32-vc':
|
|
print "Building on win32"
|
|
defines += ['_WIN32']
|
|
warn_flags = ['/Wall']
|
|
platform_libs = ['ws2_32']
|
|
elif ourplatform == 'win32-mingw':
|
|
defines += ['_WIN32', 'WIN32']
|
|
platform_libs = ['shell32', 'kernel32', 'gdi32', 'user32', 'ws2_32']
|
|
elif ourplatform == 'linux2':
|
|
print "Building on linux2"
|
|
elif ourplatform == 'openbsd3':
|
|
print "Building on openbsd3"
|
|
|
|
root_build_dir = env['BF_BUILDDIR']
|
|
|
|
if env['VERSE_BUILD_BINARY'] == 'release':
|
|
cflags = extra_flags + release_flags + warn_flags
|
|
if ourplatform == 'win32-vc':
|
|
defines += ['NDEBUG']
|
|
else:
|
|
cflags = extra_flags + debug_flags + warn_flags
|
|
if ourplatform == 'win32-vc':
|
|
#defines += ['_DEBUG'] specifying this makes msvc want to link to python22_d.lib??
|
|
platform_linkflags += ['/DEBUG','/PDB:verse.pdb']
|
|
|
|
|
|
verse_env = env.Clone()
|
|
|
|
cmd_gen_files = (['v_cmd_gen.c',
|
|
'v_cmd_def_a.c',
|
|
'v_cmd_def_b.c',
|
|
'v_cmd_def_c.c',
|
|
'v_cmd_def_g.c',
|
|
'v_cmd_def_m.c',
|
|
'v_cmd_def_o.c',
|
|
'v_cmd_def_s.c',
|
|
'v_cmd_def_t.c'
|
|
])
|
|
|
|
cmd_gen_deps = (['v_gen_pack_init.c'])
|
|
|
|
proto_env = env.Clone()
|
|
proto_env.Append(CPPDEFINES=['V_GENERATE_FUNC_MODE'])
|
|
mkprot_tool = proto_env.Program(target = 'mkprot', source = cmd_gen_files)
|
|
|
|
mkprot_re = re.compile('v_cmd_def_([a-z]{1}).c')
|
|
def mkprot_emitter(target = None, source = None, env = None):
|
|
newtargets = list()
|
|
for s in source:
|
|
p, f = os.path.split(str(s))
|
|
m = mkprot_re.match(f)
|
|
if m:
|
|
newtargets.append("v_gen_pack_"+m.group(1)+"_node.c")
|
|
newtargets.extend(['verse.h'])
|
|
env.Depends(newtargets, mkprot_tool)
|
|
return (newtargets, source)
|
|
|
|
mkprot_bld = Builder(action = "\"" + mkprot_tool[0].abspath + "\" -src=\""+os.getcwd()+os.sep+"extern"+os.sep+"verse"+os.sep+"dist"+os.sep+os.sep+"\" -dst=\""+os.path.abspath(env['BF_BUILDDIR'])+os.sep+"extern"+os.sep+"verse"+os.sep+"dist"+os.sep+os.sep+"\"",
|
|
emitter = mkprot_emitter)
|
|
|
|
verse_env['BUILDERS']['Protocol'] = mkprot_bld
|
|
|
|
cmd_gen_deps.extend(verse_env.Protocol('do_mkprot', cmd_gen_files))
|
|
|
|
cmd_gen_deps.pop()
|
|
|
|
lib_source_files = (['v_cmd_buf.c',
|
|
'v_connect.c',
|
|
'v_connection.c',
|
|
'v_encryption.c',
|
|
'v_func_storage.c',
|
|
'v_man_pack_node.c',
|
|
'v_network.c',
|
|
'v_network_in_que.c',
|
|
'v_network_out_que.c',
|
|
'v_pack.c',
|
|
'v_pack_method.c',
|
|
'v_prime.c',
|
|
'v_randgen.c',
|
|
'v_util.c',
|
|
'v_bignum.c',
|
|
'verse_ms.c'
|
|
])
|
|
lib_source_files.extend(cmd_gen_deps)
|
|
|
|
server_source_files = (['vs_connection.c',
|
|
'vs_main.c',
|
|
'vs_master.c',
|
|
'vs_node_audio.c',
|
|
'vs_node_bitmap.c',
|
|
'vs_node_curve.c',
|
|
'vs_node_geometry.c',
|
|
'vs_node_head.c',
|
|
'vs_node_material.c',
|
|
'vs_node_object.c',
|
|
'vs_node_particle.c',
|
|
'vs_node_storage.c',
|
|
'vs_node_text.c'
|
|
])
|
|
|
|
verselib_env = verse_env.Clone()
|
|
verselib_env.Append(CPPDEFINES = defines)
|
|
|
|
verseserver_env = verse_env.Clone()
|
|
verseserver_env.Append(CPPDEFINES = defines)
|
|
verseserver_env.Append (LIBPATH = ['.'])
|
|
verseserver_env.Append (LIBS= ['verse'])
|
|
verseserver_env.Append (LIBS= platform_libs)
|
|
|
|
verselib_env.BlenderLib(libname='verse', sources=lib_source_files, includes=["."], defines = defines, libtype=['core', 'intern', 'player'], priority = [5, 5, 100])
|
|
verseserver_env.BlenderProg(builddir="#"+root_build_dir+os.sep, progname='verse', sources=server_source_files, libs=[],
|
|
libpath='#'+env['BF_BUILDDIR']+'/lib')
|
|
|
|
|