bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr / build / apr_network.m4
1 dnl -----------------------------------------------------------------
2 dnl apr_network.m4: APR's autoconf macros for testing network support
3 dnl
4
5 dnl
6 dnl check for working getaddrinfo()
7 dnl
8 dnl Note that if the system doesn't have gai_strerror(), we
9 dnl can't use getaddrinfo() because we can't get strings
10 dnl describing the error codes.
11 dnl
12 AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[
13   AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[
14   AC_TRY_RUN( [
15 #ifdef HAVE_NETDB_H
16 #include <netdb.h>
17 #endif
18 #ifdef HAVE_STRING_H
19 #include <string.h>
20 #endif
21 #ifdef HAVE_SYS_TYPES_H
22 #include <sys/types.h>
23 #endif
24 #ifdef HAVE_SYS_SOCKET_H
25 #include <sys/socket.h>
26 #endif
27
28 void main(void) {
29     struct addrinfo hints, *ai;
30     int error;
31
32     memset(&hints, 0, sizeof(hints));
33     hints.ai_family = AF_UNSPEC;
34     hints.ai_socktype = SOCK_STREAM;
35     error = getaddrinfo("127.0.0.1", NULL, &hints, &ai);
36     if (error) {
37         exit(1);
38     }
39     if (ai->ai_addr->sa_family != AF_INET) {
40         exit(1);
41     }
42     exit(0);
43 }
44 ],[
45   ac_cv_working_getaddrinfo="yes"
46 ],[
47   ac_cv_working_getaddrinfo="no"
48 ],[
49   ac_cv_working_getaddrinfo="yes"
50 ])])
51 if test "$ac_cv_working_getaddrinfo" = "yes"; then
52   if test "$ac_cv_func_gai_strerror" != "yes"; then
53     ac_cv_working_getaddrinfo="no"
54   else
55     AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works well enough for APR])
56   fi
57 fi
58 ])
59
60 dnl
61 dnl check for working getnameinfo()
62 dnl
63 AC_DEFUN(APR_CHECK_WORKING_GETNAMEINFO,[
64   AC_CACHE_CHECK(for working getnameinfo, ac_cv_working_getnameinfo,[
65   AC_TRY_RUN( [
66 #ifdef HAVE_NETDB_H
67 #include <netdb.h>
68 #endif
69 #ifdef HAVE_STRING_H
70 #include <string.h>
71 #endif
72 #ifdef HAVE_SYS_TYPES_H
73 #include <sys/types.h>
74 #endif
75 #ifdef HAVE_SYS_SOCKET_H
76 #include <sys/socket.h>
77 #endif
78 #ifdef HAVE_NETINET_IN_H
79 #include <netinet/in.h>
80 #endif
81
82 void main(void) {
83     struct sockaddr_in sa;
84     char hbuf[256];
85     int error;
86
87     sa.sin_family = AF_INET;
88     sa.sin_port = 0;
89     sa.sin_addr.s_addr = inet_addr("127.0.0.1");
90 #ifdef SIN6_LEN
91     sa.sin_len = sizeof(sa);
92 #endif
93
94     error = getnameinfo((const struct sockaddr *)&sa, sizeof(sa),
95                         hbuf, 256, NULL, 0,
96                         NI_NUMERICHOST);
97     if (error) {
98         exit(1);
99     } else {
100         exit(0);
101     }
102 }
103 ],[
104   ac_cv_working_getnameinfo="yes"
105 ],[
106   ac_cv_working_getnameinfo="no"
107 ],[
108   ac_cv_working_getnameinfo="yes"
109 ])])
110 if test "$ac_cv_working_getnameinfo" = "yes"; then
111   AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo exists])
112 fi
113 ])
114
115 dnl
116 dnl check for negative error codes for getaddrinfo()
117 dnl
118 AC_DEFUN(APR_CHECK_NEGATIVE_EAI,[
119   AC_CACHE_CHECK(for negative error codes for getaddrinfo, ac_cv_negative_eai,[
120   AC_TRY_RUN( [
121 #ifdef HAVE_NETDB_H
122 #include <netdb.h>
123 #endif
124
125 void main(void) {
126     if (EAI_ADDRFAMILY < 0) {
127         exit(0);
128     }
129     exit(1);
130 }
131 ],[
132   ac_cv_negative_eai="yes"
133 ],[
134   ac_cv_negative_eai="no"
135 ],[
136   ac_cv_negative_eai="no"
137 ])])
138 if test "$ac_cv_negative_eai" = "yes"; then
139   AC_DEFINE(NEGATIVE_EAI, 1, [Define if EAI_ error codes from getaddrinfo are negative])
140 fi
141 ])
142
143 dnl
144 dnl check for presence of  retrans/retry variables in the res_state structure
145 dnl
146 AC_DEFUN(APR_CHECK_RESOLV_RETRANS,[
147   AC_CACHE_CHECK(for presence of retrans/retry fields in res_state/resolv.h , ac_cv_retransretry,[
148   AC_TRY_RUN( [
149 #include <sys/types.h>
150 #if defined(__sun__)
151 #include <inet/ip.h>
152 #endif
153 #include <resolv.h>
154 /* _res is a global defined in resolv.h */
155 int main(void) {
156     _res.retrans = 2;
157     _res.retry = 1;
158     exit(0);
159     return 0;
160 }
161 ],[
162   ac_cv_retransretry="yes"
163 ],[
164   ac_cv_retransretry="no"
165 ],[
166   ac_cv_retransretry="no"
167 ])])
168 if test "$ac_cv_retransretry" = "yes"; then
169   AC_DEFINE(RESOLV_RETRANSRETRY, 1, [Define if resolv.h's res_state has the fields retrans/rety])
170 fi
171 ])
172
173 dnl
174 dnl Checks the definition of gethostbyname_r and gethostbyaddr_r
175 dnl which are different for glibc, solaris and assorted other operating
176 dnl systems
177 dnl
178 dnl Note that this test is executed too early to see if we have all of
179 dnl the headers.
180 AC_DEFUN(APR_CHECK_GETHOSTBYNAME_R_STYLE,[
181
182 dnl Try and compile a glibc2 gethostbyname_r piece of code, and set the
183 dnl style of the routines to glibc2 on success
184 AC_CACHE_CHECK([style of gethostbyname_r routine], ac_cv_gethostbyname_r_style,
185 APR_TRY_COMPILE_NO_WARNING([
186 #ifdef HAVE_SYS_TYPES_H
187 #include <sys/types.h>
188 #endif
189 #ifdef HAVE_NETINET_IN_H
190 #include <netinet/in.h>
191 #endif
192 #ifdef HAVE_ARPA_INET_H
193 #include <arpa/inet.h>
194 #endif
195 #ifdef HAVE_NETDB_H
196 #include <netdb.h>
197 #endif
198 #ifdef HAVE_STDLIB_H
199 #include <stdlib.h>
200 #endif
201 ],[
202 int tmp = gethostbyname_r((const char *) 0, (struct hostent *) 0, 
203                           (char *) 0, 0, (struct hostent **) 0, &tmp);
204 ], ac_cv_gethostbyname_r_style=glibc2, ac_cv_gethostbyname_r_style=none))
205
206 if test "$ac_cv_gethostbyname_r_style" = "glibc2"; then
207     AC_DEFINE(GETHOSTBYNAME_R_GLIBC2, 1, [Define if gethostbyname_r has the glibc style])
208 fi
209
210 AC_CACHE_CHECK([3rd argument to the gethostbyname_r routines], ac_cv_gethostbyname_r_arg,
211 APR_TRY_COMPILE_NO_WARNING([
212 #ifdef HAVE_SYS_TYPES_H
213 #include <sys/types.h>
214 #endif
215 #ifdef HAVE_NETINET_IN_H
216 #include <netinet/in.h>
217 #endif
218 #ifdef HAVE_ARPA_INET_H
219 #include <arpa/inet.h>
220 #endif
221 #ifdef HAVE_NETDB_H
222 #include <netdb.h>
223 #endif
224 #ifdef HAVE_STDLIB_H
225 #include <stdlib.h>
226 #endif
227 ],[
228 int tmp = gethostbyname_r((const char *) 0, (struct hostent *) 0, 
229                           (struct hostent_data *) 0);],
230 ac_cv_gethostbyname_r_arg=hostent_data, ac_cv_gethostbyname_r_arg=char))
231
232 if test "$ac_cv_gethostbyname_r_arg" = "hostent_data"; then
233     AC_DEFINE(GETHOSTBYNAME_R_HOSTENT_DATA, 1, [Define if gethostbyname_r has the hostent_data for the third argument])
234 fi
235 ])
236
237 dnl
238 dnl see if TCP_NODELAY setting is inherited from listening sockets
239 dnl
240 AC_DEFUN(APR_CHECK_TCP_NODELAY_INHERITED,[
241   AC_CACHE_CHECK(if TCP_NODELAY setting is inherited from listening sockets, ac_cv_tcp_nodelay_inherited,[
242   AC_TRY_RUN( [
243 #include <stdio.h>
244 #ifdef HAVE_SYS_TYPES_H
245 #include <sys/types.h>
246 #endif
247 #ifdef HAVE_SYS_SOCKET_H
248 #include <sys/socket.h>
249 #endif
250 #ifdef HAVE_NETINET_IN_H
251 #include <netinet/in.h>
252 #endif
253 #ifdef HAVE_NETINET_TCP_H
254 #include <netinet/tcp.h>
255 #endif
256 #ifndef HAVE_SOCKLEN_T
257 typedef int socklen_t;
258 #endif
259 int main(void) {
260     int listen_s, connected_s, client_s;
261     int listen_port, rc;
262     struct sockaddr_in sa;
263     socklen_t sa_len;
264     socklen_t option_len;
265     int option;
266
267     listen_s = socket(AF_INET, SOCK_STREAM, 0);
268     if (listen_s < 0) {
269         perror("socket");
270         exit(1);
271     }
272     option = 1;
273     rc = setsockopt(listen_s, IPPROTO_TCP, TCP_NODELAY, &option, sizeof option);
274     if (rc < 0) {
275         perror("setsockopt TCP_NODELAY");
276         exit(1);
277     }
278     memset(&sa, 0, sizeof sa);
279     sa.sin_family = AF_INET;
280 #ifdef BEOS
281     sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
282 #endif
283     /* leave port 0 to get ephemeral */
284     rc = bind(listen_s, (struct sockaddr *)&sa, sizeof sa);
285     if (rc < 0) {
286         perror("bind for ephemeral port");
287         exit(1);
288     }
289     /* find ephemeral port */
290     sa_len = sizeof(sa);
291     rc = getsockname(listen_s, (struct sockaddr *)&sa, &sa_len);
292     if (rc < 0) {
293         perror("getsockname");
294         exit(1);
295     }
296     listen_port = sa.sin_port;
297     rc = listen(listen_s, 5);
298     if (rc < 0) {
299         perror("listen");
300         exit(1);
301     }
302     client_s = socket(AF_INET, SOCK_STREAM, 0);
303     if (client_s < 0) {
304         perror("socket");
305         exit(1);
306     }
307     memset(&sa, 0, sizeof sa);
308     sa.sin_family = AF_INET;
309     sa.sin_port   = listen_port;
310 #ifdef BEOS
311     sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
312 #endif
313     /* leave sin_addr all zeros to use loopback */
314     rc = connect(client_s, (struct sockaddr *)&sa, sizeof sa);
315     if (rc < 0) {
316         perror("connect");
317         exit(1);
318     }
319     sa_len = sizeof sa;
320     connected_s = accept(listen_s, (struct sockaddr *)&sa, &sa_len);
321     if (connected_s < 0) {
322         perror("accept");
323         exit(1);
324     }
325     option_len = sizeof option;
326     rc = getsockopt(connected_s, IPPROTO_TCP, TCP_NODELAY, &option, &option_len);
327     if (rc < 0) {
328         perror("getsockopt");
329         exit(1);
330     }
331     if (!option) {
332         fprintf(stderr, "TCP_NODELAY is not set in the child.\n");
333         exit(1);
334     }
335     return 0;
336 }
337 ],[
338     ac_cv_tcp_nodelay_inherited="yes"
339 ],[
340     ac_cv_tcp_nodelay_inherited="no"
341 ],[
342     ac_cv_tcp_nodelay_inherited="yes"
343 ])])
344 if test "$ac_cv_tcp_nodelay_inherited" = "yes"; then
345     tcp_nodelay_inherited=1
346 else
347     tcp_nodelay_inherited=0
348 fi
349 ])
350
351 dnl
352 dnl see if O_NONBLOCK setting is inherited from listening sockets
353 dnl
354 AC_DEFUN(APR_CHECK_O_NONBLOCK_INHERITED,[
355   AC_CACHE_CHECK(if O_NONBLOCK setting is inherited from listening sockets, ac_cv_o_nonblock_inherited,[
356   AC_TRY_RUN( [
357 #include <stdio.h>
358 #ifdef HAVE_SYS_TYPES_H
359 #include <sys/types.h>
360 #endif
361 #ifdef HAVE_SYS_SOCKET_H
362 #include <sys/socket.h>
363 #endif
364 #ifdef HAVE_NETINET_IN_H
365 #include <netinet/in.h>
366 #endif
367 #ifdef HAVE_NETINET_TCP_H
368 #include <netinet/tcp.h>
369 #endif
370 #ifndef HAVE_SOCKLEN_T
371 typedef int socklen_t;
372 #endif
373 #ifdef HAVE_FCNTL_H
374 #include <fcntl.h>
375 #endif
376 int main(void) {
377     int listen_s, connected_s, client_s;
378     int listen_port, rc;
379     struct sockaddr_in sa;
380     socklen_t sa_len;
381
382     listen_s = socket(AF_INET, SOCK_STREAM, 0);
383     if (listen_s < 0) {
384         perror("socket");
385         exit(1);
386     }
387     memset(&sa, 0, sizeof sa);
388     sa.sin_family = AF_INET;
389 #ifdef BEOS
390     sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
391 #endif
392     /* leave port 0 to get ephemeral */
393     rc = bind(listen_s, (struct sockaddr *)&sa, sizeof sa);
394     if (rc < 0) {
395         perror("bind for ephemeral port");
396         exit(1);
397     }
398     /* find ephemeral port */
399     sa_len = sizeof(sa);
400     rc = getsockname(listen_s, (struct sockaddr *)&sa, &sa_len);
401     if (rc < 0) {
402         perror("getsockname");
403         exit(1);
404     }
405     listen_port = sa.sin_port;
406     rc = listen(listen_s, 5);
407     if (rc < 0) {
408         perror("listen");
409         exit(1);
410     }
411     rc = fcntl(listen_s, F_SETFL, O_NONBLOCK);
412     if (rc < 0) {
413         perror("fcntl(F_SETFL)");
414         exit(1);
415     }
416     client_s = socket(AF_INET, SOCK_STREAM, 0);
417     if (client_s < 0) {
418         perror("socket");
419         exit(1);
420     }
421     memset(&sa, 0, sizeof sa);
422     sa.sin_family = AF_INET;
423     sa.sin_port   = listen_port;
424 #ifdef BEOS
425     sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
426 #endif
427     /* leave sin_addr all zeros to use loopback */
428     rc = connect(client_s, (struct sockaddr *)&sa, sizeof sa);
429     if (rc < 0) {
430         perror("connect");
431         exit(1);
432     }
433     sa_len = sizeof sa;
434     connected_s = accept(listen_s, (struct sockaddr *)&sa, &sa_len);
435     if (connected_s < 0) {
436         perror("accept");
437         exit(1);
438     }
439     rc = fcntl(connected_s, F_GETFL, 0);
440     if (rc < 0) {
441         perror("fcntl(F_GETFL)");
442         exit(1);
443     }
444     if (!(rc & O_NONBLOCK)) {
445         fprintf(stderr, "O_NONBLOCK is not set in the child.\n");
446         exit(1);
447     }
448     return 0;
449 }
450 ],[
451     ac_cv_o_nonblock_inherited="yes"
452 ],[
453     ac_cv_o_nonblock_inherited="no"
454 ],[
455     ac_cv_o_nonblock_inherited="yes"
456 ])])
457 if test "$ac_cv_o_nonblock_inherited" = "yes"; then
458     o_nonblock_inherited=1
459 else
460     o_nonblock_inherited=0
461 fi
462 ])
463
464 dnl 
465 dnl check for socklen_t, fall back to unsigned int
466 dnl
467 AC_DEFUN(APR_CHECK_SOCKLEN_T,[
468 AC_CACHE_CHECK(for socklen_t, ac_cv_socklen_t,[
469 AC_TRY_COMPILE([
470 #ifdef HAVE_SYS_TYPES_H
471 #include <sys/types.h>
472 #endif
473 #ifdef HAVE_SYS_SOCKET_H
474 #include <sys/socket.h>
475 #endif
476 ],[
477 socklen_t foo = (socklen_t) 0;
478 ],[
479     ac_cv_socklen_t=yes
480 ],[
481     ac_cv_socklen_t=no
482 ])
483 ])
484
485 if test "$ac_cv_socklen_t" = "yes"; then
486   AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t])
487 fi
488 ])
489
490
491 AC_DEFUN(APR_CHECK_INET_ADDR,[
492 AC_CACHE_CHECK(for inet_addr, ac_cv_func_inet_addr,[
493 AC_TRY_COMPILE([
494 #ifdef HAVE_SYS_TYPES_H
495 #include <sys/types.h>
496 #endif
497 #ifdef HAVE_ARPA_INET_H
498 #include <arpa/inet.h>
499 #endif
500 ],[
501 inet_addr("127.0.0.1");
502 ],[
503     ac_cv_func_inet_addr=yes
504 ],[
505     ac_cv_func_inet_addr=no
506 ])
507 ])
508
509 if test "$ac_cv_func_inet_addr" = "yes"; then
510   have_inet_addr=1
511 else
512   have_inet_addr=0
513 fi
514 ])
515
516
517 AC_DEFUN(APR_CHECK_INET_NETWORK,[
518 AC_CACHE_CHECK(for inet_network, ac_cv_func_inet_network,[
519 AC_TRY_COMPILE([
520 #ifdef HAVE_SYS_TYPES_H
521 #include <sys/types.h>
522 #endif
523 #ifdef HAVE_ARPA_INET_H
524 #include <arpa/inet.h>
525 #endif
526 ],[
527 inet_network("127.0.0.1");
528 ],[
529     ac_cv_func_inet_network=yes
530 ],[
531     ac_cv_func_inet_network=no
532 ])
533 ])
534
535 if test "$ac_cv_func_inet_network" = "yes"; then
536   have_inet_network=1
537 else
538   have_inet_network=0
539 fi
540 ])
541
542
543 AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[
544 AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[
545 AC_TRY_COMPILE([
546 #ifdef HAVE_SYS_TYPES_H
547 #include <sys/types.h>
548 #endif
549 #ifdef HAVE_NETINET_IN_H
550 #include <netinet/in.h>
551 #endif
552 ],[
553 struct sockaddr_in6 sa;
554 ],[
555     ac_cv_define_sockaddr_in6=yes
556 ],[
557     ac_cv_define_sockaddr_in6=no
558 ])
559 ])
560
561 if test "$ac_cv_define_sockaddr_in6" = "yes"; then
562   have_sockaddr_in6=1
563 else
564   have_sockaddr_in6=0
565 fi
566 ])
567
568 dnl
569 dnl APR_INADDR_NONE
570 dnl
571 dnl checks for missing INADDR_NONE macro
572 dnl
573 AC_DEFUN(APR_INADDR_NONE,[
574   AC_CACHE_CHECK(whether system defines INADDR_NONE, ac_cv_inaddr_none,[
575   AC_TRY_COMPILE([
576 #ifdef HAVE_SYS_TYPES_H
577 #include <sys/types.h>
578 #endif
579 #ifdef HAVE_SYS_SOCKET_H
580 #include <sys/socket.h>
581 #endif
582 #ifdef HAVE_NETINET_IN_H
583 #include <netinet/in.h>
584 #endif
585 #ifdef HAVE_ARPA_INET_H
586 #include <arpa/inet.h>
587 #endif
588 ],[
589 unsigned long foo = INADDR_NONE;
590 ],[
591     ac_cv_inaddr_none=yes
592 ],[
593     ac_cv_inaddr_none=no
594 ])])
595   if test "$ac_cv_inaddr_none" = "no"; then
596     apr_inaddr_none="((unsigned int) 0xffffffff)"
597   else
598     apr_inaddr_none="INADDR_NONE"
599   fi
600 ])
601
602
603 dnl
604 dnl APR_H_ERRNO_COMPILE_CHECK
605 dnl
606 AC_DEFUN(APR_H_ERRNO_COMPILE_CHECK,[
607   if test x$1 != x; then
608     CPPFLAGS="-D$1 $CPPFLAGS"
609   fi
610   AC_TRY_COMPILE([
611 #ifdef HAVE_SYS_TYPES_H
612 #include <sys/types.h>
613 #endif
614 #ifdef HAVE_NETDB_H
615 #include <netdb.h>
616 #endif
617 ],[
618 int h_e = h_errno;
619 ],[
620   if test x$1 != x; then
621     ac_cv_h_errno_cppflags="$1"
622   else
623     ac_cv_h_errno_cppflags=yes
624   fi
625 ],[
626   ac_cv_h_errno_cppflags=no
627 ])])
628
629
630 dnl
631 dnl APR_CHECK_SCTP
632 dnl
633 dnl check for presence of SCTP protocol support
634 dnl
635 AC_DEFUN([APR_CHECK_SCTP],
636 [
637   AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [
638   AC_TRY_RUN([
639 #ifdef HAVE_SYS_TYPES_H
640 #include <sys/types.h>
641 #endif
642 #ifdef HAVE_SYS_SOCKET_H
643 #include <sys/socket.h>
644 #endif
645 #ifdef HAVE_NETINET_IN_H
646 #include <netinet/in.h>
647 #endif
648 #ifdef HAVE_NETINET_SCTP_H
649 #include <netinet/sctp.h>
650 #endif
651 #ifdef HAVE_NETINET_SCTP_UIO_H
652 #include <netinet/sctp_uio.h>
653 #endif
654 #include <stdlib.h>
655 int main(void) {
656     int s, opt = 1;
657     if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP)) < 0)
658        exit(1);
659     if (setsockopt(s, IPPROTO_SCTP, SCTP_NODELAY, &opt, sizeof(int)) < 0)
660        exit(2);
661     exit(0);
662 }], [apr_cv_sctp=yes], [apr_cv_sctp=no], [apr_cv_sctp=no])])
663
664 if test "$apr_cv_sctp" = "yes"; then
665     have_sctp=1
666 else
667     have_sctp=0
668 fi
669 ])
670
671 dnl
672 dnl APR_CHECK_H_ERRNO_FLAG
673 dnl
674 dnl checks which flags are necessary for <netdb.h> to define h_errno
675 dnl
676 AC_DEFUN(APR_CHECK_H_ERRNO_FLAG,[
677   AC_MSG_CHECKING([for h_errno in netdb.h])
678   AC_CACHE_VAL(ac_cv_h_errno_cppflags,[
679     APR_H_ERRNO_COMPILE_CHECK
680     if test "$ac_cv_h_errno_cppflags" = "no"; then
681       ac_save="$CPPFLAGS"
682       for flag in _XOPEN_SOURCE_EXTENDED; do
683         APR_H_ERRNO_COMPILE_CHECK($flag)
684         if test "$ac_cv_h_errno_cppflags" != "no"; then
685           break
686         fi
687       done
688       CPPFLAGS="$ac_save"
689     fi
690   ])
691   if test "$ac_cv_h_errno_cppflags" != "no"; then
692     if test "$ac_cv_h_errno_cppflags" != "yes"; then
693       CPPFLAGS="-D$ac_cv_h_errno_cppflags $CPPFLAGS"
694       AC_MSG_RESULT([yes, with -D$ac_cv_h_errno_cppflags])
695     else
696       AC_MSG_RESULT([$ac_cv_h_errno_cppflags])
697     fi
698   else
699     AC_MSG_RESULT([$ac_cv_h_errno_cppflags])
700   fi
701 ])
702
703
704 AC_DEFUN(APR_EBCDIC,[
705   AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
706   AC_TRY_RUN( [
707 int main(void) { 
708   return (unsigned char)'A' != (unsigned char)0xC1; 
709
710 ],[
711   ac_cv_ebcdic="yes"
712 ],[
713   ac_cv_ebcdic="no"
714 ],[
715   ac_cv_ebcdic="no"
716 ])])
717   if test "$ac_cv_ebcdic" = "yes"; then
718     apr_charset_ebcdic=1
719   else
720     apr_charset_ebcdic=0
721   fi
722   AC_SUBST(apr_charset_ebcdic)
723 ])
724