1 dnl @(#) $Header: /opt/backups/cvs.m17n.org/root/starttls/Attic/acinclude.m4,v 1.2 2002-01-22 08:33:12 ueno Exp $ (LBL)
3 dnl Copyright (c) 1995, 1996, 1997, 1998
4 dnl The Regents of the University of California. All rights reserved.
6 dnl Redistribution and use in source and binary forms, with or without
7 dnl modification, are permitted provided that: (1) source code distributions
8 dnl retain the above copyright notice and this paragraph in its entirety, (2)
9 dnl distributions including binary code include the above copyright notice and
10 dnl this paragraph in its entirety in the documentation or other materials
11 dnl provided with the distribution, and (3) all advertising materials mentioning
12 dnl features or use of this software display the following acknowledgement:
13 dnl ``This product includes software developed by the University of California,
14 dnl Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
15 dnl the University nor the names of its contributors may be used to endorse
16 dnl or promote products derived from this software without specific prior
17 dnl written permission.
18 dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
19 dnl WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
20 dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 dnl LBL autoconf macros
25 dnl Copyright (c) 1999 WIDE Project. All rights reserved.
27 dnl Redistribution and use in source and binary forms, with or without
28 dnl modification, are permitted provided that the following conditions
30 dnl 1. Redistributions of source code must retain the above copyright
31 dnl notice, this list of conditions and the following disclaimer.
32 dnl 2. Redistributions in binary form must reproduce the above copyright
33 dnl notice, this list of conditions and the following disclaimer in the
34 dnl documentation and/or other materials provided with the distribution.
35 dnl 3. Neither the name of the project nor the names of its contributors
36 dnl may be used to endorse or promote products derived from this software
37 dnl without specific prior written permission.
39 dnl THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
40 dnl ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
42 dnl ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
43 dnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44 dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
45 dnl OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
47 dnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
48 dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52 dnl Checks to see if AF_INET6 is defined
53 AC_DEFUN(AC_CHECK_AF_INET6, [
54 AC_MSG_CHECKING(for AF_INET6)
57 # include <sys/types.h>
58 # include <sys/socket.h>],
63 if test $$1 = yes ; then
64 AC_DEFINE(HAVE_AF_INET6)
69 dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member
70 dnl borrowed from LBL libpcap
71 AC_DEFUN(AC_CHECK_SA_LEN, [
72 AC_MSG_CHECKING(if sockaddr struct has sa_len member)
75 # include <sys/types.h>
76 # include <sys/socket.h>],
77 [u_int i = sizeof(((struct sockaddr *)0)->sa_len)],
81 if test $$1 = yes ; then
82 AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
87 dnl Checks for portable prototype declaration macro
88 AC_DEFUN(AC_CHECK_PORTABLE_PROTO, [
89 AC_MSG_CHECKING(for __P)
92 # include <unistd.h>],
97 if test $$1 = yes; then
98 AC_DEFINE(HAVE_PORTABLE_PROTOTYPE)
102 dnl checks for u_intXX_t
103 AC_DEFUN(AC_CHECK_BITTYPES, [
105 dnl check for u_int8_t
106 AC_MSG_CHECKING(for u_int8_t)
107 AC_CACHE_VAL(ac_cv_u_int8_t,
109 # include <sys/types.h>],
113 AC_MSG_RESULT($ac_cv_u_int8_t)
114 if test $ac_cv_u_int8_t = yes; then
115 AC_DEFINE(HAVE_U_INT8_T)
119 dnl check for u_int16_t
120 AC_MSG_CHECKING(for u_int16_t)
121 AC_CACHE_VAL(ac_cv_u_int16_t,
123 # include <sys/types.h>],
127 AC_MSG_RESULT($ac_cv_u_int16_t)
128 if test $ac_cv_u_int16_t = yes; then
129 AC_DEFINE(HAVE_U_INT16_T)
133 dnl check for u_int32_t
134 AC_MSG_CHECKING(for u_int32_t)
135 AC_CACHE_VAL(ac_cv_u_int32_t,
137 # include <sys/types.h>],
141 AC_MSG_RESULT($ac_cv_u_int32_t)
142 if test $ac_cv_u_int32_t = yes; then
143 AC_DEFINE(HAVE_U_INT32_T)
150 dnl Checks for addrinfo structure
151 AC_DEFUN(AC_STRUCT_ADDRINFO, [
152 AC_MSG_CHECKING(for addrinfo)
155 # include <netdb.h>],
160 if test $$1 = yes; then
161 AC_DEFINE(HAVE_ADDRINFO)
163 AC_DEFINE(NEED_ADDRINFO_H)
168 dnl Checks for NI_MAXSERV
169 AC_DEFUN(AC_NI_MAXSERV, [
170 AC_MSG_CHECKING(for NI_MAXSERV)
172 AC_EGREP_CPP(yes, [#include <netdb.h>
179 if test $$1 != yes; then
180 AC_DEFINE(NEED_ADDRINFO_H)
185 dnl Checks for NI_NAMEREQD
186 AC_DEFUN(AC_NI_NAMEREQD, [
187 AC_MSG_CHECKING(for NI_NAMEREQD)
189 AC_EGREP_CPP(yes, [#include <netdb.h>
196 if test $$1 != yes; then
197 AC_DEFINE(NEED_ADDRINFO_H)
202 dnl Checks for sockaddr_storage structure
203 AC_DEFUN(AC_STRUCT_SA_STORAGE, [
204 AC_MSG_CHECKING(for sockaddr_storage)
207 # include <sys/types.h>
208 # include <sys/socket.h>],
209 [struct sockaddr_storage s],
213 if test $$1 = yes; then
214 AC_DEFINE(HAVE_SOCKADDR_STORAGE)
219 dnl Checks for macro of IP address size
220 AC_DEFUN(AC_CHECK_ADDRSZ, [
222 dnl check for INADDRSZ
223 AC_MSG_CHECKING(for INADDRSZ)
224 AC_CACHE_VAL(ac_cv_inaddrsz,
226 # include <arpa/nameser.h>],
230 AC_MSG_RESULT($ac_cv_inaddrsz)
231 if test $ac_cv_inaddrsz = yes; then
232 AC_DEFINE(HAVE_INADDRSZ)
236 dnl check for IN6ADDRSZ
237 AC_MSG_CHECKING(for IN6ADDRSZ)
238 AC_CACHE_VAL(ac_cv_in6addrsz,
240 # include <arpa/nameser.h>],
244 AC_MSG_RESULT($ac_cv_in6addrsz)
245 if test $ac_cv_in6addrsz = yes; then
246 AC_DEFINE(HAVE_IN6ADDRSZ)
253 dnl check for RES_USE_INET6
254 AC_DEFUN(AC_CHECK_RES_USE_INET6, [
255 AC_MSG_CHECKING(for RES_USE_INET6)
258 # include <sys/types.h>
259 # include <netinet/in.h>
260 # include <resolv.h>],
261 [int a = RES_USE_INET6],
265 if test $$1 = yes; then
266 AC_DEFINE(HAVE_RES_USE_INET6)
272 AC_DEFUN(AC_CHECK_AAAA, [
273 AC_MSG_CHECKING(for AAAA)
276 # include <sys/types.h>
277 # include <arpa/nameser.h>],
282 if test $$1 = yes; then
288 dnl check for struct res_state_ext
289 AC_DEFUN(AC_STRUCT_RES_STATE_EXT, [
290 AC_MSG_CHECKING(for res_state_ext)
293 # include <sys/types.h>
294 # include <netinet/in.h>
295 # include <netinet6/in6.h>
296 # include <resolv.h>],
297 [struct __res_state_ext e],
301 if test $$1 = yes; then
302 AC_DEFINE(HAVE_RES_STATE_EXT)
307 dnl check for struct res_state_ext
308 AC_DEFUN(AC_STRUCT_RES_STATE, [
309 AC_MSG_CHECKING(for nsort in res_state)
312 # include <sys/types.h>
313 # include <netinet/in.h>
314 # include <netinet6/in6.h>
315 # include <resolv.h>],
316 [struct __res_state e; e.nsort = 0],
320 if test $$1 = yes; then
321 AC_DEFINE(HAVE_NEW_RES_STATE)
326 dnl check for h_errno
327 AC_DEFUN(AC_VAR_H_ERRNO, [
328 AC_MSG_CHECKING(for h_errno)
329 AC_CACHE_VAL(ac_cv_var_h_errno,
331 # include <sys/types.h>
332 # include <netdb.h>],
333 [int foo = h_errno;],
334 ac_cv_var_h_errno=yes,
335 ac_cv_var_h_errno=no))
336 AC_MSG_RESULT($ac_cv_var_h_errno)
337 if test "$ac_cv_var_h_errno" = "yes"; then
338 AC_DEFINE(HAVE_H_ERRNO)
343 dnl Test for __attribute__
346 AC_DEFUN(AC_C___ATTRIBUTE__, [
347 AC_MSG_CHECKING(for __attribute__)
348 AC_CACHE_VAL(ac_cv___attribute__, [
353 static void foo(void) __attribute__ ((noreturn));
361 ac_cv___attribute__=yes,
362 ac_cv___attribute__=no)])
363 if test "$ac_cv___attribute__" = "yes"; then
364 AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
366 AC_MSG_RESULT($ac_cv___attribute__)