]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/interface/configure.in
configure.in : check for perl
[helm.git] / helm / interface / configure.in
index 6a512e98c998777f279fc7b24aee9e0577cf665c..1b8c3a1bd492daf5861a1e40a26cb83dcfa4a344 100644 (file)
@@ -1,5 +1,11 @@
 AC_INIT(configuration.ml.in)
 
+PACKAGE=helm_gtk_interface
+MAJOR_VERSION=0
+MINOR_VERSION=0
+MICRO_VERSION=2
+VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
+
 if test "x$prefix" != xNONE; then
   RESOLVED_PREFIX=$prefix
 else
@@ -12,37 +18,105 @@ else
   RESOLVED_EXEC_PREFIX=$RESOLVED_PREFIX
 fi
 
-dnl General
+dnl The following is the directory where the binary will be installed
+BIN_DIR=$RESOLVED_EXEC_PREFIX/bin
+
+AC_PATH_PROG(PERL_BINARY,perl,no)
+if test $PERL_BINARY = no ; then
+   AC_MSG_ERROR(Could not find perl)
+fi
+
+dnl MISSING CHECKS:
+dnl ocaml-findlib, ocaml-netstring, ocaml-pxp
+
+dnl Check for Ocaml
+AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
+if test $HAVE_OCAMLC = "no"; then
+  AC_MSG_ERROR(could not find ocamlc in PATH, please make sure ocaml is installed)
+fi
+
+dnl Check for the Ocaml library dir
 AC_MSG_CHECKING("for the ocaml library dir")
 OCAML_ROOT=`ocamlc -v | grep "^Standard" | sed 's/^.*: *//'`
 AC_MSG_RESULT($OCAML_ROOT)
 
-AC_MSG_CHECKING("for the bin dir")
-HELM_BIN_DIR=$RESOLVED_EXEC_PREFIX/bin
-AC_MSG_RESULT($HELM_BIN_DIR)
+dnl Check for mlminidom
+AC_CHECK_FILE($OCAML_ROOT/mlminidom/minidom.mli,
+  RES="yes"
+  MLMINIDOM_LIB_DIR=$OCAML_ROOT/mlminidom,
+  RES="no"
+)
 
-AC_MSG_CHECKING("for the helm configuration dir")
-RES=""
-AC_CACHE_VAL(helm_cv_HELM_DEFAULT_CONFIGURATION_DIR,
-  echo "In which directory can I find configuration.xml (part of the helm_configuration package)?"
-  read helm_cv_HELM_DEFAULT_CONFIGURATION_DIR
-  RES="Asked"
+if test $RES = "no"; then
+  echo
+  echo "It seems that mlminidom isn't installed in the default directory"
+  echo "$OCAML_ROOT/mlminidom. Where can I find it?"
+  echo
+  AC_CACHE_VAL(mmlinterface_cv_MLMINIDOM_LIB_DIR,
+    read mmlinterface_cv_MLMINIDOM_LIB_DIR
+  )
+  MLMINIDOM_LIB_DIR=$mmlinterface_cv_MLMINIDOM_LIB_DIR
+fi
+
+dnl Check for lablgtk
+AC_CHECK_FILE($OCAML_ROOT/lablgtk/gtk.ml,
+  RES="yes"
+  LABLGTK_LIB_DIR=$OCAML_ROOT/lablgtk,
+  RES="no"
 )
-HELM_DEFAULT_CONFIGURATION_DIR=$helm_cv_HELM_DEFAULT_CONFIGURATION_DIR
-if test "$RES" != "Asked" ; then
-   HELM_DEFAULT_CONFIGURATION_DIR=`eval "echo $HELM_DEFAULT_CONFIGURATION_DIR"`
-   AC_MSG_RESULT($HELM_DEFAULT_CONFIGURATION_DIR)
+
+if test $RES = "no"; then
+  echo
+  echo "It seems that lablgtk isn't installed in the default directory"
+  echo "$OCAML_ROOT/lablgtk. Where can I find it?"
+  echo
+  AC_CACHE_VAL(mmlinterface_cv_LABLGTK_LIB_DIR,
+    read mmlinterface_cv_LABLGTK_LIB_DIR
+  )
+  LABLGTK_LIB_DIR=$mmlinterface_cv_LABLGTK_LIB_DIR
 fi
-AC_CACHE_SAVE
 
-AC_PATH_PROG(PERL_BINARY,perl,no)
-if test $PERL_BINARY = no ; then
-   AC_MSG_ERROR(Could not find perl)
+dnl Check for lablgtkmathview
+AC_CHECK_FILE($OCAML_ROOT/lablgtkmathview/gtkMathView.ml,
+  RES="yes"
+  LABLGTKMATHVIEW_LIB_DIR=$OCAML_ROOT/lablgtkmathview,
+  RES="no"
+)
+
+if test $RES = "no"; then
+  echo
+  echo "It seems that lablgtkmathview isn't installed in the default directory"
+  echo "$OCAML_ROOT/lablgtkmathview. Where can I find it?"
+  echo
+  AC_CACHE_VAL(mmlinterface_cv_LABLGTKMATHVIEW_LIB_DIR,
+    read mmlinterface_cv_LABLGTKMATHVIEW_LIB_DIR
+  )
+  LABLGTKMATHVIEW_LIB_DIR=$mmlinterface_cv_LABLGTKMATHVIEW_LIB_DIR
+fi
+
+dnl Check for HELM
+AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
+if test $HAVE_HELM_CONFIG = "no"; then
+  AC_MSG_ERROR(Could not find helm-config)
 fi
 
+HELM_DEFAULT_CONFIGURATION_DIR=`helm-config --etc-dir`
+
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
 AC_SUBST(OCAML_ROOT)
-AC_SUBST(HELM_BIN_DIR)
+AC_SUBST(MLMINIDOM_LIB_DIR)
+AC_SUBST(LABLGTK_LIB_DIR)
+AC_SUBST(LABLGTKMATHVIEW_LIB_DIR)
+AC_SUBST(BIN_DIR)
 AC_SUBST(HELM_DEFAULT_CONFIGURATION_DIR)
 AC_SUBST(PERL_BINARY)
 
-AC_OUTPUT([Makefile configuration.ml helm_wget], chmod +x helm_wget)
+AC_OUTPUT([
+  Makefile
+  configuration.ml
+  helm_wget
+  helm_gtk_interface.spec
+],
+  chmod +x helm_wget
+)