summaryrefslogtreecommitdiff
path: root/mk/buildlink2/README
blob: 9f7596ddce992e8d11ed5763ab240458770215f7 (plain)
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
$NetBSD: README,v 1.4 2002/10/05 22:06:32 wiz Exp $

For more general information about the use of buildlink2, see the file
buildlink2.txt in this directory.

 0 buildlink2 Wrapper Script System
 ==================================

The purpose of the buildlink2 wrapper script system is to replace calls to
compiler tool with scripts that tranlate any arguments into their buildlink
equivalents, then invoke the actual compiler tools with the translated
arguments.  The pkgsrc/mk/buildlink2 directory contains bits of the wrapper
script system for the buildlink2 framework.  The wrapper script system is
composed of four parts: the main wrapper script, the "cache", the "logic"
script generated from the cache, and a wrapper-specific "logic" script.

 0.1 Main wrapper script
 =======================

The main wrapper script for a compiler tool (cc, ld, as, etc.) is
generated from wrapper.sh, except for the libtool wrapper script which is
generated from libtool.sh.  The wrapper scripts share a common set of logic
files that translate arguments into their buildlink equivalents.

 0.2 Cache
 =========

The cache contains a series of lines that may be directly used as the
contents of a Bourne shell "case" statement.  They contain only arguments
that have already been seen and their buildlink equivalents.

 0.3 Logic script
 ================

The logic script contains a large "case" statement that handles the
translation of an argument into its buildlink equivalent.  It is generated
from three files: the pre-cache, cache, and post-cache files.  The cache is
described above.  The pre- and post-cache files simply complete the "case"
statement.  The post-cache also contains the final case that performs the
actual argument translation and, as an optimization, saves the result into
the cache.

 0.4 Wrapper-specifc logic script
 ================================

The wrapper-specific logic script contains extra shell commands that
typically perform an extra uncached translation of an argument after the
main translation has been performed by the logic script.