]> matita.cs.unibo.it Git - helm.git/blob - helm/http_getter/configure.in
This commit was manufactured by cvs2svn to create tag 'v0_0_2'.
[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=0
6 MICRO_VERSION=2
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 if test $USE_DEFAULTS = auto; then
31         AC_CHECK_PROG(HAVE_HELM_CONFIG, helm-config, yes, no)
32         if test $HAVE_HELM_CONFIG = yes; then
33                 HELM_LIB_DIR=`helm-config --lib-dir`
34         else
35                 USE_DEFAULTS=no
36         fi
37 fi
38
39 if test $USE_DEFAULTS = no; then
40         echo
41         echo "\`helm-config' is not installed (or I can't find it in your path)."
42         echo "Please, insert the lib directory HELM..."
43         echo
44         echo -n "[[$DEFAULT_HELM_LIB_DIR]] ? "
45         read HELM_LIB_DIR
46         if test "x$HELM_LIB_DIR" = "x"; then
47                 HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
48         fi
49 elif test $USE_DEFAULTS = yes; then
50         HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
51 fi
52
53 AC_MSG_CHECKING(for $HELM_LIB_DIR/configuration.pl)
54 if test -f $HELM_LIB_DIR/configuration.pl; then
55         AC_MSG_RESULT(ok)
56 else
57         AC_MSG_RESULT(no)
58         AC_MSG_ERROR(please check your installation)
59 fi
60
61 AC_PATH_PROG(PERL_BINARY,perl,no)
62 if test $PERL_BINARY = no ; then
63    AC_MSG_ERROR(Could not find perl)
64 fi
65
66 dnl Perl modules checks
67 PERL_MODS="HTTP::Daemon HTTP::Status HTTP::Request LWP::UserAgent DB_File Compress::Zlib"
68 PERL_INC=`perl -e 'print(join(" ",@INC))'`
69 for perl_mod in $PERL_MODS; do
70         AC_MSG_CHECKING("for perl module: $perl_mod")
71         perl_mod_file=`echo $perl_mod | sed -e 's/::/\//' -e 's/$/\.pm/'`
72         module_found="false"
73         for perl_lib_dir in $PERL_INC; do
74                 if test -f "$perl_lib_dir/$perl_mod_file"; then
75                         module_found="true"
76                         AC_MSG_RESULT("found in $perl_lib_dir")
77                         break
78                 fi
79         done
80         if test "$module_found" != "true"; then
81                 AC_MSG_ERROR("not found")
82         fi
83 done
84
85 AC_SUBST(PACKAGE)
86 AC_SUBST(VERSION)
87 AC_SUBST(RESOLVED_PREFIX)
88 AC_SUBST(RESOLVED_EXEC_PREFIX)
89 AC_SUBST(HELM_LIB_DIR)
90 AC_SUBST(PERL_BINARY)
91
92 AC_OUTPUT([
93   Makefile
94   http_getter.pl
95   helm_http_getter.spec
96 ], chmod +x http_getter.pl)
97