configure.ac 6.3 KB

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