X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fhttp_getter%2Fconfigure.in;h=2412b10094704c474eb7ed3eab4b4df7b684225b;hb=5d7d6bd5090f3f82279bef0b93b4b361a5b1d751;hp=84f3def5140a3a64b56dca8fefd6ef8f7e85e00d;hpb=bbaa3a3f3e9955601a08a1770a080d97db83d1c4;p=helm.git diff --git a/helm/http_getter/configure.in b/helm/http_getter/configure.in index 84f3def51..2412b1009 100644 --- a/helm/http_getter/configure.in +++ b/helm/http_getter/configure.in @@ -1,5 +1,20 @@ AC_INIT(http_getter.pl.in) +PACKAGE=helm_http_getter +MAJOR_VERSION=0 +MINOR_VERSION=1 +MICRO_VERSION=54 +VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION + +DEFAULT_HELM_LIB_DIR=/usr/local/lib/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 @@ -12,38 +27,74 @@ else RESOLVED_EXEC_PREFIX=$RESOLVED_PREFIX fi -dnl MISSING CHECKS: -dnl perl-libwww-perl, perl-URI, MIME-Base64, perl-HTML-Parser, perl-XML-Parser +HELM_CGI_DIR=$RESOLVED_PREFIX/bin -dnl General -AC_MSG_CHECKING("for configuration.pl") -RES="" -AC_CACHE_VAL(helm_cv_DEFAULT_HELM_LIBRARY_DIR, - echo "Where is configuration.pl (part of the helm_configuration package)?" - read helm_cv_DEFAULT_HELM_LIBRARY_DIR - RES="Asked" -) -DEFAULT_HELM_LIBRARY_DIR=$helm_cv_DEFAULT_HELM_LIBRARY_DIR -if test "$RES" != "Asked" ; then - DEFAULT_HELM_LIBRARY_DIR=`eval "echo $DEFAULT_HELM_LIBRARY_DIR"` - AC_MSG_RESULT($DEFAULT_HELM_LIBRARY_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_LIB_DIR=`helm-config --lib-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 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 $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_CACHE_SAVE AC_PATH_PROG(PERL_BINARY,perl,no) if test $PERL_BINARY = no ; then AC_MSG_ERROR(Could not find perl) fi -AC_MSG_CHECKING("for the bin dir") -HELM_BIN_DIR=$RESOLVED_EXEC_PREFIX/bin -AC_MSG_RESULT($HELM_BIN_DIR) +dnl Perl modules checks +PERL_MODS="HTTP::Daemon HTTP::Status HTTP::Request LWP::UserAgent DB_File Compress::Zlib CGI" +PERL_INC=`perl -e 'print(join(" ",@INC))'` +for perl_mod in $PERL_MODS; do + AC_MSG_CHECKING("for perl module: $perl_mod") + perl_mod_file=`echo $perl_mod | sed -e 's/::/\//' -e 's/$/\.pm/'` + module_found="false" + for perl_lib_dir in $PERL_INC; do + if test -f "$perl_lib_dir/$perl_mod_file"; then + module_found="true" + AC_MSG_RESULT("found in $perl_lib_dir") + break + fi + done + if test "$module_found" != "true"; then + AC_MSG_ERROR("not found") + fi +done -AC_SUBST(HELM_BIN_DIR) -AC_SUBST(DEFAULT_HELM_LIBRARY_DIR) +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) +AC_SUBST(RESOLVED_PREFIX) +AC_SUBST(RESOLVED_EXEC_PREFIX) +AC_SUBST(HELM_LIB_DIR) AC_SUBST(PERL_BINARY) +AC_SUBST(HELM_CGI_DIR) AC_OUTPUT([ - Makefile - http_getter.pl -],chmod +x http_getter.pl) + Makefile + http_getter.pl + helm_http_getter.spec +], chmod +x http_getter.pl) +