aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-02 01:23:18 +0000
committerChris Lattner <sabre@nondot.org>2006-06-02 01:23:18 +0000
commite02b97bf5bbc0c2706ff68634b95d47b45a970b2 (patch)
tree71c3a951a30eefe48e84a1c2f5274832e6ede64a
parent411c33da6a57934f699cf24af5d2863a600f1cca (diff)
Add a gross "--use-current-dir-as-prefix" option as a temporary workaround
for the "build with one prefix and move the installed files to another dir" problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28654 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/llvm-config/llvm-config.in.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/llvm-config/llvm-config.in.in b/tools/llvm-config/llvm-config.in.in
index 2f1e2141cf..b0c74dfd39 100644
--- a/tools/llvm-config/llvm-config.in.in
+++ b/tools/llvm-config/llvm-config.in.in
@@ -27,6 +27,9 @@ my $CXXFLAGS = q{@LLVM_CXXFLAGS@};
my $LDFLAGS = q{@LLVM_LDFLAGS@};
#---- end Makefile values ----
+# Convert the current executable name into its directory (e.g. ".").
+my ($PARTIALDIR) = ($0 =~ /^(.*)\/.*$/);
+
sub usage;
sub fix_library_names (@);
sub expand_dependecies (@);
@@ -43,6 +46,11 @@ foreach my $arg (@ARGV) {
if ($arg =~ /^-/) {
if ($arg eq "--version") {
$has_opt = 1; print "$VERSION\n";
+ } elsif ($arg eq "--use-current-dir-as-prefix") {
+ # Convert the scripts executable dir into a full absolute directory.
+ my $ABSDIR = `cd $PARTIALDIR/..; pwd`;
+ chomp($ABSDIR);
+ $PREFIX = $ABSDIR;
} elsif ($arg eq "--prefix") {
$has_opt = 1; print "$PREFIX\n";
} elsif ($arg eq "--bindir") {