12
preproc.strict_quotes=0
15
14
import waffles.misc
16
15
import waffles.gnome as gnome
18
# the following two variables are used by the target "waf dist"
17
bzrrevno = '$CurRevno$'
18
bzrrevid = '$CurRevid$'
22
if VERSION.find('dev') != -1 and len(bzrrevno.split()) > 1:
23
VERSION = '+'.join((VERSION,
24
'bzr' + bzrrevno.split()[1]))
25
if bzrrevid.split()[1].find('svn') != -1:
26
VERSION = '+'.join((VERSION,
27
'svn' + bzrrevid.split()[1].split(':')[-1]))
25
# these variables are mandatory ('/' are converted automatically)
29
# dir where waf will search custom (additional) files
30
34
_tooldir = './waffles/'
32
_prefix = '/usr/local'
34
35
ROOTDIR_WIN32 = 'C:\msys'
165
161
env['IS_LINUX'] = True
167
163
## temporary HACKS for win32
169
env['PREFIX'] = conf.escpath(os.path.abspath('win32/binaries/Xiphos'))
165
# env['PREFIX'] = conf.escpath(os.path.abspath('win32/binaries/Xiphos'))
172
167
if env['IS_WIN32']:
173
168
env['ROOTDIR'] = ROOTDIR_WIN32
170
conf.check_tool('nothreads', tooldir=_tooldir)
175
171
conf.check_tool('g++ gcc')
177
173
if env['IS_CROSS_WIN32']:
178
174
conf.check_tool('cross_linux_win32', tooldir=_tooldir)
180
176
conf.check_tool('gnu_dirs misc')
181
conf.check_tool('intltool') # check for locale.h included
177
conf.check_tool('intltool')
183
179
opt = Options.options
184
180
env['DISABLE_HELP'] = opt.disable_help
322
309
define('PACKAGE_PIXMAPS_DIR', conf.escpath(sub('${DATAROOTDIR}/pixmaps/${PACKAGE}', env)))
323
310
define('PACKAGE_SOURCE_DIR', conf.escpath(os.path.abspath(srcdir))) # foder where was wscript executed
313
if conf.check_cfg(modversion='gtkhtml-editor-3.14',
314
msg='Is post GNOME3 gtkhtml-editor available?',
316
errmsg='Probably, not'
318
editor='"gtkhtml-editor-3.14"'
320
editor='"gtkhtml-editor"'
322
common_libs = string.join(
330
"libgtkhtml-3.14 >= 3.23"
326
334
conf.check_cfg(atleast_pkgconfig_version='0.9.0')
329
#check_pkg(conf, 'gtk+-x11-2.0', '2.0.0', var='LIBGTK_X11_2_0')
330
#if not env['HAVE_LIBGTK_X11_2_0']:
331
# check_pkg(conf, 'gtk+-x11-2.0', '2.0.0', True, var='LIBGTK_WIN32_2_0')
332
conf.check_pkg('gtk+-2.0', '2.14', True, var='GTK')
334
conf.check_pkg('libglade-2.0', '2.0.0', var='GLADE')
336
conf.check_pkg('gmodule-2.0', '2.0.0', True, var='GMODULEEXP')
337
conf.check_pkg('glib-2.0', '2.0.0', True, 'GLIB')
340
conf.check_pkg('libgsf-1', '1.14', True, var='GFS')
342
#check_pkg(conf, 'libgnomeprintui-2.2', '2.2', True, var='GNOMEPRINTUI')
343
#check_pkg(conf, 'libgnomeprint-2.2', '2.2', True, var='GNOMEPRINT')
346
conf.check_pkg('libxml-2.0', '2.0.0', True, var='XML')
348
conf.check_pkg('gtk+-unix-print-2.0', '2.0.0', var='UPRINT')
349
if env['HAVE_UPRINT']:
350
dfn('USE_GTKUPRINT', 1)
353
conf.check_pkg('sword', '1.5.11', True, var='SWORD')
355
conf.check_pkgver_msg('sword', '1.5.11.99', var='MULTIVERSE',
356
msg='Checking for sword multiverse')
357
if env['HAVE_MULTIVERSE']:
358
dfn('SWORD_MULTIVERSE', 1)
362
conf.check_pkg('libgtkhtml-3.14', version='3.23', mandatory=True, var='GTKHTML')
364
if conf.env['HAVE_GTKHTML']:
365
conf.define('USE_GTKHTML3_14', 1)
367
conf.check_pkg('gtkhtml-editor', mandatory=True)
335
conf.check_cfg(msg="Checking for GNOME related libs",
338
uselib_store='GNOME',
341
env.append_value('ALL_LIBS', 'GNOME')
343
conf.check_cfg(package="gtk+-unix-print-2.0",
344
uselib_stor='GTKUPRINT')
346
env.append_value('ALL_LIBS', 'GTKUPRINT')
348
conf.check_cfg(package='sword',
349
args='"sword >= 1.6.1" --cflags --libs',
350
uselib_store='SWORD',
352
env.append_value('ALL_LIBS', 'SWORD')
354
conf.check_cfg(package="gtk+-2.0",
355
atleast_version = "2.16",
356
uselib_store="GTK_216")
357
conf.check_cfg(package="gtk+-2.0",
358
atleast_version = "2.18",
359
uselib_store="GTK_218")
360
conf.check_cfg(package="gtk+-2.0",
361
atleast_version = "2.20",
362
uselib_store="GTK_220")
369
364
######################
370
365
### gecko (xulrunner) for html rendering
372
367
if not env['ENABLE_GTKHTML']:
373
368
if not env["IS_WIN32"]:
375
conf.check_cfg (package='libxul-embedding',
370
conf.check_cfg (package='nspr', uselib_store='NSPR')
371
conf.check_cfg (package='',
376
372
uselib_store='GECKO',
377
args='--define-variable=includetype=unstable --cflags --libs',
378
atleast_version='1.9.0')
379
conf.define('GECKO_HOME', conf.get_pkgvar('libxul-embedding', 'sdkdir'))
373
args='"libxul-embedding >= 1.9.0" --define-variable=includetype=unstable "nspr" --cflags --libs',
374
msg='checking for libxul-embedding')
376
conf.define('GECKO_HOME', conf.check_cfg(package='libxul-embedding',
377
args='--variable=sdkdir',
378
okmsg=waffles.misc.myokmsg,
379
msg="Checking for libxul sdkdir").strip())
381
381
d = env['MOZILLA_DISTDIR']
382
382
conf.define['CPPPATH_GECKO'] = ['%s/sdk/include' % d,
390
390
conf.define['LIBPATH_GECKO'] = ['%s/sdk/lib' % d]
391
391
conf.define['LIB_GECKO'] = ['xpcomglue_s', 'xpcom', 'xul', 'nspr4']
393
env.append_value('ALL_LIBS', 'NSPR')
393
394
env.append_value('ALL_LIBS', 'GECKO')
394
395
conf.define('USE_GTKMOZEMBED', 1)
397
######################
400
# TODO: maybe the following checks should be in a more generic module.
402
#always defined to indicate that i18n is enabled */
403
399
dfn('ENABLE_NLS', 1)
406
#Define to 1 if you have the `bind_textdomain_codeset' function.
407
400
dfn('HAVE_BIND_TEXTDOMAIN_CODESET', 1)
411
#Define if the GNU gettext() function is already present or preinstalled.
412
401
dfn('HAVE_GETTEXT', 1)
413
#Define to 1 if you have the `dcgettext' function.
414
402
dfn('HAVE_DCGETTEXT', 1)
433
421
# Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
434
422
dfn('TIME_WITH_SYS_TIME', 1)
437
# TODO: how to detect these values? is it possible to detect them?
439
# TODO: not necessary SELECT* defines?
440
# Define to the type of arg 1 for `select'. */
441
#dfn('SELECT_TYPE_ARG1', 'int', quote=0) # dont add quotes around 'int'
442
# Define to the type of args 2, 3 and 4 for `select'. */
443
#dfn('SELECT_TYPE_ARG234', '(fd_set *)', quote=0)
444
# Define to the type of arg 5 for `select'. */
445
#dfn('SELECT_TYPE_ARG5', '(struct timeval *)', quote=0)
448
#dfn('__cplusplus', 1)
450
# let compiler know that we have 'config.h'
425
env.append_value('CXXFLAGS', env['CXXFLAGS_%s' % opt.debug_level.upper()])
426
env.append_value('CCFLAGS', env['CCFLAGS_%s' % opt.debug_level.upper()])
429
env.append_value('CXXFLAGS', env['CXXFLAGS_DELINT'])
430
env.append_value('CCFLAGS', env['CCFLAGS_DELINT'])
452
432
# portable adding define, should work gcc and msvc
453
433
env.append_value('CXXFLAGS', env['CXXDEFINES_ST'] % 'HAVE_CONFIG_H')
454
434
env.append_value('CCFLAGS', env['CCDEFINES_ST'] % 'HAVE_CONFIG_H')