diff options
Diffstat (limited to 'linden/indra/SConstruct')
-rw-r--r-- | linden/indra/SConstruct | 88 |
1 files changed, 66 insertions, 22 deletions
diff --git a/linden/indra/SConstruct b/linden/indra/SConstruct index cbf2029..39b50bc 100644 --- a/linden/indra/SConstruct +++ b/linden/indra/SConstruct | |||
@@ -1,4 +1,4 @@ | |||
1 | ################################################# | 1 | ################################################# -*- python -*- |
2 | # | 2 | # |
3 | # SConstruct makefile for Second Life viewer | 3 | # SConstruct makefile for Second Life viewer |
4 | # and servers. | 4 | # and servers. |
@@ -19,6 +19,7 @@ | |||
19 | import os | 19 | import os |
20 | import sys | 20 | import sys |
21 | import glob | 21 | import glob |
22 | import re | ||
22 | 23 | ||
23 | platform = sys.platform | 24 | platform = sys.platform |
24 | if platform == 'linux2': | 25 | if platform == 'linux2': |
@@ -28,18 +29,49 @@ if platform == 'linux2': | |||
28 | # GET VERSION # | 29 | # GET VERSION # |
29 | ###################### | 30 | ###################### |
30 | 31 | ||
31 | pipe = os.popen('grep LL_VERSION_MAJOR llcommon/llversion.h | sed \'s/.*=//; s/[^0-9]*//g\'') | 32 | def grep(filestr,searchstr): |
32 | version_major = pipe.read().rstrip('\n') | 33 | try: |
33 | pipe.close() | 34 | f = open( filestr, 'r' ) |
34 | pipe = os.popen('grep LL_VERSION_MINOR llcommon/llversion.h | sed \'s/.*=//; s/[^0-9]*//g\'') | 35 | except IOError: |
35 | version_minor = pipe.read().rstrip('\n') | 36 | print "No such file " + filestr |
36 | pipe.close() | 37 | sys.exit(2) |
37 | pipe = os.popen('grep LL_VERSION_PATCH llcommon/llversion.h | sed \'s/.*=//; s/[^0-9]*//g\'') | 38 | r = re.compile( searchstr ) |
38 | version_patch = pipe.read().rstrip('\n') | 39 | for line in f.read().split('\n'): |
39 | pipe.close() | 40 | if ( r.search(line) ): |
40 | pipe = os.popen('grep LL_VERSION_BUILD llcommon/llversion.h | sed \'s/.*=//; s/[^0-9]*//g\'') | 41 | f.close() |
41 | version_build = pipe.read().rstrip('\n') | 42 | return line |
42 | pipe.close() | 43 | f.close() |
44 | return None | ||
45 | |||
46 | def get_version(llver): | ||
47 | re_vernum = re.compile("[0-9]+") | ||
48 | rstr = grep('llcommon/llversion.h', "LL_VERSION_" + llver) | ||
49 | if rstr == None: | ||
50 | print "No version information in llversion.h" | ||
51 | sys.exit(2) | ||
52 | version = re_vernum.findall( rstr )[1] | ||
53 | return version | ||
54 | |||
55 | version_major = get_version("MAJOR") | ||
56 | version_minor = get_version("MINOR") | ||
57 | version_patch = get_version("PATCH") | ||
58 | version_build = get_version("BUILD") | ||
59 | |||
60 | version = version_major + '.' + version_minor + '.' + version_patch + '.' + version_build | ||
61 | |||
62 | |||
63 | ############### | ||
64 | # SYSTEM INFO # | ||
65 | ############### | ||
66 | |||
67 | # Debian Sarge has a broken glibc that leads to build failures on | ||
68 | # *non*-Sarge systems (because of prebuilt static libraries built on | ||
69 | # Sarge). | ||
70 | |||
71 | try: | ||
72 | debian_sarge = open('/etc/debian_version').read().strip() == '3.1' | ||
73 | except: | ||
74 | debian_sarge = False | ||
43 | 75 | ||
44 | ######################### | 76 | ######################### |
45 | # COMMAND LINE OPTIONS # | 77 | # COMMAND LINE OPTIONS # |
@@ -90,7 +122,7 @@ for build_target in targets: | |||
90 | 122 | ||
91 | system_str = arch + '-' + platform | 123 | system_str = arch + '-' + platform |
92 | 124 | ||
93 | print 'Building ' + build_target + ' ' + version_major + '.' + version_minor + '.' + version_patch + '.' + version_build + ' on ' + system_str + ' (' + buildtype + ')' | 125 | print 'Building ' + build_target + ' ' + version + ' on ' + system_str + ' (' + buildtype + ')' |
94 | 126 | ||
95 | system_lib_dir = '../libraries/' + system_str | 127 | system_lib_dir = '../libraries/' + system_str |
96 | if build_target == 'client': | 128 | if build_target == 'client': |
@@ -161,11 +193,15 @@ for build_target in targets: | |||
161 | 193 | ||
162 | if build_target == 'server': | 194 | if build_target == 'server': |
163 | # Server flags | 195 | # Server flags |
164 | flags += '-march=pentiumpro -D_GNU_SOURCE -ftemplate-depth-60 -DLL_MESA_HEADLESS=1 -DLL_MESA=1 ' | 196 | flags += '-D_GNU_SOURCE -ftemplate-depth-60 -DLL_MESA_HEADLESS=1 -DLL_MESA=1 ' |
165 | try: | 197 | if arch == 'i686': |
166 | server_cppflags = os.environ['SERVER_CPPFLAGS'] | 198 | flags += '-march=pentiumpro ' |
167 | except: | 199 | if debian_sarge: |
168 | server_cppflags = '' | 200 | def_server_cppflags = '' |
201 | else: | ||
202 | def_server_cppflags = '-DCTYPE_WORKAROUND' | ||
203 | server_cppflags = os.environ.get('SERVER_CPPFLAGS', | ||
204 | def_server_cppflags) | ||
169 | flags += server_cppflags + ' ' | 205 | flags += server_cppflags + ' ' |
170 | else: | 206 | else: |
171 | # Viewer flags | 207 | # Viewer flags |
@@ -243,9 +279,15 @@ for build_target in targets: | |||
243 | if enable_distcc: | 279 | if enable_distcc: |
244 | compiler = 'distcc ' + gcc_bin | 280 | compiler = 'distcc ' + gcc_bin |
245 | 281 | ||
282 | lib_path = [lib_dir] + [system_lib_dir] | ||
283 | |||
284 | mysql_lib_dir = '/usr/lib/mysql4/mysql' | ||
285 | if os.path.isdir(mysql_lib_dir): | ||
286 | lib_path.append(mysql_lib_dir) | ||
287 | |||
246 | base_env = Environment(CXX = compiler, | 288 | base_env = Environment(CXX = compiler, |
247 | CPPPATH = include_dirs, | 289 | CPPPATH = include_dirs, |
248 | LIBPATH = [lib_dir] + [system_lib_dir], | 290 | LIBPATH = lib_path, |
249 | LINKFLAGS = system_link_flags + '--no-keep-memory --reduce-memory-overheads ' ) | 291 | LINKFLAGS = system_link_flags + '--no-keep-memory --reduce-memory-overheads ' ) |
250 | 292 | ||
251 | ### Environments for various build types ### | 293 | ### Environments for various build types ### |
@@ -418,8 +460,10 @@ for build_target in targets: | |||
418 | 460 | ||
419 | external_libs = client_external_libs + common_external_libs + [ 'freetype', 'jpeg', 'SDL', 'GL', 'GLU', 'ogg', 'vorbisenc', 'vorbisfile', 'vorbis', 'db-4.2', 'openjpeg' ] | 461 | external_libs = client_external_libs + common_external_libs + [ 'freetype', 'jpeg', 'SDL', 'GL', 'GLU', 'ogg', 'vorbisenc', 'vorbisfile', 'vorbis', 'db-4.2', 'openjpeg' ] |
420 | 462 | ||
421 | if arch != 'x86_64' and arch != 'x86_64cross' and enable_fmod: | 463 | if arch != 'x86_64' and arch != 'x86_64cross': |
422 | external_libs += [ 'fmod-3.75' ] | 464 | if enable_fmod: |
465 | external_libs += [ 'fmod-3.75' ] | ||
466 | external_libs += ['tcmalloc', 'stacktrace'] | ||
423 | 467 | ||
424 | external_libs.remove('cares') | 468 | external_libs.remove('cares') |
425 | 469 | ||