AC_INIT(dtd/cic.dtd)
-if test "x$prefix" != xNONE; then
- RESOLVED_PREFIX=$prefix
-else
- RESOLVED_PREFIX=$ac_default_prefix
-fi
+PACKAGE=helm_data
+MAJOR_VERSION=0
+MINOR_VERSION=0
+MICRO_VERSION=2
+VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
+
+DEFAULT_HELM_DTD_DIR=/usr/local/share/helm/dtd
+DEFAULT_HELM_STYLE_DIR=/usr/local/share/helm/style
-dnl General
-AC_MSG_CHECKING("for the share/helm/dtd dir")
-RES=""
-AC_CACHE_VAL(helm_cv_HELM_DTDS_DIR,
- echo "Where should I put the DTDs? Note: your answer must be the entry of value dtd_dir in the configuration.xml file of the helm_configuration package that you should have already installed."
- read helm_cv_HELM_DTDS_DIR
- RES="Asked"
+AC_ARG_ENABLE(
+ defaults,
+ [ --enable-defaults[=ARG] if yes then use defaults (don't ask user) [default=auto]],
+ USE_DEFAULTS=$enableval,
+ USE_DEFAULTS=auto
)
-HELM_DTDS_DIR=$helm_cv_HELM_DTDS_DIR
-if test "$RES" != "Asked" ; then
- HELM_DTDS_DIR=`eval "echo $HELM_DTDS_DIR"`
- AC_MSG_RESULT($HELM_DTDS_DIR)
+
+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
+
+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_CACHE_SAVE
-AC_MSG_CHECKING("for the share/helm/style dir")
-HELM_STYLES_DIR=$RESOLVED_PREFIX/share/helm/style
-AC_MSG_RESULT($HELM_STYLES_DIR)
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+AC_SUBST(HELM_DTD_DIR)
+AC_SUBST(HELM_STYLE_DIR)
-AC_SUBST(HELM_DTDS_DIR)
-AC_SUBST(HELM_STYLES_DIR)
+AC_OUTPUT([
+ Makefile
+ helm_data.spec
+])
-AC_OUTPUT([Makefile])