1
2# Initialize Autoconf
3AC_PREREQ([2.70])
4AC_INIT([libXext], [1.3.6],
5        [https://gitlab.freedesktop.org/xorg/lib/libxext/-/issues], [libXext])
6AC_CONFIG_SRCDIR([Makefile.am])
7AC_CONFIG_HEADERS([config.h])
8AC_CONFIG_MACRO_DIR([m4])
9
10# Set common system defines for POSIX extensions, such as _GNU_SOURCE
11# Must be called before any macros that run the compiler (like LT_INIT)
12# to avoid autoconf errors.
13AC_USE_SYSTEM_EXTENSIONS
14
15# Initialize Automake
16AM_INIT_AUTOMAKE([foreign dist-xz])
17
18# Initialize libtool
19LT_INIT
20
21# Require xorg-macros minimum of 1.12 for DocBook external references
22m4_ifndef([XORG_MACROS_VERSION],
23          [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
24XORG_MACROS_VERSION(1.12)
25XORG_DEFAULT_OPTIONS
26XORG_ENABLE_SPECS
27XORG_WITH_XMLTO(0.0.22)
28XORG_WITH_FOP
29XORG_WITH_XSLTPROC
30XORG_CHECK_SGML_DOCTOOLS(1.8)
31XORG_CHECK_MALLOC_ZERO
32
33# Determine .so library version per platform
34# based on SharedXextRev in monolith xc/config/cf/*Lib.tmpl
35if test "x$XEXT_SOREV" = "x" ; then
36    case $host_os in
37	openbsd*)	XEXT_SOREV=8:0 		;;
38	solaris*)       XEXT_SOREV=0 		;;
39	*)              XEXT_SOREV=6:4:0 	;;
40    esac
41fi
42AC_SUBST(XEXT_SOREV)
43
44# Obtain compiler/linker options for dependencies
45PKG_CHECK_MODULES(XEXT, [xproto >= 7.0.13] [x11 >= 1.6] [xextproto >= 7.1.99])
46
47AX_GCC_BUILTIN([__builtin_popcountl])
48AC_REPLACE_FUNCS([reallocarray])
49
50# Allow checking code with lint, sparse, etc.
51XORG_WITH_LINT
52XORG_LINT_LIBRARY([Xext])
53
54AC_CONFIG_FILES([Makefile
55		man/Makefile
56		src/Makefile
57		specs/Makefile
58		xext.pc])
59AC_OUTPUT
60