188cd5fc2Smrg#
288cd5fc2Smrg#  Copyright © 2012 Keith Packard
388cd5fc2Smrg#
488cd5fc2Smrg#  Permission to use, copy, modify, distribute, and sell this software and its
588cd5fc2Smrg#  documentation for any purpose is hereby granted without fee, provided that
688cd5fc2Smrg#  the above copyright notice appear in all copies and that both that
788cd5fc2Smrg#  copyright notice and this permission notice appear in supporting
888cd5fc2Smrg#  documentation, and that the name of Keith Packard not be used in
988cd5fc2Smrg#  advertising or publicity pertaining to distribution of the software without
1088cd5fc2Smrg#  specific, written prior permission.  Keith Packard makes no
1188cd5fc2Smrg#  representations about the suitability of this software for any purpose.  It
1288cd5fc2Smrg#  is provided "as is" without express or implied warranty.
1388cd5fc2Smrg#
1488cd5fc2Smrg#  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1588cd5fc2Smrg#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1688cd5fc2Smrg#  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1788cd5fc2Smrg#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
1888cd5fc2Smrg#  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1988cd5fc2Smrg#  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2088cd5fc2Smrg#  PERFORMANCE OF THIS SOFTWARE.
2188cd5fc2Smrg#
2288cd5fc2Smrg
2388cd5fc2Smrg# Initialize Autoconf
2488cd5fc2SmrgAC_PREREQ([2.60])
2588cd5fc2Smrg
2688cd5fc2Smrg#
2788cd5fc2Smrg# Version should match the current XPresent version. XPresentQueryVersion
2888cd5fc2Smrg# returns the version from xpresentwire.h, NOT the version we set here. But we
2988cd5fc2Smrg# try to keep these the same.  Note that the library has an extra
3088cd5fc2Smrg# digit in the version number to track changes which don't affect the
3188cd5fc2Smrg# protocol, so Xpresent version l.n.m corresponds to protocol version l.n,
3288cd5fc2Smrg# that 'revision' number appears in Xpresent.h and has to be manually
3388cd5fc2Smrg# synchronized.
3488cd5fc2Smrg#
35a33c354dSmrgAC_INIT(libXpresent, [1.0.1],
36a33c354dSmrg	[https://gitlab.freedesktop.org/xorg/lib/libxpresent/-/issues],
37a33c354dSmrg	[libXpresent])
3888cd5fc2SmrgAC_CONFIG_SRCDIR([Makefile.am])
3988cd5fc2SmrgAC_CONFIG_HEADERS([config.h])
4088cd5fc2SmrgAC_CONFIG_AUX_DIR([.])
4188cd5fc2SmrgAC_CONFIG_MACRO_DIR([m4])
4288cd5fc2Smrg
4388cd5fc2Smrg# Initialize Automake
44a33c354dSmrgAM_INIT_AUTOMAKE([foreign dist-xz])
4588cd5fc2Smrg
4688cd5fc2Smrg# Initialize libtool
4788cd5fc2SmrgAC_PROG_LIBTOOL
4888cd5fc2Smrg
4988cd5fc2Smrg# Require xorg-macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
5088cd5fc2Smrgm4_ifndef([XORG_MACROS_VERSION],
5188cd5fc2Smrg	  [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
5288cd5fc2SmrgXORG_MACROS_VERSION(1.8)
5388cd5fc2SmrgXORG_DEFAULT_OPTIONS
5488cd5fc2Smrg
5588cd5fc2Smrg# Check presentext configuration, strip extra digits from package version to
5688cd5fc2Smrg# find the required protocol version
5788cd5fc2SmrgPRESENTEXT_VERSION=[`echo $VERSION | sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`]
5888cd5fc2SmrgAC_SUBST(PRESENTEXT_VERSION)
5988cd5fc2Smrg
60a33c354dSmrg# Obtain compiler/linker options for dependencies
61a33c354dSmrgPKG_CHECK_MODULES(PRESENTEXT, xproto [presentproto >= $PRESENTEXT_VERSION] xextproto x11 xext xfixes xrandr)
6288cd5fc2Smrg
6388cd5fc2SmrgAC_CONFIG_FILES([Makefile
6488cd5fc2Smrg		src/Makefile
6588cd5fc2Smrg		man/Makefile
6688cd5fc2Smrg		xpresent.pc])
6788cd5fc2SmrgAC_OUTPUT
68