5 import os
, sys
, platform
6 from scons
import wxconfig
9 sys
.stderr
.write('Error: %s\n' % msg
)
12 env
= Environment(ENV
= os
.environ
)
13 conf
= Configure(env
, custom_tests
= {'CheckWXConfig': wxconfig
.CheckWXConfig
})
16 if not conf
.CheckLib('SDL'):
17 error('SDL not found')
18 if not conf
.CheckLib('SDL_mixer'):
19 error('SDL_mixer not found')
20 env
.ParseConfig('sdl-config --cflags --libs')
21 env
['LIBS'] += ['SDL_mixer']
23 # check for wxWidgets 2.8.9
24 if not conf
.CheckWXConfig(2.89, ['adv', 'core', 'base']):
25 error('wxWidgets (>= 2.8.9) not found')
26 wxconfig
.ParseWXConfig(env
)
29 if not conf
.CheckLib('gif'):
30 error('libgif not found')
31 env
['LIBS'] += ['gif']
34 env
['CCFLAGS'] += ['-g', '-O2', '-DPACKAGE_VERSION=\\"1.5\\"', '-DPACKAGE_STRING=\\"obeditor\\ 1.5\\"']
35 if env
['PLATFORM'] == 'win32':
36 env
['CCFLAGS'] += ['-DOSWINDOW']
37 elif env
['PLATFORM'] == 'posix':
38 env
['CCFLAGS'] += ['-DOSLINUX']
40 error('unknown platform')
42 # make the output prettier
43 env
['CCCOMSTR'] = 'Compiling $SOURCE'
44 env
['CXXCOMSTR'] = 'Compiling $SOURCE'
45 env
['LINKCOMSTR'] = 'Linking $TARGET'
50 SConscript('src/SConscript')
52 # move to "release" directory
53 os
.system('rm -rf release')
55 env
.Command('release/obeditor', 'src/obeditor', [Move('release/obeditor', 'src/obeditor')])
56 env
.Command('release/resources', 'resources', [Copy('release/resources', 'resources')])