aboutsummaryrefslogtreecommitdiffstats
path: root/waflib/extras
diff options
context:
space:
mode:
Diffstat (limited to 'waflib/extras')
-rw-r--r--waflib/extras/autowaf.py68
1 files changed, 19 insertions, 49 deletions
diff --git a/waflib/extras/autowaf.py b/waflib/extras/autowaf.py
index 8c6e258..870a69a 100644
--- a/waflib/extras/autowaf.py
+++ b/waflib/extras/autowaf.py
@@ -7,9 +7,6 @@ import time
from waflib import Configure, ConfigSet, Build, Context, Logs, Options, Utils
from waflib.TaskGen import feature, before, after
-global g_is_child
-g_is_child = False
-
NONEMPTY = -10
if sys.platform == 'win32':
@@ -454,26 +451,6 @@ def append_property(obj, key, val):
else:
setattr(obj, key, val)
-def use_lib(bld, obj, libs):
- abssrcdir = os.path.abspath('.')
- libs_list = libs.split()
- for l in libs_list:
- in_headers = l.lower() in bld.env['AUTOWAF_LOCAL_HEADERS']
- in_libs = l.lower() in bld.env['AUTOWAF_LOCAL_LIBS']
- if in_libs:
- append_property(obj, 'use', ' lib%s ' % l.lower())
- append_property(obj, 'framework', bld.env['FRAMEWORK_' + l])
- if in_headers or in_libs:
- if bld.env.MSVC_COMPILER:
- inc_flag = '/I' + os.path.join(abssrcdir, l.lower())
- else:
- inc_flag = '-iquote ' + os.path.join(abssrcdir, l.lower())
- for f in ['CFLAGS', 'CXXFLAGS']:
- if inc_flag not in bld.env[f]:
- bld.env.prepend_value(f, inc_flag)
- else:
- append_property(obj, 'uselib', ' ' + l)
-
@feature('c', 'cxx')
@before('apply_link')
def version_lib(self):
@@ -484,22 +461,34 @@ def version_lib(self):
if [x for x in applicable if x in self.features]:
self.target = self.target + 'D'
-def set_lib_env(conf, name, version, has_objects=True):
+def set_lib_env(conf,
+ name,
+ version,
+ has_objects=True,
+ include_path=None,
+ lib_path=None):
"Set up environment for local library as if found via pkg-config."
NAME = name.upper()
major_ver = version.split('.')[0]
pkg_var_name = 'PKG_' + name.replace('-', '_') + '_' + major_ver
lib_name = '%s-%s' % (name, major_ver)
- lib_path = [str(conf.path.get_bld())]
+
+ if lib_path is None:
+ lib_path = str(conf.path.get_bld())
+
+ if include_path is None:
+ include_path = str(conf.path)
+
if conf.env.PARDEBUG:
lib_name += 'D'
+
conf.env[pkg_var_name] = lib_name
- conf.env['INCLUDES_' + NAME] = ['${INCLUDEDIR}/%s-%s' % (name, major_ver)]
- conf.env['LIBPATH_' + NAME] = lib_path
+ conf.env['INCLUDES_' + NAME] = [include_path]
+ conf.env['LIBPATH_' + NAME] = [lib_path]
if has_objects:
conf.env['LIB_' + NAME] = [lib_name]
- conf.run_env.append_unique(lib_path_name, lib_path)
+ conf.run_env.append_unique(lib_path_name, [lib_path])
conf.define(NAME + '_VERSION', version)
def display_msg(conf, msg, status=None, color=None):
@@ -526,14 +515,6 @@ def compile_flags(env, lib):
return ' '.join(map(lambda x: env['CPPPATH_ST'] % x,
env['INCLUDES_' + lib]))
-def set_recursive():
- global g_is_child
- g_is_child = True
-
-def is_child():
- global g_is_child
- return g_is_child
-
def build_pc(bld, name, version, version_suffix, libs, subst_dict={}):
"""Build a pkg-config file for a library.
@@ -588,13 +569,6 @@ def build_pc(bld, name, version, version_suffix, libs, subst_dict={}):
obj.__dict__.update(subst_dict)
-def build_dir(name, subdir):
- if is_child():
- return os.path.join('build', name, subdir)
- else:
- return os.path.join('build', subdir)
-
-
def make_simple_dox(name):
"Clean up messy Doxygen documentation after it is built"
name = name.lower()
@@ -641,12 +615,8 @@ def build_dox(bld, name, version, srcdir, blddir, outdir='', versioned=True):
if not bld.env['DOCS']:
return
- # Doxygen paths in are relative to the doxygen file, not build directory
- if is_child():
- src_dir = os.path.join(srcdir, name.lower())
- else:
- src_dir = srcdir
-
+ # Doxygen paths in are relative to the doxygen file
+ src_dir = bld.path.srcpath()
subst_tg = bld(features='subst',
source='doc/reference.doxygen.in',
target='doc/reference.doxygen',