Blame sofort/ccenv/ccenv.usage

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