1 dnl Taken from Unix Network Programming, W. Richard Stevens
3 dnl ##################################################################
4 dnl We cannot use the AC_CHECK_TYPE macros becasue AC_CHECK_TYPE
5 dnl #includes only <sys/types.h>, <stdlib.h>, and <stddef.h>.
6 dnl Unfortunately, many implementations today hide typedefs in wierd
7 dnl locations: Solaris 2.5.1 has uint8_t and uint32_t in <pthread.h>.
8 dnl SunOS 4.1.x has int8_t in <sys/bittypes.h>.
9 dnl So we define our own macro AC_UNP_CHECK_TYPE that does the same
10 dnl #includes as "unp.h", and then looks for the typedef.
12 dnl This macro should be invoked after all the header checks have been
13 dnl performed, since we #include "confdefs.h" below, and then use the
14 dnl HAVE_foo_H values that is can #define.
16 AC_DEFUN([AC_UNP_CHECK_TYPE],
17 [AC_MSG_CHECKING(if $1 defined)
18 AC_CACHE_VAL(ac_cv_type_$1,
21 #include "confdefs.h" /* the header built by configure so far */
22 #ifdef HAVE_SYS_TYPES_H
23 # include <sys/types.h>
25 #ifdef HAVE_SYS_SOCKET_H
26 # include <sys/socket.h>
28 #ifdef HAVE_SYS_TIME_H
29 # include <sys/time.h>
31 #ifdef HAVE_NETINET_IN_H
32 # include <netinet/in.h>
34 #ifdef HAVE_ARPA_INET_H
35 # include <arpa/inet.h>
58 #ifdef HAVE_SYS_STAT_H
59 # include <sys/stat.h>
67 #ifdef HAVE_SYS_WAIT_H
68 # include <sys/wait.h>
73 #ifdef HAVE_SYS_SELECT_H
74 # include <sys/select.h>
79 #ifdef HAVE_SYS_IOCTL_H
80 # include <sys/ioctl.h>
82 #ifdef HAVE_SYS_FILIO_H
83 # include <sys/filio.h>
85 #ifdef HAVE_SYS_SOCKIO_H
86 # include <sys/sockio.h>
98 AC_MSG_RESULT([$ac_cv_type_$1])
99 if test $ac_cv_type_$1 = no ; then
100 AH_TEMPLATE([$1], [Defined with the proper type.])