Bump to 7.0.13.
[xorg:x11proto-core.git] / configure.ac
1 AC_PREREQ([2.57])
2 AC_INIT([Xproto], [7.0.13], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
3 AM_INIT_AUTOMAKE([foreign dist-bzip2])
4
5 AC_CONFIG_HEADER([do-not-use-config.h])
6 AC_CONFIG_HEADER([Xfuncproto.h])
7
8 AC_CANONICAL_HOST
9
10 m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
11
12 # Check for enable/disable options
13 AC_ARG_ENABLE(function-prototypes,
14         AS_HELP_STRING([--enable-function-prototypes],
15                        [force function prototypes (default: auto)]),
16         [FUNCPROTO=$enableval], [FUNCPROTO=auto])
17 AC_ARG_ENABLE(varargs-prototypes,
18         AS_HELP_STRING([--enable-varargs-prototypes],
19                        [varargs prototypes are supported (default: auto)]),
20         [VAPROTO=$enableval], [VAPROTO=auto])
21 AC_ARG_ENABLE(const-prototypes,
22         AS_HELP_STRING([--enable-const-prototypes],
23                        [const is supported (default: auto)]),
24         [CONSTPROTO=$enableval], [CONSTPROTO=auto])
25 AC_ARG_ENABLE(nested-prototypes,
26         AS_HELP_STRING([--enable-nested-prototypes],
27                        [nested prototypes are supported (default: auto)]),
28         [NESTEDPROTO=$enableval], [NESTEDPROTO=auto])
29 AC_ARG_ENABLE(wide-prototypes,
30         AS_HELP_STRING([--enable-wide-prototypes],
31                        [widen function prototypes (default: auto)]),
32         [WIDEPROTO=$enableval], [WIDEPROTO=auto])
33
34
35 AC_CHECK_HEADERS([sys/select.h sys/param.h sys/types.h sys/time.h])
36
37 # Handle Xpoll.h.in
38 # Avoid determining fds_bits on WIN32 hosts (not including cygwin)
39 case $host_os in
40         mingw*)         fds_bits_found=true;;
41         *)              fds_bits_found=false;;
42 esac
43
44 if test "x$fds_bits_found" = xfalse ; then
45    AC_CHECK_MEMBER(fd_set.fds_bits, 
46                            [
47                                fds_bits_found=plain
48                                USE_FDS_BITS="fds_bits"
49                            ],,
50                            [
51                                #ifdef HAVE_SYS_PARAM_H
52                                #include <sys/param.h>
53                                #endif
54                                #ifdef HAVE_SYS_TYPES_H
55                                #include <sys/types.h>
56                                #endif
57                                #ifdef HAVE_SYS_TIME_H
58                                #include <sys/time.h>
59                                #endif
60                                #ifdef HAVE_SYS_SELECT_H
61                                #include <sys/select.h>
62                                #endif
63                            ])
64 fi
65
66 if test "x$fds_bits_found" = xfalse ; then
67    AC_CHECK_MEMBER(fd_set.__fds_bits,
68                         [
69                             fds_bits_found=underscores
70                             USE_FDS_BITS="__fds_bits"
71                         ],,
72                         [
73                                #ifdef HAVE_SYS_PARAM_H
74                                #include <sys/param.h>
75                                #endif
76                                #ifdef HAVE_SYS_TYPES_H
77                                #include <sys/types.h>
78                                #endif
79                                #ifdef HAVE_SYS_TIME_H
80                                #include <sys/time.h>
81                                #endif
82                                #ifdef HAVE_SYS_SELECT_H
83                                #include <sys/select.h>
84                                #endif
85                         ])
86 fi
87
88 if test "x$fds_bits_found" = xfalse ; then
89     AC_MSG_ERROR([Could not determine how to access the fds_bits or equivalent
90                   structure in fd_set on your platform.])
91 fi
92
93 AC_SUBST([USE_FDS_BITS])
94
95
96 # Handle Xfuncproto.h
97 AC_MSG_CHECKING([whether const prototypes are supported])
98 if test "x$CONSTPROTO" = xauto; then
99         case $host_os in
100                 linux*)         CONSTPROTO=yes ;;
101                 freebsd*)       CONSTPROTO=yes ;;
102                 netbsd*)        CONSTPROTO=yes ;;
103                 openbsd*)       CONSTPROTO=yes ;;
104                 solaris*)       CONSTPROTO=yes ;;
105                 *)              CONSTPROTO=no ;;
106         esac
107 fi
108 AC_MSG_RESULT([$CONSTPROTO])
109
110 AC_MSG_CHECKING([whether varargs prototypes are supported])
111 if test "x$VAPROTO" = xauto; then
112         case $host_os in
113                 linux*)         VAPROTO=yes ;;
114                 freebsd*)       VAPROTO=yes ;;
115                 netbsd*)        VAPROTO=yes ;;
116                 openbsd*)       VAPROTO=yes ;;
117                 solaris*)       VAPROTO=yes ;;
118                 *)              VAPROTO=no ;;
119         esac
120 fi
121 AC_MSG_RESULT([$VAPROTO])
122
123 AC_MSG_CHECKING([whether nested prototypes are supported])
124 if test "x$NESTEDPROTO" = xauto; then
125         case $host_os in
126                 linux*)         NESTEDPROTO=yes ;;
127                 freebsd*)       NESTEDPROTO=yes ;;
128                 netbsd*)        NESTEDPROTO=yes ;;
129                 openbsd*)       NESTEDPROTO=yes ;;
130                 solaris*)       NESTEDPROTO=yes ;;
131                 *)              NESTEDPROTO=no ;;
132         esac
133 fi
134 AC_MSG_RESULT([$NESTEDPROTO])
135
136 AC_MSG_CHECKING([whether to force function prototypes])
137 if test "x$FUNCPROTO" = xauto; then
138         case $host_os in
139             linux*)     FUNCPROTO=yes ;;
140             freebsd*)   FUNCPROTO=yes ;;
141             netbsd*)    FUNCPROTO=yes ;;
142             openbsd*)   FUNCPROTO=yes ;;
143             *)
144                 if test "x$VAPROTO" = xyes && test "x$NESTEDPROTO" = xyes; then
145                         FUNCPROTO=yes
146                 else
147                         FUNCPROTO=no
148                 fi
149                 ;;
150         esac
151 fi
152 AC_MSG_RESULT([$FUNCPROTO])
153
154 # Logic for this was taken from Imake.tmpl
155 if test "x$FUNCPROTO" = xyes && test "x$VAPROTO" = xyes && test "x$NESTEDPROTO" = xyes && test "x$CONSTPROTO" = xyes; then
156                 AC_DEFINE(FUNCPROTO, [15], [FUNCPROTO])
157 else
158   if test "x$FUNCPROTO" = xyes && test "x$VAPROTO" = xyes && test "x$NESTEDPROTO" = xyes; then
159                 AC_DEFINE(FUNCPROTO, [11], [FUNCPROTO])
160   else
161     if test "x$FUNCPROTO" = xyes && test "x$NESTEDPROTO" = xyes; then
162                 AC_DEFINE(FUNCPROTO, [9], [FUNCPROTO])
163     else
164       if test "x$FUNCPROTO" = xyes && test "x$VAPROTO" = xyes && test "x$CONSTPROTO" = xyes; then
165                 AC_DEFINE(FUNCPROTO, [7], [FUNCPROTO])
166       else
167         if test "x$FUNCPROTO" = xyes && test "x$CONSTPROTO" = xyes; then
168                 AC_DEFINE(FUNCPROTO, [5], [FUNCPROTO])
169         else
170           if test "x$FUNCPROTO" = xyes && test "x$VAPROTO" = xyes; then
171                 AC_DEFINE(FUNCPROTO, [3], [FUNCPROTO])
172           else
173             if test "x$FUNCPROTO" = xyes; then
174                 AC_DEFINE(FUNCPROTO, [], [FUNCPROTO])
175             fi
176           fi
177         fi
178       fi
179     fi
180   fi
181 fi
182
183 AC_MSG_CHECKING([whether to widen function prototypes])
184 if test "x$WIDEPROTO" = xauto; then
185         case $host_os in
186                 linux*)         WIDEPROTO=no ;;
187                 freebsd*)       WIDEPROTO=no ;;
188                 netbsd*)        WIDEPROTO=no ;;
189                 openbsd*)       WIDEPROTO=no ;;
190                 *)              WIDEPROTO=yes ;;
191         esac
192 fi
193 AC_MSG_RESULT([$WIDEPROTO])
194
195 if test "x$WIDEPROTO" = xno; then
196         AC_DEFINE(NARROWPROTO, [], [Narrow prototypes])
197 fi
198
199 XORG_RELEASE_VERSION
200
201 AC_OUTPUT([Makefile
202            Xpoll.h
203            xproto.pc])