~ubuntu-branches/ubuntu/wily/xmms2/wily

« back to all changes in this revision

Viewing changes to wscript

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2008-05-29 10:14:25 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080529101425-ycw1nbd980uhvzfp
Tags: 0.4DrKosmos-4ubuntu1
* Merge from debian unstable (LP: #178477), remaining changes:
  - debian/control: Update Maintainer field
  - debian/control: add lpia to xmms2-plugin-alsa supported architectures
* This version reads AAC files (LP: #156359)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import Utils
24
24
import Common
25
25
 
26
 
VERSION="0.2 DrJekyll (git commit: %s)" % gittools.get_info_str()
 
26
VERSION="0.4 DrKosmos (git commit: %s)" % gittools.get_info_str()
27
27
APPNAME='xmms2'
28
28
 
29
29
srcdir='.'
56
56
                    "src/clients/lib/xmmsclient-ecore",
57
57
                    "src/clients/lib/xmmsclient++",
58
58
                    "src/clients/lib/xmmsclient++-glib",
 
59
                    "src/clients/lib/xmmsclient-cf",
59
60
                    "src/clients/lib/python",
60
61
                    "src/clients/lib/perl",
61
 
                    "src/clients/lib/ruby"]
 
62
                    "src/clients/lib/ruby",
 
63
                    "pixmaps"]
62
64
 
63
65
all_optionals = sets.Set([os.path.basename(o) for o in optional_subdirs])
64
66
all_plugins = sets.Set([p for p in os.listdir("src/plugins")
207
209
    Params.pprint('BLUE', ", ".join(disabled_plugins))
208
210
 
209
211
def configure(conf):
 
212
    if os.environ.has_key('PKG_CONFIG_PREFIX'):
 
213
        prefix = os.environ['PKG_CONFIG_PREFIX']
 
214
        if not os.path.isabs(prefix):
 
215
            prefix = os.path.abspath(prefix)
 
216
        conf.env['PKG_CONFIG_DEFINES'] = {'prefix':prefix}
 
217
 
210
218
    conf.env["BUILD_XMMS2D"] = False
211
219
    if not Params.g_options.without_xmms2d == True:
212
220
        conf.env["BUILD_XMMS2D"] = True
226
234
    conf.check_tool('pkgconfig', tooldir=os.path.abspath('waftools'))
227
235
    conf.check_tool('man', tooldir=os.path.abspath('waftools'))
228
236
 
 
237
    if conf.check_tool('winres'):
 
238
        conf.env['WINRCFLAGS'] = '-I' + os.path.abspath('pixmaps')
 
239
        conf.env['xmms_icon'] = True
 
240
    else:
 
241
        conf.env['xmms_icon'] = False
 
242
 
 
243
    if Params.g_options.target_platform:
 
244
        Params.g_platform = Params.g_options.target_platform
 
245
 
229
246
    conf.env["VERSION"] = VERSION
230
247
    conf.env["CCFLAGS"] = Utils.to_list(conf.env["CCFLAGS"]) + ['-g', '-O0']
231
248
    conf.env["CXXFLAGS"] = Utils.to_list(conf.env["CXXFLAGS"]) + ['-g', '-O0']
235
252
    conf.env['CCDEFINES'] += ["XMMS_VERSION=\"\\\"%s\\\"\"" % VERSION]
236
253
    conf.env['CXXDEFINES'] += ["XMMS_VERSION=\"\\\"%s\\\"\"" % VERSION]
237
254
 
 
255
    if Params.g_options.libdir:
 
256
        conf.env["LIBDIR"] = Params.g_options.libdir
 
257
        conf.env["shlib_INST_DIR"] = ""
 
258
        conf.env["shlib_INST_VAR"] = "LIBDIR"
 
259
 
238
260
    if Params.g_options.config_prefix:
239
 
        conf.env["LIBPATH"] += [os.path.join(Params.g_options.config_prefix, "lib")]
240
 
        include = [os.path.join(Params.g_options.config_prefix, "include")]
241
 
        conf.env['CPPPATH'] += include
242
 
 
243
 
    conf.env["LINKFLAGS_xlibs"] += ['-install_name %s%s%s' % (os.path.join(conf.env["PREFIX"], 'lib', conf.env["shlib_PREFIX"]), '%s', conf.env["shlib_SUFFIX"])]
 
261
        for dir in Params.g_options.config_prefix:
 
262
            if not os.path.isabs(dir):
 
263
                dir = os.path.abspath(dir)
 
264
            conf.env.prepend_value("LIBPATH", os.path.join(dir, "lib"))
 
265
            conf.env.prepend_value("CPPPATH", os.path.join(dir, "include"))
244
266
 
245
267
    # Our static libraries may link to dynamic libraries
246
 
    conf.env["staticlib_CCFLAGS"] += ['-fPIC', '-DPIC']
 
268
    if Params.g_platform != 'win32':
 
269
        conf.env["staticlib_CCFLAGS"] += ['-fPIC', '-DPIC']
 
270
    else:
 
271
        # As we have to change target platform after the tools
 
272
        # have been loaded there are a few variables that needs
 
273
        # to be initiated if building for win32.
 
274
 
 
275
        # Make sure we don't have -fPIC and/or -DPIC in our CCFLAGS
 
276
        conf.env["shlib_CCFLAGS"] = []
 
277
        conf.env['plugin_CCFLAGS'] = []
 
278
 
 
279
        # Setup various prefixes
 
280
        conf.env["shlib_SUFFIX"] = '.dll'
 
281
        conf.env['plugin_SUFFIX'] = '.dll'
 
282
        conf.env['program_SUFFIX'] = '.exe'
 
283
 
 
284
    # Add some specific OSX things
 
285
    if Params.g_platform == 'darwin':
 
286
        conf.env["LINKFLAGS"] += ['-multiply_defined suppress']
 
287
        conf.env["explicit_install_name"] = True
 
288
    else:
 
289
        conf.env["explicit_install_name"] = False
247
290
 
248
291
    # Check for support for the generic platform
249
292
    has_platform_support = os.name in ('nt', 'posix')
255
298
    conf.check_tool('checks')
256
299
 
257
300
    # Check sunOS socket support
258
 
    if sys.platform == 'sunos5':
 
301
    if Params.g_platform == 'sunos5':
259
302
        if not conf.check_library2("socket", uselib='socket'):
260
303
            Params.fatal("xmms2 requires libsocket on Solaris.")
261
304
        conf.env.append_unique('CCFLAGS', '-D_POSIX_PTHREAD_SEMANTICS')
262
305
        conf.env.append_unique('CCFLAGS', '-D_REENTRANT')
263
 
 
 
306
        conf.env['socket_impl'] = 'socket'
264
307
    # Check win32 (winsock2) socket support
265
 
    if sys.platform == 'win32':
 
308
    elif Params.g_platform == 'win32':
266
309
        if not conf.check_library2("wsock32", uselib='socket'):
267
310
            Params.fatal("xmms2 requires wsock32 on windows.")
268
311
        conf.env.append_unique('LIB_socket', 'ws2_32')
 
312
        conf.env['socket_impl'] = 'wsock32'
 
313
    # Default POSIX sockets
 
314
    else:
 
315
        conf.env['socket_impl'] = 'posix'
269
316
 
270
317
    # Glib is required by everyone, so check for it here and let them
271
318
    # assume its presence.
278
325
    conf.env['NEWEST_WSCRIPT_SUBDIR'] = newest
279
326
 
280
327
    [conf.sub_config(s) for s in subdirs]
281
 
    
 
328
 
282
329
    _output_summary(enabled_plugins, disabled_plugins, enabled_optionals, disabled_optionals)
283
330
 
 
331
    return True
 
332
 
284
333
 
285
334
####
286
335
## Options
302
351
                   type="string", dest="enable_optionals")
303
352
    opt.add_option('--without-optionals', action="callback", callback=_list_cb,
304
353
                   type="string", dest="disable_optionals")
305
 
    opt.add_option('--conf-prefix', type='string', dest='config_prefix')
 
354
    opt.add_option('--conf-prefix', action="callback", callback=_list_cb,
 
355
                   type='string', dest='config_prefix')
306
356
    opt.add_option('--without-xmms2d', type='int', dest='without_xmms2d')
307
357
    opt.add_option('--with-mandir', type='string', dest='manualdir')
 
358
    opt.add_option('--with-libdir', type='string', dest='libdir')
 
359
    opt.add_option('--with-target-platform', type='string',
 
360
                       dest='target_platform')
308
361
 
309
362
    for o in optional_subdirs + subdirs:
310
363
        opt.sub_options(o)