commit 2969027c0ebe9c86a7a58c00612180b0b048c83b
parent 4c131a4c65a6d240b97e1495856e77e76bc90625
Author: Kyle Milz <kyle@0x30.net>
Date: Thu, 16 Jun 2016 19:35:26 -0600
src: leave CITRUN_LIB env var for test suite during packaging
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/Test/Project.pm b/Test/Project.pm
@@ -52,6 +52,7 @@ EOF
# Use the tools in this source tree
my $cwd = getcwd;
$ENV{CITRUN_PATH} = "$cwd/share";
+ $ENV{CITRUN_LIB} = "$cwd/lib/libcitrun.a";
$ENV{PATH} = "$ENV{CITRUN_PATH}:$ENV{PATH}";
my $ret = system( "cd $tmp_dir && jam" );
diff --git a/src/inst_main.cc b/src/inst_main.cc
@@ -198,7 +198,13 @@ patch_link_command(std::vector<char *> &args)
// libcitrun.a needs pthread but is static and doesn't include it itself
args.push_back(const_cast<char *>("-pthread"));
- args.push_back(const_cast<char *>(STR(CITRUN_LIB)));
+
+ char *lib_str;
+ if ((lib_str = getenv("CITRUN_LIB")) == NULL)
+ // Trap door not found.
+ args.push_back(const_cast<char *>(STR(CITRUN_LIB)));
+ else
+ args.push_back(lib_str);
}
int