Blame sofort/ccenv/ccenv.usage

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