summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-05-07 11:41:50 +0200
committerAndrew Tridgell <tridge@samba.org>2010-05-07 15:14:49 +0200
commit022266566d7b87fe3aea0c7080f6374c7740b11c (patch)
treef17d9e2dd872ae1e59d4f20e4609a8bd75085ef9 /buildtools/wafsamba
parente8c3da1fc09c3b0a2213952ec96294b3b5d8d4c0 (diff)
downloadsamba-022266566d7b87fe3aea0c7080f6374c7740b11c.tar.gz
samba-022266566d7b87fe3aea0c7080f6374c7740b11c.tar.bz2
samba-022266566d7b87fe3aea0c7080f6374c7740b11c.zip
build: fixed pc file variable substitution
We should not substitute for the first use of each variable declaration in the pkgconfig file
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/wafsamba.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 2b53a9ceb6..96e95159b9 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -662,6 +662,7 @@ def subst_at_vars(task):
# split on the vars
a = re.split('(@\w+@)', s)
out = []
+ done_var = {}
back_sub = [ ('PREFIX', '${prefix}'), ('EXEC_PREFIX', '${exec_prefix}')]
for v in a:
if re.match('@\w+@', v):
@@ -676,7 +677,12 @@ def subst_at_vars(task):
for (b, m) in back_sub:
s = task.env[b]
if s == v[0:len(s)]:
- v = m + v[len(s):]
+ if not b in done_var:
+ # we don't want to substitute the first usage
+ done_var[b] = True
+ else:
+ v = m + v[len(s):]
+ break
out.append(v)
contents = ''.join(out)
f = open(tgt, 'w')