From 6b6bdb24339736cf3830213947fbdd03630d4b1c Mon Sep 17 00:00:00 2001 From: Basile Desloges <basile.desloges@cea.fr> Date: Tue, 13 Oct 2020 17:26:27 +0200 Subject: [PATCH] [eacsl] Put dlmalloc library in lib/frama-c/e-acsl --- src/plugins/e-acsl/Makefile.in | 13 +++++++++---- src/plugins/e-acsl/scripts/e-acsl-gcc.sh | 8 ++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/plugins/e-acsl/Makefile.in b/src/plugins/e-acsl/Makefile.in index 4ce114193f1..c0ff4c019fe 100644 --- a/src/plugins/e-acsl/Makefile.in +++ b/src/plugins/e-acsl/Makefile.in @@ -29,6 +29,9 @@ ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif +ifndef FRAMAC_LIBDIR +FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) +endif ################### # Plug-in sources # @@ -485,7 +488,9 @@ EACSL_INSTALL_SCRIPTS=$(addprefix $(E_ACSL_DIR)/,$(EACSL_SCRIPTS)) EACSL_INSTALL_MANPAGES=$(addprefix $(E_ACSL_DIR)/,$(EACSL_MANPAGES)) -install:: +EACSL_INSTALL_LIB_DIR :=$(FRAMAC_LIBDIR)/e-acsl + +install:: clean-install $(PRINT_INSTALL) E-ACSL share files for dir in $(EACSL_C_DIRECTORIES); do \ $(MKDIR) $(FRAMAC_DATADIR)/$$dir && \ @@ -499,8 +504,8 @@ ifneq ("$(EACSL_INSTALL_MANUAL_FILES)","") $(CP) $(EACSL_INSTALL_MANUAL_FILES) $(FRAMAC_DATADIR)/manuals; endif $(PRINT_INSTALL) E-ACSL libraries - $(MKDIR) $(LIBDIR) - $(CP) $(EACSL_LIBDIR)/libeacsl-*.a $(LIBDIR) + $(MKDIR) $(EACSL_INSTALL_LIB_DIR) + $(CP) $(EACSL_LIBDIR)/libeacsl-*.a $(EACSL_INSTALL_LIB_DIR) $(PRINT_INSTALL) E-ACSL scripts $(MKDIR) $(BINDIR) $(CP) $(EACSL_INSTALL_SCRIPTS) $(BINDIR)/ @@ -519,7 +524,7 @@ uninstall:: $(PRINT_RM) E-ACSL manuals $(RM) $(FRAMAC_DATADIR)/manuals/*.pdf $(PRINT_RM) E-ACSL libraries - $(RM) $(LIBDIR)/libeacsl-*.a + $(RM) -r $(EACSL_INSTALL_LIB_DIR) $(PRINT_RM) E-ACSL scripts $(RM) $(EACSL_INSTALLED_SCRIPTS) $(PRINT_RM) E-ACSL man pages diff --git a/src/plugins/e-acsl/scripts/e-acsl-gcc.sh b/src/plugins/e-acsl/scripts/e-acsl-gcc.sh index a168729e80b..1804b7cb022 100755 --- a/src/plugins/e-acsl/scripts/e-acsl-gcc.sh +++ b/src/plugins/e-acsl/scripts/e-acsl-gcc.sh @@ -352,8 +352,6 @@ Notes: # Base dir of this script BASEDIR="$(realpath `dirname $0`)" -# Directory with contrib libraries of E-ACSL -LIBDIR="$BASEDIR/../lib" # Run getopt ARGS=`getopt -n "$ERROR" -l "$LONGOPTIONS" -o "$SHORTOPTIONS" -- "$@"` @@ -672,6 +670,7 @@ if [ -f "$BASEDIR/../E_ACSL.mli" ]; then `test -f "$DEVELOPMENT/META.frama-c-e_acsl" -o \ -f "$FRAMAC_PLUGIN/META.frama-c-e_acsl"; echo $?` EACSL_SHARE="$DEVELOPMENT/share/e-acsl" + EACSL_LIB="$DEVELOPMENT/lib" # Add the project directory to FRAMAC_PLUGINS, # otherwise Frama-C uses an installed version if test -f "$DEVELOPMENT/META.frama-c-e_acsl"; then @@ -680,7 +679,8 @@ if [ -f "$BASEDIR/../E_ACSL.mli" ]; then else # Installed version. FRAMAC_SHARE should not be used here as Frama-C # and E-ACSL may not be installed to the same location - EACSL_SHARE="$BASEDIR/../share/frama-c/e-acsl/" + EACSL_SHARE="$BASEDIR/../share/frama-c/e-acsl" + EACSL_LIB="$BASEDIR/../lib/frama-c/e-acsl" fi # Architecture-dependent flags. Since by default Frama-C uses 32-bit @@ -768,7 +768,7 @@ FRAMAC_FLAGS="$FRAMAC_FLAGS \ # C, CPP and LD flags for compilation of E-ACSL-generated sources EACSL_CFLAGS="$OPTION_EXTERNAL_ASSERT" EACSL_CPPFLAGS="-I$EACSL_SHARE" -EACSL_LDFLAGS="$LIBDIR/libeacsl-dlmalloc.a -lgmp -lm" +EACSL_LDFLAGS="$EACSL_LIB/libeacsl-dlmalloc.a -lgmp -lm" # Output file names OUTPUT_CODE="$OPTION_OUTPUT_CODE" # E-ACSL instrumented source -- GitLab