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('png'):
17 error('libpng not found')
18 env
['LIBS'] += ['png']
21 if not conf
.CheckLib('SDL'):
22 error('SDL not found')
23 if not conf
.CheckLib('SDL_mixer'):
24 error('SDL_mixer not found')
25 env
.ParseConfig('sdl-config --cflags --libs')
26 env
['LIBS'] += ['SDL_mixer']
28 # check for wxWidgets 2.8.9
29 if not conf
.CheckWXConfig(2.89, ['adv', 'core', 'base']):
30 error('wxWidgets (>= 2.8.9) not found')
31 wxconfig
.ParseWXConfig(env
)
34 if not conf
.CheckLib('gif'):
35 error('libgif not found')
36 env
['LIBS'] += ['gif']
39 env
['CCFLAGS'] += ['-g', '-O2', '-DPACKAGE_VERSION=\\"1.5\\"', '-DPACKAGE_STRING=\\"obeditor\\ 1.5\\"']
40 if env
['PLATFORM'] == 'win32':
41 env
['CCFLAGS'] += ['-DOSWINDOW']
42 elif env
['PLATFORM'] == 'posix':
43 env
['CCFLAGS'] += ['-DOSLINUX']
45 error('unknown platform')
47 # make the output prettier
48 env
['CCCOMSTR'] = 'Compiling $SOURCE'
49 env
['CXXCOMSTR'] = 'Compiling $SOURCE'
50 env
['LINKCOMSTR'] = 'Linking $TARGET'
55 SConscript('src/SConscript')
57 # move to "release" directory
58 os
.system('rm -rf release')
60 env
.Command('release/obeditor', 'src/obeditor', [Move('release/obeditor', 'src/obeditor')])
61 env
.Command('release/resources', 'resources', [Copy('release/resources', 'resources')])