Blame sofort/ccenv/ccenv.usage

7a17ab
A few words on sofort's tool-finding logic
7a17ab
==========================================
7a17ab
7a17ab
# the goals of sofort's tool-finding logic are:
7a17ab
- follow a clear, transparent, and consistent logic
7a17ab
- allow users to easily specify per-build preferences
7a17ab
- allow distros to easily and cleanly use site-wide settings
7a17ab
7a17ab
7a17ab
# three-way terminology:
7a17ab
- native machine: where make(1) will be running.
7a17ab
- host machine:   where the package's program or libraries will execute.
7a17ab
- target machine: where code generated by the host package will execute.
7a17ab
7a17ab
! NOTE, however, that the host/target distinction is only relevant
7a17ab
  when building a code-generating utility (e.g. a compiler), and that
7a17ab
  the two are otherwise rather synonymous. Moreover, in practice it
7a17ab
  is much more common to see configure scripts being invoked with a
7a17ab
  --target=<machine> argument specifying the host, than with a
7a17ab
  --host=<machine> argument.
7a17ab
7a17ab
7a17ab
# invocation and names of binary tools:
7a17ab
- agnostic names (ar, nm, objdump, ...)
7a17ab
- branded names (llvm-ar, llvm-nm, llvm-objdump, ...)
7a17ab
- machine-prefixed agnostic names (x86_64-nt64-midipix-ar, ...)
7a17ab
- machine-prefixed branded names (x86_64-linux-gnu-gcc-ar, ...)
7a17ab
- machine-specifying branded tools, as in
7a17ab
  llvm-ar --target=x86_64-linux.
7a17ab
7a17ab
7a17ab
# cross-compilation: default search order:
7a17ab
- machine-prefixed agnostic tools
7a17ab
- machine-prefixed branded tools, starting with the prefix
7a17ab
  most commonly associated with the selected compiler (that is,
7a17ab
  ``gcc'' when using gcc, and ``llvm'' when using clang)
7a17ab
- (machine-specifying) agnostic tools
7a17ab
- (machine-speficying) branded tools, starting once again with the
7a17ab
  prefix most commonly associated with the selected compiler
7a17ab
7a17ab
7a17ab
# native builds: default search order:
7a17ab
- agnostic tools
7a17ab
- machine-prefixed agnostic tools
7a17ab
- machine-prefixed branded tools
7a17ab
- branded tools
7a17ab
7a17ab
7a17ab
# using an alternate search order:
7a17ab
- --toolchain=<prefix> (e.g. --toolchain=llvm) --> search for tools
7a17ab
  that begin with <prefix> before searching for agnostic tools
7a17ab
7a17ab
7a17ab
# restricting which tools may be searched:
7a17ab
- --zealous          --> only search for agnostic tools
7a17ab
- --zealous=<prefix> --> only search for <prefix>-branded tools
7a17ab
7a17ab
7a17ab
# per-tool overrides, by example of the ``ar'' tool:
7a17ab
- AR=ar          --> set AR to $(command -v ar)
7a17ab
- AR=/path/to/ar --> set AR to the specified absolute path
7a17ab
7a17ab
7a17ab
# host generated config file and variable names:
7a17ab
- ccenv/host.mk
7a17ab
- AR, NM, OBJDUMP, ...
7a17ab
7a17ab
7a17ab
# native generated config file and variable names:
7a17ab
- ccenv/native.mk
7a17ab
- NATIVE_AR, NATIVE_NM, NATIVE_OBJDUMP, ...
7a17ab
7a17ab
7a17ab
# distro: site-wide preferences
7a17ab
- --ccenv=/path/to/site-specific/ccenv
7a17ab
- use the above to create ccenv as a symlink to
7a17ab
  /path/to/site-specific/ccenv, and to accordingly
7a17ab
  skip configure's tool-finding step.