commit dc7ea65e3a3dae108e701f80060b2cabbee05bed
parent 97919caf639a68fafced2e687c5a131af1a9623c
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Sat, 9 Apr 2016 13:49:53 -0600
if not already set, let PREFIX equal the current directory
Diffstat:
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Jamrules b/Jamrules
@@ -4,7 +4,8 @@ if $(OS) = OPENBSD {
C++ = eg++ ;
SHLIB_SUF = so.0.0 ;
- C++FLAGS = -DLLVM_VER=34 ;
+ PREFIX ?= `pwd`/$(TOP) ;
+ C++FLAGS = -DLLVM_VER=34 -DPREFIX=$(PREFIX) ;
PKG_CONFIG_LIBS = gl glew freetype2 ;
# Link directly against libestdc++ from ports
diff --git a/src/Jamfile b/src/Jamfile
@@ -25,7 +25,6 @@ ObjectC++Flags $(INSTRUMENT_SRCS) $(CITRUN_SRCS) : -std=c++11 ;
ObjectC++Flags $(INSTRUMENT_SRCS) : `llvm-config --cxxflags` ;
ObjectC++Flags $(CITRUN_SRCS) : `pkg-config $(PKG_CONFIG_LIBS) --cflags` ;
ObjectC++Flags $(CITRUN_SRCS) : -I/usr/local/include ;
-ObjectDefines $(INSTRUMENT_SRCS) : PREFIX='\"$(PREFIX)\"' ;
# Common link libraries on all platforms
LINKFLAGS on citrun_instrument = `llvm-config --ldflags` ;
diff --git a/src/instrument_main.cc b/src/instrument_main.cc
@@ -204,7 +204,9 @@ main(int argc, char *argv[])
// Add the runtime library and the symbol define hack
// automatically to the command line
modified_args.push_back(strdup(defsym_arg.str().c_str()));
- modified_args.push_back(const_cast<char *>(PREFIX "/lib/libcitrun.so.0.0"));
+#define STR_EXPAND(tok) #tok
+#define STR(tok) STR_EXPAND(tok)
+ modified_args.push_back(const_cast<char *>(STR(PREFIX) "/lib/libcitrun.so.0.0"));
}
// Instrumentation succeeded. Run the native compiler with a modified