Code

build system: Check for a2x and xsltproc.
[template.git] / configure.ac
index fd6e6888d1ea4d307ce542368b530752e1999b50..5f0be652dbade58b9b735754eca21cfd959bc7d7 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) 2010 Sebastian Harl <sh@tokkee.org>
+dnl Copyright (C) 2011 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 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])
@@ -73,7 +77,7 @@ m4_ifdef([LT_INIT],
 )
 
 test_cc_flags() {
-       AC_LANG_CONFTEST([int main() {}])
+       AC_LANG_CONFTEST([AC_LANG_PROGRAM([[ ]], [[ ]])])
        $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
        ret=$?
        rm -f conftest.o
@@ -189,7 +193,27 @@ AC_SUBST([STRICT_CFLAGS])
 
 AC_CHECK_HEADERS(libgen.h)
 
-AC_CONFIG_FILES([Makefile src/Makefile])
+dnl Check for dependencies.
+build_documentation="yes"
+
+have_xsltproc="yes"
+AC_PATH_PROG([XSLTPROC], [xsltproc])
+if test "x$XSLTPROC" = "x"; then
+       have_xsltproc="no"
+       build_documentation="no (missing xsltproc)"
+fi
+
+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])
+
+AM_CONDITIONAL([BUILD_DOCUMENTATION], test "x$build_documentation" = "xyes")
+
+AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile])
 AC_OUTPUT
 
 cat <<EOF;
@@ -204,6 +228,14 @@ Configuration summary:
   package version: $PACKAGE_VERSION
   build date: `date --utc '+%F %T'` (UTC)
 
+  Tools:
+    AsciiDoc (a2x): . . . . . . $have_a2x
+    xsltproc: . . . . . . . . . $have_xsltproc
+
+  Features:
+    documentation:  . . . . . . $build_documentation
+
+This package is maintained by $PACKAGE_MAINTAINER.
 Please report bugs to $PACKAGE_BUGREPORT.
 
 EOF