adns-ocloexec
[platform/upstream/adns.git] / packaging / adns-1.4-configure.patch
1 --- configure.in
2 +++ configure.in        2006/09/01 12:30:00
3 @@ -23,8 +23,7 @@
4  AC_INIT(src/adns.h)
5  AC_CONFIG_HEADER(src/config.h)
6  
7 -dnl DPKG_CACHED_TRY_COMPILE(<description>,<cachevar>,<include>,<program>,<ifyes>,<ifno>)
8 -define([DPKG_CACHED_TRY_COMPILE],[
9 +AC_DEFUN([DPKG_CACHED_TRY_COMPILE],[
10   AC_MSG_CHECKING($1)
11   AC_CACHE_VAL($2,[
12    AC_TRY_COMPILE([$3],[$4],[$2=yes],[$2=no])
13 @@ -65,6 +64,116 @@
14  AC_PROG_RANLIB
15  AC_PROG_INSTALL
16  
17 +AH_TOP([
18 +/*
19 + *  This file is
20 + *    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
21 + *
22 + *  It is part of adns, which is
23 + *    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
24 + *    Copyright (C) 1999-2000 Tony Finch <dot@dotat.at>
25 + *  
26 + *  This program is free software; you can redistribute it and/or modify
27 + *  it under the terms of the GNU General Public License as published by
28 + *  the Free Software Foundation; either version 2, or (at your option)
29 + *  any later version.
30 + *  
31 + *  This program is distributed in the hope that it will be useful,
32 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
33 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
34 + *  GNU General Public License for more details.
35 + *  
36 + *  You should have received a copy of the GNU General Public License
37 + *  along with this program; if not, write to the Free Software Foundation,
38 + *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
39 + */
40 +])
41 +
42 +AH_TEMPLATE([HAVE_INLINE],
43 +           [Define if inline functions a la GCC are available.])
44 +AH_TEMPLATE([HAVE_GNUC25_ATTRIB],
45 +           [Define if function attributes a la GCC 2.5 and higher are available.])
46 +AH_TEMPLATE([HAVE_GNUC25_CONST],
47 +           [Define if function attributes a la GCC 2.5 and higher are available.])
48 +AH_TEMPLATE([HAVE_GNUC25_NORETURN],
49 +           [Define if nonreturning functions a la GCC 2.5 and higher are available.])
50 +AH_TEMPLATE([HAVE_GNUC25_PRINTFFORMAT],
51 +           [Define if printf-format argument lists a la GCC are available.])
52 +AH_TEMPLATE([HAVEUSE_RPCTYPES_H],
53 +            [Define if we want to include rpc/types.h.  Crap BSDs put INADDR_LOOPBACK there.])
54 +
55 +AH_BOTTOM([
56 +/* Use the definitions: */
57 +
58 +#ifndef HAVE_INLINE
59 +#define inline
60 +#endif
61 +
62 +#ifdef HAVE_POLL
63 +#include <sys/poll.h>
64 +#else
65 +/* kludge it up */
66 +struct pollfd { int fd; short events; short revents; };
67 +#define POLLIN  1
68 +#define POLLPRI 2
69 +#define POLLOUT 4
70 +#endif
71 +
72 +/* GNU C attributes. */
73 +#ifndef FUNCATTR
74 +#ifdef HAVE_GNUC25_ATTRIB
75 +#define FUNCATTR(x) __attribute__(x)
76 +#else
77 +#define FUNCATTR(x)
78 +#endif
79 +#endif
80 +
81 +/* GNU C printf formats, or null. */
82 +#ifndef ATTRPRINTF
83 +#ifdef HAVE_GNUC25_PRINTFFORMAT
84 +#define ATTRPRINTF(si,tc) format(printf,si,tc)
85 +#else
86 +#define ATTRPRINTF(si,tc)
87 +#endif
88 +#endif
89 +#ifndef PRINTFFORMAT
90 +#define PRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc)))
91 +#endif
92 +
93 +/* GNU C nonreturning functions, or null. */
94 +#ifndef ATTRNORETURN
95 +#ifdef HAVE_GNUC25_NORETURN
96 +#define ATTRNORETURN noreturn
97 +#else
98 +#define ATTRNORETURN
99 +#endif
100 +#endif
101 +#ifndef NONRETURNING
102 +#define NONRETURNING FUNCATTR((ATTRNORETURN))
103 +#endif
104 +
105 +/* Combination of both the above. */
106 +#ifndef NONRETURNPRINTFFORMAT
107 +#define NONRETURNPRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc),ATTRNORETURN))
108 +#endif
109 +
110 +/* GNU C constant functions, or null. */
111 +#ifndef ATTRCONST
112 +#ifdef HAVE_GNUC25_CONST
113 +#define ATTRCONST const
114 +#else
115 +#define ATTRCONST
116 +#endif
117 +#endif
118 +#ifndef CONSTANT
119 +#define CONSTANT FUNCATTR((ATTRCONST))
120 +#endif
121 +
122 +#ifdef HAVEUSE_RPCTYPES_H
123 +#include <rpc/types.h>
124 +#endif
125 +])
126 +
127  AC_CHECK_FUNCS(poll)
128  ADNS_C_GETFUNC(socket,socket)
129  ADNS_C_GETFUNC(inet_ntoa,nsl)