2012-05-09 00:50:35 +08:00
|
|
|
llvm-config - Print LLVM compilation options
|
|
|
|
============================================
|
|
|
|
|
[docs][tools] Add missing "program" tags to rst files
Sphinx allows for definitions of command-line options using
`.. option <name>` and references to those options via `:option:<name>`.
However, it looks like there is no scoping of these options by default,
meaning that links can end up pointing to incorrect documents. See for
example the llvm-mca document, which contains references to -o that,
prior to this patch, pointed to a different document. What's worse is
that these links appear to be non-deterministic in which one is picked
(on my machine, some references end up pointing to opt, whereas on the
live docs, they point to llvm-dwarfdump, for example).
The fix is to add the .. program <name> tag. This essentially namespaces
the options (definitions and references) to the named program, ensuring
that the links are kept correct.
Reviwed by: andreadb
Differential Revision: https://reviews.llvm.org/D63873
llvm-svn: 364538
2019-06-27 21:24:46 +08:00
|
|
|
.. program:: llvm-config
|
2012-05-09 00:50:35 +08:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
|
|
|
|
**llvm-config** *option* [*components*...]
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
|
|
|
|
**llvm-config** makes it easier to build applications that use LLVM. It can
|
|
|
|
print the compiler flags, linker flags and object libraries needed to link
|
|
|
|
against LLVM.
|
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
|
|
|
To link against the JIT:
|
|
|
|
|
2012-06-12 23:45:07 +08:00
|
|
|
.. code-block:: sh
|
2012-05-09 00:50:35 +08:00
|
|
|
|
|
|
|
g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
|
|
|
|
g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
|
|
|
|
`llvm-config --libs engine bcreader scalaropts`
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
|
|
|
|
**--version**
|
|
|
|
|
|
|
|
Print the version number of LLVM.
|
|
|
|
|
|
|
|
**-help**
|
|
|
|
|
|
|
|
Print a summary of **llvm-config** arguments.
|
|
|
|
|
|
|
|
**--prefix**
|
|
|
|
|
|
|
|
Print the installation prefix for LLVM.
|
|
|
|
|
|
|
|
**--src-root**
|
|
|
|
|
|
|
|
Print the source root from which LLVM was built.
|
|
|
|
|
|
|
|
**--obj-root**
|
|
|
|
|
|
|
|
Print the object root used to build LLVM.
|
|
|
|
|
|
|
|
**--bindir**
|
|
|
|
|
|
|
|
Print the installation directory for LLVM binaries.
|
|
|
|
|
|
|
|
**--includedir**
|
|
|
|
|
|
|
|
Print the installation directory for LLVM headers.
|
|
|
|
|
|
|
|
**--libdir**
|
|
|
|
|
|
|
|
Print the installation directory for LLVM libraries.
|
|
|
|
|
|
|
|
**--cxxflags**
|
|
|
|
|
|
|
|
Print the C++ compiler flags needed to use LLVM headers.
|
|
|
|
|
|
|
|
**--ldflags**
|
|
|
|
|
|
|
|
Print the flags needed to link against LLVM libraries.
|
|
|
|
|
|
|
|
**--libs**
|
|
|
|
|
|
|
|
Print all the libraries needed to link against the specified LLVM
|
|
|
|
*components*, including any dependencies.
|
|
|
|
|
|
|
|
**--libnames**
|
|
|
|
|
|
|
|
Similar to **--libs**, but prints the bare filenames of the libraries
|
|
|
|
without **-l** or pathnames. Useful for linking against a not-yet-installed
|
|
|
|
copy of LLVM.
|
|
|
|
|
|
|
|
**--libfiles**
|
|
|
|
|
|
|
|
Similar to **--libs**, but print the full path to each library file. This is
|
|
|
|
useful when creating makefile dependencies, to ensure that a tool is relinked if
|
|
|
|
any library it uses changes.
|
|
|
|
|
|
|
|
**--components**
|
|
|
|
|
|
|
|
Print all valid component names.
|
|
|
|
|
|
|
|
**--targets-built**
|
|
|
|
|
|
|
|
Print the component names for all targets supported by this copy of LLVM.
|
|
|
|
|
|
|
|
**--build-mode**
|
|
|
|
|
|
|
|
Print the build mode used when LLVM was built (e.g. Debug or Release)
|
|
|
|
|
|
|
|
|
|
|
|
COMPONENTS
|
|
|
|
----------
|
|
|
|
|
|
|
|
To print a list of all available components, run **llvm-config
|
|
|
|
--components**. In most cases, components correspond directly to LLVM
|
|
|
|
libraries. Useful "virtual" components include:
|
|
|
|
|
|
|
|
**all**
|
|
|
|
|
2014-08-12 02:04:46 +08:00
|
|
|
Includes all LLVM libraries. The default if no components are specified.
|
2012-05-09 00:50:35 +08:00
|
|
|
|
|
|
|
**backend**
|
|
|
|
|
|
|
|
Includes either a native backend or the C backend.
|
|
|
|
|
|
|
|
**engine**
|
|
|
|
|
|
|
|
Includes either a native JIT or the bitcode interpreter.
|
|
|
|
|
|
|
|
|
|
|
|
EXIT STATUS
|
|
|
|
-----------
|
|
|
|
|
|
|
|
If **llvm-config** succeeds, it will exit with 0. Otherwise, if an error
|
|
|
|
occurs, it will exit with a non-zero value.
|