Skip to content
Snippets Groups Projects
configure.ac 4.8 KiB
Newer Older
##########################################################################
#                                                                        #
#  This file is part of the Frama-C's E-ACSL plug-in.                    #
Julien Signoles's avatar
Julien Signoles committed
#  Copyright (C) 2012-2016                                               #
Julien Signoles's avatar
Julien Signoles committed
#    CEA (Commissariat  l'nergie atomique et aux nergies              #
#         alternatives)                                                  #
#                                                                        #
#  you can redistribute it and/or modify it under the terms of the GNU   #
#  Lesser General Public License as published by the Free Software       #
#  Foundation, version 2.1.                                              #
#                                                                        #
#  It is distributed in the hope that it will be useful,                 #
#  but WITHOUT ANY WARRANTY; without even the implied warranty of        #
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         #
#  GNU Lesser General Public License for more details.                   #
#                                                                        #
#  See the GNU Lesser General Public License version 2.1                 #
#  for more details (enclosed in the file license/LGPLv2.1).             #
#                                                                        #
##########################################################################

########################################
# E-ACSL as a standard Frama-C plug-in #
########################################

m4_define([plugin_file],Makefile.in)

m4_define([FRAMAC_SHARE_ENV],
          [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))])

m4_define([FRAMAC_SHARE],
	  [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV],
                                     [m4_esyscmd(frama-c -print-path)])])

m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)])

check_plugin(e_acsl,PLUGIN_RELATIVE_PATH(plugin_file),
	     [support for E-ACSL plug-in],yes,yes)

plugin_require(e_acsl,rtegen)
# restrict the plug-in dependency checking to external plug-in configuration
m4_ifndef([FRAMAC_MAIN_AUTOCONF],[check_plugin_dependencies],[])
# Check Frama-C version
#######################

AC_MSG_CHECKING(for Frama-C version)
VERSION_NUMBER=`echo $FRAMAC_VERSION | sed -n -e 's/[[a-zA-Z]]\+-\([[0-9]]\+\).*/\1/p'`
EXTRA_VERSION_NUMBER=`echo $FRAMAC_VERSION | sed -n -e 's/[[a-zA-Z]]\+-[[0-9]]\+-\(.*\)/\1/p'`
Julien Signoles's avatar
Julien Signoles committed
REQUIRED_NUMBER=20161101
REQUIRED_NAME=Silicon
  $REQUIRED_NAME-$REQUIRED_NUMBER+dev*)
    # at the time being, must use the Frama-C development version
    ;;
#   $REQUIRED_NAME-$REQUIRED_NUMBER*)
#     if test -n "$EXTRA_VERSION_NUMBER"; then
#       AC_MSG_WARN(no guarantee of compatibility with your Frama-C custom \
# version of $REQUIRED_NAME)
#     fi;;
  *)
    if test $VERSION_NUMBER -lt $REQUIRED_NUMBER; then
      AC_MSG_ERROR(Frama-C version must be at least \
$REQUIRED_NAME-$REQUIRED_NUMBER.)
      if test $VERSION_NUMBER -gt $REQUIRED_NUMBER; then
        AC_MSG_WARN(Frama-C version is more recent than $REQUIRED_NAME: \
# OCaml version
###############

OCAMLVERSION=`ocamlc -v | sed -n -e 's|.*version *\(.*\)$|\1|p' `

###############################
# C specific stuff for E-ACSL #
###############################

MAY_RUN_TESTS=yes

# C compiler and stdio.h
#########################

# not sure it can actually happen:
# looks like configure stops on error if no C compiler detected
if test -z $HAVE_STDIO_H; then
  MAY_RUN_TESTS=no
  AC_MSG_WARN([stdio.h missing: non-regression tests unavailable.])
fi

AC_CHECK_PROG(DOXYGEN,doxygen,doxygen,no)
AC_OUTPUT(PLUGIN_RELATIVE_PATH(doc/doxygen/doxygen.cfg), [  ])
# GMP
#####
AC_ARG_ENABLE(full-gmp,
    AS_HELP_STRING([--enable-full-gmp],
    ["Disable runtime assertions in the RTL"]),
    [FULL_GMP="yes"],[FULL_GMP="no"])

#######################
# Generating Makefile #
#######################

AC_SUBST(MAY_RUN_TESTS)
write_plugin_config(Makefile)

###############################
# Configure contrib libraries #
###############################

m4_ifndef([plugin_dir], [
  m4_define([plugin_dir],[./])
])

# Configure libgmp
if test "$FULL_GMP" = yes; then
  AC_MSG_NOTICE([Configure libgmp])
  (cd plugin_dir/contrib/libgmp && ./configure)
fi

# Configure libjemalloc
AC_MSG_NOTICE([Configure libjemalloc])
(cd plugin_dir/contrib/libjemalloc && ./autogen.sh \
  --with-jemalloc-prefix="__e_acsl_native_" \
  --with-private-namespace="__e_acsl_hidden_")