Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SConstruct « dist « verse « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a80a1ac79e9d2298a7a09c19c101bc524203c9eb (plain)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/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')