1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
$NetBSD: patch-ah,v 1.2 2005/05/23 22:58:26 epg Exp $
--- build/generator/gen_make.py.orig 2005-03-22 10:08:25.000000000 -0500
+++ build/generator/gen_make.py
@@ -5,6 +5,7 @@
import os
import sys
import string
+import ConfigParser
import gen_base
@@ -39,6 +40,13 @@ class Generator(gen_base.GeneratorBase):
install_deps = self.graph.get_deps(gen_base.DT_INSTALL)
install_sources = self.graph.get_all_sources(gen_base.DT_INSTALL)
+ cp = ConfigParser.ConfigParser()
+ cp.read('gen-make.opts')
+ if cp.has_option('options', '--installed-libs'):
+ self.installed_libs = cp.get('options', '--installed-libs').split(',')
+ else:
+ self.installed_libs = []
+
# ensure consistency between runs
install_deps.sort()
install_sources.sort(lambda s1, s2: cmp(s1.name, s2.name))
@@ -54,11 +62,17 @@ class Generator(gen_base.GeneratorBase):
# construct a list of the other .la libs to link against
retreat = build_path_retreat(target.path)
- deps = [ target.filename ]
- link = [ build_path_join(retreat, target.filename) ]
+ if target.name in self.installed_libs:
+ deps = []
+ link = [ '-l%s-%s' % (target.name[3:], self.version) ]
+ else:
+ deps = [ target.filename ]
+ link = [ build_path_join(retreat, target.filename) ]
for source in self.graph.get_sources(gen_base.DT_LINK, target.name):
if not isinstance(source, gen_base.TargetLib) or source.external_lib:
continue
+ elif source.name in self.installed_libs:
+ continue
deps.append(source.filename)
link.append(build_path_join(retreat, source.filename))
@@ -136,6 +150,8 @@ class Generator(gen_base.GeneratorBase):
elif isinstance(link_dep, gen_base.TargetLinked):
if link_dep.external_lib:
libs.append(link_dep.external_lib)
+ elif link_dep.name in self.installed_libs:
+ libs.append('-l%s-%s' % (link_dep.name[3:], self.version))
else:
# append the output of the target to our stated dependencies
deps.append(link_dep.filename)
|