forked from xmms2/xmms2-devel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wscript
641 lines (544 loc) · 23.4 KB
/
wscript
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
# encoding: utf-8
#
# WAF build scripts for XMMS2
# Copyright (C) 2006-2017 XMMS2 Team
#
import sys
if sys.version_info < (2,4):
raise RuntimeError("Python 2.4 or newer is required")
import os
import logging
# Waf removes the current dir from the python path. We readd it to import waf
# tools stuff.
sys.path.insert(0, os.getcwd())
from waflib import Configure, Options, Utils, Errors, Logs
from waftools.compiler_flags import compiler_flags
from waftools import gittools
BASEVERSION="0.8 DrO_o"
APPNAME='xmms2'
top = '.'
out = '_build_'
_waf_hexversion = 0x1090900
_waf_mismatch_msg = """
You are building xmms2 with a waf version that is different from the one
distributed with xmms2. This is not supported by the XMMS2 Team. Before
reporting any errors with this setup, please rebuild XMMS2 using './waf
configure build install'
"""
####
## Initialization
####
def init(ctx):
import gc
gc.disable()
from waflib import Context
if _waf_hexversion != Context.HEXVERSION:
Logs.warn(_waf_mismatch_msg)
xmms2d_dirs = """
src/xmms
src/lib/s4/src/lib
""".split()
subdirs = """
src/lib/xmmstypes
src/lib/xmmsc-glib
src/lib/xmmssocket
src/lib/xmmsipc
src/lib/xmmsutils
src/lib/xmmsvisualization
src/clients/lib/xmmsclient
src/clients/lib/xmmsclient-glib
src/include
src/includepriv
""".split()
optional_subdirs = """
src/clients/nycli
src/clients/launcher
src/clients/et
src/clients/mdns
src/clients/medialib-updater
src/clients/vistest
src/clients/lib/xmmsclient-ecore
src/clients/lib/xmmsclient++
src/clients/lib/xmmsclient++-glib
src/clients/lib/xmmsclient-cf
src/clients/lib/python
src/clients/lib/perl
src/clients/lib/ruby
src/lib/s4/src/tools/s4
src/lib/s4/tests
src/tools/sqlite2s4
src/tools/migrate-collections
tests
pixmaps
""".split()
builtin_plugins_defaults = """
equalizer
replaygain
""".split()
def is_plugin(x):
return os.path.exists(os.path.join("src/plugins", x, "wscript"))
all_optionals = set(os.path.basename(o) for o in optional_subdirs)
all_plugins = set(p for p in os.listdir("src/plugins") if is_plugin(p))
def get_newest(*dirs):
m = 0
for d in dirs:
m = max([m]+[os.stat(os.path.join(sd, "wscript")).st_mtime for sd in d])
return m
####
## Build
####
def build(bld):
subdirs = bld.env.BUILD_SUBDIRS
plugins = bld.env.XMMS_PLUGINS_ENABLED
plugindirs = ["src/plugins/%s" % plugin for plugin in plugins]
optionaldirs = bld.env.XMMS_OPTIONAL_BUILD
newest = get_newest(subdirs, plugindirs, optionaldirs)
if bld.env.NEWEST_WSCRIPT_SUBDIR and newest > bld.env.NEWEST_WSCRIPT_SUBDIR:
bld.fatal("You need to run waf configure")
raise SystemExit()
bld.recurse(subdirs)
bld.recurse(plugindirs)
bld.recurse(optionaldirs)
for name, lib in bld.env.XMMS_PKGCONF_FILES:
bld(features = 'subst',
source = 'xmms2.pc.in',
target = name + '.pc',
install_path = '${PKGCONFIGDIR}',
NAME = name,
LIB = lib+' ', # Avoid error in waf 1.6 if lib == ''
PREFIX = bld.env.PREFIX,
BINDIR = bld.env.BINDIR,
LIBDIR = bld.env.LIBDIR,
INCLUDEDIR = os.path.join(bld.env.INCLUDEDIR, "xmms2"),
VERSION = bld.env.VERSION
)
bld.install_files('${SHAREDDIR}', "mind.in.a.box-lament_snipplet.ogg")
bld.add_post_fun(shutdown)
####
## Configuration
####
def _configure_optionals(conf):
"""Process the optional xmms2 subprojects"""
def _check_exist(optionals, msg):
unknown_optionals = optionals.difference(all_optionals)
if unknown_optionals:
conf.fatal(msg%dict(unknown_optionals=', '.join(unknown_optionals)))
raise SystemExit()
return optionals
conf.env.XMMS_OPTIONAL_BUILD = []
if conf.options.enable_optionals is not None:
selected_optionals = _check_exist(set(conf.options.enable_optionals),
"The following optional(s) were requested, "
"but don't exist: %(unknown_optionals)s")
optionals_must_work = True
elif conf.options.disable_optionals is not None:
disabled_optionals = _check_exist(set(conf.options.disable_optionals),
"The following optional(s) were disabled, "
"but don't exist: %(unknown_optionals)s")
selected_optionals = all_optionals.difference(disabled_optionals)
optionals_must_work = False
else:
selected_optionals = all_optionals
optionals_must_work = False
succeeded_optionals = set()
for o in optional_subdirs:
if os.path.basename(o) not in selected_optionals:
continue
try:
conf.recurse(o)
conf.env.append_value('XMMS_OPTIONAL_BUILD', o)
succeeded_optionals.add(os.path.basename(o))
except Errors.ConfigurationError:
if optionals_must_work:
# This raises a new exception:
conf.fatal("The required optional %s failed to configure: %s" % (o, sys.exc_info()[1]))
else:
pass
disabled_optionals = set(all_optionals)
disabled_optionals.difference_update(succeeded_optionals)
return succeeded_optionals, disabled_optionals
def _configure_plugins(conf):
"""Process ll xmms2d plugins"""
def _check_exist(universe, plugins, msg):
unknown_plugins = plugins.difference(universe)
if unknown_plugins:
conf.fatal(msg%dict(unknown_plugins=', '.join(unknown_plugins)))
raise SystemExit(1)
return plugins
conf.env.XMMS_PLUGINS_ENABLED = []
conf.env.XMMS_PLUGINS_BUILTIN = []
if conf.options.enable_plugins is not None:
selected_plugins = _check_exist(all_plugins, set(conf.options.enable_plugins),
"The following plugin(s) were requested, "
"but don't exist: %(unknown_plugins)s")
disabled_plugins = all_plugins.difference(selected_plugins)
plugins_must_work = True
elif conf.options.disable_plugins is not None:
disabled_plugins = _check_exist(all_plugins, set(conf.options.disable_plugins),
"The following plugin(s) were disabled, "
"but don't exist: %(unknown_plugins)s")
selected_plugins = all_plugins.difference(disabled_plugins)
plugins_must_work = False
elif conf.options.without_xmms2d:
disabled_plugins = all_plugins
selected_plugins = set()
plugins_must_work = False
else:
selected_plugins = all_plugins
disabled_plugins = set()
plugins_must_work = False
if conf.options.builtin_plugins is None:
builtin_plugins = selected_plugins.intersection(builtin_plugins_defaults)
else:
builtin_plugins = conf.options.builtin_plugins
if builtin_plugins and not conf.options.without_xmms2d:
builtin_plugins = _check_exist(selected_plugins, set(builtin_plugins),
"The following plugin(s) were requested to be built-in, "
"but weren't enabled: %(unknown_plugins)s")
conf.env.XMMS_PLUGINS_BUILTIN = builtin_plugins
def disable_plugin(plugin, must_work, exc = None):
disabled_plugins.add(plugin)
if must_work:
if exc:
conf.fatal("The required plugin %s failed to configure: %s"
% (plugin, exc))
else:
conf.fatal("The required plugin %s failed to configure"
% plugin)
for plugin in selected_plugins:
must_work = plugins_must_work or plugin in conf.env.XMMS_PLUGINS_BUILTIN
try:
conf.recurse("src/plugins/%s" % plugin)
if plugin not in conf.env.XMMS_PLUGINS_ENABLED[-1:]:
disable_plugin(plugin, must_work)
except Errors.ConfigurationError:
disable_plugin(plugin, must_work, sys.exc_info()[1])
return conf.env.XMMS_PLUGINS_ENABLED, disabled_plugins, conf.env.XMMS_PLUGINS_BUILTIN
def check_git_submodules():
submodules = gittools.get_submodules()
needupdate = False
for k in submodules:
status, commithash = submodules[k]
commithash = commithash[:8]
Logs.pprint('NORMAL', "%s:" % k, sep='')
if status == 'missing':
Logs.pprint('RED', "%s (not initialized)" % commithash)
Logs.pprint('RED',
"The submodule '%s' is not initialized. "
"Run `git submodule update --init` and try again." % k)
raise SystemExit(1)
elif status == 'outdated':
Logs.pprint('YELLOW', "%s (may need update)" % commithash)
needupdate = True
else:
Logs.pprint('GREEN', '%s (up-to-date)' % commithash)
if needupdate:
Logs.pprint('YELLOW',
"Some submodules are not up-to-date. You may need to run "
"`git submodule update` and reconfigure.")
def _output_summary(enabled_plugins, disabled_plugins, builtin_plugins,
enabled_optionals, disabled_optionals,
output_plugins, warning_cache):
enabled_plugins = [x for x in enabled_plugins if x not in output_plugins]
Logs.pprint('Normal', "\n")
# Check again for outdated submodules.
Logs.pprint('NORMAL', "Git submodules:\n"
"===============")
check_git_submodules()
Logs.pprint('Normal', "\n"
"Optional configuration:\n"
"=======================")
Logs.pprint('Normal', "Enabled: ", sep='')
Logs.pprint('BLUE', ', '.join(sorted(enabled_optionals)))
Logs.pprint('Normal', "Disabled: ", sep='')
Logs.pprint('BLUE', ', '.join(sorted(disabled_optionals)))
Logs.pprint('Normal', "\n"
"Plugins configuration:\n"
"======================")
Logs.pprint('Normal', 'Output: ', sep='')
Logs.pprint('BLUE', ', '.join(sorted(output_plugins)))
Logs.pprint('Normal', 'XForm/Other: ', sep='')
Logs.pprint('BLUE', ', '.join(sorted(enabled_plugins)))
Logs.pprint('Normal', 'Disabled: ', sep='')
Logs.pprint('BLUE', ', '.join(sorted(disabled_plugins)))
Logs.pprint('Normal', 'Built-ins: ', sep='')
Logs.pprint('BLUE', ', '.join(sorted(builtin_plugins)))
if len(warning_cache) > 0:
fmter = Logs.formatter();
Logs.pprint('Normal', "Warnings from buildsystem:\n"
"==========================")
for i,x in enumerate(warning_cache):
sys.stderr.write("%d: %s\n" % (i, fmter.format(x)))
class _CacheHandler(logging.Handler):
def __init__(self, cache, lvl = logging.NOTSET):
logging.Handler.__init__(self, lvl)
self.cache = cache
def emit(self, rec):
self.cache.append(rec)
def configure(conf):
global subdirs
warning_cache = []
logging.getLogger("waflib").addHandler(_CacheHandler(warning_cache, logging.WARNING))
has_platform_support = os.name in ('nt', 'posix')
conf.msg('Platform code for %s' % os.name, has_platform_support)
if not has_platform_support:
conf.fatal('xmms2 only has platform support for Windows and POSIX operating systems.')
raise SystemExit(1)
if 'PKG_CONFIG_PREFIX' in os.environ:
prefix = os.environ['PKG_CONFIG_PREFIX']
if not os.path.isabs(prefix):
pretix = os.path.abspath(prefix)
conf.env.PKG_CONFIG_DEFINES = dict(prefix=prefix)
conf.env.BUILD_XMMS2D = False
if not conf.options.without_xmms2d:
conf.env.BUILD_XMMS2D = True
subdirs = xmms2d_dirs + subdirs
conf.env.BUILD_SUBDIRS = subdirs
conf.load('gnu_dirs')
conf.load('man', tooldir='waftools')
conf.load('compiler_c')
conf.load('compiler_cxx')
conf.load('visibility', tooldir='waftools')
conf.load('localdeps', tooldir='waftools')
conf.load('python-generator', tooldir='waftools')
if conf.options.target_platform:
Utils.unversioned_sys_platform = lambda : conf.options.target_platform
nam, changed = gittools.get_info()
conf.msg("git commit id", nam)
conf.msg("uncommited changed", changed and "yes" or "no")
conf.env.VERSION = conf.options.customversion % {
"commit": nam + (changed and "-dirty" or ""),
"version": BASEVERSION
}
for env in ('CFLAGS', 'CXXFLAGS'):
# Makes sure the env variable exists and is a list
conf.env.append_unique(env, [])
hasoptim=False
for f in conf.env[env]:
if f.startswith('-O'):
hasoptim=True
break
if not hasoptim:
conf.env.append_unique(env, ['-g', '-O0'])
if conf.options.enable_gcov:
conf.env.enable_gcov = True
conf.env.append_unique('CFLAGS', ['--coverage', '-pg'])
conf.env.append_unique('LINKFLAGS', ['--coverage', '-pg'])
flags = compiler_flags(conf)
flags.enable_c_warning('all')
flags.enable_c_warning('empty-body')
flags.enable_c_warning('format=2')
flags.enable_c_warning('format-nonliteral')
flags.enable_c_warning('format-security')
flags.enable_c_warning('ignored-qualifiers')
flags.enable_c_warning('missing-prototypes')
flags.enable_c_warning('strict-prototypes')
flags.enable_c_warning('type-limits')
flags.enable_c_warning('write-strings')
flags.enable_c_warning('unused-but-set-variable')
flags.disable_c_warning('format-extra-args')
flags.disable_c_warning('format-zero-length')
flags.enable_feature('diagnostics-show-option')
flags.enable_c_error('implicit-function-declaration')
conf.env.XMMS_PKGCONF_FILES = []
conf.env.XMMS_OUTPUT_PLUGINS = [(-1, "NONE")]
if conf.options.pkgconfigdir:
conf.env.PKGCONFIGDIR = conf.options.pkgconfigdir
Logs.pprint('Normal', conf.env.PKGCONFIGDIR) #XXX What is it ?
else:
conf.env.PKGCONFIGDIR = os.path.join(conf.env.LIBDIR, 'pkgconfig')
if conf.options.config_prefix:
for d in conf.options.config_prefix:
if not os.path.isabs(d):
d = os.path.abspath(d)
conf.env.prepend_value('LIBPATH', os.path.join(d, 'lib'))
conf.env.prepend_value('INCLUDES', os.path.join(d, 'include'))
if Utils.unversioned_sys_platform() != 'win32':
conf.env.CFLAGS_cshlib = ['-fPIC', '-DPIC']
conf.env.CFLAGS_cstlib = ['-fPIC', '-DPIC']
conf.env.CPPFLAGS_cxxshlib = ['-fPIC', '-DPIC']
conf.env.CPPFLAGS_cxxstlib = ['-fPIC', '-DPIC']
else:
# As we have to change target platform after the tools
# have been loaded there are a few variables that needs
# to be initiated if building for win32.
# Make sure we don't have -fPIC and/or -DPIC in our CFLAGS
conf.env.CFLAGS_cshlib = []
conf.env.CXXFLAGS_cxxshlib = []
# Setup various prefixes
conf.env.cshlib_PATTERN = 'lib%s.dll'
conf.env.cprogram_PATTERN = '%s.exe'
if Utils.unversioned_sys_platform() == 'darwin':
conf.env.append_value('LINKFLAGS', '-headerpad_max_install_names')
conf.env.explicit_install_name = True
else:
conf.env.explicit_install_name = False
if Utils.unversioned_sys_platform() == 'sunos':
conf.check_cc(function_name='socket', lib='socket', header_name='sys/socket.h', uselib_store='socket')
conf.env.append_unique('CFLAGS', '-D_POSIX_PTHREAD_SEMANTICS')
conf.env.append_unique('CFLAGS', '-D_REENTRANT')
conf.env.append_unique('CFLAGS', '-std=gnu99')
conf.env.socket_impl = 'socket'
elif Utils.unversioned_sys_platform() == 'win32':
if conf.options.winver:
major, minor = [int(x) for x in Options.options.winver.split('.')]
else:
try:
major, minor = sys.getwindowsversion()[:2]
except AttributeError:
Logs.warn("No Windows version found and no version set. "
"Defaulting to 5.1 (XP). You will not be able to use "
"this build of XMMS2 on older Windows versions.")
major, minor = (5, 1)
need_wspiapi = True
if ((major, minor) >= (5, 1)):
need_wspiapi = False
# check_cc is mandatory by default.
for lib in 'wsock32 ws2_32'.split():
conf.check_cc(lib=lib, uselib_store="socket")
for hdr in 'windows.h ws2tcpip.h winsock2.h'.split():
conf.check_cc(header_name=hdr, uselib="socket")
code = """
#include <ws2tcpip.h>
#include <wspiapi.h>
int main() { return 0; }
"""
if not conf.check_cc(header_name="wspiapi.h", fragment=code,
uselib="socket", mandatory=need_wspiapi):
Logs.warn('This XMMS2 will only run on Windows XP and newer '
'machines. If you are planning to use XMMS2 on older '
'versions of Windows or are packaging a binary, please '
'consider installing the WSPiApi.h header for '
'compatibility. It is provided by the Platform SDK.')
conf.env.DEFINES += [
'_WIN32_WINNT=0x%02x%02x' % (major, minor),
'HAVE_WINSOCK2=1'
]
conf.env.socket_impl = 'wsock32'
else:
conf.env.socket_impl = 'posix'
conf.env.xmms_icon = False
if Utils.unversioned_sys_platform() == 'win32':
try:
conf.load('winres')
except Errors.ConfigurationError:
pass
else:
conf.env.WINRCFLAGS = '-I%s' % os.path.abspath('pixmaps')
conf.env.xmms_icon = True
# TaskGen.mac_bundle option seems to be no longer silently ignored
# if gcc -bundle option is not available.
# TODO: Add --no-mac-bundle in options ?
conf.env.mac_bundle_enabled = Utils.unversioned_sys_platform() == 'darwin'
conf.check_cfg(package='glib-2.0', atleast_version='2.32.0',
uselib_store='glib2', args='--cflags --libs')
# Valgrind can be used for debugging here and there, so lets check
# it at top-level so each consumer don't have to bother.
try:
conf.check_cfg(package='valgrind', uselib_store='valgrind',
args='--cflags')
except Errors.ConfigurationError:
conf.env.have_valgrind = False
else:
conf.env.have_valgrind = True
enabled_plugins, disabled_plugins, builtin_plugins = _configure_plugins(conf)
enabled_optionals, disabled_optionals = _configure_optionals(conf)
plugins = conf.env.XMMS_PLUGINS_ENABLED
plugindirs = ["src/plugins/%s" % plugin for plugin in plugins]
optionaldirs = conf.env.XMMS_OPTIONAL_BUILD
newest = get_newest(subdirs, plugindirs, optionaldirs)
conf.env.NEWEST_WSCRIPT_SUBDIR = newest
[conf.recurse(s) for s in subdirs]
conf.write_config_header('xmms_configuration.h')
output_plugins = [name for x, name in conf.env.XMMS_OUTPUT_PLUGINS if x > 0]
_output_summary(
enabled_plugins, disabled_plugins, builtin_plugins,
enabled_optionals, disabled_optionals,
output_plugins, warning_cache)
conf.env.DEFINES += ["XMMS_DISABLE_DEPRECATION_WARNINGS"]
return True
####
## Options
####
def _list_cb(option, opt, value, parser):
"""
Callback for specifying a comma seperated lists of strings.
If the string value is empty, set the option to []. If the string value
starts with a comma, augment the pre-existing option (if any) with the list
represented by the string value[1::]. Otherwise set the option to the list
represented by the string value.
Before the above delete any space from the string value.
"""
value = value.replace(' ','')
if value == '':
vals = []
elif value[0] == ',':
vals = value[1::].split(',')
if getattr(parser.values, option.dest):
vals = getattr(parser.values, option.dest) + vals
else:
vals = value.split(',')
setattr(parser.values, option.dest, vals)
def options(opt):
opt.load('gnu_dirs')
opt.load('compiler_c')
opt.load('compiler_cxx')
opt.add_option('--with-custom-version', type='string',
dest='customversion', default="%(version)s (git commit: %(commit)s)",
help="Override git commit hash version, may use %(version)s, %(commit)s")
opt.add_option('--with-plugins', action="callback", callback=_list_cb,
type="string", dest="enable_plugins", default=None,
help="Comma separated list of plugins to build")
opt.add_option('--without-plugins', action="callback", callback=_list_cb,
type="string", dest="disable_plugins", default=None,
help="Comma separated list of plugins to skip")
opt.add_option('--with-builtin-plugins', action="callback", callback=_list_cb,
type="string", dest="builtin_plugins", default=None,
help="Comma separated list of plugins to link statically "
"into daemon. [Default: %s]" % ','.join(builtin_plugins_defaults))
opt.add_option('--with-default-output-plugin', type='string',
dest='default_output_plugin',
help="Force a default output plugin")
opt.add_option('--with-optionals', action="callback", callback=_list_cb,
type="string", dest="enable_optionals", default=None,
help="Comma separated list of optionals to build")
opt.add_option('--without-optionals', action="callback", callback=_list_cb,
type="string", dest="disable_optionals", default=None,
help="Comma separated list of optionals to skip")
opt.add_option('--conf-prefix', action="callback", callback=_list_cb,
type='string', dest='config_prefix',
help="Specify a directory to prepend to configuration prefix")
opt.add_option('--without-xmms2d', action='store_true', default=False,
dest='without_xmms2d', help="Skip build of xmms2d")
opt.add_option('--with-pkgconfigdir', type='string', dest='pkgconfigdir',
help="Specify directory where to install pkg-config files")
opt.add_option('--with-target-platform', type='string',
dest='target_platform',
help="Force a target platform (cross-compilation)")
opt.add_option('--with-windows-version', type='string', dest='winver',
help="Force a specific Windows version (cross-compilation)")
opt.add_option('--enable-gcov', action="store_true", default=False,
dest='enable_gcov', help="Enable coverage report")
opt.add_option('--with-ldconfig', action='store_true', default=None,
dest='ldconfig', help="Run ldconfig after install even if not root")
opt.add_option('--without-ldconfig', action='store_false',
dest='ldconfig', help="Don't run ldconfig after install")
opt.recurse("src/xmms")
for o in optional_subdirs + subdirs:
opt.recurse(o)
def shutdown(ctx):
if ctx.cmd != 'install':
return
# explicitly avoid running ldconfig on --without-ldconfig
if ctx.options.ldconfig is False:
return
# implicitly run ldconfig when running as root if not told otherwise
if ctx.options.ldconfig is None and os.geteuid() != 0:
return
if not os.path.isfile('/sbin/ldconfig'):
return
libprefix = Utils.subst_vars('${LIBDIR}', ctx.env)
Logs.info("- ldconfig '%s'" % libprefix)
ctx.exec_command('/sbin/ldconfig %s' % libprefix)
# Wee need to do the check right now because options() is called before init()
check_git_submodules()