1 AC_INIT(configuration.ml.in)
3 PACKAGE=helm_gtk_interface
7 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
9 DEFAULT_HELM_CONFIGURATION_DIR=/usr/local/etc/helm
13 [ --enable-defaults[=ARG] if yes then use defaults (don't ask user) [default=auto]],
14 USE_DEFAULTS=$enableval,
18 if test "x$prefix" != xNONE; then
19 RESOLVED_PREFIX=$prefix
21 RESOLVED_PREFIX=$ac_default_prefix
24 if test "x$exec_prefix" != xNONE; then
25 RESOLVED_EXEC_PREFIX=$exec_prefix
27 RESOLVED_EXEC_PREFIX=$RESOLVED_PREFIX
30 dnl The following is the directory where the binary will be installed
31 BIN_DIR=$RESOLVED_EXEC_PREFIX/bin
33 AC_PATH_PROG(WGET_BINARY,wget,no)
34 if test $WGET_BINARY = no; then
35 AC_MSG_WARN(wget is required to update the database)
38 AC_PATH_PROG(PERL_BINARY,perl,no)
39 if test $PERL_BINARY = no ; then
40 AC_MSG_ERROR(Could not find perl)
44 dnl ocaml-findlib, ocaml-netstring, ocaml-pxp, ocaml-netclient
47 AC_CHECK_PROG(HAVE_OCAMLC, ocamlc, yes, no)
48 if test $HAVE_OCAMLC = "no"; then
49 AC_MSG_ERROR(could not find ocamlc in PATH, please make sure ocaml is installed)
52 dnl Check for the Ocaml library dir
53 AC_MSG_CHECKING(for the ocaml library dir)
54 OCAML_ROOT=`ocamlc -v | grep "^Standard" | sed 's/^.*: *//'`
55 AC_MSG_RESULT($OCAML_ROOT)
57 DEFAULT_MLMINIDOM_LIB_DIR=$OCAML_ROOT/mlminidom
58 DEFAULT_LABLGTK_LIB_DIR=$OCAML_ROOT/lablgtk
59 DEFAULT_LABLGTKMATHVIEW_LIB_DIR=$OCAML_ROOT/lablgtkmathview
61 dnl Check for mlminidom
62 DEFAULTS=$USE_DEFAULTS
63 if test $DEFAULTS = auto; then
64 if test -f $DEFAULT_MLMINIDOM_LIB_DIR/minidom.mli; then
65 MLMINIDOM_LIB_DIR=$DEFAULT_MLMINIDOM_LIB_DIR
71 if test $DEFAULTS = no; then
73 echo "Where can I find the mlminidom library?"
75 echo -n "[[$DEFAULT_MLMINIDOM_LIB_DIR]] ? "
77 read MLMINIDOM_LIB_DIR
78 if test "x$MLMINIDOM_LIB_DIR" = x; then
79 MLMINIDOM_LIB_DIR=$DEFAULT_MLMINIDOM_LIB_DIR
81 elif test $DEFAULTS = yes; then
82 MLMINIDOM_LIB_DIR=$DEFAULT_MLMINIDOM_LIB_DIR
85 AC_MSG_CHECKING(for $MLMINIDOM_LIB_DIR/minidom.mli)
86 if test ! -f $MLMINIDOM_LIB_DIR/minidom.mli; then
88 AC_MSG_ERROR(please check your installation)
93 DEFAULTS=$USE_DEFAULTS
94 if test $DEFAULTS = auto; then
95 if test -f $DEFAULT_LABLGTK_LIB_DIR/gtk.ml; then
96 LABLGTK_LIB_DIR=$DEFAULT_LABLGTK_LIB_DIR
102 if test $DEFAULTS = no; then
104 echo "Where can I find the lablgtk library?"
106 echo -n "[[$DEFAULT_LABLGTK_LIB_DIR]] ? "
109 if test "x$LABLGTK_LIB_DIR" = x; then
110 LABLGTK_LIB_DIR=$DEFAULT_LABLGTK_LIB_DIR
112 elif test $DEFAULTS = yes; then
113 LABLGTK_LIB_DIR=$DEFAULT_LABLGTK_LIB_DIR
116 AC_MSG_CHECKING(for $LABLGTK_LIB_DIR/gtk.ml)
117 if test ! -f $LABLGTK_LIB_DIR/gtk.ml; then
119 AC_MSG_ERROR(please check your installation)
123 dnl Check for lablgtkmathview
124 DEFAULTS=$USE_DEFAULTS
125 if test $DEFAULTS = auto; then
126 if test -f $DEFAULT_LABLGTKMATHVIEW_LIB_DIR/gMathView.ml; then
127 LABLGTKMATHVIEW_LIB_DIR=$DEFAULT_LABLGTKMATHVIEW_LIB_DIR
133 if test $DEFAULTS = no; then
135 echo "Where can I find the lablgtkmathview library?"
137 echo -n "[[$DEFAULT_LABLGTKMATHVIEW_LIB_DIR]] ? "
138 read LABLGTKMATHVIEW_LIB_DIR
140 if test "x$LABLGTKMATHVIEW_LIB_DIR" = x; then
141 LABLGTKMATHVIEW_LIB_DIR=$DEFAULT_LABLGTKMATHVIEW_LIB_DIR
143 elif test $DEFAULTS = yes; then
144 LABLGTKMATHVIEW_LIB_DIR=$DEFAULT_LABLGTKMATHVIEW_LIB_DIR
147 AC_MSG_CHECKING(for $LABLGTKMATHVIEW_LIB_DIR/gMathView.ml)
148 if test ! -f $LABLGTKMATHVIEW_LIB_DIR/gMathView.ml; then
150 AC_MSG_ERROR(please check your installation)
155 DEFAULTS=$USE_DEFAULTS
156 if test $DEFAULTS = auto; then
157 AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
158 if test $HAVE_HELM_CONFIG = yes; then
159 HELM_CONFIGURATION_DIR=`helm-config --etc-dir`
165 if test $DEFAULTS = no; then
167 echo "\`helm-config' is not installed (or I can't find it in your path)."
168 echo "Please, insert the directory where I can find the configuration"
169 echo "files for HELM (configuration.xml in particular)..."
171 echo -n "[[$DEFAULT_HELM_CONFIGURATION_DIR]] ? "
172 read HELM_CONFIGURATION_DIR
174 if test "x$HELM_CONFIGURATION_DIR" = "x"; then
175 HELM_CONFIGURATION_DIR=$DEFAULT_HELM_CONFIGURATION_DIR
177 elif test $DEFAULTS = yes; then
178 HELM_CONFIGURATION_DIR=$DEFAULT_HELM_CONFIGURATION_DIR
181 AC_MSG_CHECKING(for configuration.xml)
182 if test -f $HELM_CONFIGURATION_DIR/configuration.xml; then
186 AC_MSG_ERROR(please check your installation)
192 AC_SUBST(MLMINIDOM_LIB_DIR)
193 AC_SUBST(LABLGTK_LIB_DIR)
194 AC_SUBST(LABLGTKMATHVIEW_LIB_DIR)
196 AC_SUBST(HELM_CONFIGURATION_DIR)
197 AC_SUBST(PERL_BINARY)
203 helm_gtk_interface.spec