commit e3934f0d68bd12f2bddaa5e05311a10730cc88bd
parent 4190798a4745aa1941582e499e7d85f657d5bd61
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Wed, 8 Jun 2016 19:00:19 -0600
src: specify libcitrun via CITRUN_LIB env var
Diffstat:
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/SCV/Project.pm b/SCV/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.so.0.0";
$ENV{PATH} = "$ENV{CITRUN_PATH}:$ENV{PATH}";
my $ret = system( "cd $tmp_dir && jam" );
diff --git a/bin/citrun-wrap b/bin/citrun-wrap
@@ -1,6 +1,7 @@
#!/bin/sh
export CITRUN_PATH="/usr/local/share/citrun"
+export CITRUN_LIB="/usr/local/lib/libcitrun.so.0.0"
export PATH="$CITRUN_PATH:$PATH"
exec $@
diff --git a/src/inst_main.cc b/src/inst_main.cc
@@ -210,10 +210,14 @@ main(int argc, char *argv[])
defsym_arg << last_node;
#endif
+ char *lib_str;
+ if ((lib_str = getenv("CITRUN_LIB")) == NULL)
+ errx(1, "CITRUN_LIB not found in environment.");
+
// Add the runtime library and the symbol define hack
// automatically to the command line
args.push_back(strdup(defsym_arg.str().c_str()));
- args.push_back(const_cast<char *>(STR(LIBCITRUN_PATH)));
+ args.push_back(lib_str);
}
// Instrumentation succeeded. Run the native compiler with a possibly