1c43cc173Smrg
2b789ec8aSmrg# Initialize Autoconf
337eb1ca1SmrgAC_PREREQ([2.60])
4c6b4a769SmrgAC_INIT([libXi], [1.8.2],
54940c694Smrg	[https://gitlab.freedesktop.org/xorg/lib/libXi/issues], [libXi])
6b789ec8aSmrgAC_CONFIG_SRCDIR([Makefile.am])
7b789ec8aSmrgAC_CONFIG_HEADERS([src/config.h])
84e8f48c7SmrgAC_CONFIG_MACRO_DIRS([m4])
9c43cc173Smrg
10b789ec8aSmrg# Initialize Automake
114e8f48c7SmrgAM_INIT_AUTOMAKE([foreign dist-xz])
12c43cc173Smrg
13b789ec8aSmrg# Initialize libtool
144e8f48c7SmrgLT_INIT
15b789ec8aSmrg
16f1ee322dSmrg# Require xorg-macros minimum of 1.12 for DocBook external references
173e256790Smrgm4_ifndef([XORG_MACROS_VERSION],
18f1ee322dSmrg          [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
19f1ee322dSmrgXORG_MACROS_VERSION(1.12)
203e256790SmrgXORG_DEFAULT_OPTIONS
21f1ee322dSmrgXORG_ENABLE_DOCS
2237eb1ca1SmrgXORG_ENABLE_SPECS
23f1ee322dSmrgXORG_WITH_XMLTO(0.0.22)
2437eb1ca1SmrgXORG_WITH_FOP
25f1ee322dSmrgXORG_WITH_XSLTPROC
26f1ee322dSmrgXORG_CHECK_SGML_DOCTOOLS(1.8)
2737eb1ca1SmrgXORG_WITH_ASCIIDOC(8.4.5)
28b789ec8aSmrgXORG_CHECK_MALLOC_ZERO
29c43cc173Smrg
30f1ee322dSmrg# Obtain compiler/linker options for dependencies
3187404ef7SmrgPKG_CHECK_MODULES(XI, [xproto >= 7.0.13] [x11 >= 1.6] [xextproto >= 7.0.3] [xext >= 1.0.99.1] [inputproto >= 2.3.99.1])
32f1ee322dSmrg# CFLAGS only for PointerBarrier typedef
33f1ee322dSmrgPKG_CHECK_MODULES(XFIXES, [xfixes >= 5])
34c43cc173Smrg
35c27c18e8Smrg# Check for xmlto and asciidoc for man page conversion
36c27c18e8Smrg# (only needed by people building tarballs)
3737eb1ca1Smrgif test "$have_xmlto" = yes && test "$have_asciidoc" = yes; then
383e256790Smrg	have_doctools=yes
393e256790Smrgelse
403e256790Smrg	have_doctools=no
413e256790Smrgfi
423e256790SmrgAM_CONDITIONAL([HAVE_DOCTOOLS], [test $have_doctools = yes])
433e256790Smrgif test $have_doctools = no; then
44c27c18e8Smrg	AC_MSG_WARN([xmlto or asciidoc not found - cannot create man pages without it])
45c27c18e8Smrgfi
46c27c18e8Smrg
473e256790Smrg# Determine if the source for man pages is available
483e256790Smrg# It may already be present (tarball) or can be generated using doctools
493e256790SmrgAM_CONDITIONAL([INSTALL_MANPAGES],
503e256790Smrg	[test -f "$srcdir/man/XAllowDeviceEvents.man" || \
513e256790Smrg	  test $have_doctools = yes])
523e256790Smrg
53b789ec8aSmrgAC_CONFIG_FILES([Makefile
54b789ec8aSmrg		src/Makefile
55b789ec8aSmrg		man/Makefile
56b789ec8aSmrg		specs/Makefile
57b789ec8aSmrg		xi.pc])
58b789ec8aSmrgAC_OUTPUT
59