09157951638 / compilers / bcparser

Forked from compilers/bcparser a year ago
Clone

Blame sofort/ccenv/ccenv.usage

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