commit 8e0df90f70d62fb4a8f8d6dea56d9af547a7b6a4
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Aug 29 15:37:50 2021 +0200

    Avoid leaking the source directory in installed files
    
    (cherry picked from commit c40977fa41469eb844db8e9ede7c102a4e2a4b84)

diff --git a/configure.ac b/configure.ac
index c76ba6196b..5387e35385 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3509,6 +3509,8 @@ AC_CONFIG_COMMANDS([executable-scripts], [
   test -e examples/scheduler/schedulers_context.sh || ln -sf $ac_abs_top_srcdir/examples/scheduler/schedulers_context.sh examples/scheduler
   test -e tools/starpu_paje_draw_histogram.R || ln -sf $ac_abs_top_srcdir/tools/starpu_paje_draw_histogram.R tools/starpu_paje_draw_histogram.R
   test -e tools/starpu_paje_state_stats.R || ln -sf $ac_abs_top_srcdir/tools/starpu_paje_state_stats.R tools/starpu_paje_state_stats.R
+  test -e tools/starpu_mlr_analysis.Rmd || ln -sf $ac_abs_top_srcdir/tools/starpu_mlr_analysis.Rmd tools/starpu_mlr_analysis.Rmd
+  test -e tools/starpu_paje_summary.Rmd || ln -sf $ac_abs_top_srcdir/tools/starpu_paje_summary.Rmd tools/starpu_paje_summary.Rmd
   test -e tools/starpu_trace_state_stats.py || ln -sf $ac_abs_top_srcdir/tools/starpu_trace_state_stats.py tools/starpu_trace_state_stats.py
   chmod +x tools/starpu_trace_state_stats.py
 ])
diff --git a/tools/starpu_mlr_analysis.in b/tools/starpu_mlr_analysis.in
index cf5bfb391b..9ce9a6bbf1 100644
--- a/tools/starpu_mlr_analysis.in
+++ b/tools/starpu_mlr_analysis.in
@@ -19,7 +19,7 @@
 set -e # fail fast
 
 # File names
-SOURCE_DIR=@abs_srcdir@
+SOURCE_DIR=$(dirname $0)
 
 outputfile="mlr_analysis.html"
 analysis_script="$SOURCE_DIR/starpu_mlr_analysis.Rmd"
@@ -37,7 +37,6 @@ Options:
 
 Examples:
 $0 .starpu/sampling/codelets/tmp/test_mlr.out
-$0 
 
 Report bugs to <@PACKAGE_BUGREPORT@>
 EOF
@@ -66,15 +65,11 @@ done
 # Reading files that need to be analyzed
 shift $((OPTIND - 1))
 inputfile=$1
-if [[ $# < 1 ]]; then
-    inputfile="$SOURCE_DIR/perfmodels/sampling/codelets/tmp/mlr_init.out"
-else
 # Error if there is more than one input file
-    if [[ $# > 1 ]]; then
-	echo "Error!"
-	help_script
-	exit 2
-    fi
+if [[ $# < 1 || $# > 1 ]]; then
+    echo "Error!"
+    help_script
+    exit 2
 fi
 
 if [ ! -s $inputfile ]
diff --git a/tools/starpu_paje_summary.in b/tools/starpu_paje_summary.in
index d49121edd1..6fdf9eac77 100755
--- a/tools/starpu_paje_summary.in
+++ b/tools/starpu_paje_summary.in
@@ -20,7 +20,7 @@
 set -e # fail fast
 
 # File names
-SOURCE_DIR=@abs_srcdir@
+SOURCE_DIR=$(dirname $0)
 
 outputfile="summary.html"
 analysis_script="$SOURCE_DIR/starpu_paje_summary.Rmd"
