Blame sofort/ccenv/ccenv.usage

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