6 INGAMEVER
='git-'+os
.popen('git-rev-parse --default HEAD').readline().strip('\n')
8 # the following two variables are used by the target "waf dist"
9 VERSION
=str(INGAMEVER
) #+'.'+str(RELEASE)
12 # these variables are mandatory ('/' are converted automatically)
20 # options provided in a script in a subdirectory named "src"
21 opt
.sub_options('src')
23 # options provided by the modules
24 opt
.tool_options('g++')
27 opt
.add_option('--with-mapeditor', action
='store_true', help='Build a simple map editor', dest
='mapedit')
28 opt
.add_option('--bindir', type='string', default
='games/bin/', help='Put binaries into this dir (relative to prefix)', dest
='bindir')
29 opt
.add_option('--docsdir', type='string', default
='share/doc/dirtystudios/blobwars/', help='Put docs into this dir (relative to prefix)', dest
='docsdir')
30 opt
.add_option('--datadir', type='string', default
='share/games/dirtystudios/blobwars/', help='Put data files into this dir (relative to prefix)', dest
='datadir')
39 ICONV_CONST char* in_orig = "boo";
45 iconv(cd, &in_orig, &in_len, &out, &out_len);
52 def check_iconv(conf
):
53 conf
.check_header2('iconv.h')
54 conf
.check_library2('iconv', mandatory
=0)
56 test
= conf
.create_test_configurator()
57 test
.code
= "#define ICONV_CONST const\n" + iconv_test
62 conf
.check_message_custom('we can compile iconv program', '', 'yes, with const')
63 conf
.add_define('ICONV_CONST', 'const', 0)
65 test
.code
= "#define ICONV_CONST \n" + iconv_test
68 conf
.check_message_custom('we can compile iconv program', '', 'yes, without const')
69 conf
.add_define('ICONV_CONST', ' ', 0)
71 conf
.check_message('we can compile iconv program', '', 0)
72 raise "Compilation failed"
78 pre
= conf
.env
['PREFIX']
79 conf
.env
['BINDIR'] = pre
+ Params
.g_options
.bindir
80 conf
.env
['DOCSDIR'] = pre
+ Params
.g_options
.docsdir
81 conf
.env
['DATADIR'] = pre
+ Params
.g_options
.datadir
82 conf
.env
['MAPEDIT'] = Params
.g_options
.mapedit
84 conf
.check_tool('g++')
86 conf
.sub_config('src')
88 conf
.env
['CXXFLAGS']='-g -Wall -O0' # -I/home/dirty_ice/crossdev/winroot/include'
89 conf
.env
['CCFLAGS']='-g -Wall -O0'
90 #conf.env['LINKFLAGS']='-L/home/dirty_ice/crossdev/winroot/lib'
91 #conf.env['SOME_INSTALL_DIR']='/tmp/ahoy/lib/'
93 #conf.find_program('sdl-config')
94 conf
.check_pkg('sdl', vnum
='1.2')
95 conf
.check_tool('checks')
96 conf
.check_library2('SDL_image')
97 conf
.check_library2('SDL_mixer')
98 conf
.check_library2('SDL_ttf')
99 conf
.check_library2('physfs')
101 conf
.check_header2('boost/format.hpp')
103 platform
=conf
.detect_platform()
104 conf
.check_message_custom("platform", '', platform
)
105 if (platform
!= 'cygwin'):
106 conf
.add_define('UNIX', 1)
108 conf
.add_define('WIN32', 1)
110 #conf.env['LIBPATH']='/home/dirty_ice/SDL_ttf-2.0.9/fkinst/usr/local/lib'
111 #conf.env['LIB']='SDL_ttfdebug'
113 conf
.add_define('VERSION', INGAMEVER
)
114 #conf.add_define('RELEASE', RELEASE)
115 conf
.add_define('DATADIR', conf
.env
['DATADIR'])
117 conf
.write_config_header('config.h')
122 ## installing resources and files - call them under build(bld) or shutdown()
123 ## to trigger the glob, ad a star in the name
124 ## the functions are not called if not in install mode
125 #install_files('PREFIX', '', 'src/a2.h src/a1.h')
126 #install_files('PREFIX', 'subfolder/subsubfolder', 'src/*.h')
127 #install_as('PREFIX', 'dir/bar.png', 'foo.png')
131 if not Params
.g_commands
['build']: return
132 os
.popen('ln -f -s build/default/dirtyblobwars ../dirtyblobwars')
133 os
.popen('ln -f -s build/default/dirtyblobwars-mapeditor ../mapedit')