1d63b911fSmrgdnl
217ca54c3Smrgdnl  Copyright © 2017 Keith Packard
3d63b911fSmrgdnl
417ca54c3Smrgdnl  Permission to use, copy, modify, distribute, and sell this software and its
517ca54c3Smrgdnl  documentation for any purpose is hereby granted without fee, provided that
617ca54c3Smrgdnl  the above copyright notice appear in all copies and that both that
717ca54c3Smrgdnl  copyright notice and this permission notice appear in supporting
817ca54c3Smrgdnl  documentation, and that the name of Keith Packard not be used in
917ca54c3Smrgdnl  advertising or publicity pertaining to distribution of the software without
1017ca54c3Smrgdnl  specific, written prior permission.  Keith Packard makes no
1117ca54c3Smrgdnl  representations about the suitability of this software for any purpose.  It
1217ca54c3Smrgdnl  is provided "as is" without express or implied warranty.
13d63b911fSmrgdnl
1417ca54c3Smrgdnl  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1517ca54c3Smrgdnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1617ca54c3Smrgdnl  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
1717ca54c3Smrgdnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
1817ca54c3Smrgdnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
1917ca54c3Smrgdnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2017ca54c3Smrgdnl  PERFORMANCE OF THIS SOFTWARE.
2117ca54c3Smrgdnl
2217ca54c3Smrgdnl Process this file with autoconf to create configure.
2317ca54c3Smrg
2417ca54c3SmrgAC_PREREQ([2.60])
255395ea76Smrg# keep version in sync with meson.build
26635a5eb8SmrgAC_INIT([xorgproto], [2024.1],
27ea1d6981Smrg        [https://gitlab.freedesktop.org/xorg/proto/xorgproto/issues])
28452262e1SmrgAM_INIT_AUTOMAKE([foreign dist-xz])
2917ca54c3Smrg
3017ca54c3Smrg# Require xorg-macros: XORG_DEFAULT_OPTIONS
3117ca54c3Smrgm4_ifndef([XORG_MACROS_VERSION],
3217ca54c3Smrg          [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
3317ca54c3SmrgXORG_MACROS_VERSION(1.12)
3417ca54c3SmrgXORG_DEFAULT_OPTIONS
3517ca54c3SmrgXORG_ENABLE_SPECS
3617ca54c3SmrgXORG_WITH_XMLTO(0.0.22)
3717ca54c3SmrgXORG_WITH_FOP
3817ca54c3SmrgXORG_WITH_XSLTPROC
3917ca54c3SmrgXORG_CHECK_SGML_DOCTOOLS(1.8)
4017ca54c3Smrg
415395ea76SmrgAM_PATH_PYTHON([3.6], , [:])
425395ea76SmrgAM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
435395ea76Smrg
4417ca54c3SmrgAC_CANONICAL_HOST
4517ca54c3Smrg
4617ca54c3SmrgAC_ARG_ENABLE(legacy,
4717ca54c3Smrg	      AS_HELP_STRING([--enable-legacy],
4817ca54c3Smrg			     [Install legacy protocol headers (default: false)]),
4917ca54c3Smrg			     [LEGACY=$enableval], [LEGACY=no])
5017ca54c3SmrgAM_CONDITIONAL(LEGACY, [test "x$LEGACY" = "xyes"])
5117ca54c3Smrg
5217ca54c3SmrgAC_CHECK_HEADERS([sys/select.h sys/param.h sys/types.h sys/time.h])
5317ca54c3Smrg
5417ca54c3Smrg# Handle Xpoll.h.in
5517ca54c3Smrg# Avoid determining fds_bits on WIN32 hosts (not including cygwin)
5617ca54c3Smrgcase $host_os in
5717ca54c3Smrg	mingw*)		fds_bits_found=true;;
5817ca54c3Smrg	*)		fds_bits_found=false;;
5917ca54c3Smrgesac
6017ca54c3Smrg
6117ca54c3Smrgif test "x$fds_bits_found" = xfalse ; then
62d63b911fSmrg   AC_CHECK_MEMBER(fd_set.fds_bits,
6317ca54c3Smrg			   [
6417ca54c3Smrg			       fds_bits_found=plain
6517ca54c3Smrg			       USE_FDS_BITS="fds_bits"
6617ca54c3Smrg			   ],,
6717ca54c3Smrg			   [
6817ca54c3Smrg                               #ifdef HAVE_SYS_PARAM_H
6917ca54c3Smrg                               #include <sys/param.h>
7017ca54c3Smrg                               #endif
7117ca54c3Smrg                               #ifdef HAVE_SYS_TYPES_H
7217ca54c3Smrg                               #include <sys/types.h>
7317ca54c3Smrg                               #endif
7417ca54c3Smrg                               #ifdef HAVE_SYS_TIME_H
7517ca54c3Smrg                               #include <sys/time.h>
7617ca54c3Smrg                               #endif
7717ca54c3Smrg                               #ifdef HAVE_SYS_SELECT_H
7817ca54c3Smrg			       #include <sys/select.h>
7917ca54c3Smrg                               #endif
8017ca54c3Smrg			   ])
8117ca54c3Smrgfi
8217ca54c3Smrg
8317ca54c3Smrgif test "x$fds_bits_found" = xfalse ; then
8417ca54c3Smrg   AC_CHECK_MEMBER(fd_set.__fds_bits,
8517ca54c3Smrg			[
8617ca54c3Smrg			    fds_bits_found=underscores
8717ca54c3Smrg			    USE_FDS_BITS="__fds_bits"
8817ca54c3Smrg			],,
8917ca54c3Smrg			[
9017ca54c3Smrg                               #ifdef HAVE_SYS_PARAM_H
9117ca54c3Smrg                               #include <sys/param.h>
9217ca54c3Smrg                               #endif
9317ca54c3Smrg                               #ifdef HAVE_SYS_TYPES_H
9417ca54c3Smrg                               #include <sys/types.h>
9517ca54c3Smrg                               #endif
9617ca54c3Smrg                               #ifdef HAVE_SYS_TIME_H
9717ca54c3Smrg                               #include <sys/time.h>
9817ca54c3Smrg                               #endif
9917ca54c3Smrg                               #ifdef HAVE_SYS_SELECT_H
10017ca54c3Smrg			       #include <sys/select.h>
10117ca54c3Smrg                               #endif
10217ca54c3Smrg			])
10317ca54c3Smrgfi
10417ca54c3Smrg
10517ca54c3Smrgif test "x$fds_bits_found" = xfalse ; then
10617ca54c3Smrg    AC_MSG_ERROR([Could not determine how to access the fds_bits or equivalent
10717ca54c3Smrg                  structure in fd_set on your platform.])
10817ca54c3Smrgfi
10917ca54c3Smrg
11017ca54c3SmrgAC_SUBST([USE_FDS_BITS])
11117ca54c3Smrg
11217ca54c3SmrgAC_CONFIG_FILES([applewmproto.pc
11317ca54c3Smrg		 bigreqsproto.pc
11417ca54c3Smrg		 compositeproto.pc
11517ca54c3Smrg		 damageproto.pc
11617ca54c3Smrg		 dmxproto.pc
1174627b59cSmrg		 dpmsproto.pc
11817ca54c3Smrg		 dri2proto.pc
11917ca54c3Smrg		 dri3proto.pc
12017ca54c3Smrg		 evieproto.pc
12117ca54c3Smrg		 fixesproto.pc
12217ca54c3Smrg		 fontcacheproto.pc
12317ca54c3Smrg		 fontsproto.pc
12417ca54c3Smrg		 glproto.pc
12517ca54c3Smrg		 include/X11/Xpoll.h
12617ca54c3Smrg		 inputproto.pc
12717ca54c3Smrg		 kbproto.pc
12817ca54c3Smrg		 lg3dproto.pc
12917ca54c3Smrg		 Makefile
13017ca54c3Smrg		 presentproto.pc
13117ca54c3Smrg		 printproto.pc
13217ca54c3Smrg		 randrproto.pc
13317ca54c3Smrg		 recordproto.pc
13417ca54c3Smrg		 renderproto.pc
13517ca54c3Smrg		 resourceproto.pc
13617ca54c3Smrg		 scrnsaverproto.pc
137ea1d6981Smrg		 specs/Makefile
138ea1d6981Smrg		 specs/bigreqsproto/Makefile
139ea1d6981Smrg		 specs/fontsproto/Makefile
140ea1d6981Smrg		 specs/kbproto/Makefile
141ea1d6981Smrg		 specs/recordproto/Makefile
142ea1d6981Smrg		 specs/scrnsaverproto/Makefile
143ea1d6981Smrg		 specs/xcmiscproto/Makefile
144ea1d6981Smrg		 specs/xextproto/Makefile
145ea1d6981Smrg		 specs/xproto/Makefile
14617ca54c3Smrg		 trapproto.pc
14717ca54c3Smrg		 videoproto.pc
14817ca54c3Smrg		 windowswmproto.pc
14917ca54c3Smrg		 xcalibrateproto.pc
15017ca54c3Smrg		 xcmiscproto.pc
15117ca54c3Smrg		 xextproto.pc
15217ca54c3Smrg		 xf86bigfontproto.pc
15317ca54c3Smrg		 xf86dgaproto.pc
15417ca54c3Smrg		 xf86driproto.pc
15517ca54c3Smrg		 xf86miscproto.pc
15617ca54c3Smrg		 xf86rushproto.pc
15717ca54c3Smrg		 xf86vidmodeproto.pc
15817ca54c3Smrg		 xineramaproto.pc
15917ca54c3Smrg		 xproto.pc
160452262e1Smrg		 xproxymngproto.pc
161452262e1Smrg		 xwaylandproto.pc])
162d63b911fSmrg
16317ca54c3SmrgAC_OUTPUT
164