Blame sofort/ccenv/ccenv.usage

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