]> matita.cs.unibo.it Git - helm.git/blob - helm/interface/configure.in
configure.in : check for perl
[helm.git] / helm / interface / configure.in
1 AC_INIT(configuration.ml.in)
2
3 PACKAGE=helm_gtk_interface
4 MAJOR_VERSION=0
5 MINOR_VERSION=0
6 MICRO_VERSION=2
7 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
8
9 if test "x$prefix" != xNONE; then
10   RESOLVED_PREFIX=$prefix
11 else
12   RESOLVED_PREFIX=$ac_default_prefix
13 fi
14
15 if test "x$exec_prefix" != xNONE; then
16   RESOLVED_EXEC_PREFIX=$exec_prefix
17 else
18   RESOLVED_EXEC_PREFIX=$RESOLVED_PREFIX
19 fi
20
21 dnl The following is the directory where the binary will be installed
22 BIN_DIR=$RESOLVED_EXEC_PREFIX/bin
23
24 AC_PATH_PROG(PERL_BINARY,perl,no)
25 if test $PERL_BINARY = no ; then
26    AC_MSG_ERROR(Could not find perl)
27 fi
28
29 dnl MISSING CHECKS:
30 dnl ocaml-findlib, ocaml-netstring, ocaml-pxp
31
32 dnl Check for Ocaml
33 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
34 if test $HAVE_OCAMLC = "no"; then
35   AC_MSG_ERROR(could not find ocamlc in PATH, please make sure ocaml is installed)
36 fi
37
38 dnl Check for the Ocaml library dir
39 AC_MSG_CHECKING("for the ocaml library dir")
40 OCAML_ROOT=`ocamlc -v | grep "^Standard" | sed 's/^.*: *//'`
41 AC_MSG_RESULT($OCAML_ROOT)
42
43 dnl Check for mlminidom
44 AC_CHECK_FILE($OCAML_ROOT/mlminidom/minidom.mli,
45   RES="yes"
46   MLMINIDOM_LIB_DIR=$OCAML_ROOT/mlminidom,
47   RES="no"
48 )
49
50 if test $RES = "no"; then
51   echo
52   echo "It seems that mlminidom isn't installed in the default directory"
53   echo "$OCAML_ROOT/mlminidom. Where can I find it?"
54   echo
55   AC_CACHE_VAL(mmlinterface_cv_MLMINIDOM_LIB_DIR,
56     read mmlinterface_cv_MLMINIDOM_LIB_DIR
57   )
58   MLMINIDOM_LIB_DIR=$mmlinterface_cv_MLMINIDOM_LIB_DIR
59 fi
60
61 dnl Check for lablgtk
62 AC_CHECK_FILE($OCAML_ROOT/lablgtk/gtk.ml,
63   RES="yes"
64   LABLGTK_LIB_DIR=$OCAML_ROOT/lablgtk,
65   RES="no"
66 )
67
68 if test $RES = "no"; then
69   echo
70   echo "It seems that lablgtk isn't installed in the default directory"
71   echo "$OCAML_ROOT/lablgtk. Where can I find it?"
72   echo
73   AC_CACHE_VAL(mmlinterface_cv_LABLGTK_LIB_DIR,
74     read mmlinterface_cv_LABLGTK_LIB_DIR
75   )
76   LABLGTK_LIB_DIR=$mmlinterface_cv_LABLGTK_LIB_DIR
77 fi
78
79 dnl Check for lablgtkmathview
80 AC_CHECK_FILE($OCAML_ROOT/lablgtkmathview/gtkMathView.ml,
81   RES="yes"
82   LABLGTKMATHVIEW_LIB_DIR=$OCAML_ROOT/lablgtkmathview,
83   RES="no"
84 )
85
86 if test $RES = "no"; then
87   echo
88   echo "It seems that lablgtkmathview isn't installed in the default directory"
89   echo "$OCAML_ROOT/lablgtkmathview. Where can I find it?"
90   echo
91   AC_CACHE_VAL(mmlinterface_cv_LABLGTKMATHVIEW_LIB_DIR,
92     read mmlinterface_cv_LABLGTKMATHVIEW_LIB_DIR
93   )
94   LABLGTKMATHVIEW_LIB_DIR=$mmlinterface_cv_LABLGTKMATHVIEW_LIB_DIR
95 fi
96
97 dnl Check for HELM
98 AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
99 if test $HAVE_HELM_CONFIG = "no"; then
100   AC_MSG_ERROR(Could not find helm-config)
101 fi
102
103 HELM_DEFAULT_CONFIGURATION_DIR=`helm-config --etc-dir`
104
105 AC_SUBST(PACKAGE)
106 AC_SUBST(VERSION)
107 AC_SUBST(OCAML_ROOT)
108 AC_SUBST(MLMINIDOM_LIB_DIR)
109 AC_SUBST(LABLGTK_LIB_DIR)
110 AC_SUBST(LABLGTKMATHVIEW_LIB_DIR)
111 AC_SUBST(BIN_DIR)
112 AC_SUBST(HELM_DEFAULT_CONFIGURATION_DIR)
113 AC_SUBST(PERL_BINARY)
114
115 AC_OUTPUT([
116   Makefile
117   configuration.ml
118   helm_wget
119   helm_gtk_interface.spec
120 ],
121   chmod +x helm_wget
122 )