Skip to content
Snippets Groups Projects
Commit 54b20a57 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

Merge branch 'fix/server/configure' into 'master'

[server] notify when zmq not installed

See merge request frama-c/frama-c!2373
parents 4176483e 66656f76
No related branches found
No related tags found
No related merge requests found
...@@ -212,6 +212,74 @@ m4_define([configure_library], ...@@ -212,6 +212,74 @@ m4_define([configure_library],
]) ])
]) ])
# 1st param: actual name of the ocamlfind package (often lowercase)
# 2nd param: warning to display if problem
m4_define([configure_pkg],
[
define([PKG_UP],[tovarname($1)])
m4_ifdef([HAS_OCAML_]PKG_UP,,
[
define([VAR],[[OCAML_]PKG_UP])
define([require],[$[REQUIRE_OCAML_]PKG_UP])
define([use],[$[USE_OCAML_]PKG_UP])
define([msg],[$2])
define([has],[[HAS_OCAML_]PKG_UP])
has=
AC_MSG_CHECKING(for OCaml package $1)
VAR=$(ocamlfind query $1 -format %v 2>/dev/null)
if test -z "$VAR" ; then
AC_MSG_RESULT(not found via ocamlfind.)
has=no
else
AC_MSG_RESULT(found.)
has=yes
fi
m4_divert_push(frama_c_configure_tool)
if test -n "require" -o -n "use" -o "$force_check" = "yes"; then
if test "$has" = "no"; then
AC_MSG_WARN([msg])
reason="$1 missing"
for p in require; do
up=`upper "$p"`
ep=ENABLE_$up
eval enable_p=\$$ep
if test "$enable_p" != "no"; then
fp=FORCE_`upper "$p"`
if eval test "\$$fp" = "yes"; then
AC_MSG_ERROR([$p requested but $reason.])
fi
eval $ep="no\ \(see\ warning\ about\ $1\)"
AC_MSG_WARN([$p disabled because $reason.])
eval INFO_$up=\", $reason\"
fi
done
for p in use; do
up=`upper "$p"`
ep=ENABLE_$up
eval eep="\$$ep"
if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then
eval $ep="partial\ \(see\ warning\ about\ $1\)"
AC_MSG_WARN([$p partially enabled because $reason.])
eval INFO_$up=\", $reason\"
fi
done
else
VAR=PKG_UP
fi
fi
m4_divert_pop(frama_c_configure_tool)
AC_SUBST(VAR)
AC_SUBST(has)
undefine([PKG_UP])
undefine([VAR])
undefine([require])
undefine([use])
undefine([msg])
undefine([has])
])
])
# 1st param: uppercase name of the program # 1st param: uppercase name of the program
# 2nd param: program which must exist. See comment on configure_library() # 2nd param: program which must exist. See comment on configure_library()
# on how to deal with multiple choices for a given program. # on how to deal with multiple choices for a given program.
...@@ -280,6 +348,7 @@ AC_CHECK_PROG(has,$file,yes,no) ...@@ -280,6 +348,7 @@ AC_CHECK_PROG(has,$file,yes,no)
]) ])
]) ])
EXTERNAL_PLUGINS= EXTERNAL_PLUGINS=
define([plugin_require_external], define([plugin_require_external],
...@@ -296,6 +365,20 @@ define([plugin_use_external], ...@@ -296,6 +365,20 @@ define([plugin_use_external],
m4_undefine([USE]) m4_undefine([USE])
m4_undefine([UPORIG])]) m4_undefine([UPORIG])])
define([plugin_require_pkg],
[m4_define([UPORIG],[OCAML_]tovarname($2))
m4_define([REQUIRE],[REQUIRE_]UPORIG)
REQUIRE=$REQUIRE" "$1
m4_undefine([REQUIRE])
m4_undefine([UPORIG])])
define([plugin_use_pkg],
[m4_define([UPORIG],[OCAML_]tovarname($2))
m4_define([USE],[USE_]UPORIG)
USE=$USE" "$1
m4_undefine([USE])
m4_undefine([UPORIG])])
define([plugin_require], define([plugin_require],
[m4_define([UPTARGET],tovarname($1)) [m4_define([UPTARGET],tovarname($1))
m4_define([UPORIG],tovarname($2)) m4_define([UPORIG],tovarname($2))
......
...@@ -37,20 +37,6 @@ m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) ...@@ -37,20 +37,6 @@ m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)])
check_plugin(server,PLUGIN_RELATIVE_PATH(plugin_file),[Server plug-in],yes) check_plugin(server,PLUGIN_RELATIVE_PATH(plugin_file),[Server plug-in],yes)
########################################
# Server Main Configuration #
########################################
AC_MSG_CHECKING(for Yojson)
SERVER_LIB_YOJSON=$($OCAMLFIND query yojson -format %v)
if test -z "$SERVER_LIB_YOJSON"
then
AC_MSG_RESULT(Server disabled (use 'opam install yojson'))
plugin_disable(server)
else
AC_MSG_RESULT(yes)
fi
######################################## ########################################
# Server ZMQ Configuration # # Server ZMQ Configuration #
######################################## ########################################
...@@ -64,19 +50,11 @@ AC_ARG_ENABLE( ...@@ -64,19 +50,11 @@ AC_ARG_ENABLE(
if test "$SERVER_ZMQ" = "yes" ; if test "$SERVER_ZMQ" = "yes" ;
then then
AC_MSG_CHECKING(for ZeroMQ) configure_pkg([zmq],
SERVER_LIB_ZMQ=$($OCAMLFIND query zmq -format %v) [Server support for ZeroMQ disabled (try 'opam install zmq').])
if test -z "$SERVER_LIB_ZMQ" plugin_use_pkg(server,zmq)
then
AC_MSG_RESULT(Server support for ZeroMQ disabled (use 'opam install zmq').)
SERVER_ZMQ=no
else
AC_MSG_RESULT(yes);
fi
fi fi
AC_SUBST(SERVER_ZMQ)
####################### #######################
# Generating Makefile # # Generating Makefile #
####################### #######################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment