OSDN Git Service

[docs] [NFC] Removed excess spacing
[android-x86/external-llvm.git] / docs / CommandGuide / llvm-config.rst
1 llvm-config - Print LLVM compilation options
2 ============================================
3
4 .. program:: llvm-config
5
6 SYNOPSIS
7 --------
8
9 **llvm-config** *option* [*components*...]
10
11 DESCRIPTION
12 -----------
13
14 **llvm-config** makes it easier to build applications that use LLVM.  It can
15 print the compiler flags, linker flags and object libraries needed to link
16 against LLVM.
17
18 EXAMPLES
19 --------
20
21 To link against the JIT:
22
23 .. code-block:: sh
24
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
29 OPTIONS
30 -------
31
32 **--version**
33
34  Print the version number of LLVM.
35
36 **-help**
37
38  Print a summary of **llvm-config** arguments.
39
40 **--prefix**
41
42  Print the installation prefix for LLVM.
43
44 **--src-root**
45
46  Print the source root from which LLVM was built.
47
48 **--obj-root**
49
50  Print the object root used to build LLVM.
51
52 **--bindir**
53
54  Print the installation directory for LLVM binaries.
55
56 **--includedir**
57
58  Print the installation directory for LLVM headers.
59
60 **--libdir**
61
62  Print the installation directory for LLVM libraries.
63
64 **--cxxflags**
65
66  Print the C++ compiler flags needed to use LLVM headers.
67
68 **--ldflags**
69
70  Print the flags needed to link against LLVM libraries.
71
72 **--libs**
73
74  Print all the libraries needed to link against the specified LLVM
75  *components*, including any dependencies.
76
77 **--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
83 **--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
89 **--components**
90
91  Print all valid component names.
92
93 **--targets-built**
94
95  Print the component names for all targets supported by this copy of LLVM.
96
97 **--build-mode**
98
99  Print the build mode used when LLVM was built (e.g. Debug or Release)
100
101
102 COMPONENTS
103 ----------
104
105 To print a list of all available components, run **llvm-config
106 --components**.  In most cases, components correspond directly to LLVM
107 libraries.  Useful "virtual" components include:
108
109 **all**
110
111  Includes all LLVM libraries.  The default if no components are specified.
112
113 **backend**
114
115  Includes either a native backend or the C backend.
116
117 **engine**
118
119  Includes either a native JIT or the bitcode interpreter.
120
121
122 EXIT STATUS
123 -----------
124
125 If **llvm-config** succeeds, it will exit with 0.  Otherwise, if an error
126 occurs, it will exit with a non-zero value.