llvm.org GIT mirror llvm / 4a444c7
Fix PR1739. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43286 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 10 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
6363 # Convert the current executable name into its directory (e.g. ".").
6464 my ($RUN_DIR) = ($0 =~ /^(.*)\/.*$/);
6565
66 # Find the unix pwd program: we don't want to use the bash builtin, as it does
67 # not look through symlinks etc.
68 my $PWD = `which pwd`;
69 chomp($PWD);
70 $PWD = "pwd" if (!-e $PWD);
71
6672 # Turn the directory into an absolute directory on the file system, also pop up
6773 # from "bin" into the build or prefix dir.
68 my $ABS_RUN_DIR = `cd $RUN_DIR/..; pwd`;
74 my $ABS_RUN_DIR = `cd $RUN_DIR/..; $PWD`;
6975 chomp($ABS_RUN_DIR);
7076
7177 # Compute the absolute object directory build, e.g. "foo/llvm/Debug".
7278 my $ABS_OBJ_ROOT = "$LLVM_OBJ_ROOT/$LLVM_BUILDMODE";
73 $ABS_OBJ_ROOT = `cd $ABS_OBJ_ROOT; pwd` if (-d $ABS_OBJ_ROOT);
79 $ABS_OBJ_ROOT = `cd $ABS_OBJ_ROOT; $PWD` if (-d $ABS_OBJ_ROOT);
7480 chomp($ABS_OBJ_ROOT);
7581
7682 my $INCLUDEDIR = "$ABS_RUN_DIR/include";
135141 } elsif ($arg eq "--build-mode") {
136142 $has_opt = 1; print "$LLVM_BUILDMODE\n";
137143 } elsif ($arg eq "--obj-root") {
138 $has_opt = 1; print `cd $LLVM_OBJ_ROOT/; pwd`;
144 $has_opt = 1; print `cd $LLVM_OBJ_ROOT/; $PWD`;
139145 } elsif ($arg eq "--src-root") {
140 $has_opt = 1; print `cd $LLVM_SRC_ROOT/; pwd`;
146 $has_opt = 1; print `cd $LLVM_SRC_ROOT/; $PWD`;
141147 } else {
142148 usage();
143149 }