Blame sofort/ccenv/ccenv.usage

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