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