configure.ac revision d63b911f
1dnl
2dnl  Copyright © 2017 Keith Packard
3dnl
4dnl  Permission to use, copy, modify, distribute, and sell this software and its
5dnl  documentation for any purpose is hereby granted without fee, provided that
6dnl  the above copyright notice appear in all copies and that both that
7dnl  copyright notice and this permission notice appear in supporting
8dnl  documentation, and that the name of Keith Packard not be used in
9dnl  advertising or publicity pertaining to distribution of the software without
10dnl  specific, written prior permission.  Keith Packard makes no
11dnl  representations about the suitability of this software for any purpose.  It
12dnl  is provided "as is" without express or implied warranty.
13dnl
14dnl  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16dnl  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20dnl  PERFORMANCE OF THIS SOFTWARE.
21dnl
22dnl Process this file with autoconf to create configure.
23
24AC_PREREQ([2.60])
25AC_INIT([xorgproto], [2021.3],
26        [https://gitlab.freedesktop.org/xorg/proto/xorgproto/issues])
27AM_INIT_AUTOMAKE([foreign dist-bzip2])
28
29# Require xorg-macros: XORG_DEFAULT_OPTIONS
30m4_ifndef([XORG_MACROS_VERSION],
31          [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
32XORG_MACROS_VERSION(1.12)
33XORG_DEFAULT_OPTIONS
34XORG_ENABLE_SPECS
35XORG_WITH_XMLTO(0.0.22)
36XORG_WITH_FOP
37XORG_WITH_XSLTPROC
38XORG_CHECK_SGML_DOCTOOLS(1.8)
39
40AC_CANONICAL_HOST
41
42AC_ARG_ENABLE(legacy,
43	      AS_HELP_STRING([--enable-legacy],
44			     [Install legacy protocol headers (default: false)]),
45			     [LEGACY=$enableval], [LEGACY=no])
46AM_CONDITIONAL(LEGACY, [test "x$LEGACY" = "xyes"])
47
48AC_CHECK_HEADERS([sys/select.h sys/param.h sys/types.h sys/time.h])
49
50# Handle Xpoll.h.in
51# Avoid determining fds_bits on WIN32 hosts (not including cygwin)
52case $host_os in
53	mingw*)		fds_bits_found=true;;
54	*)		fds_bits_found=false;;
55esac
56
57if test "x$fds_bits_found" = xfalse ; then
58   AC_CHECK_MEMBER(fd_set.fds_bits,
59			   [
60			       fds_bits_found=plain
61			       USE_FDS_BITS="fds_bits"
62			   ],,
63			   [
64                               #ifdef HAVE_SYS_PARAM_H
65                               #include <sys/param.h>
66                               #endif
67                               #ifdef HAVE_SYS_TYPES_H
68                               #include <sys/types.h>
69                               #endif
70                               #ifdef HAVE_SYS_TIME_H
71                               #include <sys/time.h>
72                               #endif
73                               #ifdef HAVE_SYS_SELECT_H
74			       #include <sys/select.h>
75                               #endif
76			   ])
77fi
78
79if test "x$fds_bits_found" = xfalse ; then
80   AC_CHECK_MEMBER(fd_set.__fds_bits,
81			[
82			    fds_bits_found=underscores
83			    USE_FDS_BITS="__fds_bits"
84			],,
85			[
86                               #ifdef HAVE_SYS_PARAM_H
87                               #include <sys/param.h>
88                               #endif
89                               #ifdef HAVE_SYS_TYPES_H
90                               #include <sys/types.h>
91                               #endif
92                               #ifdef HAVE_SYS_TIME_H
93                               #include <sys/time.h>
94                               #endif
95                               #ifdef HAVE_SYS_SELECT_H
96			       #include <sys/select.h>
97                               #endif
98			])
99fi
100
101if test "x$fds_bits_found" = xfalse ; then
102    AC_MSG_ERROR([Could not determine how to access the fds_bits or equivalent
103                  structure in fd_set on your platform.])
104fi
105
106AC_SUBST([USE_FDS_BITS])
107
108AC_CONFIG_FILES([applewmproto.pc
109		 bigreqsproto.pc
110		 compositeproto.pc
111		 damageproto.pc
112		 dmxproto.pc
113		 dpmsproto.pc
114		 dri2proto.pc
115		 dri3proto.pc
116		 evieproto.pc
117		 fixesproto.pc
118		 fontcacheproto.pc
119		 fontsproto.pc
120		 glproto.pc
121		 include/X11/Xpoll.h
122		 inputproto.pc
123		 kbproto.pc
124		 lg3dproto.pc
125		 Makefile
126		 presentproto.pc
127		 printproto.pc
128		 randrproto.pc
129		 recordproto.pc
130		 renderproto.pc
131		 resourceproto.pc
132		 scrnsaverproto.pc
133		 specs/Makefile
134		 specs/bigreqsproto/Makefile
135		 specs/fontsproto/Makefile
136		 specs/kbproto/Makefile
137		 specs/recordproto/Makefile
138		 specs/scrnsaverproto/Makefile
139		 specs/xcmiscproto/Makefile
140		 specs/xextproto/Makefile
141		 specs/xproto/Makefile
142		 trapproto.pc
143		 videoproto.pc
144		 windowswmproto.pc
145		 xcalibrateproto.pc
146		 xcmiscproto.pc
147		 xextproto.pc
148		 xf86bigfontproto.pc
149		 xf86dgaproto.pc
150		 xf86driproto.pc
151		 xf86miscproto.pc
152		 xf86rushproto.pc
153		 xf86vidmodeproto.pc
154		 xineramaproto.pc
155		 xproto.pc
156		 xproxymngproto.pc])
157
158AC_OUTPUT
159