INN commit: trunk (configure.ac m4/perl.m4)

INN Commit Russ_Allbery at isc.org
Sat Jan 10 13:36:38 UTC 2009


    Date: Saturday, January 10, 2009 @ 05:36:38
  Author: iulius
Revision: 8282

Add a warning at configure time if MIME::Parser or Encode
are missing.

see #122

Modified:
  trunk/configure.ac
  trunk/m4/perl.m4

--------------+
 configure.ac |    7 +++++++
 m4/perl.m4   |   13 +++++++++++++
 2 files changed, 20 insertions(+)

Modified: configure.ac
===================================================================
--- configure.ac	2009-01-10 11:52:16 UTC (rev 8281)
+++ configure.ac	2009-01-10 13:36:38 UTC (rev 8282)
@@ -552,6 +552,13 @@
 
 EOM
 
+dnl Write a warning for missing Perl modules at the end of the output.
+dnl $inn_perl_module_warning already has a leading space.
+if test x"$inn_perl_module_warning" != x ; then
+    echo "Missing Perl modules: $inn_perl_module_warning."
+    echo "You should install them for these programs to work fine."
+fi
+
 dnl Finally, double-check the configured temporary directory.  Some people
 dnl point this at the system temporary directories or at other world-writeable
 dnl directories, which can be a local security hole.

Modified: m4/perl.m4
===================================================================
--- m4/perl.m4	2009-01-10 11:52:16 UTC (rev 8281)
+++ m4/perl.m4	2009-01-10 13:36:38 UTC (rev 8282)
@@ -14,6 +14,16 @@
         AC_MSG_ERROR([Perl $1 or greater is required])
     fi])])
 
+dnl Check for Perl modules used by scripts shipped with INN.
+AC_DEFUN([INN_PERL_MODULE],
+[AC_MSG_CHECKING([for $1])
+    if $PERL -e 'require $1;' > /dev/null 2>&1 ; then
+        AC_MSG_RESULT([yes])
+    else
+        AC_MSG_WARN([$1 Perl module is required by $2])
+        inn_perl_module_warning="$inn_perl_module_warning $1 (for $2)"
+    fi])
+
 dnl Check to see if Perl embedding was requested.  Regardless of whether it
 dnl was or not, determine the path to Perl.  If it was requested, make sure
 dnl that we have the right version and then set PERL_CPPFLAGS and PERL_LIBS as
@@ -34,8 +44,11 @@
 dnl Embedded Perl requires 5.004.  controlchan requires 5.004_03.  Other
 dnl things may work with 5.003, but make 5.004_03 the minimum level; anyone
 dnl should really have at least that these days.
+dnl We also check for useful Perl modules.
 INN_PATH_PROG_ENSURE([PERL], [perl])
 _INN_PERL_VERSION(5.004_03)
+INN_PERL_MODULE([Encode], [controlchan])
+INN_PERL_MODULE([MIME::Parser], [controlchan])
 
 dnl Libraries and flags for embedded Perl.  Some distributions of Linux have
 dnl Perl linked with gdbm but don't normally have gdbm installed, so on that




More information about the inn-committers mailing list