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