Blame sofort/ccenv/ccenv.usage

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