summaryrefslogtreecommitdiff
path: root/tools/llvm-config
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-02 22:03:50 +0000
committerChris Lattner <sabre@nondot.org>2006-06-02 22:03:50 +0000
commit0cd059eddb0e51494f0f662ea8ebbed97baa14b0 (patch)
tree82f7802a4a524a80faa177e6d513950953adb353 /tools/llvm-config
parent16ad618fc2b68e107a19a28094929903220f0976 (diff)
downloadllvm-0cd059eddb0e51494f0f662ea8ebbed97baa14b0.tar.gz
llvm-0cd059eddb0e51494f0f662ea8ebbed97baa14b0.tar.bz2
llvm-0cd059eddb0e51494f0f662ea8ebbed97baa14b0.tar.xz
Add flags to get access to build_mode, objdir, srcdir etc.
If installed, ignore the prefix the tree is configured with: always use the prefix that llvm-config is currently at, which may be different if the tree was moved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r--tools/llvm-config/llvm-config.in.in27
1 files changed, 18 insertions, 9 deletions
diff --git a/tools/llvm-config/llvm-config.in.in b/tools/llvm-config/llvm-config.in.in
index 4b9cef168c..c799983545 100644
--- a/tools/llvm-config/llvm-config.in.in
+++ b/tools/llvm-config/llvm-config.in.in
@@ -66,17 +66,17 @@ chomp($ABS_RUN_DIR);
my $ABS_OBJ_ROOT = `cd $LLVM_OBJ_ROOT/$LLVM_BUILDMODE; pwd`;
chomp($ABS_OBJ_ROOT);
-my $INCLUDEDIR = "$PREFIX/include";
-my $LIBDIR = "$PREFIX/lib";
-my $BINDIR = "$PREFIX/bin";
-$LIBDIR = "$ABS_RUN_DIR/lib";
-$BINDIR = "$ABS_RUN_DIR/bin";
+my $INCLUDEDIR = "$ABS_RUN_DIR/include";
+my $LIBDIR = "$ABS_RUN_DIR/lib";
+my $BINDIR = "$ABS_RUN_DIR/bin";
if ($ABS_RUN_DIR eq $ABS_OBJ_ROOT) {
# If we are running out of the build directory, the include dir is in the
# srcdir.
$INCLUDEDIR = "$LLVM_SRC_ROOT/include";
} else {
- $INCLUDEDIR = "$ABS_RUN_DIR/include";
+ # If installed, ignore the prefix the tree was configured with, use the
+ # current prefix.
+ $PREFIX = $ABS_RUN_DIR;
}
sub usage;
@@ -115,6 +115,12 @@ foreach my $arg (@ARGV) {
$has_opt = 1; print join(' ', name_map_entries), "\n";
} elsif ($arg eq "--targets-built") {
$has_opt = 1; print join(' ', @TARGETS_BUILT), "\n";
+ } elsif ($arg eq "--build-mode") {
+ $has_opt = 1; print "$LLVM_BUILDMODE\n";
+ } elsif ($arg eq "--obj-root") {
+ $has_opt = 1; print `cd $LLVM_OBJ_ROOT/; pwd` . "\n";
+ } elsif ($arg eq "--src-root") {
+ $has_opt = 1; print `cd $LLVM_SRC_ROOT/; pwd` . "\n";
} else {
usage();
}
@@ -159,17 +165,20 @@ LLVM. Typically called from 'configure' scripts. Examples:
llvm-config --libs engine bcreader scalaropts
Options:
- --version LLVM version.
- --prefix Installation prefix.
+ --version Print LLVM version.
+ --prefix Print the installation prefix.
+ --src-root Print the source root LLVM was built from.
+ --obj-root Print the object root used to build LLVM.
--bindir Directory containing LLVM executables.
--includedir Directory containing LLVM headers.
--libdir Directory containing LLVM libraries.
--cxxflags C++ compiler flags for files that include LLVM headers.
- --ldflags Linker flags.
+ --ldflags Print Linker flags.
--libs Libraries needed to link against LLVM components.
--libnames Bare library names for in-tree builds.
--components List of all possible components.
--targets-built List of all targets currently built.
+ --build-mode Print build mode of LLVM tree (e.g. Debug or Release).
Typical components:
all All LLVM libraries (default).
backend Either a native backend or the C backend.