diff options
-rw-r--r-- | Makefile.am | 9 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | m4-local/autobuild.m4 | 34 | ||||
-rw-r--r-- | t.rc | 1 | ||||
-rwxr-xr-x | t.smoke | 11 |
5 files changed, 60 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 21435d4a..474ecc44 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,6 +46,9 @@ DEPENDENCIES= libfm.a $(LIBOBJS) check_PROGRAMS= +TESTS= t.smoke +TESTS_ENVIRONMENT= srcdir="@srcdir@" LC_ALL=C TZ=UTC + if NEED_TRIO noinst_LIBRARIES+= libtrio.a libtrio_a_SOURCES= trio/triostr.c trio/trio.c trio/trionan.c \ @@ -54,7 +57,7 @@ libtrio_a_SOURCES= trio/triostr.c trio/trio.c trio/trionan.c \ check_PROGRAMS+= regression regression_SOURCES= trio/regression.c LDADD += libtrio.a -lm -TESTS= regression +TESTS+= regression endif fetchmail_SOURCES= fetchmail.h getopt.h \ @@ -106,7 +109,9 @@ EXTRA_DIST+= $(DISTDOCS) fetchmail.spec $(distdirs) ucs/README.svn \ trio/CHANGES trio/README \ strlcpy.3 \ m4-local/ac-archive-license.txt \ - m4-local/ac_ma_search_package.m4 + m4-local/ac_ma_search_package.m4 \ + m4-local/autobuild.m4 \ + t.smoke t.rc fetchmailconf: ( echo '#! /bin/sh' && echo 'exec @PYTHON@ @pythondir@/fetchmailconf.py "$$@"' ) >$@ || { rm -f $@ ; exit 1; } diff --git a/configure.ac b/configure.ac index 721029fc..52b672fa 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,13 @@ dnl we may need a newer automake version - the oldest tested is 1.7 AC_PREREQ(2.59) AM_INIT_AUTOMAKE(1.5 foreign no-installinfo) +dnl autobuild support, see <http://josefsson.org/autobuild/> +( + TZ= + export TZ + AB_INIT +) + dnl python is optional AM_PATH_PYTHON(2.0,,AC_MSG_WARN([Disabling fetchmailconf: python 2.0 or greater not found])) AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) diff --git a/m4-local/autobuild.m4 b/m4-local/autobuild.m4 new file mode 100644 index 00000000..bd1f4dc1 --- /dev/null +++ b/m4-local/autobuild.m4 @@ -0,0 +1,34 @@ +# autobuild.m4 serial 2 (autobuild-3.3) +# Copyright (C) 2004 Simon Josefsson +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can can be used in projects which are not available under +# the GNU General Public License or the GNU Library General Public +# License but which still want to provide support for Autobuild. + +# Usage: AB_INIT([MODE]). +AC_DEFUN([AB_INIT], +[ + AC_REQUIRE([AC_CANONICAL_BUILD]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + AC_MSG_NOTICE([autobuild project... ${PACKAGE_NAME:-$PACKAGE}]) + AC_MSG_NOTICE([autobuild revision... ${PACKAGE_VERSION:-$VERSION}]) + hostname=`hostname` + if test "$hostname"; then + AC_MSG_NOTICE([autobuild hostname... $hostname]) + fi + ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])]) + date=`date +%Y%m%d-%H%M%S` + if test "$?" != 0; then + date=`date` + fi + if test "$date"; then + AC_MSG_NOTICE([autobuild timestamp... $date]) + fi +]) @@ -0,0 +1 @@ +skip mail.example.org diff --git a/t.smoke b/t.smoke new file mode 100755 index 00000000..f7924a3c --- /dev/null +++ b/t.smoke @@ -0,0 +1,11 @@ +#! /bin/sh + +# This is a rudimentary tests to see if fetchmail can parse a trivial +# configuration and dump it in human-readable and machine-readable form. + +set -e +cp "${srcdir}/t.rc" t.rc.$$ +chmod 0400 t.rc.$$ +./fetchmail -V -f t.rc.$$ >/dev/null +./fetchmail --configdump -f t.rc.$$ >/dev/null +rm -f t.rc.$$ |