From 7bc065e043793ef67c75c85addd8c42553324dd0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 16 Mar 2011 05:51:11 +0000 Subject: Update for waf 1.6 (without compat15 extra). Fix imports to work when bundled in waf script. git-svn-id: http://svn.drobilla.net/autowaf@36 e2e4594f-ea7b-45dc-bc5a-5f5301e603aa --- autowaf.py | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/autowaf.py b/autowaf.py index 9cf38f6..da4ec21 100644 --- a/autowaf.py +++ b/autowaf.py @@ -8,12 +8,8 @@ import os import subprocess import sys -import Configure -import Logs -import Options - -from waflib import Context, Task, Utils, Node -from TaskGen import feature, before, after +from waflib import Configure, Context, Logs, Node, Options, Task, Utils +from waflib.TaskGen import feature, before, after global g_is_child g_is_child = False @@ -36,8 +32,8 @@ def set_options(opt): global g_step if g_step > 0: return - opt.tool_options('compiler_cc') - opt.tool_options('compiler_cxx') + opt.load('compiler_cc') + opt.load('compiler_cxx') opt.add_option('--debug', action='store_true', default=False, dest='debug', help="Build debuggable binaries [Default: False]") opt.add_option('--grind', action='store_true', default=False, dest='grind', @@ -97,8 +93,6 @@ def define(conf, var_name, value): def check_pkg(conf, name, **args): "Check for a package iff it hasn't been checked for yet" - if not 'mandatory' in args: - args['mandatory'] = True var_name = 'HAVE_' + nameify(args['uselib_store']) check = not var_name in conf.env if not check and 'atleast_version' in args: @@ -108,15 +102,8 @@ def check_pkg(conf, name, **args): check = True; if check: conf.check_cfg(package=name, args="--cflags --libs", **args) - found = bool(conf.env[var_name]) - if found: - define(conf, var_name, 1) - if 'atleast_version' in args: - conf.env['VERSION_' + name] = args['atleast_version'] - else: - conf.undefine(var_name) - if args['mandatory'] == True: - conf.fatal("Required package " + name + " not found") + if 'atleast_version' in args: + conf.env['VERSION_' + name] = args['atleast_version'] def configure(conf): global g_step @@ -127,8 +114,8 @@ def configure(conf): conf.env.append_value('CXXFLAGS', vals.split()) print('') display_header('Global Configuration') - conf.check_tool('compiler_cc') - conf.check_tool('compiler_cxx') + conf.load('compiler_cc') + conf.load('compiler_cxx') if Options.options.docs: conf.load('doxygen') conf.env['DOCS'] = Options.options.docs -- cgit v1.2.1