aclocal.m4 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. dnl ##################################################################
  2. dnl Our macro to check for a function prototype in a given header.
  3. dnl
  4. AC_DEFUN(AC_CHECK_FUNC_PROTO,
  5. [AC_CACHE_CHECK(for $1 function prototype in $2, ac_cv_have_$1_proto,
  6. AC_EGREP_HEADER($1, $2,
  7. ac_cv_have_$1_proto=yes,
  8. ac_cv_have_$1_proto=no))
  9. if test $ac_cv_have_$1_proto = yes ; then
  10. ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_PROTO
  11. AC_DEFINE_UNQUOTED($ac_tr_func)
  12. fi
  13. ])
  14. dnl ##################################################################
  15. dnl We cannot use the AC_CHECK_TYPE macros because AC_CHECK_TYPE
  16. dnl #includes only <sys/types.h>, <stdlib.h>, and <stddef.h>.
  17. dnl Unfortunately, many implementations today hide typedefs in wierd
  18. dnl locations: Solaris 2.5.1 has uint8_t and uint32_t in <pthread.h>.
  19. dnl SunOS 4.1.x has int8_t in <sys/bitypes.h>.
  20. dnl So we define our own macro AC_UNP_CHECK_TYPE that does the same
  21. dnl #includes as "unp.h", and then looks for the typedef.
  22. dnl
  23. dnl This macro should be invoked after all the header checks have been
  24. dnl performed, since we #include "confdefs.h" below, and then use the
  25. dnl HAVE_foo_H values that it can #define.
  26. dnl
  27. AC_DEFUN(AC_UNP_CHECK_TYPE,
  28. [AC_MSG_CHECKING(if $1 defined)
  29. AC_CACHE_VAL(ac_cv_type_$1,
  30. AC_TRY_COMPILE(
  31. [
  32. #include "confdefs.h" /* the header built by configure so far */
  33. #ifdef HAVE_SYS_TYPES_H
  34. # include <sys/types.h>
  35. #endif
  36. #ifdef HAVE_SYS_SOCKET_H
  37. # include <sys/socket.h>
  38. #endif
  39. #ifdef HAVE_SYS_TIME_H
  40. # include <sys/time.h>
  41. #endif
  42. #ifdef HAVE_NETINET_IN_H
  43. # include <netinet/in.h>
  44. #endif
  45. #ifdef HAVE_ARPA_INET_H
  46. # include <arpa/inet.h>
  47. #endif
  48. #ifdef HAVE_ERRNO_H
  49. # include <errno.h>
  50. #endif
  51. #ifdef HAVE_FCNTL_H
  52. # include <fcntl.h>
  53. #endif
  54. #ifdef HAVE_NETDB_H
  55. # include <netdb.h>
  56. #endif
  57. #ifdef HAVE_SIGNAL_H
  58. # include <signal.h>
  59. #endif
  60. #ifdef HAVE_STDIO_H
  61. # include <stdio.h>
  62. #endif
  63. #ifdef HAVE_STDLIB_H
  64. # include <stdlib.h>
  65. #endif
  66. #ifdef HAVE_STRING_H
  67. # include <string.h>
  68. #endif
  69. #ifdef HAVE_SYS_STAT_H
  70. # include <sys/stat.h>
  71. #endif
  72. #ifdef HAVE_SYS_UIO_H
  73. # include <sys/uio.h>
  74. #endif
  75. #ifdef HAVE_UNISTD_H
  76. # include <unistd.h>
  77. #endif
  78. #ifdef HAVE_SYS_WAIT_H
  79. # include <sys/wait.h>
  80. #endif
  81. #ifdef HAVE_SYS_UN_H
  82. # include <sys/un.h>
  83. #endif
  84. #ifdef HAVE_SYS_SELECT_H
  85. # include <sys/select.h>
  86. #endif
  87. #ifdef HAVE_STRINGS_H
  88. # include <strings.h>
  89. #endif
  90. #ifdef HAVE_SYS_IOCTL_H
  91. # include <sys/ioctl.h>
  92. #endif
  93. #ifdef HAVE_SYS_FILIO_H
  94. # include <sys/filio.h>
  95. #endif
  96. #ifdef HAVE_SYS_SOCKIO_H
  97. # include <sys/sockio.h>
  98. #endif
  99. #ifdef HAVE_PTHREAD_H
  100. # include <pthread.h>
  101. #endif],
  102. [ $1 foo ],
  103. ac_cv_type_$1=yes,
  104. ac_cv_type_$1=no))
  105. AC_MSG_RESULT($ac_cv_type_$1)
  106. if test $ac_cv_type_$1 = no ; then
  107. AC_DEFINE($1, $2, $3)
  108. fi
  109. ])
  110. dnl ##################################################################
  111. dnl The following checks for any typedefs for XTI programs.
  112. dnl We perform all the #includes that "libxti/unpxti.h" performs.
  113. dnl
  114. AC_DEFUN(AC_UNPXTI_CHECK_TYPE,
  115. [AC_MSG_CHECKING(if $1 defined)
  116. AC_CACHE_VAL(ac_cv_type_$1,
  117. AC_TRY_COMPILE(
  118. [
  119. #include "confdefs.h" /* the header built by configure so far */
  120. #ifdef HAVE_SYS_TYPES_H
  121. # include <sys/types.h>
  122. #endif
  123. #ifdef HAVE_SYS_SOCKET_H
  124. # include <sys/socket.h>
  125. #endif
  126. #ifdef HAVE_SYS_TIME_H
  127. # include <sys/time.h>
  128. #endif
  129. #ifdef HAVE_NETINET_IN_H
  130. # include <netinet/in.h>
  131. #endif
  132. #ifdef HAVE_ARPA_INET_H
  133. # include <arpa/inet.h>
  134. #endif
  135. #ifdef HAVE_ERRNO_H
  136. # include <errno.h>
  137. #endif
  138. #ifdef HAVE_FCNTL_H
  139. # include <fcntl.h>
  140. #endif
  141. #ifdef HAVE_NETDB_H
  142. # include <netdb.h>
  143. #endif
  144. #ifdef HAVE_SIGNAL_H
  145. # include <signal.h>
  146. #endif
  147. #ifdef HAVE_STDIO_H
  148. # include <stdio.h>
  149. #endif
  150. #ifdef HAVE_STDLIB_H
  151. # include <stdlib.h>
  152. #endif
  153. #ifdef HAVE_STRING_H
  154. # include <string.h>
  155. #endif
  156. #ifdef HAVE_SYS_STAT_H
  157. # include <sys/stat.h>
  158. #endif
  159. #ifdef HAVE_SYS_UIO_H
  160. # include <sys/uio.h>
  161. #endif
  162. #ifdef HAVE_UNISTD_H
  163. # include <unistd.h>
  164. #endif
  165. #ifdef HAVE_SYS_WAIT_H
  166. # include <sys/wait.h>
  167. #endif
  168. #ifdef HAVE_SYS_UN_H
  169. # include <sys/un.h>
  170. #endif
  171. #ifdef HAVE_SYS_SELECT_H
  172. # include <sys/select.h>
  173. #endif
  174. #ifdef HAVE_STRINGS_H
  175. # include <strings.h>
  176. #endif
  177. #ifdef HAVE_SYS_IOCTL_H
  178. # include <sys/ioctl.h>
  179. #endif
  180. #ifdef HAVE_SYS_FILIO_H
  181. # include <sys/filio.h>
  182. #endif
  183. #ifdef HAVE_SYS_SOCKIO_H
  184. # include <sys/sockio.h>
  185. #endif
  186. #ifdef HAVE_PTHREAD_H
  187. # include <pthread.h>
  188. #endif
  189. #ifdef HAVE_POLL_H
  190. # include <poll.h>
  191. #endif
  192. #ifdef HAVE_XTI_H
  193. # include <xti.h>
  194. #endif
  195. #ifdef HAVE_NETCONFIG_H
  196. # include <netconfig.h>
  197. #endif
  198. #ifdef HAVE_NETDIR_H
  199. # include <netdir.h>
  200. #endif
  201. #ifdef HAVE_STROPTS_H
  202. # include <stropts.h>
  203. #endif],
  204. [ $1 foo ],
  205. ac_cv_type_$1=yes,
  206. ac_cv_type_$1=no))
  207. AC_MSG_RESULT($ac_cv_type_$1)
  208. if test $ac_cv_type_$1 = no ; then
  209. AC_DEFINE($1, $2, $3)
  210. fi
  211. ])