blob: 159006685591926e7d632c9fe4a8e356bc6e2eee [file] [log] [blame]
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +00001llvm-config - Print LLVM compilation options
2============================================
3
James Hendersona0566842019-06-27 13:24:46 +00004.. program:: llvm-config
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +00005
6SYNOPSIS
7--------
8
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +00009**llvm-config** *option* [*components*...]
10
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000011DESCRIPTION
12-----------
13
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000014**llvm-config** makes it easier to build applications that use LLVM. It can
15print the compiler flags, linker flags and object libraries needed to link
16against LLVM.
17
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000018EXAMPLES
19--------
20
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000021To link against the JIT:
22
Dmitri Gribenkoa99fa5b2012-06-12 15:45:07 +000023.. code-block:: sh
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000024
25 g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
26 g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
27 `llvm-config --libs engine bcreader scalaropts`
28
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000029OPTIONS
30-------
31
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000032**--version**
33
34 Print the version number of LLVM.
35
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000036**-help**
37
38 Print a summary of **llvm-config** arguments.
39
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000040**--prefix**
41
42 Print the installation prefix for LLVM.
43
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000044**--src-root**
45
46 Print the source root from which LLVM was built.
47
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000048**--obj-root**
49
50 Print the object root used to build LLVM.
51
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000052**--bindir**
53
54 Print the installation directory for LLVM binaries.
55
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000056**--includedir**
57
58 Print the installation directory for LLVM headers.
59
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000060**--libdir**
61
62 Print the installation directory for LLVM libraries.
63
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000064**--cxxflags**
65
66 Print the C++ compiler flags needed to use LLVM headers.
67
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000068**--ldflags**
69
70 Print the flags needed to link against LLVM libraries.
71
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000072**--libs**
73
74 Print all the libraries needed to link against the specified LLVM
75 *components*, including any dependencies.
76
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000077**--libnames**
78
79 Similar to **--libs**, but prints the bare filenames of the libraries
80 without **-l** or pathnames. Useful for linking against a not-yet-installed
81 copy of LLVM.
82
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000083**--libfiles**
84
85 Similar to **--libs**, but print the full path to each library file. This is
86 useful when creating makefile dependencies, to ensure that a tool is relinked if
87 any library it uses changes.
88
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000089**--components**
90
91 Print all valid component names.
92
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000093**--targets-built**
94
95 Print the component names for all targets supported by this copy of LLVM.
96
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000097**--build-mode**
98
99 Print the build mode used when LLVM was built (e.g. Debug or Release)
100
101
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000102COMPONENTS
103----------
104
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000105To print a list of all available components, run **llvm-config
106--components**. In most cases, components correspond directly to LLVM
107libraries. Useful "virtual" components include:
108
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000109**all**
110
Sylvestre Ledru469de192014-08-11 18:04:46 +0000111 Includes all LLVM libraries. The default if no components are specified.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000112
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000113**backend**
114
115 Includes either a native backend or the C backend.
116
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000117**engine**
118
119 Includes either a native JIT or the bitcode interpreter.
120
121
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000122EXIT STATUS
123-----------
124
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000125If **llvm-config** succeeds, it will exit with 0. Otherwise, if an error
126occurs, it will exit with a non-zero value.