From 211df542d460ed2a235e1d0a84cd1ab3415a5e2a Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Fri, 22 Jul 2016 19:30:46 +0200
Subject: [PATCH] [script] Remove useless assignments

- If FRAMAC_SHARE is not already set, either frama-c -print-share-path
  gives a correct result, and there's no need to set FRAMAC_SHARE in the
  first place, or it does not, and putting this result in FRAMAC_SHARE
  won't do any good.
- there's no need (and it seems to confuse Frama-C) to -add-path when in
  internal mode.
---
 src/plugins/e-acsl/scripts/e-acsl-gcc.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/plugins/e-acsl/scripts/e-acsl-gcc.sh b/src/plugins/e-acsl/scripts/e-acsl-gcc.sh
index aeea5a51d0e..8a6eda63a26 100755
--- a/src/plugins/e-acsl/scripts/e-acsl-gcc.sh
+++ b/src/plugins/e-acsl/scripts/e-acsl-gcc.sh
@@ -383,9 +383,9 @@ check_tool "$OPTION_CC"
 
 # Frama-C directories
 FRAMAC="$OPTION_FRAMAC"
-FRAMAC_SHARE="`$FRAMAC -print-share-path`"
-FRAMAC_PLUGIN="`$FRAMAC -print-plugin-path`"
-
+#FRAMAC_SHARE="`$FRAMAC -print-share-path`"
+#FRAMAC_PLUGIN="`$FRAMAC -print-plugin-path`"
+#FRAMAC_LIB="$($FRAMAC -print-lib-path)"
 # Check if this is a development or an installed version
 if [ -f "$BASEDIR/../E_ACSL.mli" ]; then
   # Development version
@@ -399,7 +399,9 @@ if [ -f "$BASEDIR/../E_ACSL.mli" ]; then
   EACSL_SHARE="$DEVELOPMENT/share/e-acsl"
   # Add the project directory to FRAMAC_PLUGINS,
   # otherwise Frama-C uses an installed version
-  FRAMAC_FLAGS="-add-path=$DEVELOPMENT/top -add-path=$DEVELOPMENT $FRAMAC_FLAGS"
+  if test -f "$DEVELOPMENT/META.frama-c-e_acsl"; then
+      FRAMAC_FLAGS="-add-path=$DEVELOPMENT/top -add-path=$DEVELOPMENT $FRAMAC_FLAGS";
+  fi
 else
   # Installed version. FRAMAC_SHARE should not be used here as Frama-C
   # and E-ACSL may not be installed to the same location
-- 
GitLab