Blame sofort/ccenv/ccenv.usage

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