@@ -24,3 +24,4 @@ traceevent_plugin_dir
trace_python_dir
tracecmd_plugin_dir
libtracecmd.pc
+build_prefix
@@ -343,7 +343,12 @@ CMAKE_COMMAND = /usr/bin/cmake
# Build with "BUILD_TYPE=Release" to remove cmake debug info
BUILD_TYPE ?= RelWithDebInfo
-$(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template
+BUILD_PREFIX := $(BUILD_OUTPUT)/build_prefix
+
+$(BUILD_PREFIX): force
+ $(Q)$(call build_prefix,$(prefix))
+
+$(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template $(BUILD_PREFIX)
$(Q) $(call do_make_pkgconfig_file,$(prefix))
$(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
@@ -121,6 +121,16 @@ define update_dir
fi);
endef
+define build_prefix
+ (echo $1 > $@.tmp; \
+ if [ -r $@ ] && cmp -s $@ $@.tmp; then \
+ rm -f $@.tmp; \
+ else \
+ $(print_update) \
+ mv -f $@.tmp $@; \
+ fi);
+endef
+
define do_install
$(print_install) \
if [ ! -d '$(DESTDIR_SQ)$2' ]; then \