# -*- python -*-
# -*- coding: utf-8 -*-
import Options
def set_options(opt):
grp = opt.get_option_group("--shared-lib")
grp.add_option('--glade-support',
action='store_const',
default=False,
const=True,
help=('build support for Glade / GtkBuilder'),
)
grp.add_option('--glade-catalog-dir',
type='string',
default='/usr/share/glade3/catalogs',
help='Glade catalog dir [Default: %default]')
grp.add_option('--glade-modules-dir',
type='string',
default='/usr/lib/glade3/modules',
help='Glade modules dir [Default: %default]')
def configure(conf):
if Options.options.glade_support:
conf.env["GX_GLADE_SUPPORT"] = True
conf.env["GXW_SHARED"] = True
conf.env["GXW_SHARED_INSTALL"] = True
conf.env["GLADE_CATALOG_DIR"] = Options.options.glade_catalog_dir
conf.env["GLADE_MODULES_DIR"] = Options.options.glade_modules_dir
def build(bld):
if not bld.env["GX_GLADE_SUPPORT"]:
return
bld.add_subdirs("glade-icons")
bld(features = ['cc','cshlib'],
ccflags = bld.env['CXXFLAGS'],
uselib = ['GTK2'],
source = ['glade-gxw.c'],
target = 'gladegx',
lib = ["gxw"],
libpath = bld.path.find_dir("../libgxw/gxw").bldpath(bld.env),
includes = ['..','../libgxw'],
install_path = bld.env["GLADE_MODULES_DIR"],
)
bld.install_files(bld.env["GLADE_CATALOG_DIR"], "gxw.xml", chmod=0o644)