summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-config/llvm-config.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update compiler extension integration into the build systemserge-sans-paille2020-06-171-0/+23
| | | | | | | | | | | | The approach here is to create a new (empty) component, `Extensions', where all statically compiled extensions dynamically register their dependencies. That way we're more natively compatible with LLVMBuild and llvm-config. Fixes: https://bugs.llvm.org/show_bug.cgi?id=44870 Differential Revision: https://reviews.llvm.org/D78192 (cherry picked from commit 8f766e382b77eef3102798b49e087d1e4804b984)
* Fix llvm-config support for CMake build-mode-style buildsJordan Rose2019-08-161-5/+8
| | | | | | | | | | | | At some point we and/or CMake changed our build-mode-style builds from $LLVM_OBJ_ROOT/bin/$CMAKE_CFG_INTDIR/ to $LLVM_OBJ_ROOT/$CMAKE_CFG_INTDIR/bin/ which is way easier to use. But no one updated llvm-config. https://reviews.llvm.org/D66326 llvm-svn: 369129
* Revert 356905Serge Guelton2019-03-251-12/+6
| | | | | | Commited from wrong directory... llvm-svn: 356907
* Python 2/3 compat: queue vs QueueSerge Guelton2019-03-251-6/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D59590 llvm-svn: 356905
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-271-1/+1
| | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits Differential Revision: https://reviews.llvm.org/D52573 llvm-svn: 343163
* [llvm-config] Use WithColor for printing errors.Jonas Devlieghere2018-06-231-7/+9
| | | | | | Use the WithColor helper from support to print errors. llvm-svn: 335417
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-4/+4
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* [tools] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: JDevlieghere, zturner, echristo, dberris, friss Reviewed By: echristo Subscribers: gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D45141 llvm-svn: 328943
* [llvm-config] Don't use PATH_MAXKeno Fischer2017-06-011-1/+1
| | | | | | | | It doesn't exist on Windows. The number we use here doesn't really matter, the storage will expand automatically but 256 seems like a reasonable default. Should fix windows buildbots that complained about rL304458. llvm-svn: 304468
* [llvm-config] Report --bindir based on LLVM_TOOLS_INSTALL_DIRKeno Fischer2017-06-011-1/+3
| | | | | | | | | | | | | | | | | | | Summary: `LLVM_TOOLS_INSTALL_DIR` was introduced in r272200 in order to override the directory name into which to install LLVM's executable. However, `llvm-config --bindir` still reported `$PREFIX/bin` independent of what LLVM_TOOLS_INSTALL_DIR was set to. This fixes the out-of-tree clang standalone build for me. Reviewers: beanz, tstellar Reviewed By: tstellar Subscribers: chapuni, tstellar, llvm-commits Differential Revision: https://reviews.llvm.org/D22499 llvm-svn: 304458
* [llvm-config] Fix obviously wrong code in parsing DyLib components.Marcello Maggioni2017-01-121-1/+1
| | | | | | | | | | | | | | The code parsing the string was using the offset returned from StringRef::find() wrong, assuming it was relative to the staring offset that is passed to the function, but the returned offset is always relative to the beginning of the line. This causes odd behaviour while parsing the component string. Spotted thanks to the newly added test: tools/llvm-config/booleans.test llvm-svn: 291803
* [llvm-config] Canonicalize CMake booleans to 0/1Michal Gorny2017-01-101-6/+6
| | | | | | | | | | | | | | | | | | | | Following the similar change to lit configuration, ensure that all CMake booleans are canonicalized to 0/1 when being passed to llvm-config. This fixes the incorrect interpretation of values when user passes another value than the ON/OFF, and simplifies the code by removing unnecessary string matching. Furthermore, the code for --has-rtti and --has-global-isel has been modified to print consistent values indepdently of the boolean used by passed by the user to CMake. Sadly, the code already implicitly used different values for the two (YES/NO for --has-rtti, ON/OFF for --has-global-isel). Include tests for all booleans and multi-value options in llvm-config. Differential Revision: https://reviews.llvm.org/D28366 llvm-svn: 291593
* [llvm-config] Print --system-libs only when static linkingMichal Gorny2017-01-061-2/+6
| | | | | | | | | | | | | | | Modify the --system-libs option in llvm-config to print system libs only when using static linking. The system libraries are irrelevant when linking to a shared library since the library has appropriate library dependencies embedded. Modify the --system-libs test appropriately to force static linking, and disable it if static libs are not available (i.e. BUILD_SHARED_LIBS is enabled). Differential Revision: https://reviews.llvm.org/D27805 llvm-svn: 291285
* [llvm-config] Add --cmakedir to obtain CMake module locationMichal Gorny2017-01-061-1/+9
| | | | | | | | | | | | Add a --cmakedir option to llvm-config that returns the correct path to built/installed CMake modules (i.e. lib/cmake/llvm). This is mostly intended as a convenience option for stand-alone builds of other LLVM projects that frequently reconstruct LLVM_CMAKE_PATH after querying llvm-config. Differential Revision: https://reviews.llvm.org/D26894 llvm-svn: 291218
* [llvm-config] Fixing one check where shared libs implied dylibChris Bieneman2016-12-131-2/+2
| | | | | | We shouldn't print the dylib if LinkDylib is false. llvm-svn: 289609
* llvm-config: Set LinkMode in addition to LinkDyLib when using --ignore-llvmDerek Schuff2016-12-131-2/+3
| | | | | | | | | | | | | | | Summary: LinkDyLib is only used (before arg processing) to set up the default for LinkMode. So reset LinkMode as well, and process before --link-shared or --link-static to allow those flags to continue to override it. Reviewers: beanz Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27736 llvm-svn: 289608
* [llvm-config] Add --ignore-libllvmChris Bieneman2016-12-131-0/+3
| | | | | | This flag forces off linking libLLVM. This should resolve some issues reported on llvm-commits. llvm-svn: 289605
* [llvm-config] Fix bug where `--libfiles` and `--names` would produceDan Liew2016-12-121-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | incorrect output when LLVM is built with `LLVM_BUILD_LLVM_DYLIB`. `llvm-config` previously produced output like this ``` $ llvm-config --libfiles /usr/lib/liblibLLVM-4.0svn.so.so $ llvm-config --libnames liblibLLVM-4.0svn.so.so ``` The library prefix and shared library extension were added to the library name twice which was wrong. I wanted to write a test cases for this but it looks like **all** `llvm-config` tests were disabled by r260386 so I'll leave this for now. Subscribers: llvm-commits, tstellarAMD Reviewers: beanz, DiamondLovesYou, axw Differential Revision: https://reviews.llvm.org/D27393 llvm-svn: 289488
* Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-171-1/+1
| | | | | | Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
* llvm-config: fix --libs on LinuxReid Kleckner2016-03-141-7/+9
| | | | | | | | | | | | | | | | | | | | Summary: llvm-config --libs does not produce correct output since commit r260263 (llvm-config: Add preliminary Windows support) changed naming format of the libraries. This patch updates llvm-config to recognize new naming format and output correct linker flags. Ref: https://llvm.org/bugs/show_bug.cgi?id=26581 Patch by Vedran Miletić Reviewers: ehsan, rnk, pxli168 Subscribers: pxli168 Differential Revision: http://reviews.llvm.org/D17300 llvm-svn: 263497
* [llvm-config] Get rid of code related to the Makefile buildsFilipe Cabecinhas2016-03-081-32/+5
| | | | | | | | | | | | Summary: I left --build-system for backwards compat, in case there are scripts using it. Feel free to ask for its removal too. Reviewers: chapuni, tstellarAMD Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17886 llvm-svn: 262924
* [llvm-config] Teach llvm-config about global-isel.Quentin Colombet2016-03-081-0/+3
| | | | | | | | llvm-config can know tell whether or not a build has been configured to support global-isel. Use '--has-global-isel' for that. llvm-svn: 262877
* llvm-config: replace assertions with a helpful error messageMehdi Amini2016-02-121-0/+8
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 260700
* llvm-config: Fix DLL prefix on cygming.NAKAMURA Takumi2016-02-101-1/+1
| | | | | | For example, LLVMSupport takes the form of LLVMSupport.dll, not libLLVMSupport.dll. llvm-svn: 260351
* llvm-config: Quick fix for cross compilation. Don't be confsed between host ↵NAKAMURA Takumi2016-02-101-1/+1
| | | | | | | and target. It has been there since r252532. FIXME: The clause may use conditions of host compiler, not HOST_TRIPLE. llvm-svn: 260343
* llvm-config: Add preliminary Windows supportEhsan Akhgari2016-02-091-33/+54
| | | | | | | | | | | | | | | | | Summary: This patch adds Windows support for a few of the llvm-config commands, including cflags, ldflags, libs, and system-libs. Currently llvm-config is untested, so this patch adds tests for the commands that it fixes as well. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16762 llvm-svn: 260263
* tools/llvm-config: improve shared library supportAndrew Wilkins2016-01-201-41/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a re-commit of r257003, which was reverted, along with the fixes from http://reviews.llvm.org/D15986. r252532 added support for reporting the monolithic library when LLVM_BUILD_LLVM_DYLIB is used. This would only be done if the individual components were not found, and the dynamic library is found. This diff extends this as follows: - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared library, even if all component libraries exist. - Two flags, --link-shared and --link-static are introduced to provide explicit guidance. If --link-shared is passed and the shared library does not exist, an error results. Additionally, changed the expected shared library names from (e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an installation (and then only in CMake builds I think?), and not in the build tree; this breaks usage of llvm-config during builds, e.g. by llvm-go. Reviewers: DiamondLovesYou, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15986 llvm-svn: 258283
* Revert r257003Andrew Wilkins2016-01-121-87/+25
| | | | | | | | This revision breaks llvm-config if you set BUILD_SHARED_LIBS=on in a CMake build. Backing out until the fix is ready to land. llvm-svn: 257457
* tools/llvm-config: improve shared library supportAndrew Wilkins2016-01-071-25/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r252532 added support for reporting the monolithic library when LLVM_BUILD_LLVM_DYLIB is used. This would only be done if the individual components were not found, and the dynamic library is found. This diff extends this as follows: - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared library, even if all component libraries exist. - Two flags, --link-shared and --link-static are introduced to provide explicit guidance. If --link-shared is passed and the shared library does not exist, an error results. Additionally, changed the expected shared library names from (e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an installation (and then only in CMake builds I think?), and not in the build tree; this breaks usage of llvm-config during builds, e.g. by llvm-go. Reviewers: DiamondLovesYou, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15033 llvm-svn: 257003
* Fix a use-after-free in `llvm-config`.Richard Diamond2015-11-251-10/+10
| | | | | | | | | | | | | | | Summary: This could happen if `GetComponentNames` is true, because `Name` from `VisitComponent` would reference a stack instance of `std::string` in `ComputeLibsForComponents`. Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14913 llvm-svn: 254108
* llvm-config.cpp: Prune an obsolete \param. [-Wdocumentation]NAKAMURA Takumi2015-11-111-2/+0
| | | | llvm-svn: 252762
* Fix mingw targets. Bandaid for r252532's buildbot brakage.Richard Diamond2015-11-101-1/+1
| | | | | | | | | | Reviewers: brad.king, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14523 llvm-svn: 252576
* Simplify some APIs I was cleaning up while fixing -Wpessimizing-move warningDavid Blaikie2015-11-091-27/+25
| | | | | | (Reid fixed the original error, but this seems nice to do in any case) llvm-svn: 252548
* Fix -Wpessimizing-move warning in llvm-config.cppReid Kleckner2015-11-091-1/+1
| | | | llvm-svn: 252542
* Fix `llvm-config` to adapt to the install environment.Richard Diamond2015-11-091-22/+243
| | | | | | | | | | | | | | | | | | | | | Summary: This patch does a couple of things: - Adds a new argument `--shared-mode` which accepts a list of components and prints whether or not the provided components need to be linked statically or shared. - Fixes `--libnames` when CMake BUILD_SHARED_LIBS is used. - Fixes `--libnames`, `--libs`, and `--libfiles` for dylib when static components aren't installed. - Fixes `--libnames`, `--libs`, `--libfiles`, and `--components` to use LLVM_DYLIB_COMPONENTS as the component manifest for dylib linking. - Uses the host platform's usual convention for filename extensions and such, instead of always defaulting to Unix-izms. Because I don't own a Mac, I am not able to test the Mac platform dependent stuff locally. If someone would be willing to run a build for me on their machine (unless there's a better option), I'd appreciate it. Reviewers: jfb, brad.king, whitequark, beanz Subscribers: beanz, jauhien, llvm-commits Differential Revision: http://reviews.llvm.org/D13198 llvm-svn: 252532
* llvm-config: Add --has-rtti optionTom Stellard2015-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | Summary: This prints NO if LLVM was built with -fno-rtti or an equivalent flag and YES otherwise. The reasons to add -has-rtti rather than adding -fno-rtti to --cxxflags are: 1. Building LLVM with -fno-rtti does not always mean that client applications need this flag. 2. Some compilers have a different flag for disabling rtti, and the compiler being used to build LLVM may not be the compiler being used to build the application. Reviewers: echristo, chandlerc, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11849 llvm-svn: 252075
* llvm-config: Add --build-system optionTom Stellard2015-09-091-0/+3
| | | | | | | | | | | | | | | Summary: This can be used for distinguishing between cmake and autoconf builds. Users may need this in order to handle inconsistencies between the outputs of the two build systems. Reviewers: echristo, chandlerc, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11838 llvm-svn: 247159
* Revert "Fix `llvm-config` to emit the linker flag for the combined shared ↵Richard Diamond2015-08-051-41/+2
| | | | | | | | | | object built by autoconfig/make instead of the individual components." It seems I was wrong thinking `autoconf`/`make` only installed shared libraries if configured with `--enable-shared`, even if `--disable-static` is present. I'll re-address with a followup patch. This reverts commit r243297 for causing PR#24154. llvm-svn: 244108
* Fix `llvm-config` to emit the linker flag for the combined shared object ↵JF Bastien2015-07-271-2/+41
| | | | | | | | | | | | | | | | | | | built by autoconfig/make instead of the individual components. Summary: When LLVM is configured to build shared libraries, CMake builds each component as it's own shared object, while autoconfig/make builds them statically and then links them all together to create a single shared object. This change adds compile time config flags to `llvm-config` so it can know whether LLVM's components are separated or not and act accordingly. This fixes `llvm-config` instead of fixing the makefiles to behave like CMake because, AIUI, LLVM's autoconfig/make build system is on the way out anyway. This change only affects `llvm-config` from builds that use autoconfig/make. Reviewers: jfb Subscribers: echristo, dschuff, llvm-commits Differential Revision: http://reviews.llvm.org/D11392 llvm-svn: 243297
* Revert "Fix `llvm-config` to emit the linker flag for the combined shared ↵JF Bastien2015-07-141-41/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | object built by autoconfig/make instead of the individual components." This reverts commit 01446706b4c0a86bb64768f307079cab5c514aa3. Causes breakage, seems to be related to 'svn' in the file's name: CC=gcc CXX=g++ \ ../llvm/configure \ --prefix=/usr \ --sysconfdir=/etc \ --enable-shared \ --enable-libffi \ --enable-targets=all \ --disable-assertions \ --with-python=/usr/bin/python2 \ --enable-optimized make REQUIRES_RTTI=1 ENABLE_PIC=1 results: llvm[2]: Linking Release unit test Support (without symbols) llvm[2]: ======= Finished Linking Release Unit test Support (without symbols) make[3]: Entering directory '/build/llvm-svn/src/build/bindings/ocaml/llvm' make[3]: *** No rule to make target '/build/llvm- svn/src/build/Release/lib/ocaml/libLLVM-3.7.0svn.so', needed by 'build- deplibs'. Stop. make[3]: *** Waiting for unfinished jobs.... llvm[3]: Compiling llvm_ocaml.c for Release build make[3]: Leaving directory '/build/llvm-svn/src/build/bindings/ocaml/llvm' /build/llvm-svn/src/llvm/Makefile.rules:880: recipe for target 'all' failed /build/llvm-svn/src/llvm/Makefile.rules:965: recipe for target 'all' failed Differential Revision: http://reviews.llvm.org/D10716 llvm-svn: 242152
* Fix `llvm-config` to emit the linker flag for the combined shared object ↵JF Bastien2015-07-101-2/+41
| | | | | | | | | | | | | | | | | built by autoconfig/make instead of the individual components. Summary: This fixes `llvm-config` instead of fixing the makefiles because, AIUI, LLVM's autoconfig/make build system is on the way out anyway. This change only affects builds that use autoconfig/make. Reviewers: jfb Subscribers: echristo, dschuff, llvm-commits Differential Revision: http://reviews.llvm.org/D10716 llvm-svn: 241938
* Make helper functions static.Benjamin Kramer2015-03-091-4/+4
| | | | | | Found by -Wmissing-prototypes. NFC. llvm-svn: 231664
* [cmake] Teach the llvm-config program to respect LLVM_LIBDIR_SUFFIX.Chandler Carruth2014-12-291-4/+6
| | | | | | | | | | | | | | For this to work, we have to encode it in the build variables and use it from llvm-config.cpp. I've tried to do this reasonably cleanly, but the code for llvm-config.cpp is pretty strange. However, with this, llvm-config stops giving the wrong answer when using LLVM_LIBDIR_SUFFIX. Note that the configure+make build just sets this to an empty string as that build system has zero support for multilib of any form. I'm not planning to add support there either, but this should leave a path for anyone that wanted to. llvm-svn: 224921
* Windows: canonicalise the default windows tripleSaleem Abdulrasool2014-03-291-1/+2
| | | | | | | Canonicalise the default triple that is used on Windows. This should hopefully fix the MSVC buildbots. llvm-svn: 205070
* Don't emit a blank line when running llvm-config --system-libs.Richard Osborne2014-03-031-18/+20
| | | | | | | | | | | | | | | | | | | | | | | Summary: Previously llvm-config --system-libs would print something like: $ llvm-config --system-libs -lz -ltinfo -lrt -ldl -lm Now we don't emit blank line. Functionality is unchanged otherwise, in particular llvm-config --libs --system-libs still emits the LLVM libraries and the system libraries on different lines. Reviewers: chapuni Reviewed By: chapuni CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2901 llvm-svn: 202719
* llvm-config: Fix typo in help message introduced with r197664.NAKAMURA Takumi2013-12-251-1/+1
| | | | | | Thanks, Vinson Lee! llvm-svn: 197996
* llvm-config: Show OBJROOT rather than OBJROOT/BUILD_MODE in MakefileStyle.NAKAMURA Takumi2013-12-201-0/+1
| | | | llvm-svn: 197818
* llvm-config: Use build_mode instead of LLVM_BUILDMODE. It should be ↵NAKAMURA Takumi2013-12-201-3/+3
| | | | | | equivalent in MakefileStyle. llvm-svn: 197817
* llvm-config: Don't show build tree with --obj-root for installed ↵NAKAMURA Takumi2013-12-191-1/+1
| | | | | | llvm-config. Show $(prefix) instead. llvm-svn: 197684
OpenPOWER on IntegriCloud