ae6ea72e34105e8a7e1a56a3817909e09ac7c2b3
[debian/amanda] / config / acinclude.m4i
1 dnl Check if the compiler can handle unsigned long constants, ie 2ul.
2 AC_DEFUN([AMANDA_C_UNSIGNED_LONG_CONSTANTS],
3     [
4         AC_CACHE_CHECK(
5             [for working unsigned long constants],
6             amanda_cv_c_unsigned_long_constants,
7             [
8                 AC_TRY_COMPILE(
9                     [
10                     ],
11                     [
12                         long l = 1ul;
13                     ],
14                     amanda_cv_c_unsigned_long_constants=yes,
15                     amanda_cv_c_unsigned_long_constants=no
16                 )
17             ]
18         )
19         if test "$amanda_cv_c_unsigned_long_constants" = yes; then
20             AC_DEFINE(HAVE_UNSIGNED_LONG_CONSTANTS,1,[Define if the compiler support unsigned long constants. ])
21         fi
22     ]
23 )
24
25 dnl Check for the argument type for shmat() and shmdt()
26 AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE],
27     [
28         AC_CACHE_CHECK(
29             [for shmdt() argument type],
30             amanda_cv_shmdt_arg_type,
31             [
32                 if test "$ac_cv_func_shmget" = yes; then
33                     cat <<EOF >conftest.$ac_ext
34 #include "confdefs.h"
35 #ifdef HAVE_SYS_TYPES_H
36 # include <sys/types.h>
37 #endif
38 #ifdef HAVE_SYS_IPC_H
39 # include <sys/ipc.h>
40 #endif
41 #ifdef HAVE_SYS_SHM_H
42 # include <sys/shm.h>
43 #endif
44
45 #ifdef __cplusplus
46 extern "C" void *shmat(int, void *, int);
47 #else
48 void *shmat();
49 #endif
50
51 int main()
52 {
53     int i;
54     return 0;
55 }
56 EOF
57                     ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
58                     if test $? = 0; then
59                         amanda_cv_shmdt_arg_type=void
60                     else
61                         amanda_cv_shmdt_arg_type=char
62                     fi
63                     rm -f conftest*
64                 else
65                     amanda_cv_shmdt_arg_type=nothing
66                 fi
67             ]
68         )
69         AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,[Define to type of shmget() function argument. ])
70     ]
71 )
72
73 dnl Figure out the select() argument type.
74 AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE],
75     [
76         AC_CACHE_CHECK(
77             [for select() argument type],
78             amanda_cv_select_arg_type,
79             [
80                 rm -f conftest.c
81                 cat <<EOF >conftest.$ac_ext
82 #include "confdefs.h"
83 #ifdef HAVE_SYS_TIME_H
84 # include <sys/time.h>
85 #endif
86 #ifdef HAVE_SYS_TYPES_H
87 # include <sys/types.h>
88 #endif
89 #ifdef HAVE_SYS_SELECT_H
90 #  include <sys/select.h>
91 #endif
92 #ifdef HAVE_SYS_SOCKET_H
93 #  include <sys/socket.h>
94 #endif
95 #ifdef HAVE_UNISTD_H
96 # include <unistd.h>
97 #endif
98
99 int main()
100 {
101 #ifdef FD_SET_POINTER
102         (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
103 #else
104         (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
105 #endif
106         return 0;
107 }
108 EOF
109
110                 dnl Figure out the select argument type by first trying to
111                 dnl compile with the fd_set argument.  If the compile fails,
112                 dnl then we know to use the int.  If it suceeds, then try to
113                 dnl use the int.  If the int fails, then use fd_set.  If
114                 dnl both suceeed, then do a line count on the number of
115                 dnl lines that the compiler spit out, assuming that the
116                 dnl compile outputing more lines had more errors.
117                 amanda_cv_select_arg_type=no
118                 select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS"
119                 $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1
120                 if test $? -ne 0; then
121                     amanda_cv_select_arg_type=int
122                 fi
123                 if test "$amanda_cv_select_arg_type" = no; then
124                     $select_compile conftest.$ac_ext 1>conftest.int 2>&1
125                     if test $? -ne 0; then
126                         amanda_cv_select_arg_type=fd_set
127                     fi
128                 fi
129                 if test "$amanda_cv_select_arg_type" = no; then
130                     wc_fdset=`wc -l <conftest.fd_set`
131                     wc_int=`wc -l <conftest.int`
132                     if test "$wc_fdset" -le "$wc_int"; then
133                         amanda_cv_select_arg_type=fd_set
134                     else
135                         amanda_cv_select_arg_type=int
136                     fi
137                 fi
138                 rm -f conftest*
139             ]
140         )
141         AC_DEFINE_UNQUOTED(SELECT_ARG_TYPE,$amanda_cv_select_arg_type,[Define to type of select arguments. ])
142     ]
143 )
144
145 dnl Check if setsockopt can use the SO_SNDTIMEO option.
146 dnl This defines HAVE_SO_SNDTIMEO if setsockopt works
147 dnl with SO_SNDTIMEO.
148 AC_DEFUN([AMANDA_FUNC_SETSOCKOPT_SO_SNDTIMEO],
149     [
150         AC_CACHE_CHECK(
151             [for setsockopt SO_SNDTIMEO option],
152             amanda_cv_setsockopt_SO_SNDTIMEO,
153             [
154                 AC_TRY_RUN(
155                     [
156 #include <sys/types.h>
157 #include <sys/socket.h>
158 #ifdef TIME_WITH_SYS_TIME
159 #  include <sys/time.h>
160 #  include <time.h>
161 #else
162 #  ifdef HAVE_SYS_TIME_H
163 #    include <sys/time.h>
164 #  else
165 #    include <time.h>
166 #  endif
167 #endif
168
169 main() {
170 #ifdef SO_SNDTIMEO
171     int sock = socket(AF_INET, SOCK_STREAM, 0);
172     struct timeval timeout;
173     timeout.tv_sec = 1;
174     timeout.tv_usec = 0;
175     return (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
176              (void *)&timeout, sizeof(timeout)));
177 #else
178     return -1;
179 #endif
180 }
181                     ],
182                     amanda_cv_setsockopt_SO_SNDTIMEO=yes,
183                     amanda_cv_setsockopt_SO_SNDTIMEO=no,
184                     amanda_cv_setsockopt_SO_SNDTIMEO=no
185                 )
186             ]
187         )
188         if test "$amanda_cv_setsockopt_SO_SNDTIMEO" = yes; then
189             AC_DEFINE(HAVE_SO_SNDTIMEO,1,[Define if SO_SNDTIMEO is available. ])
190         fi
191     ]
192 )
193
194 dnl Find out how {awk,gawk,nawk,mawk} likes to assign variables, if it
195 dnl can do so at all.
196 AC_DEFUN([AMANDA_PROG_AWK_VAR],
197     [
198         AC_REQUIRE([AC_PROG_AWK])
199         AC_CACHE_CHECK(
200             [for $AWK command line variable assignment],
201             amanda_cv_awk_var_assignment,
202             [
203                 echo 'BEGIN{print i; exit}' > conftest.awk
204                 result=`$AWK -f conftest.awk i=xx | wc -c`
205                 if test "$result" -le 1; then
206                     result=`$AWK -f conftest.awk -v i=xx | wc -c`
207                     if test "$result" -le 1; then
208                         amanda_cv_awk_var_assignment=no
209                     else
210                         amanda_cv_awk_var_assignment="yes with -v"
211                     fi
212                 else
213                     amanda_cv_awk_var_assignment="yes"
214                 fi
215                 rm -fr conftest.awk
216             ]
217         )
218         AWK_VAR_ASSIGNMENT_OPT=
219         case "$amanda_cv_awk_var_assignment" in
220             no)
221                 HAVE_AWK_WITH_VAR=no
222                 ;;
223             yes)
224                 HAVE_AWK_WITH_VAR=yes
225                 ;;
226             "yes with -v")
227                 HAVE_AWK_WITH_VAR=yes
228                 AWK_VAR_ASSIGNMENT_OPT=-v
229                 ;;
230         esac
231         AC_SUBST(AWK_VAR_ASSIGNMENT_OPT)
232     ]
233 )       
234
235 dnl Check for the one or two argument version of gettimeofday.
236 AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS],
237     [
238         AC_REQUIRE([AC_HEADER_TIME])
239         AC_CACHE_CHECK(
240             [for gettimeofday number of arguments],
241             amanda_cv_gettimeofday_args,
242             [
243                 AC_TRY_COMPILE(
244                     [
245 #ifdef TIME_WITH_SYS_TIME
246 #  include <sys/time.h>
247 #  include <time.h>
248 #else
249 #  ifdef HAVE_SYS_TIME_H
250 #    include <sys/time.h>
251 #  else
252 #    include <time.h>
253 #  endif
254 #endif
255                     ],
256                     [
257                         struct timeval val;
258                         struct timezone zone;
259                         gettimeofday(&val, &zone);
260                     ],
261                     amanda_cv_gettimeofday_args=2,
262                     amanda_cv_gettimeofday_args=1
263                 )
264             ]
265         )
266         if test "$amanda_cv_gettimeofday_args" = 2; then
267             AC_DEFINE(HAVE_TWO_ARG_GETTIMEOFDAY,1,[Define if gettimeofday takes two arguments. ])
268         fi
269     ]
270 )
271
272
273
274 dnl Check if the compiler understands volatile.
275 AC_DEFUN([AMANDA_C_VOLATILE],
276     [
277         AC_CACHE_CHECK(
278             [for working volatile],
279             amanda_cv_c_volatile,
280             [
281                 AC_TRY_COMPILE(,
282                     [
283                         volatile int aaa = 0;
284                     ],
285                     amanda_cv_c_volatile=yes,
286                     amanda_cv_c_volatile=no
287                 )
288             ]
289         )
290         if test $amanda_cv_c_volatile = no; then
291             AC_DEFINE(volatile, [],[Define to empty if the compiler does not support volatile. ])
292         fi
293     ]
294 )
295
296
297 dnl Check for if pid_t is a long, int, or short.
298 AC_DEFUN([AMANDA_TYPE_PID_T],
299     [
300         AC_REQUIRE([AC_TYPE_PID_T])
301         AC_CACHE_CHECK([for pid_t type], amanda_cv_pid_type,
302             [
303                 amanda_cv_pid_type=unknown
304                 if test "$ac_cv_type_pid_t" = no; then
305                     amanda_cv_pid_type=int
306                 fi
307                 for TEST_amanda_cv_pid_type in long short int; do
308                     if test $amanda_cv_pid_type = unknown; then
309                         AC_EGREP_CPP(typedef.*${TEST_amanda_cv_pid_type}.*pid_t,
310                             [
311 #include <sys/types.h>
312 #if STDC_HEADERS
313 #include <stdlib.h>
314 #include <stddef.h>
315 #endif
316                             ],
317                         amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
318                     fi
319                     if test $amanda_cv_pid_type = unknown; then
320                         AC_EGREP_CPP(ZZZZ.*${TEST_amanda_cv_pid_type},
321                             [
322 #include <sys/types.h>
323 #if STDC_HEADERS
324 #include <stdlib.h>
325 #include <stddef.h>
326 #endif
327                                 ZZZZ pid_t
328                         ],
329                         amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
330                     fi
331                 done
332                 if test $amanda_cv_pid_type = unknown; then
333                     amanda_cv_pid_type=int
334                 fi
335             ]
336         )
337         case $amanda_cv_pid_type in
338             int)        AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d",[Define to printf formatting string to print a PID. ]) ;;
339             long)       AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%ld") ;;
340             short)      AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d") ;;
341         esac
342     ]
343 )
344
345 dnl
346 dnl
347 dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...)
348 dnl If FUNCTION is available, define `HAVE_FUNCTION'.  If it is declared
349 dnl in one of the headers named in the whitespace-separated list 
350 dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals).
351 dnl
352 AC_DEFUN([ICE_CHECK_DECL],
353 [
354 ice_have_$1=no
355 AC_CHECK_FUNCS($1, ice_have_$1=yes)
356 if test "${ice_have_$1}" = yes; then
357 AC_MSG_CHECKING(for $1 declaration in $2)
358 AC_CACHE_VAL(ice_cv_have_$1_decl,
359 [
360 ice_cv_have_$1_decl=no
361 changequote(,)dnl
362 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
363 ice_re_word='(^|[^a-zA-Z0-9_])'
364 changequote([,])dnl
365 for header in $2; do
366 # Check for ordinary declaration
367 AC_EGREP_HEADER([${ice_re_word}$1[      ]*\(], $header, 
368         ice_cv_have_$1_decl=yes)
369 if test "$ice_cv_have_$1_decl" = yes; then
370         break
371 fi
372 # Check for "fixed" declaration like "getpid _PARAMS((int))"
373 AC_EGREP_HEADER([${ice_re_word}$1[      ]*$ice_re_params\(\(], $header, 
374         ice_cv_have_$1_decl=yes)
375 if test "$ice_cv_have_$1_decl" = yes; then
376         break
377 fi
378 done
379 ])
380 AC_MSG_RESULT($ice_cv_have_$1_decl)
381 if test "$ice_cv_have_$1_decl" = yes; then
382 AC_DEFINE_UNQUOTED([HAVE_]translit($1,[a-z],[A-Z])[_DECL],1,[Define if $1 is declared. ])
383 fi
384 fi
385 ])dnl
386 dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'.
387 dnl by T.E.Dickey" , Jim Spath <jspath@mail.bcpl.lib.md.us>
388 dnl
389 dnl     FIXME: These tests should have been in autoconf 1.11!
390 dnl
391 dnl     Note that we cannot simply grep for 'union wait' in the wait.h file,
392 dnl     because some Posix systems turn this on only when a BSD variable is
393 dnl     defined. Since I'm trying to do without special defines, I'll live
394 dnl     with the default behavior of the include-file.
395 dnl
396 dnl     I do _2_ compile checks, because we may have union-wait, but the
397 dnl     prototype for 'wait()' may want an int.
398 dnl
399 dnl     Don't use HAVE_UNION_WAIT, because the autoconf documentation implies
400 dnl     that if we've got union-wait, we'll automatically use it.
401 dnl
402 dnl Garrett Wollman adds:
403 dnl     The tests described above don't quite do the right thing,
404 dnl     since some systems have hacks which allow `union wait' to
405 dnl     still work even though `int' is preferred (and generates
406 dnl     fewer warnings).  Since all of these systems use prototypes,
407 dnl     we can use the prototype of wait(2) to disambiguate them.
408 dnl
409 dnl Alexandre Oliva adds:
410 dnl     A single compile check is enough.  If we don't have union wait,
411 dnl     it's obvious that the test will fail, and that we must use int.
412 dnl     If we do, the prototype (on STDC systems) and WIFEXITED will tell
413 dnl     whether we're supposed to be using union wait instead of int.
414 dnl
415 AC_DEFUN([CF_WAIT],
416 [
417 AC_REQUIRE([AC_TYPE_PID_T])
418 AC_HAVE_HEADERS(sys/wait.h wait.h)
419 AC_CACHE_CHECK([whether wait uses union wait], [cf_cv_arg_union_wait],
420         [AC_TRY_COMPILE([
421 #include <sys/types.h>
422
423 #if HAVE_SYS_WAIT_H
424 # include <sys/wait.h>
425 #else
426 # if HAVE_WAIT_H
427 #  include <wait.h>
428 # endif
429 #endif
430
431 #ifdef __STDC__
432 pid_t wait(union wait *);
433 #endif
434 ], [
435   union wait x; int i;
436   wait(&x); i = WIFEXITED(x)
437 ], [cf_cv_arg_union_wait=yes], [cf_cv_arg_union_wait=no])])
438 if test $cf_cv_arg_union_wait = yes; then
439         AC_DEFINE(WAIT_USES_UNION,1,[Defined if wait() puts the status in a union wait instead of int. ])
440 fi
441 ])dnl
442 AC_DEFUN([CF_WAIT_INT],
443 [
444 AC_REQUIRE([AC_TYPE_PID_T])
445 AC_HAVE_HEADERS(sys/wait.h wait.h)
446 AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int],
447         [AC_TRY_COMPILE([
448 #include <sys/types.h>
449
450 #if HAVE_SYS_WAIT_H
451 # include <sys/wait.h>
452 #else
453 # if HAVE_WAIT_H
454 #  include <wait.h>
455 # endif
456 #endif
457
458 #ifdef __STDC__
459 pid_t wait(int *);
460 #endif
461 ], [
462   int x; int i;
463   wait(&x); i = WIFEXITED(x)
464 ], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])])
465 if test $cf_cv_arg_int = yes; then
466         AC_DEFINE(WAIT_USES_INT,1,[Defined if wait() puts the status in a int instead of a union wait. ])
467 fi
468 ])dnl
469
470 dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
471 dnl
472 dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
473 dnl existence of an include file <stdint.h> that defines a set of 
474 dnl typedefs, especially uint8_t,int32_t,uintptr_t.
475 dnl Many older installations will not provide this file, but some will
476 dnl have the very same definitions in <inttypes.h>. In other enviroments
477 dnl we can use the inet-types in <sys/types.h> which would define the
478 dnl typedefs int8_t and u_int8_t respectivly.
479 dnl
480 dnl This macros will create a local "_stdint.h" or the headerfile given as 
481 dnl an argument. In many cases that file will just "#include <stdint.h>" 
482 dnl or "#include <inttypes.h>", while in other environments it will provide 
483 dnl the set of basic 'stdint's definitions/typedefs: 
484 dnl   int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
485 dnl   int_least32_t.. int_fast32_t.. intmax_t
486 dnl which may or may not rely on the definitions of other files,
487 dnl or using the AC_CHECK_SIZEOF macro to determine the actual
488 dnl sizeof each type.
489 dnl
490 dnl if your header files require the stdint-types you will want to create an
491 dnl installable file mylib-int.h that all your other installable header
492 dnl may include. So if you have a library package named "mylib", just use
493 dnl      AX_CREATE_STDINT_H(mylib-int.h) 
494 dnl in configure.ac and go to install that very header file in Makefile.am
495 dnl along with the other headers (mylib.h) - and the mylib-specific headers
496 dnl can simply use "#include <mylib-int.h>" to obtain the stdint-types.
497 dnl
498 dnl Remember, if the system already had a valid <stdint.h>, the generated
499 dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things...
500 dnl
501 dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/)
502 dnl @version Id: ax_create_stdint_h.m4,v 1.5 2005/01/06 18:27:27 guidod Exp
503 dnl @author  Guido Draheim <guidod@gmx.de> 
504
505 AC_DEFUN([AX_CHECK_DATA_MODEL],[
506    AC_CHECK_SIZEOF(char)
507    AC_CHECK_SIZEOF(short)
508    AC_CHECK_SIZEOF(int)
509    AC_CHECK_SIZEOF(long)
510    AC_CHECK_SIZEOF(void*)
511    ac_cv_char_data_model=""
512    ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
513    ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
514    ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
515    ac_cv_long_data_model=""
516    ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
517    ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
518    ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
519    AC_MSG_CHECKING([data model])
520    case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
521     122/242)     ac_cv_data_model="IP16"  ; n="standard 16bit machine" ;;
522     122/244)     ac_cv_data_model="LP32"  ; n="standard 32bit machine" ;;
523     122/*)       ac_cv_data_model="i16"   ; n="unusual int16 model" ;;
524     124/444)     ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
525     124/488)     ac_cv_data_model="LP64"  ; n="standard 64bit unixish" ;;
526     124/448)     ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
527     124/*)       ac_cv_data_model="i32"   ; n="unusual int32 model" ;;
528     128/888)     ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
529     128/*)       ac_cv_data_model="i64"   ; n="unusual int64 model" ;;         
530     222/*2)      ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
531     333/*3)      ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
532     444/*4)      ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
533     666/*6)      ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
534     888/*8)      ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
535     222/*|333/*|444/*|666/*|888/*) :
536                  ac_cv_data_model="iDSP"  ; n="unusual dsptype" ;;
537      *)          ac_cv_data_model="none"  ; n="very unusual model" ;;
538    esac
539    AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)])
540 ])
541
542 dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF])
543 AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
544 AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
545  ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
546   AC_MSG_RESULT([(..)])
547   for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do
548    unset ac_cv_type_uintptr_t 
549    unset ac_cv_type_uint64_t
550    AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
551    AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
552    m4_ifvaln([$1],[$1]) break
553   done
554   AC_MSG_CHECKING([for stdint uintptr_t])
555  ])
556 ])
557
558 AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
559 AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
560  ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
561   AC_MSG_RESULT([(..)])
562   for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do
563    unset ac_cv_type_uint32_t
564    unset ac_cv_type_uint64_t
565    AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
566    AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
567    m4_ifvaln([$1],[$1]) break
568    break;
569   done
570   AC_MSG_CHECKING([for stdint uint32_t])
571  ])
572 ])
573
574 AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[
575 AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
576  ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
577   AC_MSG_RESULT([(..)])
578   for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do
579    unset ac_cv_type_u_int32_t
580    unset ac_cv_type_u_int64_t
581    AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>])
582    AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
583    m4_ifvaln([$1],[$1]) break
584    break;
585   done
586   AC_MSG_CHECKING([for stdint u_int32_t])
587  ])
588 ])
589
590 AC_DEFUN([AX_CREATE_STDINT_H],
591 [# ------ AX CREATE STDINT H -------------------------------------
592 AC_MSG_CHECKING([for stdint types])
593 ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
594 # try to shortcircuit - if the default include path of the compiler
595 # can find a "stdint.h" header then we assume that all compilers can.
596 AC_CACHE_VAL([ac_cv_header_stdint_t],[
597 old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
598 old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
599 old_CFLAGS="$CFLAGS"     ; CFLAGS=""
600 AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
601 [ac_cv_stdint_result="(assuming C99 compatible system)"
602  ac_cv_header_stdint_t="stdint.h"; ],
603 [ac_cv_header_stdint_t=""])
604 CXXFLAGS="$old_CXXFLAGS"
605 CPPFLAGS="$old_CPPFLAGS"
606 CFLAGS="$old_CFLAGS" ])
607
608 v="... $ac_cv_header_stdint_h"
609 if test "$ac_stdint_h" = "stdint.h" ; then
610  AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
611 elif test "$ac_stdint_h" = "inttypes.h" ; then
612  AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
613 elif test "_$ac_cv_header_stdint_t" = "_" ; then
614  AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
615 else
616  ac_cv_header_stdint="$ac_cv_header_stdint_t"
617  AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
618 fi
619
620 if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
621
622 dnl .....intro message done, now do a few system checks.....
623 dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, 
624 dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW 
625 dnl instead that is triggered with 3 or more arguments (see types.m4)
626
627 inttype_headers=`echo $2 | sed -e 's/,/ /g'`
628
629 ac_cv_stdint_result="(no helpful system typedefs seen)"
630 AX_CHECK_HEADER_STDINT_X(dnl
631    stdint.h inttypes.h sys/inttypes.h $inttype_headers,
632    ac_cv_stdint_result="(seen uintptr_t$and64 in $i)")
633
634 if test "_$ac_cv_header_stdint_x" = "_" ; then
635 AX_CHECK_HEADER_STDINT_O(dnl,
636    inttypes.h sys/inttypes.h stdint.h $inttype_headers,
637    ac_cv_stdint_result="(seen uint32_t$and64 in $i)")
638 fi
639
640 if test "_$ac_cv_header_stdint_x" = "_" ; then
641 if test "_$ac_cv_header_stdint_o" = "_" ; then
642 AX_CHECK_HEADER_STDINT_U(dnl,
643    sys/types.h inttypes.h sys/inttypes.h $inttype_headers,
644    ac_cv_stdint_result="(seen u_int32_t$and64 in $i)")
645 fi fi
646
647 dnl if there was no good C99 header file, do some typedef checks...
648 if test "_$ac_cv_header_stdint_x" = "_" ; then
649    AC_MSG_CHECKING([for stdint datatype model])
650    AC_MSG_RESULT([(..)])
651    AX_CHECK_DATA_MODEL
652 fi
653
654 if test "_$ac_cv_header_stdint_x" != "_" ; then
655    ac_cv_header_stdint="$ac_cv_header_stdint_x"
656 elif  test "_$ac_cv_header_stdint_o" != "_" ; then
657    ac_cv_header_stdint="$ac_cv_header_stdint_o"
658 elif  test "_$ac_cv_header_stdint_u" != "_" ; then
659    ac_cv_header_stdint="$ac_cv_header_stdint_u"
660 else
661    ac_cv_header_stdint="stddef.h"
662 fi
663
664 AC_MSG_CHECKING([for extra inttypes in chosen header])
665 AC_MSG_RESULT([($ac_cv_header_stdint)])
666 dnl see if int_least and int_fast types are present in _this_ header.
667 unset ac_cv_type_int_least32_t
668 unset ac_cv_type_int_fast32_t
669 AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
670 AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
671 AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
672
673 fi # shortcircut to system "stdint.h"
674 # ------------------ PREPARE VARIABLES ------------------------------
675 if test "$GCC" = "yes" ; then
676 ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` 
677 else
678 ac_cv_stdint_message="using $CC"
679 fi
680
681 AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
682 $ac_cv_stdint_result])
683
684 dnl -----------------------------------------------------------------
685 # ----------------- DONE inttypes.h checks START header -------------
686 AC_CONFIG_COMMANDS([$ac_stdint_h],[
687 AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
688 ac_stdint=$tmp/_stdint.h
689
690 echo "#ifndef" $_ac_stdint_h >$ac_stdint
691 echo "#define" $_ac_stdint_h "1" >>$ac_stdint
692 echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
693 echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
694 echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
695 if test "_$ac_cv_header_stdint_t" != "_" ; then 
696 echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
697 echo "#include <stdint.h>" >>$ac_stdint
698 echo "#endif" >>$ac_stdint
699 echo "#endif" >>$ac_stdint
700 else
701
702 cat >>$ac_stdint <<STDINT_EOF
703
704 /* ................... shortcircuit part ........................... */
705
706 #if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
707 #include <stdint.h>
708 #else
709 #include <stddef.h>
710
711 /* .................... configured part ............................ */
712
713 STDINT_EOF
714
715 echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
716 if test "_$ac_cv_header_stdint_x" != "_" ; then
717   ac_header="$ac_cv_header_stdint_x"
718   echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
719 else
720   echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
721 fi
722
723 echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
724 if  test "_$ac_cv_header_stdint_o" != "_" ; then
725   ac_header="$ac_cv_header_stdint_o"
726   echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
727 else
728   echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
729 fi
730
731 echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
732 if  test "_$ac_cv_header_stdint_u" != "_" ; then
733   ac_header="$ac_cv_header_stdint_u"
734   echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
735 else
736   echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
737 fi
738
739 echo "" >>$ac_stdint
740
741 if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
742   echo "#include <$ac_header>" >>$ac_stdint
743   echo "" >>$ac_stdint
744 fi fi
745
746 echo "/* which 64bit typedef has been found */" >>$ac_stdint
747 if test "$ac_cv_type_uint64_t" = "yes" ; then
748 echo "#define   _STDINT_HAVE_UINT64_T" "1"  >>$ac_stdint
749 else
750 echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
751 fi
752 if test "$ac_cv_type_u_int64_t" = "yes" ; then
753 echo "#define   _STDINT_HAVE_U_INT64_T" "1"  >>$ac_stdint
754 else
755 echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
756 fi
757 echo "" >>$ac_stdint
758
759 echo "/* which type model has been detected */" >>$ac_stdint
760 if test "_$ac_cv_char_data_model" != "_" ; then
761 echo "#define   _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
762 echo "#define   _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
763 else
764 echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
765 echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
766 fi
767 echo "" >>$ac_stdint
768
769 echo "/* whether int_least types were detected */" >>$ac_stdint
770 if test "$ac_cv_type_int_least32_t" = "yes"; then
771 echo "#define   _STDINT_HAVE_INT_LEAST32_T" "1"  >>$ac_stdint
772 else
773 echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
774 fi
775 echo "/* whether int_fast types were detected */" >>$ac_stdint
776 if test "$ac_cv_type_int_fast32_t" = "yes"; then
777 echo "#define   _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
778 else
779 echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
780 fi
781 echo "/* whether intmax_t type was detected */" >>$ac_stdint
782 if test "$ac_cv_type_intmax_t" = "yes"; then
783 echo "#define   _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
784 else
785 echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
786 fi
787 echo "" >>$ac_stdint
788
789   cat >>$ac_stdint <<STDINT_EOF
790 /* .................... detections part ............................ */
791
792 /* whether we need to define bitspecific types from compiler base types */
793 #ifndef _STDINT_HEADER_INTPTR
794 #ifndef _STDINT_HEADER_UINT32
795 #ifndef _STDINT_HEADER_U_INT32
796 #define _STDINT_NEED_INT_MODEL_T
797 #else
798 #define _STDINT_HAVE_U_INT_TYPES
799 #endif
800 #endif
801 #endif
802
803 #ifdef _STDINT_HAVE_U_INT_TYPES
804 #undef _STDINT_NEED_INT_MODEL_T
805 #endif
806
807 #ifdef  _STDINT_CHAR_MODEL
808 #if     _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
809 #ifndef _STDINT_BYTE_MODEL
810 #define _STDINT_BYTE_MODEL 12
811 #endif
812 #endif
813 #endif
814
815 #ifndef _STDINT_HAVE_INT_LEAST32_T
816 #define _STDINT_NEED_INT_LEAST_T
817 #endif
818
819 #ifndef _STDINT_HAVE_INT_FAST32_T
820 #define _STDINT_NEED_INT_FAST_T
821 #endif
822
823 #ifndef _STDINT_HEADER_INTPTR
824 #define _STDINT_NEED_INTPTR_T
825 #ifndef _STDINT_HAVE_INTMAX_T
826 #define _STDINT_NEED_INTMAX_T
827 #endif
828 #endif
829
830
831 /* .................... definition part ............................ */
832
833 /* some system headers have good uint64_t */
834 #ifndef _HAVE_UINT64_T
835 #if     defined _STDINT_HAVE_UINT64_T  || defined HAVE_UINT64_T
836 #define _HAVE_UINT64_T
837 #elif   defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
838 #define _HAVE_UINT64_T
839 typedef u_int64_t uint64_t;
840 #endif
841 #endif
842
843 #ifndef _HAVE_UINT64_T
844 /* .. here are some common heuristics using compiler runtime specifics */
845 #if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
846 #define _HAVE_UINT64_T
847 #define _HAVE_LONGLONG_UINT64_T
848 typedef long long int64_t;
849 typedef unsigned long long uint64_t;
850
851 #elif !defined __STRICT_ANSI__
852 #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
853 #define _HAVE_UINT64_T
854 typedef __int64 int64_t;
855 typedef unsigned __int64 uint64_t;
856
857 #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
858 /* note: all ELF-systems seem to have loff-support which needs 64-bit */
859 #if !defined _NO_LONGLONG
860 #define _HAVE_UINT64_T
861 #define _HAVE_LONGLONG_UINT64_T
862 typedef long long int64_t;
863 typedef unsigned long long uint64_t;
864 #endif
865
866 #elif defined __alpha || (defined __mips && defined _ABIN32)
867 #if !defined _NO_LONGLONG
868 #define _HAVE_UINT64_T
869 typedef long int64_t;
870 typedef unsigned long uint64_t;
871 #endif
872   /* compiler/cpu type to define int64_t */
873 #endif
874 #endif
875 #endif
876
877 #if defined _STDINT_HAVE_U_INT_TYPES
878 /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
879 typedef u_int8_t uint8_t;
880 typedef u_int16_t uint16_t;
881 typedef u_int32_t uint32_t;
882
883 /* glibc compatibility */
884 #ifndef __int8_t_defined
885 #define __int8_t_defined
886 #endif
887 #endif
888
889 #ifdef _STDINT_NEED_INT_MODEL_T
890 /* we must guess all the basic types. Apart from byte-adressable system, */
891 /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
892 /* (btw, those nibble-addressable systems are way off, or so we assume) */
893
894 dnl   /* have a look at "64bit and data size neutrality" at */
895 dnl   /* http://unix.org/version2/whatsnew/login_64bit.html */
896 dnl   /* (the shorthand "ILP" types always have a "P" part) */
897
898 #if defined _STDINT_BYTE_MODEL
899 #if _STDINT_LONG_MODEL+0 == 242
900 /* 2:4:2 =  IP16 = a normal 16-bit system                */
901 typedef unsigned char   uint8_t;
902 typedef unsigned short  uint16_t;
903 typedef unsigned long   uint32_t;
904 #ifndef __int8_t_defined
905 #define __int8_t_defined
906 typedef          char    int8_t;
907 typedef          short   int16_t;
908 typedef          long    int32_t;
909 #endif
910 #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
911 /* 2:4:4 =  LP32 = a 32-bit system derived from a 16-bit */
912 /* 4:4:4 = ILP32 = a normal 32-bit system                */
913 typedef unsigned char   uint8_t;
914 typedef unsigned short  uint16_t;
915 typedef unsigned int    uint32_t;
916 #ifndef __int8_t_defined
917 #define __int8_t_defined
918 typedef          char    int8_t;
919 typedef          short   int16_t;
920 typedef          int     int32_t;
921 #endif
922 #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
923 /* 4:8:4 =  IP32 = a 32-bit system prepared for 64-bit    */
924 /* 4:8:8 =  LP64 = a normal 64-bit system                 */
925 typedef unsigned char   uint8_t;
926 typedef unsigned short  uint16_t;
927 typedef unsigned int    uint32_t;
928 #ifndef __int8_t_defined
929 #define __int8_t_defined
930 typedef          char    int8_t;
931 typedef          short   int16_t;
932 typedef          int     int32_t;
933 #endif
934 /* this system has a "long" of 64bit */
935 #ifndef _HAVE_UINT64_T
936 #define _HAVE_UINT64_T
937 typedef unsigned long   uint64_t;
938 typedef          long    int64_t;
939 #endif
940 #elif _STDINT_LONG_MODEL+0 == 448
941 /*      LLP64   a 64-bit system derived from a 32-bit system */
942 typedef unsigned char   uint8_t;
943 typedef unsigned short  uint16_t;
944 typedef unsigned int    uint32_t;
945 #ifndef __int8_t_defined
946 #define __int8_t_defined
947 typedef          char    int8_t;
948 typedef          short   int16_t;
949 typedef          int     int32_t;
950 #endif
951 /* assuming the system has a "long long" */
952 #ifndef _HAVE_UINT64_T
953 #define _HAVE_UINT64_T
954 #define _HAVE_LONGLONG_UINT64_T
955 typedef unsigned long long uint64_t;
956 typedef          long long  int64_t;
957 #endif
958 #else
959 #define _STDINT_NO_INT32_T
960 #endif
961 #else
962 #define _STDINT_NO_INT8_T
963 #define _STDINT_NO_INT32_T
964 #endif
965 #endif
966
967 /*
968  * quote from SunOS-5.8 sys/inttypes.h:
969  * Use at your own risk.  As of February 1996, the committee is squarely
970  * behind the fixed sized types; the "least" and "fast" types are still being
971  * discussed.  The probability that the "fast" types may be removed before
972  * the standard is finalized is high enough that they are not currently
973  * implemented.
974  */
975
976 #if defined _STDINT_NEED_INT_LEAST_T
977 typedef  int8_t    int_least8_t;
978 typedef  int16_t   int_least16_t;
979 typedef  int32_t   int_least32_t;
980 #ifdef _HAVE_UINT64_T
981 typedef  int64_t   int_least64_t;
982 #endif
983
984 typedef uint8_t   uint_least8_t;
985 typedef uint16_t  uint_least16_t;
986 typedef uint32_t  uint_least32_t;
987 #ifdef _HAVE_UINT64_T
988 typedef uint64_t  uint_least64_t;
989 #endif
990   /* least types */
991 #endif
992
993 #if defined _STDINT_NEED_INT_FAST_T
994 typedef  int8_t    int_fast8_t; 
995 typedef  int       int_fast16_t;
996 typedef  int32_t   int_fast32_t;
997 #ifdef _HAVE_UINT64_T
998 typedef  int64_t   int_fast64_t;
999 #endif
1000
1001 typedef uint8_t   uint_fast8_t; 
1002 typedef unsigned  uint_fast16_t;
1003 typedef uint32_t  uint_fast32_t;
1004 #ifdef _HAVE_UINT64_T
1005 typedef uint64_t  uint_fast64_t;
1006 #endif
1007   /* fast types */
1008 #endif
1009
1010 #ifdef _STDINT_NEED_INTMAX_T
1011 #ifdef _HAVE_UINT64_T
1012 typedef  int64_t       intmax_t;
1013 typedef uint64_t      uintmax_t;
1014 #else
1015 typedef          long  intmax_t;
1016 typedef unsigned long uintmax_t;
1017 #endif
1018 #endif
1019
1020 #ifdef _STDINT_NEED_INTPTR_T
1021 #ifndef __intptr_t_defined
1022 #define __intptr_t_defined
1023 /* we encourage using "long" to store pointer values, never use "int" ! */
1024 #if   _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
1025 typedef  unsinged int   uintptr_t;
1026 typedef           int    intptr_t;
1027 #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
1028 typedef  unsigned long  uintptr_t;
1029 typedef           long   intptr_t;
1030 #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
1031 typedef        uint64_t uintptr_t;
1032 typedef         int64_t  intptr_t;
1033 #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
1034 typedef  unsigned long  uintptr_t;
1035 typedef           long   intptr_t;
1036 #endif
1037 #endif
1038 #endif
1039
1040 /* The ISO C99 standard specifies that in C++ implementations these
1041    should only be defined if explicitly requested.  */
1042 #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
1043 #ifndef UINT32_C
1044
1045 /* Signed.  */
1046 # define INT8_C(c)      c
1047 # define INT16_C(c)     c
1048 # define INT32_C(c)     c
1049 # ifdef _HAVE_LONGLONG_UINT64_T
1050 #  define INT64_C(c)    c ## L
1051 # else
1052 #  define INT64_C(c)    c ## LL
1053 # endif
1054
1055 /* Unsigned.  */
1056 # define UINT8_C(c)     c ## U
1057 # define UINT16_C(c)    c ## U
1058 # define UINT32_C(c)    c ## U
1059 # ifdef _HAVE_LONGLONG_UINT64_T
1060 #  define UINT64_C(c)   c ## UL
1061 # else
1062 #  define UINT64_C(c)   c ## ULL
1063 # endif
1064
1065 /* Maximal type.  */
1066 # ifdef _HAVE_LONGLONG_UINT64_T
1067 #  define INTMAX_C(c)   c ## L
1068 #  define UINTMAX_C(c)  c ## UL
1069 # else
1070 #  define INTMAX_C(c)   c ## LL
1071 #  define UINTMAX_C(c)  c ## ULL
1072 # endif
1073
1074   /* literalnumbers */
1075 #endif
1076 #endif
1077
1078 /* These limits are merily those of a two complement byte-oriented system */
1079
1080 /* Minimum of signed integral types.  */
1081 # define INT8_MIN               (-128)
1082 # define INT16_MIN              (-32767-1)
1083 # define INT32_MIN              (-2147483647-1)
1084 # define INT64_MIN              (-__INT64_C(9223372036854775807)-1)
1085 /* Maximum of signed integral types.  */
1086 # define INT8_MAX               (127)
1087 # define INT16_MAX              (32767)
1088 # define INT32_MAX              (2147483647)
1089 # define INT64_MAX              (__INT64_C(9223372036854775807))
1090
1091 /* Maximum of unsigned integral types.  */
1092 # define UINT8_MAX              (255)
1093 # define UINT16_MAX             (65535)
1094 # define UINT32_MAX             (4294967295U)
1095 # define UINT64_MAX             (__UINT64_C(18446744073709551615))
1096
1097 /* Minimum of signed integral types having a minimum size.  */
1098 # define INT_LEAST8_MIN         INT8_MIN
1099 # define INT_LEAST16_MIN        INT16_MIN
1100 # define INT_LEAST32_MIN        INT32_MIN
1101 # define INT_LEAST64_MIN        INT64_MIN
1102 /* Maximum of signed integral types having a minimum size.  */
1103 # define INT_LEAST8_MAX         INT8_MAX
1104 # define INT_LEAST16_MAX        INT16_MAX
1105 # define INT_LEAST32_MAX        INT32_MAX
1106 # define INT_LEAST64_MAX        INT64_MAX
1107
1108 /* Maximum of unsigned integral types having a minimum size.  */
1109 # define UINT_LEAST8_MAX        UINT8_MAX
1110 # define UINT_LEAST16_MAX       UINT16_MAX
1111 # define UINT_LEAST32_MAX       UINT32_MAX
1112 # define UINT_LEAST64_MAX       UINT64_MAX
1113
1114   /* shortcircuit*/
1115 #endif
1116   /* once */
1117 #endif
1118 #endif
1119 STDINT_EOF
1120 fi
1121     if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
1122       AC_MSG_NOTICE([$ac_stdint_h is unchanged])
1123     else
1124       ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
1125       AS_MKDIR_P(["$ac_dir"])
1126       rm -f $ac_stdint_h
1127       mv $ac_stdint $ac_stdint_h
1128     fi
1129 ],[# variables for create stdint.h replacement
1130 PACKAGE="$PACKAGE"
1131 VERSION="$VERSION"
1132 ac_stdint_h="$ac_stdint_h"
1133 _ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
1134 ac_cv_stdint_message="$ac_cv_stdint_message"
1135 ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
1136 ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
1137 ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
1138 ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
1139 ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
1140 ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
1141 ac_cv_char_data_model="$ac_cv_char_data_model"
1142 ac_cv_long_data_model="$ac_cv_long_data_model"
1143 ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
1144 ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
1145 ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
1146 ])
1147 ])