orbea / cross / slibtool

Forked from cross/slibtool 3 years ago
Clone

Blame sofort/ccenv/ccenv.usage

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