From 56667184e39cf6da7f8e780b75ec6eea4dab7b69 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 15 Oct 2011 04:57:01 +0000 Subject: Use variables in pkgconfig paths where possible (#782) git-svn-id: http://svn.drobilla.net/autowaf@55 e2e4594f-ea7b-45dc-bc5a-5f5301e603aa --- autowaf.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'autowaf.py') diff --git a/autowaf.py b/autowaf.py index f43ff92..df54935 100644 --- a/autowaf.py +++ b/autowaf.py @@ -302,6 +302,14 @@ def build_pc(bld, name, version, version_suffix, libs, subst_dict={}): target += '-' + version_suffix target += '.pc' + libdir = bld.env['LIBDIR'] + if libdir.startswith(pkg_prefix): + libdir = libdir.replace(pkg_prefix, '${exec_prefix}') + + includedir = bld.env['INCLUDEDIR'] + if includedir.startswith(pkg_prefix): + includedir = includedir.replace(pkg_prefix, '${prefix}') + obj = bld(features = 'subst', source = '%s.pc.in' % name.lower(), target = target, @@ -309,8 +317,8 @@ def build_pc(bld, name, version, version_suffix, libs, subst_dict={}): exec_prefix = '${prefix}', PREFIX = pkg_prefix, EXEC_PREFIX = '${prefix}', - LIBDIR = bld.env['LIBDIR'], - INCLUDEDIR = bld.env['INCLUDEDIR']) + LIBDIR = libdir, + INCLUDEDIR = includedir) if type(libs) != list: libs = libs.split() -- cgit v1.2.1