Blame sofort/ccenv/ccenv.usage

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