Commit 3dc87d94 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[config] add support for ocamlgraph 2.0 and the ocamlgraph/ocamlgraph_gtk split

parent b876bf4e
......@@ -413,25 +413,6 @@ clean_share_link:
clean:: clean_share_link
##############
# Ocamlgraph #
##############
# dgraph (included in ocamlgraph)
#[LC] Cf https://github.com/backtracking/ocamlgraph/pull/32
ifeq ($(HAS_GNOMECANVAS),yes)
ifneq ($(ENABLE_GUI),no)
GRAPH_GUICMO= dgraph.cmo
GRAPH_GUICMX= dgraph.cmx
GRAPH_GUIO= dgraph.o
HAS_DGRAPH=yes
else # enable_gui is no: disable dgraph
HAS_DGRAPH=no
endif
else # gnome_canvas is not yes: disable dgraph
HAS_DGRAPH=no
endif
##################
# Frama-C Kernel #
##################
......
......@@ -279,6 +279,10 @@ if test -z "$OCAMLGRAPH" ; then
AC_MSG_ERROR(Cannot find ocamlgraph via ocamlfind \
(requires ocamlgraph 1.8.5 or higher).)
fi
AC_SUBST(HAS_OCAMLGRAPH_2)
HAS_OCAMLGRAPH_2=no
case $OCAMLGRAPH in
0.* | 1.[[01234567]].* \
| 1.8.0 | 1.8.0+dev \
......@@ -287,10 +291,14 @@ case $OCAMLGRAPH in
| 1.8.3 | 1.8.3+dev \
| 1.8.4 | 1.8.4+dev)
AC_MSG_ERROR(found $OCAMLGRAPH: requires 1.8.5 or higher.);;
1.8.5 | 1.8.6 | 1.8.7)
1.8.5 | 1.8.6 | 1.8.7|1.8.8)
AC_MSG_RESULT(found);;
2.0.*)
HAS_OCAMLGRAPH_2=yes
AC_MSG_RESULT(found);;
*)
AC_MSG_RESULT(found $OCAMLGRAPH: should work);;
HAS_OCAMLGRAPH_2=yes
AC_MSG_RESULT(found $OCAMLGRAPH: should work, but is not tested);;
esac
# zarith
......@@ -733,7 +741,13 @@ plugin_require(from_analysis,callgraph)
check_plugin(gui,src/plugins/gui,[support for gui],yes)
plugin_require_external(gui,lablgtk)
plugin_use_external(gui,gnomecanvas)
# in ocamlgraph 2, the gtk part is separated. Hence if we found it,
# there's no need to check specifically for gnomecanvas
if test "$HAS_OCAMLGRAPH_2" = "yes"; then
plugin_use_external(gui,ocaml_ocamlgraph_gtk)
else
plugin_use_external(gui,gnomecanvas)
fi
plugin_require_external(gui,gtksourceview)
plugin_use_external(gui,dot)
......@@ -973,6 +987,10 @@ configure_library([LABLGTK],
[$LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX not found.],
no)
if test "$HAS_OCAMLGRAPH_2" = yes; then
configure_pkg([ocamlgraph_gtk],[package ocamlgraph_gtk not found])
fi
# dot and xdot tools
####################
......@@ -991,6 +1009,13 @@ new_section "checking for plug-in dependencies"
check_frama_c_dependencies
AC_SUBST(HAS_DGRAPH)
if test "$HAS_OCAMLGRAPH_2" = "yes"; then
HAS_DGRAPH=$HAS_OCAML_OCAMLGRAPH_GTK;
else
HAS_DGRAPH=$HAS_GNOMECANVAS
fi
############################
# Substitutions to perform #
############################
......
......@@ -98,6 +98,10 @@ DEVELOPMENT ?=@DEVELOPMENT@
# Libraries #
#############
# ocamlgraph
HAS_OCAMLGRAPH_2 ?= @HAS_OCAMLGRAPH_2@
HAS_DGRAPH ?= @HAS_DGRAPH@
# lablgtk
HAS_LABLGTK ?=@HAS_LABLGTK@
HAS_LABLGTK_CUSTOM_MODEL ?=@HAS_LABLGTK@
......@@ -105,6 +109,8 @@ LABLGTK_PATH ?=@LABLGTK_PATH@
LABLGTK ?= lablgtk@LABLGTK_VERSION@
# lablgtksourceview
HAS_GTKSOURCEVIEW ?=@HAS_GTKSOURCEVIEW@
#gnomecanvas
HAS_GNOMECANVAS ?=@HAS_GNOMECANVAS@
LABLGTK_VERSION ?=@LABLGTK_VERSION@
ifeq ("$(LABLGTK_VERSION)","3")
......@@ -116,9 +122,6 @@ else
THREAD:=
endif
# lablgnomecanvas
HAS_GNOMECANVAS ?=@HAS_GNOMECANVAS@
# apron
HAS_APRON ?=@HAS_APRON@
......@@ -202,8 +205,17 @@ endif
ifneq ($(ENABLE_GUI),no)
LIBRARY_NAMES_GUI = $(LABLGTK) $(GTKSOURCEVIEW)
ifeq ($(HAS_GNOMECANVAS),yes)
LIBRARY_NAMES_GUI+=lablgtk2.gnomecanvas
ifeq ($(HAS_OCAMLGRAPH_2),yes)
ifeq ($(HAS_DGRAPH),yes)
LIBRARY_NAMES_GUI+=ocamlgraph_gtk
endif
else
ifeq ($(HAS_GNOMECANVAS),yes)
LIBRARY_NAMES_GUI+=lablgtk2.gnomecanvas
GRAPH_GUICMO= dgraph.cmo
GRAPH_GUICMX= dgraph.cmx
GRAPH_GUIO= dgraph.o
endif
endif
else
LIBRARY_NAMES_GUI =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment