]> matita.cs.unibo.it Git - helm.git/commitdiff
configuration improvements
authorLuca Padovani <luca.padovani@unito.it>
Mon, 29 Jan 2001 12:33:18 +0000 (12:33 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Mon, 29 Jan 2001 12:33:18 +0000 (12:33 +0000)
helm/helm_data/Makefile.in
helm/helm_data/configure.in
helm/http_getter/configure.in
helm/http_getter/http_getter.pl.in
helm/interface/configuration.ml.in
helm/interface/configure.in
helm/xsltd/configure.in
helm/xsltd/start-xaland.in

index f1ba7b438b680974b7e7abe9175db0a9d929e8fa..dd7f493a16b5549559e48f5e3e3d74179a3866bd 100644 (file)
@@ -8,7 +8,9 @@ install:
        cp dtd/* $(HELM_DTD_DIR)
        cp style/*.xsl $(HELM_STYLE_DIR)
 
-distclean:
+clean:
+       
+distclean: clean
        rm -f Makefile configure config.log config.cache config.status *.spec
        rm -rf dtd style
 
index 2c65c6391a8e9f4c65f3d71eae7c4b4650e72cf5..635258995358481952c0d9707d40fd736fac92d4 100644 (file)
@@ -6,13 +6,48 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
-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)
+DEFAULT_HELM_DTD_DIR=/usr/local/share/helm/dtd
+DEFAULT_HELM_STYLE_DIR=/usr/local/share/helm/style
+
+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 $USE_DEFAULTS = auto; then
+       AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
+       if test $HAVE_HELM_CONFIG = yes; then
+               HELM_DTD_DIR=`helm-config --dtd-dir`
+               HELM_STYLE_DIR=`helm-config --style-dir`
+       else
+               USE_DEFAULTS=no
+       fi
 fi
 
-HELM_DTD_DIR=`helm-config --dtd-dir`
-HELM_STYLE_DIR=`helm-config --style-dir`
+if test $USE_DEFAULTS = no; then
+       echo
+       echo "\`helm-config' is not installed (or I can't find it in your path)."
+       echo "Please, insert the directory where I can find the DTDs for HELM..."
+       echo
+       echo -n "[[$DEFAULT_HELM_DTD_DIR]] ? "
+       read HELM_DTD_DIR
+       if test "x$HELM_DTD_DIR" = "x"; then
+               HELM_DTD_DIR=$DEFAULT_HELM_DTD_DIR
+       fi
+       echo
+       echo "Please, insert the directory where I can find the stylesheets for HELM..."
+       echo
+       echo -n "[[$DEFAULT_HELM_STYLE_DIR]] ? "
+       read HELM_STYLE_DIR
+       if test "x$HELM_STYLE_DIR" = "x"; then
+               HELM_STYLE_DIR=$DEFAULT_HELM_STYLE_DIR
+       fi
+elif test $USE_DEFAULTS = yes; then
+       HELM_DTD_DIR=$DEFAULT_HELM_DTD_DIR
+       HELM_STYLE_DIR=$DEFAULT_HELM_STYLE_DIR
+fi
 
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
index b13b33a75ff65834a4719a0716d0a1223eb643d2..7577ae7425e6bade8391864a41215dd5376a4660 100644 (file)
@@ -6,6 +6,15 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
+DEFAULT_HELM_LIB_DIR=/usr/local/helm/lib
+
+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
 else
@@ -18,18 +27,36 @@ else
   RESOLVED_EXEC_PREFIX=$RESOLVED_PREFIX
 fi
 
-AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
-if test $HAVE_HELM_CONFIG = no; then
-  AC_MSG_ERROR(helm-config not found)
+if test $USE_DEFAULTS = auto; then
+       AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
+       if test $HAVE_HELM_CONFIG = yes; then
+               HELM_LIB_DIR=`helm-config --lib-dir`
+       else
+               USE_DEFAULTS=no
+       fi
 fi
 
-DEFAULT_HELM_LIB_DIR=`helm-config --lib-dir`
+if test $USE_DEFAULTS = no; then
+       echo
+       echo "\`helm-config' is not installed (or I can't find it in your path)."
+       echo "Please, insert the lib directory HELM..."
+       echo
+       echo -n "[[$DEFAULT_HELM_LIB_DIR]] ? "
+       read HELM_LIB_DIR
+       if test "x$HELM_LIB_DIR" = "x"; then
+               HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
+       fi
+elif test $USE_DEFAULTS = yes; then
+       HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
+fi
 
-AC_MSG_CHECKING("for configuration.pl")
-if test ! -f $DEFAULT_HELM_LIB_DIR/configuration.pl; then
-  AC_MSG_ERROR(Could not find configuration.pl in $DEFAULT_HELM_LIB_DIR, please check your installation)
+AC_MSG_CHECKING(for $HELM_LIB_DIR/configuration.pl)
+if test -f $HELM_LIB_DIR/configuration.pl; then
+       AC_MSG_RESULT(ok)
+else
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(please check your installation)
 fi
-AC_MSG_RESULT(in $DEFAULT_HELM_LIB_DIR)
 
 AC_PATH_PROG(PERL_BINARY,perl,no)
 if test $PERL_BINARY = no ; then
@@ -59,7 +86,7 @@ AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
 AC_SUBST(RESOLVED_PREFIX)
 AC_SUBST(RESOLVED_EXEC_PREFIX)
-AC_SUBST(DEFAULT_HELM_LIB_DIR)
+AC_SUBST(HELM_LIB_DIR)
 AC_SUBST(PERL_BINARY)
 
 AC_OUTPUT([
index f0392de2caa9acd9cbafb1b4805ba6f71e28e1c3..bee3315e7583cb9e1a98700559c36fc9eafb34b4 100755 (executable)
@@ -27,7 +27,7 @@
 use Env;
 my $HELM_LIB_DIR = $ENV{"HELM_LIB_DIR"};
 # this should be the only fixed constant
-my $DEFAULT_HELM_LIB_DIR = "@DEFAULT_HELM_LIB_DIR@";
+my $DEFAULT_HELM_LIB_DIR = "@HELM_LIB_DIR@";
 if (defined ($HELM_LIB_DIR)) {
    $HELM_LIB_PATH = $HELM_LIB_DIR."/configuration.pl";
 } else {
index 2177397eeec2623c3ade7f0db6e65631f9b3d05e..d78e0b36101a9f0e19bd624e5236576714c05aaf 100644 (file)
@@ -15,7 +15,7 @@ let filename =
   try
    Sys.getenv "HELM_CONFIGURATION_DIR"
   with
-   Not_found -> "@HELM_DEFAULT_CONFIGURATION_DIR@"
+   Not_found -> "@HELM_CONFIGURATION_DIR@"
  in
   prefix ^ "/configuration.xml";;
 
index 1b8c3a1bd492daf5861a1e40a26cb83dcfa4a344..e7dc8c801f1a2904b82746d11e3e300881b05237 100644 (file)
@@ -6,6 +6,15 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
+DEFAULT_HELM_CONFIGURATION_DIR=/etc/helm
+
+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
 else
@@ -21,6 +30,11 @@ fi
 dnl The following is the directory where the binary will be installed
 BIN_DIR=$RESOLVED_EXEC_PREFIX/bin
 
+AC_PATH_PROG(WGET_BINARY,wget,no)
+if test $WGET_BINARY = no; then
+       AC_MSG_WARN(wget is required to update the database)
+fi
+
 AC_PATH_PROG(PERL_BINARY,perl,no)
 if test $PERL_BINARY = no ; then
    AC_MSG_ERROR(Could not find perl)
@@ -36,71 +50,141 @@ if test $HAVE_OCAMLC = "no"; then
 fi
 
 dnl Check for the Ocaml library dir
-AC_MSG_CHECKING("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)
 
+DEFAULT_MLMINIDOM_LIB_DIR=$OCAML_ROOT/mlminidom
+DEFAULT_LABLGTK_LIB_DIR=$OCAML_ROOT/lablgtk
+DEFAULT_LABLGTKMATHVIEW_LIB_DIR=$OCAML_ROOT/lablgtkmathview
+
 dnl Check for mlminidom
-AC_CHECK_FILE($OCAML_ROOT/mlminidom/minidom.mli,
-  RES="yes"
-  MLMINIDOM_LIB_DIR=$OCAML_ROOT/mlminidom,
-  RES="no"
-)
+DEFAULTS=$USE_DEFAULTS
+if test $DEFAULTS = auto; then
+       if test -f $DEFAULT_MLMINIDOM_LIB_DIR/minidom.mli; then
+               MLMINIDOM_LIB_DIR=$DEFAULT_MLMINIDOM_LIB_DIR
+       else
+               DEFAULTS=no
+       fi
+fi
 
-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
+if test $DEFAULTS = no; then
+       echo
+       echo "Where can I find the mlminidom library?"
+       echo
+       echo -n "[[$DEFAULT_MLMINIDOM_LIB_DIR]] ? "
+       echo
+       read MLMINIDOM_LIB_DIR
+       if test "x$MLMINIDOM_LIB_DIR" = x; then
+               MLMINIDOM_LIB_DIR=$DEFAULT_MLMINIDOM_LIB_DIR
+       fi
+elif test $DEFAULTS = yes; then
+       MLMINIDOM_LIB_DIR=$DEFAULT_MLMINIDOM_LIB_DIR
 fi
 
+AC_MSG_CHECKING(for $MLMINIDOM_LIB_DIR/minidom.mli)
+if test ! -f $MLMINIDOM_LIB_DIR/minidom.mli; then
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(please check your installation)
+fi
+AC_MSG_RESULT(ok)
+
 dnl Check for lablgtk
-AC_CHECK_FILE($OCAML_ROOT/lablgtk/gtk.ml,
-  RES="yes"
-  LABLGTK_LIB_DIR=$OCAML_ROOT/lablgtk,
-  RES="no"
-)
+DEFAULTS=$USE_DEFAULTS
+if test $DEFAULTS = auto; then
+       if test -f $DEFAULT_LABLGTK_LIB_DIR/gtk.ml; then
+               LABLGTK_LIB_DIR=$DEFAULT_LABLGTK_LIB_DIR
+       else
+               DEFAULTS=no
+       fi
+fi
+
+if test $DEFAULTS = no; then
+       echo
+       echo "Where can I find the lablgtk library?"
+       echo
+       echo -n "[[$DEFAULT_LABLGTK_LIB_DIR]] ? "
+       read LABLGTK_LIB_DIR
+       echo
+       if test "x$LABLGTK_LIB_DIR" = x; then
+               LABLGTK_LIB_DIR=$DEFAULT_LABLGTK_LIB_DIR
+       fi
+elif test $DEFAULTS = yes; then
+       LABLGTK_LIB_DIR=$DEFAULT_LABLGTK_LIB_DIR
+fi
 
-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
+AC_MSG_CHECKING(for $LABLGTK_LIB_DIR/gtk.ml)
+if test ! -f $LABLGTK_LIB_DIR/gtk.ml; then
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(please check your installation)
 fi
+AC_MSG_RESULT(ok)
 
 dnl Check for lablgtkmathview
-AC_CHECK_FILE($OCAML_ROOT/lablgtkmathview/gtkMathView.ml,
-  RES="yes"
-  LABLGTKMATHVIEW_LIB_DIR=$OCAML_ROOT/lablgtkmathview,
-  RES="no"
-)
+DEFAULTS=$USE_DEFAULTS
+if test $DEFAULTS = auto; then
+       if test -f $DEFAULT_LABLGTKMATHVIEW_LIB_DIR/gMathView.ml; then
+               LABLGTKMATHVIEW_LIB_DIR=$DEFAULT_LABLGTKMATHVIEW_LIB_DIR
+       else
+               DEFAULTS=no
+       fi
+fi
 
-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
+if test $DEFAULTS = no; then
+       echo
+       echo "Where can I find the lablgtkmathview library?"
+       echo
+       echo -n "[[$DEFAULT_LABLGTKMATHVIEW_LIB_DIR]] ? "
+       read LABLGTKMATHVIEW_LIB_DIR
+       echo
+       if test "x$LABLGTKMATHVIEW_LIB_DIR" = x; then
+               LABLGTKMATHVIEW_LIB_DIR=$DEFAULT_LABLGTKMATHVIEW_LIB_DIR
+       fi
+elif test $DEFAULTS = yes; then
+       LABLGTKMATHVIEW_LIB_DIR=$DEFAULT_LABLGTKMATHVIEW_LIB_DIR
 fi
 
+AC_MSG_CHECKING(for $LABLGTKMATHVIEW_LIB_DIR/gMathView.ml)
+if test ! -f $LABLGTKMATHVIEW_LIB_DIR/gMathView.ml; then
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(please check your installation)
+fi
+AC_MSG_RESULT(ok)
+
 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)
+DEFAULTS=$USE_DEFAULTS
+if test $DEFAULTS = auto; then
+       AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
+       if test $HAVE_HELM_CONFIG = yes; then
+               HELM_CONFIGURATION_DIR=`helm-config --etc-dir`
+       else
+               DEFAULTS=no
+       fi
+fi
+
+if test $DEFAULTS = no; then
+       echo
+       echo "\`helm-config' is not installed (or I can't find it in your path)."
+       echo "Please, insert the directory where I can find the configuration"
+       echo "files for HELM (configuration.xml in particular)..."
+       echo
+       echo -n "[[$DEFAULT_HELM_CONFIGURATION_DIR]] ? "
+       read HELM_CONFIGURATION_DIR
+       echo
+       if test "x$HELM_CONFIGURATION_DIR" = "x"; then
+               HELM_CONFIGURATION_DIR=$DEFAULT_HELM_CONFIGURATION_DIR
+       fi
+elif test $DEFAULTS = yes; then
+       HELM_CONFIGURATION_DIR=$DEFAULT_HELM_CONFIGURATION_DIR
 fi
 
-HELM_DEFAULT_CONFIGURATION_DIR=`helm-config --etc-dir`
+AC_MSG_CHECKING(for configuration.xml)
+if test -f $HELM_CONFIGURATION_DIR/configuration.xml; then
+       AC_MSG_RESULT(ok)
+else
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(please check your installation)
+fi
 
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
@@ -109,7 +193,7 @@ 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(HELM_CONFIGURATION_DIR)
 AC_SUBST(PERL_BINARY)
 
 AC_OUTPUT([
index 3c320c421aca39675c00c23d5f3be2d51a8690ee..2a8fcd0f3ed4af168a44bf591265a4354123ce7c 100644 (file)
@@ -6,6 +6,16 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
+DEFAULT_HELM_LIB_DIR=/usr/local/lib/helm
+DEFAULT_HELM_STYLE_DIR=/usr/local/share/helm/style
+
+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
 else
@@ -20,26 +30,60 @@ fi
 
 BIN_DIR=$RESOLVED_EXEC_PREFIX/bin
 
-AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
-if test $HAVE_HELM_CONFIG = no; then
-  AC_MSG_ERROR(Could not fing helm-config)
+if test $USE_DEFAULTS = auto; then
+       AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)   
+       if test $HAVE_HELM_CONFIG = yes; then
+               HELM_LIB_DIR=`helm-config --lib-dir`
+               HELM_STYLE_DIR=`helm-config --style-dir`
+       else
+               USE_DEFAULTS=no
+       fi
+fi
+
+if test $USE_DEFAULTS = no; then
+       echo
+       echo "\`helm-config' is not installed (or I can't find it in your path)."
+       echo "Please, insert the lib directory for HELM..."
+       echo
+       echo -n "[[$DEFAULT_HELM_LIB_DIR]] ? "
+       read HELM_LIB_DIR
+       if test "x$HELM_LIB_DIR" = "x"; then
+               HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
+       fi
+       echo
+       echo "Please, insert the directory where I can find the stylesheets for HELM..."
+       echo
+       echo -n "[[$DEFAULT_HELM_STYLE_DIR]] ? "
+       read HELM_STYLE_DIR
+       if test "x$HELM_STYLE_DIR" = "x"; then
+               HELM_STYLE_DIR=$DEFAULT_HELM_STYLE_DIR
+       fi
+elif test $USE_DEFAULTS = yes; then
+       HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
+       HELM_STYLE_DIR=$DEFAULT_HELM_STYLE_DIR
 fi
 
-HELM_LIB_DIR=`helm-config --lib-dir`
-if test ! -d $HELM_LIB_DIR; then
-  AC_MSG_ERROR(Could not find HELM lib directory, please check your installation)
+AC_MSG_CHECKING(for the $HELM_LIB_DIR)
+if test -d $HELM_LIB_DIR; then
+       AC_MSG_RESULT(ok)
+else
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(please check your installation)
 fi
 
-HELM_STYLES_DIR=`helm-config --style-dir`
-if test ! -d $HELM_STYLES_DIR; then
-  AC_MSG_ERROR(Could not find stylesheet directory, please check your installation)
+AC_MSG_CHECKING(for $HELM_STYLE_DIR)
+if test -d $HELM_STYLE_DIR; then
+       AC_MSG_RESULT(ok)
+else
+       AC_MSG_RESULT(no)
+       AC_MSG_ERROR(please check your installation)
 fi
 
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
 AC_SUBST(BIN_DIR)
 AC_SUBST(HELM_LIB_DIR)
-AC_SUBST(HELM_STYLES_DIR)
+AC_SUBST(HELM_STYLE_DIR)
 
 AC_OUTPUT([
   Makefile
index c1d2e63b03fbd1e12035b6bc4a62a7187bbbb61b..687e09bf8a771600014e58288f0fefd867612a0f 100755 (executable)
@@ -44,12 +44,12 @@ export CLASSPATH2=/projects/helm/shared/libraries/java/xalan_1_1/xerces.jar
 
 export CLASSPATH=$CLASSPATH1:$CLASSPATH2:$CLASSPATH:.
 export CLASS_DIR=@HELM_LIB_DIR@
-export HELM_STYLES_DIR=@HELM_STYLES_DIR@
+export HELM_STYLE_DIR=@HELM_STYLE_DIR@
 
 cd $CLASS_DIR &&
 java -ss1024K -oss8192K \
  xaland 12345 12346 \
- $HELM_STYLES_DIR/rootcontent.xsl \
- $HELM_STYLES_DIR/annotatedpres.xsl \
- $HELM_STYLES_DIR/theory_content.xsl \
- $HELM_STYLES_DIR/theory_pres.xsl
+ $HELM_STYLE_DIR/rootcontent.xsl \
+ $HELM_STYLE_DIR/annotatedpres.xsl \
+ $HELM_STYLE_DIR/theory_content.xsl \
+ $HELM_STYLE_DIR/theory_pres.xsl