commit 5ba2ca507fbe62f5dbe608bf29748159e74707d5
parent 4b7f628386f8e1a106e4231ecb9c3ae1021cafa3
Author: Kyle Milz <kyle@0x30.net>
Date: Mon, 26 Dec 2016 13:02:14 -0700
Jam: move PREFIX test into configure, nuke CITRUN_SRCDIR
Diffstat:
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/configure b/configure
@@ -52,6 +52,15 @@ else
fi
echo
+#
+# citrun_inst needs to know the absolute installation path.
+#
+if [ -z ${PREFIX-} ]; then
+ CITRUN_SHARE="`pwd`/src"
+else
+ CITRUN_SHARE="${PREFIX}/share/citrun"
+fi
+
# Write Jamrules. Any errors inside backticks get ignored.
cat <<EOF > Jamrules
CC = ${CC-cc} ;
@@ -62,7 +71,7 @@ C++FLAGS += -std=c++11 -fno-exceptions -fno-rtti ${CFLAGS-} ;
LINKFLAGS += ${LDFLAGS-} ;
FONT_PATH = "${FONT_PATH}" ;
-CITRUN_SRCDIR = "`pwd`/src" ;
+CITRUN_SHARE = ${CITRUN_SHARE} ;
GL_CFLAGS = `pkg-config --cflags glfw3 glew freetype2` ;
GL_LIBS = ${GL_EXTRALIB-} `pkg-config --libs glfw3 glew freetype2` ;
diff --git a/src/Jamfile b/src/Jamfile
@@ -1,18 +1,4 @@
SubDir TOP src ;
-#
-# Knowing the absolute path to citrun resources is necessary because:
-# - instrumented programs must be linked to the runtime library
-# - the PATH compiler interception mechanism needs to remove itself from PATH
-#
-# If PREFIX is set we're building a package, so trust that will be the final
-# (after installation) location.
-#
-if $(PREFIX) {
- CITRUN_SHARE = $(PREFIX)/share/citrun ;
-}
-else {
- CITRUN_SHARE = $(CITRUN_SRCDIR) ;
-}
# Do a string replacement on the first argument.
actions ReplaceTokens