Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 1 | llvm-config - Print LLVM compilation options |
| 2 | ============================================ |
| 3 | |
James Henderson | a056684 | 2019-06-27 13:24:46 +0000 | [diff] [blame] | 4 | .. program:: llvm-config |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 5 | |
| 6 | SYNOPSIS |
| 7 | -------- |
| 8 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 9 | **llvm-config** *option* [*components*...] |
| 10 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 11 | DESCRIPTION |
| 12 | ----------- |
| 13 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 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 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 18 | EXAMPLES |
| 19 | -------- |
| 20 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 21 | To link against the JIT: |
| 22 | |
Dmitri Gribenko | a99fa5b | 2012-06-12 15:45:07 +0000 | [diff] [blame] | 23 | .. code-block:: sh |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 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 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 29 | OPTIONS |
| 30 | ------- |
| 31 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 32 | **--version** |
| 33 | |
| 34 | Print the version number of LLVM. |
| 35 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 36 | **-help** |
| 37 | |
| 38 | Print a summary of **llvm-config** arguments. |
| 39 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 40 | **--prefix** |
| 41 | |
| 42 | Print the installation prefix for LLVM. |
| 43 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 44 | **--src-root** |
| 45 | |
| 46 | Print the source root from which LLVM was built. |
| 47 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 48 | **--obj-root** |
| 49 | |
| 50 | Print the object root used to build LLVM. |
| 51 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 52 | **--bindir** |
| 53 | |
| 54 | Print the installation directory for LLVM binaries. |
| 55 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 56 | **--includedir** |
| 57 | |
| 58 | Print the installation directory for LLVM headers. |
| 59 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 60 | **--libdir** |
| 61 | |
| 62 | Print the installation directory for LLVM libraries. |
| 63 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 64 | **--cxxflags** |
| 65 | |
| 66 | Print the C++ compiler flags needed to use LLVM headers. |
| 67 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 68 | **--ldflags** |
| 69 | |
| 70 | Print the flags needed to link against LLVM libraries. |
| 71 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 72 | **--libs** |
| 73 | |
| 74 | Print all the libraries needed to link against the specified LLVM |
| 75 | *components*, including any dependencies. |
| 76 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 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 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 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 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 89 | **--components** |
| 90 | |
| 91 | Print all valid component names. |
| 92 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 93 | **--targets-built** |
| 94 | |
| 95 | Print the component names for all targets supported by this copy of LLVM. |
| 96 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 97 | **--build-mode** |
| 98 | |
| 99 | Print the build mode used when LLVM was built (e.g. Debug or Release) |
| 100 | |
| 101 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 102 | COMPONENTS |
| 103 | ---------- |
| 104 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 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 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 109 | **all** |
| 110 | |
Sylvestre Ledru | 469de19 | 2014-08-11 18:04:46 +0000 | [diff] [blame] | 111 | Includes all LLVM libraries. The default if no components are specified. |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 112 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 113 | **backend** |
| 114 | |
| 115 | Includes either a native backend or the C backend. |
| 116 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 117 | **engine** |
| 118 | |
| 119 | Includes either a native JIT or the bitcode interpreter. |
| 120 | |
| 121 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 122 | EXIT STATUS |
| 123 | ----------- |
| 124 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 125 | If **llvm-config** succeeds, it will exit with 0. Otherwise, if an error |
| 126 | occurs, it will exit with a non-zero value. |