Fix a bug in the following scenario.
authorChris Lattner <sabre@nondot.org>
Tue, 6 Jun 2006 23:54:15 +0000 (23:54 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 6 Jun 2006 23:54:15 +0000 (23:54 +0000)
1. llvm is built with objroot = OBJ and installed.
2. OBJ is deleted or install tree is shipped.
3. llvm-config is run.

In this scenario, llvm-config shouldn't emit an error message at #3, it
should just know it's not running in the objdir :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28704 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-config/llvm-config.in.in

index 12d8a57e59b51827d2109af58b4943c8ff5c3ab3..5f9c9d9b229b5ae7e221916a9bea0f22eda1e670 100644 (file)
@@ -63,7 +63,8 @@ my $ABS_RUN_DIR = `cd $RUN_DIR/..; pwd`;
 chomp($ABS_RUN_DIR);
 
 # Compute the absolute object directory build, e.g. "foo/llvm/Debug".
-my $ABS_OBJ_ROOT = `cd $LLVM_OBJ_ROOT/$LLVM_BUILDMODE; pwd`;
+my $ABS_OBJ_ROOT = "$LLVM_OBJ_ROOT/$LLVM_BUILDMODE";
+$ABS_OBJ_ROOT = `cd $ABS_OBJ_ROOT; pwd` if (-d $ABS_OBJ_ROOT);
 chomp($ABS_OBJ_ROOT);
 
 my $INCLUDEDIR = "$ABS_RUN_DIR/include";