Blame sofort/ccenv/ccenv.usage

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