1 AC_INIT(http_getter.pl.in)
3 PACKAGE=helm_http_getter
7 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
9 DEFAULT_HELM_LIB_DIR=/usr/local/lib/helm
13 [ --enable-defaults[=ARG] if yes then use defaults (don't ask user) [default=auto]],
14 USE_DEFAULTS=$enableval,
18 if test "x$prefix" != xNONE; then
19 RESOLVED_PREFIX=$prefix
21 RESOLVED_PREFIX=$ac_default_prefix
24 if test "x$exec_prefix" != xNONE; then
25 RESOLVED_EXEC_PREFIX=$exec_prefix
27 RESOLVED_EXEC_PREFIX=$RESOLVED_PREFIX
30 HELM_CGI_DIR=$RESOLVED_PREFIX/bin
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`
41 if test $USE_DEFAULTS = no; then
43 echo "\`helm-config' is not installed (or I can't find it in your path)."
44 echo "Please, insert the lib directory HELM..."
46 echo -n "[[$DEFAULT_HELM_LIB_DIR]] ? "
48 if test "x$HELM_LIB_DIR" = "x"; then
49 HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
51 elif test $USE_DEFAULTS = yes; then
52 HELM_LIB_DIR=$DEFAULT_HELM_LIB_DIR
55 AC_MSG_CHECKING(for $HELM_LIB_DIR/configuration.pl)
56 if test -f $HELM_LIB_DIR/configuration.pl; then
60 AC_MSG_ERROR(please check your installation)
63 AC_PATH_PROG(PERL_BINARY,perl,no)
64 if test $PERL_BINARY = no ; then
65 AC_MSG_ERROR(Could not find perl)
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/'`
75 for perl_lib_dir in $PERL_INC; do
76 if test -f "$perl_lib_dir/$perl_mod_file"; then
78 AC_MSG_RESULT("found in $perl_lib_dir")
82 if test "$module_found" != "true"; then
83 AC_MSG_ERROR("not found")
89 AC_SUBST(RESOLVED_PREFIX)
90 AC_SUBST(RESOLVED_EXEC_PREFIX)
91 AC_SUBST(HELM_LIB_DIR)
93 AC_SUBST(HELM_CGI_DIR)
99 ], chmod +x http_getter.pl)