]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/configuration/configure.in
ocaml 3.09 transition
[helm.git] / helm / configuration / configure.in
index 2db664ed0a3556c7d95764dcdff1c8f40e3447e8..03c923e9d4d89a9ec7f5231a288094db40e67cc2 100644 (file)
@@ -4,8 +4,19 @@ PACKAGE=helm_configuration
 
 HELM_MAJOR_VERSION=0
 HELM_MINOR_VERSION=0
-HELM_MICRO_VERSION=1
+HELM_MICRO_VERSION=2
 HELM_VERSION=$HELM_MAJOR_VERSION.$HELM_MINOR_VERSION.$HELM_MICRO_VERSION
+VERSION=$HELM_VERSION
+
+DEFAULT_HELM_VAR_DIR=/var/local/helm
+DEFAULT_HELM_TMP_DIR=/tmp
+
+AC_ARG_ENABLE(
+       defaults,
+       [  --enable-defaults[=ARG] if yes then use defaults (don't ask user) [default=auto]],
+       USE_DEFAULTS=$enableval,
+       USE_DEFAULTS=auto
+)
 
 if test "x$prefix" != xNONE; then
   RESOLVED_PREFIX=$prefix
@@ -26,29 +37,57 @@ HELM_ETC_DIR=$RESOLVED_PREFIX/etc/helm
 HELM_SHARE_DIR=$RESOLVED_PREFIX/share/helm
 
 dnl Checking for the variable directory
-echo ""
-echo "Now you have to choose a suitable directory for variable files."
-echo "Normally, this directory would be something like /var/local/helm, you"
-echo "have to be sure that the directory (and the subdirectories in it)"
-echo "is world-writable."
-echo ""
-AC_CACHE_CHECK(
-  "for the variable dir [[[/var/local/helm]]]",
-  helm_cv_HELM_VAR_DIR,
-  read helm_cv_HELM_VAR_DIR
-  if test x$helm_cv_HELM_VAR_DIR = x; then
-    helm_cv_HELM_VAR_DIR="/var/local/helm"
-  fi
-)
-HELM_VAR_DIR=$helm_cv_HELM_VAR_DIR
+if test $USE_DEFAULTS != yes; then
+       echo
+       echo "Now you have to choose a suitable directory for variable files."
+       echo "Normally, this directory would be something like /var/local/helm, you"
+       echo "have to be sure that the directory (and the subdirectories in it)"
+       echo "is world-writable."
+       echo
+       echo -n "[[$DEFAULT_HELM_VAR_DIR]] ? "
+       read HELM_VAR_DIR
+       echo
+       if test x$HELM_VAR_DIR = x; then
+               HELM_VAR_DIR="/var/local/helm"
+       fi
+else
+       HELM_VAR_DIR=$DEFAULT_HELM_VAR_DIR
+fi
+
+AC_MSG_CHECKING(for HELM variable dir)
+AC_MSG_RESULT($HELM_VAR_DIR)
 
 dnl Checking for the /tmp directory
-if test -d "/tmp" ; then
-   HELM_TMP_DIR=/tmp
+DEFAULTS=$USE_DEFAULTS
+if test $DEFAULTS = auto; then
+       if test -d $DEFAULT_HELM_TMP_DIR ; then
+               HELM_TMP_DIR=$DEFAULT_HELM_TMP_DIR
+       else
+               DEFAULTS=no
+       fi
+fi
+
+if test $DEFAULTS = no; then
+       echo
+       echo "Please, tell me the name of a directory which can be used to store"
+       echo "temporary files (normally it is something like /tmp)"
+       echo
+       echo -n "[[$DEFAULT_HELM_TMP_DIR]]"
+       read HELM_TMP_DIR
+       echo
+       if test x$HELM_TMP_DIR = x; then
+               HELM_TMP_DIR=$DEFAULT_HELM_TMP_DIR
+       fi
 else
-   AC_MSG_WARN(Could not find /tmp. Which directory could I use instead?)
-   read $HELM_TMP_DIR
+       HELM_TMP_DIR=$DEFAULT_HELM_TMP_DIR
+fi
+
+AC_MSG_CHECKING(for $HELM_TMP_DIR)
+if test ! -d $HELM_TMP_DIR; then
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(please check your installation)
 fi
+AC_MSG_RESULT(ok)
 
 dnl Checks for GtkMathView
 AC_CHECK_PROG(HAVE_GTKMATHVIEW_CONFIG, gtkmathview-config, yes, no)
@@ -93,7 +132,7 @@ HELM_FONT_CONFIGURATION_PATH=$HELM_ETC_DIR/helm-font-configuration.xml
 dnl Only for HELM XML configuration
 HELM_LIBRARY_DIR=$HELM_VAR_DIR/library
 HELM_SERVERS_FILE=$HELM_VAR_DIR/servers.txt
-HELM_URIS_DBM=$HELM_VAR_DIR/urls_of_uris
+HELM_URIS_DBM=$HELM_VAR_DIR/urls_of_uris.db
 
 dnl CSC: FIXME: getters should download the DTDs
 HELM_DTD_DIR=$HELM_SHARE_DIR/dtd
@@ -105,7 +144,7 @@ AC_SUBST(RESOLVED_EXEC_PREFIX)
 
 dnl HELM version
 AC_SUBST(PACKAGE)
-AC_SUBST(HELM_VERSION)
+AC_SUBST(VERSION)
 
 dnl HELM directories
 AC_SUBST(HELM_BIN_DIR)