summaryrefslogtreecommitdiffhomepage
path: root/sofort/ccenv/ccenv.usage
blob: 8eab780ac036540e9eaf78eb5a8544fd82de6950 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
A few words on sofort's tool-finding logic
==========================================

# the goals of sofort's tool-finding logic are:
- follow a clear, transparent, and consistent logic
- allow users to easily specify per-build preferences
- allow distros to easily and cleanly use site-wide settings


# three-way terminology:
- native machine: where make(1) will be running.
- host machine:   where the package's program or libraries will execute.
- target machine: where code generated by the host package will execute.

! NOTE, however, that the host/target distinction is only relevant
  when building a code-generating utility (e.g. a compiler), and that
  the two are otherwise rather synonymous. Moreover, in practice it
  is much more common to see configure scripts being invoked with a
  --target=<machine> argument specifying the host, than with a
  --host=<machine> argument.


# invocation and names of binary tools:
- agnostic names (ar, nm, objdump, ...)
- branded names (llvm-ar, llvm-nm, llvm-objdump, ...)
- machine-prefixed agnostic names (x86_64-nt64-midipix-ar, ...)
- machine-prefixed branded names (x86_64-linux-gnu-gcc-ar, ...)
- machine-specifying branded tools, as in
  llvm-ar --target=x86_64-linux.


# cross-compilation: default search order:
- machine-prefixed agnostic tools
- machine-prefixed branded tools, starting with the prefix
  most commonly associated with the selected compiler (that is,
  ``gcc'' when using gcc, and ``llvm'' when using clang)
- (machine-specifying) agnostic tools
- (machine-speficying) branded tools, starting once again with the
  prefix most commonly associated with the selected compiler


# native builds: default search order:
- agnostic tools
- machine-prefixed agnostic tools
- machine-prefixed branded tools
- branded tools


# using an alternate search order:
- --toolchain=<prefix> (e.g. --toolchain=llvm) --> search for tools
  that begin with <prefix> before searching for agnostic tools


# restricting which tools may be searched:
- --zealous          --> only search for agnostic tools
- --zealous=<prefix> --> only search for <prefix>-branded tools


# per-tool overrides, by example of the ``ar'' tool:
- AR=ar          --> set AR to $(command -v ar)
- AR=/path/to/ar --> set AR to the specified absolute path


# host generated config file and variable names:
- ccenv/host.mk
- AR, NM, OBJDUMP, ...


# native generated config file and variable names:
- ccenv/native.mk
- NATIVE_AR, NATIVE_NM, NATIVE_OBJDUMP, ...


# distro: site-wide preferences
- --ccenv=/path/to/site-specific/ccenv
- use the above to create ccenv as a symlink to
  /path/to/site-specific/ccenv, and to accordingly
  skip configure's tool-finding step.