diff options
author | Jacek Antonelli | 2008-08-15 23:45:07 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:07 -0500 |
commit | 8465910c79b8e746e04fd581cca2d60399e569b9 (patch) | |
tree | f43fec3e83c46e0d6190dca923d6fb268b52ffdd /linden/indra/SConstruct | |
parent | Second Life viewer sources 1.18.2.1 (diff) | |
download | meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.zip meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.gz meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.bz2 meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.xz |
Second Life viewer sources 1.18.3.2-RC
Diffstat (limited to 'linden/indra/SConstruct')
-rw-r--r-- | linden/indra/SConstruct | 128 |
1 files changed, 74 insertions, 54 deletions
diff --git a/linden/indra/SConstruct b/linden/indra/SConstruct index e90a7e6..6105759 100644 --- a/linden/indra/SConstruct +++ b/linden/indra/SConstruct | |||
@@ -38,35 +38,25 @@ if platform == 'linux2': | |||
38 | # GET VERSION # | 38 | # GET VERSION # |
39 | ###################### | 39 | ###################### |
40 | 40 | ||
41 | def grep(filestr,searchstr): | 41 | def get_version(type): |
42 | try: | 42 | file = open('llcommon/llversion%s.h' % type,"r") |
43 | f = open( filestr, 'r' ) | 43 | file_str = file.read() |
44 | except IOError: | 44 | file.close() |
45 | print "No such file " + filestr | 45 | |
46 | sys.exit(2) | 46 | m = re.search('const S32 LL_VERSION_MAJOR = (\d+);', file_str) |
47 | r = re.compile( searchstr ) | 47 | VER_MAJOR = m.group(1) |
48 | for line in f.read().split('\n'): | 48 | m = re.search('const S32 LL_VERSION_MINOR = (\d+);', file_str) |
49 | if ( r.search(line) ): | 49 | VER_MINOR = m.group(1) |
50 | f.close() | 50 | m = re.search('const S32 LL_VERSION_PATCH = (\d+);', file_str) |
51 | return line | 51 | VER_PATCH = m.group(1) |
52 | f.close() | 52 | m = re.search('const S32 LL_VERSION_BUILD = (\d+);', file_str) |
53 | return None | 53 | VER_BUILD = m.group(1) |
54 | 54 | version = "%(VER_MAJOR)s.%(VER_MINOR)s.%(VER_PATCH)s.%(VER_BUILD)s" % locals() | |
55 | def get_version(llver): | ||
56 | re_vernum = re.compile("[0-9]+") | ||
57 | rstr = grep('llcommon/llversion.h', "LL_VERSION_" + llver) | ||
58 | if rstr == None: | ||
59 | print "No version information in llversion.h" | ||
60 | sys.exit(2) | ||
61 | version = re_vernum.findall( rstr )[1] | ||
62 | return version | ||
63 | 55 | ||
64 | version_major = get_version("MAJOR") | 56 | return version |
65 | version_minor = get_version("MINOR") | ||
66 | version_patch = get_version("PATCH") | ||
67 | version_build = get_version("BUILD") | ||
68 | 57 | ||
69 | version = version_major + '.' + version_minor + '.' + version_patch + '.' + version_build | 58 | version_viewer = get_version('viewer') |
59 | version_server = get_version('server') | ||
70 | 60 | ||
71 | 61 | ||
72 | ############### | 62 | ############### |
@@ -82,8 +72,6 @@ try: | |||
82 | except: | 72 | except: |
83 | debian_sarge = False | 73 | debian_sarge = False |
84 | 74 | ||
85 | fedora = os.path.exists('/etc/fedora-release') | ||
86 | |||
87 | ######################### | 75 | ######################### |
88 | # COMMAND LINE OPTIONS # | 76 | # COMMAND LINE OPTIONS # |
89 | ######################### | 77 | ######################### |
@@ -103,6 +91,8 @@ opts.AddOptions( | |||
103 | BoolOption('COLORGCC', 'Enabled colorgcc', True), | 91 | BoolOption('COLORGCC', 'Enabled colorgcc', True), |
104 | EnumOption('GRID', 'Client package\'s default grid', 'default', | 92 | EnumOption('GRID', 'Client package\'s default grid', 'default', |
105 | allowed_values=('default', 'aditi', 'agni', 'dmz', 'durga', 'firstlook', 'ganga', 'shakti', 'siva', 'soma', 'uma', 'vaak')), | 93 | allowed_values=('default', 'aditi', 'agni', 'dmz', 'durga', 'firstlook', 'ganga', 'shakti', 'siva', 'soma', 'uma', 'vaak')), |
94 | EnumOption('CHANNEL', 'Client package default channel', 'default', | ||
95 | allowed_values=('default', 'Release', 'Release Candidate', 'WindLight')), | ||
106 | BoolOption('ELFIO', 'Enabled enhanced backtraces with libELFIO symbol extraction support', True), | 96 | BoolOption('ELFIO', 'Enabled enhanced backtraces with libELFIO symbol extraction support', True), |
107 | BoolOption('STANDALONE', 'Build using system packages (implies OPENSOURCE)', False), | 97 | BoolOption('STANDALONE', 'Build using system packages (implies OPENSOURCE)', False), |
108 | BoolOption('OPENSOURCE', 'Build using only non-proprietary dependencies', True) # OPENSOURCE: do not edit this line | 98 | BoolOption('OPENSOURCE', 'Build using only non-proprietary dependencies', True) # OPENSOURCE: do not edit this line |
@@ -118,6 +108,7 @@ enable_mozlib = optenv['MOZLIB'] | |||
118 | enable_gstreamer = optenv['GSTREAMER'] | 108 | enable_gstreamer = optenv['GSTREAMER'] |
119 | enable_colorgcc = optenv['COLORGCC'] | 109 | enable_colorgcc = optenv['COLORGCC'] |
120 | grid = optenv['GRID'] | 110 | grid = optenv['GRID'] |
111 | channel = optenv['CHANNEL'] | ||
121 | standalone = optenv['STANDALONE'] | 112 | standalone = optenv['STANDALONE'] |
122 | opensource = standalone or optenv['OPENSOURCE'] | 113 | opensource = standalone or optenv['OPENSOURCE'] |
123 | enable_fmod = not opensource and optenv['FMOD'] | 114 | enable_fmod = not opensource and optenv['FMOD'] |
@@ -136,8 +127,6 @@ if standalone and platform != 'linux': | |||
136 | print >> sys.stderr, 'Warning: standalone builds have only been tested on Linux' | 127 | print >> sys.stderr, 'Warning: standalone builds have only been tested on Linux' |
137 | 128 | ||
138 | standalone_pkgs = [ | 129 | standalone_pkgs = [ |
139 | 'apr-1', | ||
140 | 'apr-util-1', | ||
141 | 'atk', | 130 | 'atk', |
142 | 'cairo', | 131 | 'cairo', |
143 | 'freetype2', | 132 | 'freetype2', |
@@ -146,7 +135,6 @@ standalone_pkgs = [ | |||
146 | 'glib-2.0', | 135 | 'glib-2.0', |
147 | 'gmodule-2.0', | 136 | 'gmodule-2.0', |
148 | 'gtk+-2.0', | 137 | 'gtk+-2.0', |
149 | 'libcurl', | ||
150 | 'libpng', | 138 | 'libpng', |
151 | 'pango', | 139 | 'pango', |
152 | 'pangoft2', | 140 | 'pangoft2', |
@@ -158,12 +146,22 @@ standalone_pkgs = [ | |||
158 | 'vorbisfile', | 146 | 'vorbisfile', |
159 | ] | 147 | ] |
160 | 148 | ||
149 | standalone_net_pkgs = [ | ||
150 | 'apr-1', | ||
151 | 'apr-util-1', | ||
152 | 'libcrypto', | ||
153 | 'libcurl', | ||
154 | 'libssl', | ||
155 | ] | ||
156 | |||
161 | def pkgconfig(opt, pkgs=None): | 157 | def pkgconfig(opt, pkgs=None): |
158 | if pkgs is None: | ||
159 | pkgs = standalone_pkgs + standalone_net_pkgs | ||
162 | return os.popen('pkg-config %s %s' % | 160 | return os.popen('pkg-config %s %s' % |
163 | (opt, pkgs or ' '.join(standalone_pkgs))).read().strip() | 161 | (opt, ' '.join(pkgs))).read().strip() |
164 | 162 | ||
165 | if standalone: | 163 | if standalone: |
166 | missing = [pkg for pkg in standalone_pkgs | 164 | missing = [pkg for pkg in standalone_pkgs + standalone_net_pkgs |
167 | if os.system('pkg-config --exists ' + pkg)] | 165 | if os.system('pkg-config --exists ' + pkg)] |
168 | if missing: | 166 | if missing: |
169 | print >> sys.stderr, ('Error: pkg-config cannot find these ' | 167 | print >> sys.stderr, ('Error: pkg-config cannot find these ' |
@@ -181,7 +179,7 @@ for build_target in targets: | |||
181 | 179 | ||
182 | system_str = arch + '-' + platform | 180 | system_str = arch + '-' + platform |
183 | 181 | ||
184 | print 'Building ' + build_target + ' ' + version + ' on ' + system_str + ' (' + buildtype + ')' | 182 | print 'Building ' + build_target + ' ' + version_server + ' on ' + system_str + ' (' + buildtype + ')' |
185 | 183 | ||
186 | system_lib_dir = '../libraries/' + system_str | 184 | system_lib_dir = '../libraries/' + system_str |
187 | 185 | ||
@@ -214,8 +212,11 @@ for build_target in targets: | |||
214 | '../libraries/' + system_str + '/include' ) | 212 | '../libraries/' + system_str + '/include' ) |
215 | 213 | ||
216 | if platform == 'linux' and build_target == 'client': | 214 | if platform == 'linux' and build_target == 'client': |
217 | if arch == 'x86_64' and os.path.exists('/usr/lib64'): | 215 | if standalone: |
218 | client_external_libs = [File('/usr/lib64/libresolv.a')] | 216 | if arch == 'x86_64' and os.path.exists('/usr/lib64'): |
217 | client_external_libs = [File('/usr/lib64/libresolv.a')] | ||
218 | else: | ||
219 | client_external_libs = [File('/usr/lib/libresolv.a')] | ||
219 | else: | 220 | else: |
220 | # Custom libresolv build which avoids a billion flavors of | 221 | # Custom libresolv build which avoids a billion flavors of |
221 | # brokenness prevalent in common libresolvs out there. | 222 | # brokenness prevalent in common libresolvs out there. |
@@ -254,7 +255,7 @@ for build_target in targets: | |||
254 | ############## | 255 | ############## |
255 | 256 | ||
256 | # Generic GCC flags | 257 | # Generic GCC flags |
257 | cflags = '-g -pipe -Wall -Wno-trigraphs -Wno-sign-compare -Werror ' | 258 | cflags = '-g -pipe -Wall -Wno-reorder -Wno-trigraphs -Wno-sign-compare -Werror ' |
258 | cxxflags = '' | 259 | cxxflags = '' |
259 | cppflags = '-D_FORTIFY_SOURCE=2 ' | 260 | cppflags = '-D_FORTIFY_SOURCE=2 ' |
260 | if standalone: | 261 | if standalone: |
@@ -275,7 +276,7 @@ for build_target in targets: | |||
275 | cppflags += server_cppflags + ' ' | 276 | cppflags += server_cppflags + ' ' |
276 | else: | 277 | else: |
277 | # Viewer flags | 278 | # Viewer flags |
278 | cflags += '-fno-math-errno -fexceptions -fsigned-char -fno-strict-aliasing ' | 279 | cflags += '-pthread -D_REENTRANT -fno-math-errno -fexceptions -fsigned-char -fno-strict-aliasing ' |
279 | cppflags += '-DLL_MESA_HEADLESS=0 -DLL_MESA=0 ' | 280 | cppflags += '-DLL_MESA_HEADLESS=0 -DLL_MESA=0 ' |
280 | try: | 281 | try: |
281 | client_cppflags = os.environ['CLIENT_CPPFLAGS'] | 282 | client_cppflags = os.environ['CLIENT_CPPFLAGS'] |
@@ -318,8 +319,7 @@ for build_target in targets: | |||
318 | # GStreamer stuff | 319 | # GStreamer stuff |
319 | if enable_gstreamer: | 320 | if enable_gstreamer: |
320 | cppflags += '-DLL_GSTREAMER_ENABLED=1 ' | 321 | cppflags += '-DLL_GSTREAMER_ENABLED=1 ' |
321 | client_external_libs += [ 'glib-2.0', 'gobject-2.0' ] | 322 | client_external_libs += [ 'glib-2.0', 'gobject-2.0', 'gthread-2.0' ] |
322 | #client_external_libs += [ 'gstreamer-0.10', 'gstvideo-0.10', 'gstaudio-0.10' ] | ||
323 | include_dirs += [ '../libraries/' + system_str + '/include/gstreamer-0.10' ] | 323 | include_dirs += [ '../libraries/' + system_str + '/include/gstreamer-0.10' ] |
324 | include_dirs += [ '../libraries/' + system_str + '/include/glib-2.0', '../libraries/' + system_str + '/include/glib-2.0/include' ] | 324 | include_dirs += [ '../libraries/' + system_str + '/include/glib-2.0', '../libraries/' + system_str + '/include/glib-2.0/include' ] |
325 | include_dirs += [ '../libraries/' + system_str + '/include/libxml2'] | 325 | include_dirs += [ '../libraries/' + system_str + '/include/libxml2'] |
@@ -544,9 +544,15 @@ for build_target in targets: | |||
544 | local_flags="", | 544 | local_flags="", |
545 | module_libs = [], | 545 | module_libs = [], |
546 | source_files = 'files.lst'): | 546 | source_files = 'files.lst'): |
547 | # -Bsymbolic avoids having the lib pull symbols from the app's | ||
548 | # namespace instead of its own by default. This avoids some | ||
549 | # rediculous problems with multiple destruction of the wrong | ||
550 | # objects, though has some gotchas of its own. | ||
551 | dyn_link_flags = '-Wl,-Bsymbolic' | ||
547 | files_list = load_files(module, source_files) | 552 | files_list = load_files(module, source_files) |
548 | BuildDir(build_dir + '/' + module, module, duplicate=duplicate) | 553 | BuildDir(build_dir + '/' + module, module, duplicate=duplicate) |
549 | local_env = env.Copy(CPPFLAGS = env['CPPFLAGS'] + ' ' + local_flags) | 554 | local_env = env.Copy(CPPFLAGS = env['CPPFLAGS'] + ' ' + local_flags, |
555 | LINKFLAGS = env['LINKFLAGS'] + ' ' + dyn_link_flags) | ||
550 | tgt = local_env.SharedLibrary(lib_dir + '/' + module, files_list, LIBS = module_libs) | 556 | tgt = local_env.SharedLibrary(lib_dir + '/' + module, files_list, LIBS = module_libs) |
551 | Default(tgt) | 557 | Default(tgt) |
552 | 558 | ||
@@ -596,12 +602,15 @@ for build_target in targets: | |||
596 | create_static_module('llxml') | 602 | create_static_module('llxml') |
597 | create_static_module('lscript', extra_depends=build_dir + '/lscript/lscript_compile/indra.y.h') | 603 | create_static_module('lscript', extra_depends=build_dir + '/lscript/lscript_compile/indra.y.h') |
598 | 604 | ||
599 | net_external_libs = [ 'curl', 'cares', 'ssl', 'crypto', 'expat', 'aprutil-1', 'apr-1' ] | 605 | if standalone: |
600 | common_external_libs = net_external_libs + [ 'z' ] | 606 | net_external_libs = [d[2:] for d in |
601 | if standalone and fedora: | 607 | pkgconfig('--libs-only-l', |
602 | common_external_libs += [ 'xmlrpc-epi' ] | 608 | standalone_net_pkgs).split()] |
603 | else: | 609 | else: |
604 | common_external_libs += [ 'xmlrpc' ] | 610 | net_external_libs = [ 'curl', 'ssl', 'crypto', 'aprutil-1', 'apr-1' ] |
611 | net_external_libs += [ 'cares', 'expat' ] | ||
612 | |||
613 | common_external_libs = net_external_libs + [ 'xmlrpc-epi', 'z' ] | ||
605 | 614 | ||
606 | if build_target == 'client': | 615 | if build_target == 'client': |
607 | if platform == 'linux': | 616 | if platform == 'linux': |
@@ -612,7 +621,7 @@ for build_target in targets: | |||
612 | if standalone: | 621 | if standalone: |
613 | external_libs = net_external_libs | 622 | external_libs = net_external_libs |
614 | external_libs += [d[2:] for d in | 623 | external_libs += [d[2:] for d in |
615 | pkgconfig('--libs-only-l', 'gtk+-2.0').split()] | 624 | pkgconfig('--libs-only-l', ['gtk+-2.0']).split()] |
616 | else: | 625 | else: |
617 | external_libs = net_external_libs + [ 'db-4.2', 'gtk-x11-2.0' ] | 626 | external_libs = net_external_libs + [ 'db-4.2', 'gtk-x11-2.0' ] |
618 | external_libs.remove('cares') | 627 | external_libs.remove('cares') |
@@ -672,14 +681,19 @@ for build_target in targets: | |||
672 | if platform == 'linux': | 681 | if platform == 'linux': |
673 | env.Command(output_bin + '-stripped', output_bin, strip_cmd) | 682 | env.Command(output_bin + '-stripped', output_bin, strip_cmd) |
674 | env.Command(output_crashlogger_bin + '-stripped', output_crashlogger_bin, strip_cmd) | 683 | env.Command(output_crashlogger_bin + '-stripped', output_crashlogger_bin, strip_cmd) |
675 | product_name = 'SecondLife_' + arch + '_' + version_major + "_" + version_minor + "_" + version_patch + "_" + version_build | 684 | product_name = 'SecondLife_' + arch + '_' + "_".join(version_viewer.split(".")) |
676 | if grid not in ['default', 'agni']: | 685 | if grid not in ['default', 'agni']: |
677 | product_name += "_" + grid.upper() | 686 | product_name += "_" + grid.upper() |
687 | if channel not in ['default', 'Release']: | ||
688 | product_name += "_" + "".join(channel.upper().split()) | ||
689 | |||
678 | package_name = product_name + '.tar.bz2' | 690 | package_name = product_name + '.tar.bz2' |
679 | cmd = 'rm -rf newview/%(pn)s* && newview/viewer_manifest.py --grid=%(grid)s --installer_name=%(pn)s --arch=%(arch)s' % { | 691 | complete_channel = 'Second Life ' + channel |
692 | cmd = 'rm -rf newview/%(pn)s* && newview/viewer_manifest.py --grid=%(grid)s --channel=\'%(ch)s\' --installer_name=%(pn)s --arch=%(arch)s' % { | ||
680 | 'pn': product_name, | 693 | 'pn': product_name, |
681 | 'grid':grid, | 694 | 'grid':grid, |
682 | 'arch':arch} | 695 | 'arch':arch, |
696 | 'ch':complete_channel} | ||
683 | env.Command('newview/' + package_name, 'newview/viewer_manifest.py', cmd) | 697 | env.Command('newview/' + package_name, 'newview/viewer_manifest.py', cmd) |
684 | Depends('newview/' + package_name, output_bin + '-stripped') | 698 | Depends('newview/' + package_name, output_bin + '-stripped') |
685 | Depends('newview/' + package_name, output_crashlogger_bin + '-stripped') | 699 | Depends('newview/' + package_name, output_crashlogger_bin + '-stripped') |
@@ -724,7 +738,9 @@ for build_target in targets: | |||
724 | internal_libs + external_libs) | 738 | internal_libs + external_libs) |
725 | 739 | ||
726 | # Dataserver | 740 | # Dataserver |
727 | external_libs = common_external_libs + ['boost_regex-gcc-mt', 'mysqlclient'] | 741 | external_libs = common_external_libs + [ |
742 | 'boost_regex-gcc-mt', 'mysqlclient', 'tcmalloc', 'stacktrace', | ||
743 | ] | ||
728 | internal_libs = [ 'llcharacter', 'lldatabase', 'llimage', 'llimagej2coj', 'llinventory', | 744 | internal_libs = [ 'llcharacter', 'lldatabase', 'llimage', 'llimagej2coj', 'llinventory', |
729 | 'llscene', 'llmessage', 'llvfs', 'llxml', 'llcommon', 'llmath' ] | 745 | 'llscene', 'llmessage', 'llvfs', 'llxml', 'llcommon', 'llmath' ] |
730 | create_executable('dataserver/dataserver' + file_suffix, 'dataserver', | 746 | create_executable('dataserver/dataserver' + file_suffix, 'dataserver', |
@@ -738,7 +754,7 @@ for build_target in targets: | |||
738 | internal_libs + external_libs) | 754 | internal_libs + external_libs) |
739 | 755 | ||
740 | # Rpcserver | 756 | # Rpcserver |
741 | external_libs = common_external_libs + ['xmlrpc', 'mysqlclient'] | 757 | external_libs = common_external_libs + ['xmlrpc-epi', 'mysqlclient'] |
742 | internal_libs = ['llscene', 'llmessage', 'lldatabase', 'llvfs', | 758 | internal_libs = ['llscene', 'llmessage', 'lldatabase', 'llvfs', |
743 | 'llmath', 'llcommon'] | 759 | 'llmath', 'llcommon'] |
744 | create_executable('rpcserver/rpcserver' + file_suffix, 'rpcserver', | 760 | create_executable('rpcserver/rpcserver' + file_suffix, 'rpcserver', |
@@ -754,7 +770,11 @@ for build_target in targets: | |||
754 | internal_libs + external_libs) | 770 | internal_libs + external_libs) |
755 | 771 | ||
756 | # Simulator | 772 | # Simulator |
757 | external_libs = common_external_libs + ['hkdynamics', 'hkgeometry', 'hkmath', 'hkbase', 'hkcollide', 'hkactions', 'boost_regex-gcc-mt', 'openjpeg', 'dl', 'kdu', 'mysqlclient', 'iconv'] | 773 | external_libs = common_external_libs + [ |
774 | 'hkdynamics', 'hkgeometry', 'hkmath', 'hkbase', 'hkcollide', | ||
775 | 'hkactions', 'boost_regex-gcc-mt', 'openjpeg', 'dl', 'kdu', | ||
776 | 'mysqlclient', 'iconv', 'tcmalloc', 'stacktrace', | ||
777 | ] | ||
758 | internal_libs = [ 'lscript', 'llprimitive', | 778 | internal_libs = [ 'lscript', 'llprimitive', |
759 | 'llscene', 'llhavok', 'llinventory', 'llimage', 'llimagej2coj', | 779 | 'llscene', 'llhavok', 'llinventory', 'llimage', 'llimagej2coj', |
760 | 'llcharacter', 'llxml', 'lldatabase', 'llkdustatic', | 780 | 'llcharacter', 'llxml', 'lldatabase', 'llkdustatic', |