Improve configure checks. Closes #10

* Actually use the result of boost headers check
 * Enable boost tool options
 * If required libraries are not installed, don't build
   gladish but still build the non-gui parts.
This commit is contained in:
Nedko Arnaudov 2009-09-01 22:45:11 +03:00
parent 0d1ac13dd3
commit 8c06cbb5ff
2 changed files with 74 additions and 59 deletions

View File

@ -6,12 +6,14 @@ Requirements (tools, headers and libraries):
* You need dbus (1.2.16 should work)
* You need libuuid from e2fsprogs (1.40.2 should work)
* You need the expat XML parser (2.0.1 should work)
* Python (for ladish_control and LADI Tools)
Optional requirements, without them GUI frontend will not be built:
* You need glib (2.20.3 should work)
* You need dbus-glib (0.74 should work)
* You need gtk+ (2.12.1 should work)
* You need libglade (2.6.2 should work)
* You need flowcanvas (svn revision 2186 or later should work, included in tarball)
* Python (for ladish_control and LADI Tools)
===================================================

49
wscript
View File

@ -37,6 +37,7 @@ def yesno(bool):
def set_options(opt):
opt.tool_options('compiler_cc')
opt.tool_options('compiler_cxx')
opt.tool_options('boost')
opt.add_option('--enable-pkg-config-dbus-service-dir', action='store_true', default=False, help='force D-Bus service install dir to be one returned by pkg-config')
opt.add_option('--enable-liblash', action='store_true', default=False, help='Build LASH compatibility library')
@ -47,6 +48,7 @@ def add_cflag(conf, flag):
def configure(conf):
conf.check_tool('compiler_cc')
conf.check_tool('compiler_cxx')
conf.check_tool('boost')
conf.check_cfg(
package = 'dbus-1',
@ -80,41 +82,50 @@ def configure(conf):
if conf.is_defined('HAVE_EXPAT'):
conf.env['LIB_EXPAT'] = ['expat']
conf.check_cfg(
build_gui = True
if build_gui and not conf.check_cfg(
package = 'glib-2.0',
mandatory = True,
mandatory = False,
errmsg = "not installed, see http://www.gtk.org/",
args = '--cflags --libs')
args = '--cflags --libs'):
build_gui = False
conf.check_cfg(
if build_gui and not conf.check_cfg(
package = 'dbus-glib-1',
mandatory = True,
mandatory = False,
errmsg = "not installed, see http://dbus.freedesktop.org/",
args = '--cflags --libs')
args = '--cflags --libs'):
build_gui = False
conf.check_cfg(
if build_gui and not conf.check_cfg(
package = 'gtk+-2.0',
mandatory = True,
mandatory = False,
errmsg = "not installed, see http://www.gtk.org/",
args = '--cflags --libs')
args = '--cflags --libs'):
build_gui = False
conf.check_cfg(
if build_gui and not conf.check_cfg(
package = 'libglade-2.0',
mandatory = True,
mandatory = False,
errmsg = "not installed, see http://ftp.gnome.org/pub/GNOME/sources/libglade/",
args = '--cflags --libs')
args = '--cflags --libs'):
build_gui = False
conf.check_cfg(
if build_gui and not conf.check_cfg(
package = 'flowcanvas',
mandatory = True,
atleast_version = '0.4.0',
mandatory = False,
atleast_version = '0.5.3',
errmsg = "not installed, see http://drobilla.net/software/flowcanvas/",
args = '--cflags --libs')
args = '--cflags --libs'):
build_gui = False
if build_gui:
# We need the boost headers package (e.g. libboost-dev)
# shared_ptr.hpp and weak_ptr.hpp
conf.check_tool('boost')
conf.check_boost()
build_gui = conf.check_boost(errmsg="not found, see http://boost.org/")
conf.env['BUILD_GLADISH'] = build_gui
add_cflag(conf, '-g')
add_cflag(conf, '-Wall')
@ -146,6 +157,7 @@ def configure(conf):
display_msg(conf)
display_msg(conf, "Install prefix", conf.env['PREFIX'], 'CYAN')
display_msg(conf, 'Build gladish', yesno(conf.env['BUILD_GLADISH']))
display_msg(conf, 'Build liblash', yesno(Options.options.enable_liblash))
if conf.env['DBUS_SERVICES_DIR'] != conf.env['DBUS_SERVICES_DIR_REAL']:
@ -262,6 +274,7 @@ def build(bld):
#####################################################
# gladish
if bld.env['BUILD_GLADISH']:
gladish = bld.new_task_gen('cxx', 'program')
gladish.features.append('cc')
gladish.target = 'gladish'