~ubuntu-branches/ubuntu/lucid/warzone2100/lucid

« back to all changes in this revision

Viewing changes to wscript

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger, Paul Wise, Christoph Egger
  • Date: 2009-06-29 17:12:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090629171252-5ddnlfg3zfchrega
Tags: 2.2.1+dfsg1-1
[ Paul Wise ]
* New upstream release (Closes: #534962)
* Adjust the flex build-depends to take account of the conflict
  with all the versions of flex 2.5.34 (LP: #372872)
* Make the -music Recommends more strict, 2.1 music doesn't work
  with 2.2.
* Upstream moved the downloads to sourceforge, update the watch file
* Bump Standards-Version, no changes needed
* Drop use of dh_desktop since it no longer does anything
* Recommend the new warzone2100-video package, version 2.2 or similar
* Mention the warzone2100 crash reports in the -dbg package description

[ Christoph Egger ]
* Replace CC-2.0 graphic from cybersphinx, create a new tarball
* Add myself to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
2
 
# encoding: utf-8
3
 
# Dennis Schridde, 2006 (devurandom)
4
 
 
5
 
# Warzone 2100
6
 
 
7
 
# the following two variables are used by the target "waf dist"
8
 
VERSION='TRUNK'
9
 
APPNAME='Warzone 2100'
10
 
 
11
 
# these variables are mandatory ('/' are converted automatically)
12
 
srcdir = '.'
13
 
blddir = '_build_'
14
 
 
15
 
# make sure waf has the version we want
16
 
import Utils
17
 
Utils.waf_version(mini="1.0", maxi="9.9.9")
18
 
 
19
 
 
20
 
# For DEFAULT_DATADIR and debug variant
21
 
import Params
22
 
 
23
 
 
24
 
def set_options(opt):
25
 
        #add option for additional/external includes and library dirs for MinGW on Windows
26
 
        opt.tool_options('compiler_cc')
27
 
        opt.add_option('--debug',
28
 
                action='store_true',
29
 
                default=False,
30
 
                help='Build debug variant [Default: False]',
31
 
                dest='debug')
32
 
 
33
 
 
34
 
def configure(conf):
35
 
        # Check for C-Compiler, the Lexer/Parser tools and get the checks module for checkEndian
36
 
        conf.check_tool('compiler_cc batched_cc flex bison checks')
37
 
 
38
 
        # Big or little endian?
39
 
        conf.checkEndian()
40
 
 
41
 
        # Check for all required libs
42
 
        if not conf.check_pkg2('sdl', '1.2', 0):
43
 
                if not conf.check_cfg2('sdl', 0):
44
 
                        conf.check_header('SDL/SDL.h')
45
 
                        conf.check_library('SDL')
46
 
                        conf.check_library('SDLmain')
47
 
 
48
 
        if not conf.check_pkg2('openal', '0', 0):
49
 
                conf.check_header2('AL/al.h')
50
 
                conf.check_library2('openal')
51
 
 
52
 
        if not conf.check_pkg2('libpng', '1.2', 0, 'PNG'):
53
 
                conf.check_header2('png.h')
54
 
                conf.check_library2('png')
55
 
 
56
 
        if not conf.check_pkg2('ogg', '1.0', 0):
57
 
                conf.check_header2('ogg/ogg.h')
58
 
                conf.check_library2('ogg')
59
 
 
60
 
        if not conf.check_pkg2('vorbisfile', '1.0', 0):
61
 
                conf.check_header2('vorbis/vorbisfile.h')
62
 
                conf.check_library2('vorbisfile')
63
 
 
64
 
        conf.check_header2('SDL/SDL_net.h')
65
 
        conf.check_library2('SDL_net')
66
 
 
67
 
        conf.check_header2('GL/gl.h')
68
 
        conf.check_library2('GL')
69
 
 
70
 
        conf.check_header2('GL/glu.h')
71
 
        conf.check_library2('GLU')
72
 
 
73
 
        conf.check_header2('physfs.h')
74
 
        conf.check_library2('physfs')
75
 
 
76
 
        # Common defines
77
 
        conf.add_define('VERSION', VERSION)
78
 
        conf.add_define('DEFAULT_DATADIR', Params.g_options.prefix + 'warzone2100')
79
 
        conf.add_define('YY_STATIC', 1)
80
 
        conf.add_define('LOCALEDIR', '')
81
 
        conf.add_define('PACKAGE', 'warzone2100')
82
 
        conf.env['CCFLAGS'] += ['-pipe', '-combine']
83
 
 
84
 
        # Split off debug variant before adding variant specific defines
85
 
        conf.set_env_name('debug', conf.env.deepcopy())
86
 
 
87
 
        # Configure non debug variant
88
 
        conf.env['CCFLAGS'] += ['-DNDEBUG', '-g', '-O2']
89
 
        conf.add_define('NDEBUG', 1)
90
 
        conf.write_config_header()
91
 
 
92
 
        # Configure debug variant
93
 
        conf.setenv('debug')
94
 
        conf.env.set_variant('debug')
95
 
        conf.env['CCFLAGS'] += ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra']
96
 
        conf.add_define('DEBUG', 1)
97
 
        conf.write_config_header()
98
 
 
99
 
 
100
 
def build(bld):
101
 
        obj = bld.create_obj('cc', 'program')
102
 
        obj.find_sources_in_dirs('lib/framework lib/gamelib lib/netplay lib/ivis_common lib/ivis_opengl lib/script lib/sequence lib/sound lib/widget src')
103
 
        obj.uselib='PNG OGG VORBISFILE GLU GL OPENAL PHYSFS SDL_NET SDL SDLMAIN'
104
 
        obj.includes='lib/framework lib/gamelib lib/script src'
105
 
        obj.defines='HAVE_CONFIG_H'
106
 
        obj.target='warzone2100'
107
 
 
108
 
        # Use debug environment when --enable-debug is given
109
 
        if Params.g_options.debug:
110
 
                obj.env = bld.env_of_name('debug')