Blame sofort/ccenv/ccenv.usage

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