warnings: fix compilation with old autoconf
[gnulib/ericb.git] / m4 / autobuild.m4
blobf5f2a1899d1cce02ef1522e0e15ff009e34ca163
1 # autobuild.m4 serial 7
2 dnl Copyright (C) 2004, 2006-2017 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl From Simon Josefsson
9 # Usage: AB_INIT([MODE]).
10 AC_DEFUN([AB_INIT],
12   AC_REQUIRE([AC_CANONICAL_BUILD])
13   AC_REQUIRE([AC_CANONICAL_HOST])
15   if test -z "$AB_PACKAGE"; then
16     AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE}
17   fi
18   AC_MSG_NOTICE([autobuild project... $AB_PACKAGE])
20   if test -z "$AB_VERSION"; then
21     AB_VERSION=${PACKAGE_VERSION:-$VERSION}
22   fi
23   AC_MSG_NOTICE([autobuild revision... $AB_VERSION])
25   hostname=`hostname`
26   if test "$hostname"; then
27     AC_MSG_NOTICE([autobuild hostname... $hostname])
28   fi
30   ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
32   date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ`
33   if test "$?" != 0; then
34     date=`date`
35   fi
36   if test "$date"; then
37     AC_MSG_NOTICE([autobuild timestamp... $date])
38   fi