Regenerate files built from other files.
[ircu2.10.12-pk.git] / aclocal.m4
1 # generated automatically by aclocal 1.7.9 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 dnl
15 dnl Macro: unet_PIPE_CFLAGS
16 dnl
17 dnl   If the compiler understands -pipe, add it to CFLAGS if not already
18 dnl   there.
19 dnl
20 AC_DEFUN(unet_PIPE_CFLAGS,
21 [AC_MSG_CHECKING([if the compiler understands -pipe])
22 unet_cv_pipe_flags="$ac_cv_prog_gcc"
23 if test "$ac_cv_prog_gcc" = no; then
24   OLDCFLAGS="$CFLAGS"
25   CFLAGS="$CFLAGS -pipe"
26   AC_TRY_COMPILE(,,unet_cv_pipe_flags=yes,)
27   CFLAGS="$OLDCFLAGS"
28 fi
29 AC_MSG_RESULT($unet_cv_pipe_flags)
30 if test "$unet_cv_pipe_flags" = yes ; then
31   x=`echo $CFLAGS | grep 'pipe' 2>/dev/null`
32   if test "$x" = "" ; then
33     CFLAGS="$CFLAGS -pipe"
34   fi
35 fi
36 ])
37
38 dnl
39 dnl Macro: unet_NONBLOCKING
40 dnl
41 dnl   Check whether we have posix, bsd or sysv non-blocking sockets and
42 dnl   define respectively NBLOCK_POSIX, NBLOCK_BSD or NBLOCK_SYSV.
43 dnl
44 AC_DEFUN(unet_NONBLOCKING,
45 [dnl Do we have posix, bsd or sysv non-blocking stuff ?
46 AC_CACHE_CHECK([for posix non-blocking], unet_cv_sys_nonblocking_posix,
47 [AC_TRY_RUN([#include <sys/types.h>
48 #include <sys/socket.h>
49 #include <fcntl.h>
50 #include <sys/ioctl.h>
51 #include <sys/file.h>
52 #include <signal.h>
53 $ac_cv_type_signal alarmed() { exit(1); }
54 int main(void)
55 {
56   char b[12];
57   struct sockaddr x;
58   size_t l = sizeof(x);
59   int f = socket(AF_INET, SOCK_DGRAM, 0);
60   if (f >= 0 && !(fcntl(f, F_SETFL, O_NONBLOCK)))
61   {
62     signal(SIGALRM, alarmed);
63     alarm(2);
64     recvfrom(f, b, 12, 0, &x, &l);
65     alarm(0);
66     exit(0);
67   }
68   exit(1);
69 }], unet_cv_sys_nonblocking_posix=yes, unet_cv_sys_nonblocking_posix=no)])
70 if test $unet_cv_sys_nonblocking_posix = yes; then
71   AC_DEFINE([NBLOCK_POSIX],,[Define if you have POSIX non-blocking sockets.])
72 else
73 AC_CACHE_CHECK([for bsd non-blocking], unet_cv_sys_nonblocking_bsd,
74 [AC_TRY_RUN([#include <sys/types.h>
75 #include <sys/socket.h>
76 #include <fcntl.h>
77 #include <sys/ioctl.h>
78 #include <sys/file.h>
79 #include <signal.h>
80 $ac_cv_type_signal alarmed() { exit(1); }
81 int main(void)
82 {
83   char b[12];
84   struct sockaddr x;
85   size_t l = sizeof(x);
86   int f = socket(AF_INET, SOCK_DGRAM, 0);
87   if (f >= 0 && !(fcntl(f, F_SETFL, O_NDELAY)))
88   {
89     signal(SIGALRM, alarmed);
90     alarm(2);
91     recvfrom(f, b, 12, 0, &x, &l);
92     alarm(0);
93     exit(0);
94   }
95   exit(1);
96 }], unet_cv_sys_nonblocking_bsd=yes, unet_cv_sys_nonblocking_bsd=no)])
97 if test $unet_cv_sys_nonblocking_bsd = yes; then
98   AC_DEFINE([NBLOCK_BSD],,[Define if you have BSD non-blocking sockets.])
99 else
100   AC_DEFINE([NBLOCK_SYSV],,[Define if you have SysV non-blocking sockets.])
101 fi
102 fi])
103
104 dnl
105 dnl Macro: unet_SIGNALS
106 dnl
107 dnl   Check if we have posix signals, reliable bsd signals or
108 dnl   unreliable sysv signals and define respectively POSIX_SIGNALS,
109 dnl   BSD_RELIABLE_SIGNALS or SYSV_UNRELIABLE_SIGNALS.
110 dnl
111 AC_DEFUN(unet_SIGNALS,
112 [dnl Do we have posix signals, reliable bsd signals or unreliable sysv signals ?
113 AC_CACHE_CHECK([for posix signals], unet_cv_sys_signal_posix,
114 [AC_TRY_COMPILE([#include <signal.h>],
115 [sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L)],
116 unet_cv_sys_signal_posix=yes, unet_cv_sys_signal_posix=no)])
117 if test $unet_cv_sys_signal_posix = yes; then
118   AC_DEFINE([POSIX_SIGNALS],,[Define if you have POSIX signals.])
119 else
120 AC_CACHE_CHECK([for bsd reliable signals], unet_cv_sys_signal_bsd,
121 [AC_TRY_RUN([#include <signal.h>
122 int calls = 0;
123 $ac_cv_type_signal handler()
124 {
125   if (calls) return;
126   calls++;
127   kill(getpid(), SIGTERM);
128   sleep(1);
129 }
130 int main(void)
131 {
132   signal(SIGTERM, handler);
133   kill(getpid(), SIGTERM);
134   exit (0);
135 }], unet_cv_sys_signal_bsd=yes, unet_cv_sys_signal_bsd=no)])
136 if test $unet_cv_sys_signal_bsd = yes; then
137   AC_DEFINE([BSD_RELIABLE_SIGNALS],,[Define if you have (reliable) BSD signals.])
138 else
139   AC_DEFINE([SYSV_UNRELIABLE_SIGNALS],,[Define if you have (unreliable) SysV signals.])
140 fi
141 fi])
142
143 dnl
144 dnl Macro: unet_CHECK_TYPE_SIZES
145 dnl
146 dnl Check the size of several types and define a valid int16_t and int32_t.
147 dnl
148 AC_DEFUN(unet_CHECK_TYPE_SIZES,
149 [dnl Check type sizes
150 AC_CHECK_SIZEOF(short)
151 AC_CHECK_SIZEOF(int)
152 AC_CHECK_SIZEOF(long)
153 AC_CHECK_SIZEOF(void *)
154 AC_CHECK_SIZEOF(int64_t)
155 AC_CHECK_SIZEOF(long long)
156 if test "$ac_cv_sizeof_int" = 2 ; then
157   AC_CHECK_TYPE(int16_t, int)
158   AC_CHECK_TYPE(uint16_t, unsigned int)
159 elif test "$ac_cv_sizeof_short" = 2 ; then
160   AC_CHECK_TYPE(int16_t, short)
161   AC_CHECK_TYPE(uint16_t, unsigned short)
162 else
163   AC_MSG_ERROR([Cannot find a type with size of 16 bits])
164 fi
165 if test "$ac_cv_sizeof_int" = 4 ; then
166   AC_CHECK_TYPE(int32_t, int)
167   AC_CHECK_TYPE(uint32_t, unsigned int)
168 elif test "$ac_cv_sizeof_short" = 4 ; then
169   AC_CHECK_TYPE(int32_t, short)
170   AC_CHECK_TYPE(uint32_t, unsigned short)
171 elif test "$ac_cv_sizeof_long" = 4 ; then
172   AC_CHECK_TYPE(int32_t, long)
173   AC_CHECK_TYPE(uint32_t, unsigned long)
174 else
175   AC_MSG_ERROR([Cannot find a type with size of 32 bits])
176 fi
177 if test "$ac_cv_sizeof_int64_t" = 8 ; then
178   AC_CHECK_TYPE(int64_t)
179   AC_CHECK_TYPE(uint64_t)
180 elif test "$ac_cv_sizeof_long_long" = 8 ; then
181   AC_CHECK_TYPE(int64_t, long long)
182   AC_CHECK_TYPE(uint64_t, unsigned long long)
183 else
184   AC_MSG_ERROR([Cannot find a type with size of 64 bits])
185 fi])
186
187 dnl Written by John Hawkinson <jhawk@mit.edu>. This code is in the Public
188 dnl Domain.
189 dnl
190 dnl This test is for network applications that need socket() and
191 dnl gethostbyname() -ish functions.  Under Solaris, those applications need to
192 dnl link with "-lsocket -lnsl".  Under IRIX, they should *not* link with
193 dnl "-lsocket" because libsocket.a breaks a number of things (for instance:
194 dnl gethostbyname() under IRIX 5.2, and snoop sockets under most versions of
195 dnl IRIX).
196 dnl 
197 dnl Unfortunately, many application developers are not aware of this, and
198 dnl mistakenly write tests that cause -lsocket to be used under IRIX.  It is
199 dnl also easy to write tests that cause -lnsl to be used under operating
200 dnl systems where neither are necessary (or useful), such as SunOS 4.1.4, which
201 dnl uses -lnsl for TLI.
202 dnl 
203 dnl This test exists so that every application developer does not test this in
204 dnl a different, and subtly broken fashion.
205 dnl 
206 dnl It has been argued that this test should be broken up into two seperate
207 dnl tests, one for the resolver libraries, and one for the libraries necessary
208 dnl for using Sockets API. Unfortunately, the two are carefully intertwined and
209 dnl allowing the autoconf user to use them independantly potentially results in
210 dnl unfortunate ordering dependancies -- as such, such component macros would
211 dnl have to carefully use indirection and be aware if the other components were
212 dnl executed. Since other autoconf macros do not go to this trouble, and almost
213 dnl no applications use sockets without the resolver, this complexity has not
214 dnl been implemented.
215 dnl
216 dnl The check for libresolv is in case you are attempting to link statically
217 dnl and happen to have a libresolv.a lying around (and no libnsl.a).
218 dnl
219 AC_DEFUN(AC_LIBRARY_NET, [
220    # Most operating systems have gethostbyname() in the default searched
221    # libraries (i.e. libc):
222    AC_CHECK_FUNC(gethostbyname, ,
223      # Some OSes (eg. Solaris) place it in libnsl:
224      AC_CHECK_LIB(nsl, gethostbyname, , 
225        # Some strange OSes (SINIX) have it in libsocket:
226        AC_CHECK_LIB(socket, gethostbyname, ,
227           # Unfortunately libsocket sometimes depends on libnsl.
228           # AC_CHECK_LIB's API is essentially broken so the following
229           # ugliness is necessary:
230           AC_CHECK_LIB(socket, gethostbyname,
231              LIBS="-lsocket -lnsl $LIBS",
232                AC_CHECK_LIB(resolv, gethostbyname),
233              -lnsl)
234        )
235      )
236    )
237   AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
238     AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)))
239   ])
240
241
242 # Copyright 1996, 1997, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
243
244 # This program is free software; you can redistribute it and/or modify
245 # it under the terms of the GNU General Public License as published by
246 # the Free Software Foundation; either version 2, or (at your option)
247 # any later version.
248
249 # This program is distributed in the hope that it will be useful,
250 # but WITHOUT ANY WARRANTY; without even the implied warranty of
251 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
252 # GNU General Public License for more details.
253
254 # You should have received a copy of the GNU General Public License
255 # along with this program; if not, write to the Free Software
256 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
257 # 02111-1307, USA.
258
259 # serial 2
260
261 # @defmac AC_PROG_CC_STDC
262 # @maindex PROG_CC_STDC
263 # @ovindex CC
264 # If the C compiler in not in ANSI C mode by default, try to add an option
265 # to output variable @code{CC} to make it so.  This macro tries various
266 # options that select ANSI C on some system or another.  It considers the
267 # compiler to be in ANSI C mode if it handles function prototypes correctly.
268 #
269 # If you use this macro, you should check after calling it whether the C
270 # compiler has been set to accept ANSI C; if not, the shell variable
271 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
272 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
273 # program @code{ansi2knr}, which comes with Ghostscript.
274 # @end defmac
275
276 AC_DEFUN([AM_PROG_CC_STDC],
277 [AC_REQUIRE([AC_PROG_CC])
278 AC_BEFORE([$0], [AC_C_INLINE])
279 AC_BEFORE([$0], [AC_C_CONST])
280 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
281 dnl a magic option to avoid problems with ANSI preprocessor commands
282 dnl like #elif.
283 dnl FIXME: can't do this because then AC_AIX won't work due to a
284 dnl circular dependency.
285 dnl AC_BEFORE([$0], [AC_PROG_CPP])
286 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
287 AC_CACHE_VAL(am_cv_prog_cc_stdc,
288 [am_cv_prog_cc_stdc=no
289 ac_save_CC="$CC"
290 # Don't try gcc -ansi; that turns off useful extensions and
291 # breaks some systems' header files.
292 # AIX                   -qlanglvl=ansi
293 # Ultrix and OSF/1      -std1
294 # HP-UX 10.20 and later -Ae
295 # HP-UX older versions  -Aa -D_HPUX_SOURCE
296 # SVR4                  -Xc -D__EXTENSIONS__
297 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
298 do
299   CC="$ac_save_CC $ac_arg"
300   AC_TRY_COMPILE(
301 [#include <stdarg.h>
302 #include <stdio.h>
303 #include <sys/types.h>
304 #include <sys/stat.h>
305 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
306 struct buf { int x; };
307 FILE * (*rcsopen) (struct buf *, struct stat *, int);
308 static char *e (p, i)
309      char **p;
310      int i;
311 {
312   return p[i];
313 }
314 static char *f (char * (*g) (char **, int), char **p, ...)
315 {
316   char *s;
317   va_list v;
318   va_start (v,p);
319   s = g (p, va_arg (v,int));
320   va_end (v);
321   return s;
322 }
323 int test (int i, double x);
324 struct s1 {int (*f) (int a);};
325 struct s2 {int (*f) (double a);};
326 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
327 int argc;
328 char **argv;
329 ], [
330 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
331 ],
332 [am_cv_prog_cc_stdc="$ac_arg"; break])
333 done
334 CC="$ac_save_CC"
335 ])
336 if test -z "$am_cv_prog_cc_stdc"; then
337   AC_MSG_RESULT([none needed])
338 else
339   AC_MSG_RESULT([$am_cv_prog_cc_stdc])
340 fi
341 case "x$am_cv_prog_cc_stdc" in
342   x|xno) ;;
343   *) CC="$CC $am_cv_prog_cc_stdc" ;;
344 esac
345 ])
346
347 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
348