Code

configure.ac: Use AC_MSG_RESULT() to display summary.
[template.git] / configure.ac
index 43383d6e8781183de96a46f669d0f1e8c7edebcb..4dba234be16cb30df7c5f9df39a6e0f2356194a4 100644 (file)
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl This is the foobar configure script.
 dnl
-dnl Copyright (C) 2011 Sebastian 'tokkee' Harl <sh@tokkee.org>
+dnl Copyright (C) 2012 Sebastian 'tokkee' Harl <sh@tokkee.org>
 dnl
 dnl This program is free software; you can redistribute it and/or modify it
 dnl under the terms of the GNU General Public License as published by the
@@ -40,9 +40,13 @@ dnl WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 dnl ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-AC_INIT([foobar],[m4_esyscmd(./version-gen.sh)],
-               [Sebastian 'tokkee' Harl <sh@tokkee.org>], [],
+AC_INIT([foobar full name],[m4_esyscmd(./version-gen.sh)],
+               [sh@tokkee.org],
+               [foobar],
                [http://git.tokkee.org/?p=template.git])
+PACKAGE_MAINTAINER="Sebastian 'tokkee' Harl <sh@tokkee.org>"
+AC_DEFINE_UNQUOTED([PACKAGE_MAINTAINER], ["$PACKAGE_MAINTAINER"],
+               [Define to the name of the maintainer of this package.])
 AC_CONFIG_SRCDIR([src/foobar.c])
 AC_CONFIG_HEADERS([src/config.h])
 AC_PREFIX_DEFAULT([/opt/foobar])
@@ -189,22 +193,50 @@ AC_SUBST([STRICT_CFLAGS])
 
 AC_CHECK_HEADERS(libgen.h)
 
-AC_CONFIG_FILES([Makefile src/Makefile])
-AC_OUTPUT
-
-cat <<EOF;
-
-$PACKAGE_NAME has been configured successfully.
+dnl Check for dependencies.
+build_documentation="yes"
 
-Run 'make' to compile the software and use 'make install' to
-install the package into $prefix.
+have_xsltproc="yes"
+AC_PATH_PROG([XSLTPROC], [xsltproc])
+if test "x$XSLTPROC" = "x"; then
+       have_xsltproc="no"
+       build_documentation="no (missing xsltproc)"
+fi
 
-Configuration summary:
+have_a2x="yes"
+AC_PATH_PROG([A2X], [a2x])
+if test "x$A2X" = "x"; then
+       have_a2x="no"
+       build_documentation="no (missing a2x)"
+fi
+AC_SUBST([A2X])
 
-  package version: $PACKAGE_VERSION
-  build date: `date --utc '+%F %T'` (UTC)
+AM_CONDITIONAL([BUILD_DOCUMENTATION], test "x$build_documentation" = "xyes")
 
-Please report bugs to $PACKAGE_BUGREPORT.
+AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile])
+AC_OUTPUT
 
-EOF
+BUILD_DATE="`date --utc '+%F %T'` (UTC)"
+
+AC_MSG_RESULT()
+AC_MSG_RESULT([$PACKAGE_NAME has been configured successfully.])
+AC_MSG_RESULT()
+AC_MSG_RESULT([Run 'make' to compile the software and use 'make install' to])
+AC_MSG_RESULT([install the package into $prefix.])
+AC_MSG_RESULT()
+AC_MSG_RESULT([Configuration summary:])
+AC_MSG_RESULT()
+AC_MSG_RESULT([  package version: $PACKAGE_VERSION])
+AC_MSG_RESULT([  build date: $BUILD_DATE])
+AC_MSG_RESULT()
+AC_MSG_RESULT([  Tools:])
+AC_MSG_RESULT([    AsciiDoc (a2x): . . . . . . $have_a2x])
+AC_MSG_RESULT([    xsltproc: . . . . . . . . . $have_xsltproc])
+AC_MSG_RESULT()
+AC_MSG_RESULT([  Features:])
+AC_MSG_RESULT([    documentation:  . . . . . . $build_documentation])
+AC_MSG_RESULT()
+AC_MSG_RESULT([This package is maintained by $PACKAGE_MAINTAINER.])
+AC_MSG_RESULT([Please report bugs to $PACKAGE_BUGREPORT.])
+AC_MSG_RESULT()