]> matita.cs.unibo.it Git - helm.git/blob - helm/http_getter/configure.in
* Abst removed from the DTD
[helm.git] / helm / http_getter / configure.in
1 AC_INIT(http_getter.pl.in)
2
3 PACKAGE=helm_http_getter
4 MAJOR_VERSION=0
5 MINOR_VERSION=1
6 MICRO_VERSION=54
7 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
8
9 DEFAULT_HELM_LIB_DIR=/usr/local/lib/helm
10
11 AC_ARG_ENABLE(
12         defaults,
13         [  --enable-defaults[=ARG] if yes then use defaults (don't ask user) [default=auto]],
14         USE_DEFAULTS=$enableval,
15         USE_DEFAULTS=auto
16 )
17
18 if test "x$prefix" != xNONE; then
19   RESOLVED_PREFIX=$prefix
20 else
21   RESOLVED_PREFIX=$ac_default_prefix
22 fi
23
24 if test "x$exec_prefix" != xNONE; then
25   RESOLVED_EXEC_PREFIX=$exec_prefix
26 else
27   RESOLVED_EXEC_PREFIX=$RESOLVED_PREFIX
28 fi
29
30 HELM_CGI_DIR=$RESOLVED_PREFIX/bin
31
32 if test $USE_DEFAULTS = auto; then
33         AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
34         if test $HAVE_HELM_CONFIG = yes; then
35                 HELM_LIB_DIR=`helm-config --lib-dir`
36         else
37                 USE_DEFAULTS=no
38         fi
39 fi
40
41 if test $USE_DEFAULTS = no; then
42         echo
43         echo "\`helm-config' is not installed (or I can't find it in your path)."
44         echo "Please, insert the lib directory HELM..."
45         echo
46         echo -n "[[$DEFAULT_HELM_LIB_DIR]] ? "
47         read HELM_LIB_DIR
48         if test "x$HELM_LIB_DIR" = "x"; then
49                 HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
50         fi
51 elif test $USE_DEFAULTS = yes; then
52         HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
53 fi
54
55 AC_MSG_CHECKING(for $HELM_LIB_DIR/configuration.pl)
56 if test -f $HELM_LIB_DIR/configuration.pl; then
57         AC_MSG_RESULT(ok)
58 else
59         AC_MSG_RESULT(no)
60         AC_MSG_ERROR(please check your installation)
61 fi
62
63 AC_PATH_PROG(PERL_BINARY,perl,no)
64 if test $PERL_BINARY = no ; then
65    AC_MSG_ERROR(Could not find perl)
66 fi
67
68 dnl Perl modules checks
69 PERL_MODS="HTTP::Daemon HTTP::Status HTTP::Request LWP::UserAgent DB_File Compress::Zlib CGI"
70 PERL_INC=`perl -e 'print(join(" ",@INC))'`
71 for perl_mod in $PERL_MODS; do
72         AC_MSG_CHECKING("for perl module: $perl_mod")
73         perl_mod_file=`echo $perl_mod | sed -e 's/::/\//' -e 's/$/\.pm/'`
74         module_found="false"
75         for perl_lib_dir in $PERL_INC; do
76                 if test -f "$perl_lib_dir/$perl_mod_file"; then
77                         module_found="true"
78                         AC_MSG_RESULT("found in $perl_lib_dir")
79                         break
80                 fi
81         done
82         if test "$module_found" != "true"; then
83                 AC_MSG_ERROR("not found")
84         fi
85 done
86
87 AC_SUBST(PACKAGE)
88 AC_SUBST(VERSION)
89 AC_SUBST(RESOLVED_PREFIX)
90 AC_SUBST(RESOLVED_EXEC_PREFIX)
91 AC_SUBST(HELM_LIB_DIR)
92 AC_SUBST(PERL_BINARY)
93 AC_SUBST(HELM_CGI_DIR)
94
95 AC_OUTPUT([
96   Makefile
97   http_getter.pl
98   helm_http_getter.spec
99 ], chmod +x http_getter.pl)
100