blob: caee955c5fee924688c61fad8efcef9fcbdd9ff6 [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
9
10**llvm-config** *option* [*components*...]
11
12
13DESCRIPTION
14-----------
15
16
17**llvm-config** makes it easier to build applications that use LLVM. It can
18print the compiler flags, linker flags and object libraries needed to link
19against LLVM.
20
21
22EXAMPLES
23--------
24
25
26To link against the JIT:
27
28
Dmitri Gribenkoa99fa5b2012-06-12 15:45:07 +000029.. code-block:: sh
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000030
31 g++ `llvm-config --cxxflags` -o HowToUseJIT.o -c HowToUseJIT.cpp
32 g++ `llvm-config --ldflags` -o HowToUseJIT HowToUseJIT.o \
33 `llvm-config --libs engine bcreader scalaropts`
34
35
36
37OPTIONS
38-------
39
40
41
42**--version**
43
44 Print the version number of LLVM.
45
46
47
48**-help**
49
50 Print a summary of **llvm-config** arguments.
51
52
53
54**--prefix**
55
56 Print the installation prefix for LLVM.
57
58
59
60**--src-root**
61
62 Print the source root from which LLVM was built.
63
64
65
66**--obj-root**
67
68 Print the object root used to build LLVM.
69
70
71
72**--bindir**
73
74 Print the installation directory for LLVM binaries.
75
76
77
78**--includedir**
79
80 Print the installation directory for LLVM headers.
81
82
83
84**--libdir**
85
86 Print the installation directory for LLVM libraries.
87
88
89
90**--cxxflags**
91
92 Print the C++ compiler flags needed to use LLVM headers.
93
94
95
96**--ldflags**
97
98 Print the flags needed to link against LLVM libraries.
99
100
101
102**--libs**
103
104 Print all the libraries needed to link against the specified LLVM
105 *components*, including any dependencies.
106
107
108
109**--libnames**
110
111 Similar to **--libs**, but prints the bare filenames of the libraries
112 without **-l** or pathnames. Useful for linking against a not-yet-installed
113 copy of LLVM.
114
115
116
117**--libfiles**
118
119 Similar to **--libs**, but print the full path to each library file. This is
120 useful when creating makefile dependencies, to ensure that a tool is relinked if
121 any library it uses changes.
122
123
124
125**--components**
126
127 Print all valid component names.
128
129
130
131**--targets-built**
132
133 Print the component names for all targets supported by this copy of LLVM.
134
135
136
137**--build-mode**
138
139 Print the build mode used when LLVM was built (e.g. Debug or Release)
140
141
142
143
144COMPONENTS
145----------
146
147
148To print a list of all available components, run **llvm-config
149--components**. In most cases, components correspond directly to LLVM
150libraries. Useful "virtual" components include:
151
152
153**all**
154
Sylvestre Ledru469de192014-08-11 18:04:46 +0000155 Includes all LLVM libraries. The default if no components are specified.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000156
157
158
159**backend**
160
161 Includes either a native backend or the C backend.
162
163
164
165**engine**
166
167 Includes either a native JIT or the bitcode interpreter.
168
169
170
171
172EXIT STATUS
173-----------
174
175
176If **llvm-config** succeeds, it will exit with 0. Otherwise, if an error
177occurs, it will exit with a non-zero value.