source: vendor/patch/current/aclocal.m4

Last change on this file was 3444, checked in by bird, 18 years ago

patch 2.5.9

File size: 20.9 KB
Line 
1# backupfile.m4 serial 1
2dnl Copyright (C) 2002 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License. As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8
9AC_DEFUN([gl_BACKUPFILE],
10[
11 dnl Prerequisites of lib/backupfile.c.
12 AC_REQUIRE([AC_HEADER_DIRENT])
13 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
14 AC_CHECK_HEADERS_ONCE(limits.h stdlib.h string.h)
15 AC_CHECK_DECLS_ONCE(getenv malloc)
16 jm_CHECK_TYPE_STRUCT_DIRENT_D_INO
17
18 dnl Prerequisites of lib/addext.c.
19 AC_REQUIRE([jm_AC_DOS])
20 AC_SYS_LONG_FILE_NAMES
21 AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h)
22 AC_CHECK_FUNCS(pathconf)
23])
24#serial 5
25
26dnl From Jim Meyering.
27dnl
28dnl Check whether struct dirent has a member named d_ino.
29dnl
30
31AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
32 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
33 AC_CACHE_CHECK([for d_ino member in directory struct],
34 jm_cv_struct_dirent_d_ino,
35 [AC_TRY_LINK(dnl
36 [
37#include <sys/types.h>
38#ifdef HAVE_DIRENT_H
39# include <dirent.h>
40#else /* not HAVE_DIRENT_H */
41# define dirent direct
42# ifdef HAVE_SYS_NDIR_H
43# include <sys/ndir.h>
44# endif /* HAVE_SYS_NDIR_H */
45# ifdef HAVE_SYS_DIR_H
46# include <sys/dir.h>
47# endif /* HAVE_SYS_DIR_H */
48# ifdef HAVE_NDIR_H
49# include <ndir.h>
50# endif /* HAVE_NDIR_H */
51#endif /* HAVE_DIRENT_H */
52 ],
53 [struct dirent dp; dp.d_ino = 0;],
54
55 jm_cv_struct_dirent_d_ino=yes,
56 jm_cv_struct_dirent_d_ino=no)
57 ]
58 )
59 if test $jm_cv_struct_dirent_d_ino = yes; then
60 AC_DEFINE(D_INO_IN_DIRENT, 1,
61 [Define if there is a member named d_ino in the struct describing
62 directory headers.])
63 fi
64 ]
65)
66# dirname.m4 serial 1
67dnl Copyright (C) 2002 Free Software Foundation, Inc.
68dnl This file is free software, distributed under the terms of the GNU
69dnl General Public License. As a special exception to the GNU General
70dnl Public License, this file may be distributed as part of a program
71dnl that contains a configuration script generated by Autoconf, under
72dnl the same distribution terms as the rest of that program.
73
74AC_DEFUN([gl_DIRNAME],
75[
76 dnl Prerequisites of lib/dirname.h.
77 AC_REQUIRE([jm_AC_DOS])
78
79 dnl Prerequisites of lib/dirname.c.
80 AC_REQUIRE([AC_HEADER_STDC])
81 AC_CHECK_HEADERS_ONCE(string.h)
82
83 dnl Prerequisites of lib/basename.c.
84 AC_REQUIRE([AC_HEADER_STDC])
85 AC_CHECK_HEADERS_ONCE(string.h)
86
87 dnl Prerequisites of lib/stripslash.c.
88 AC_REQUIRE([AC_HEADER_STDC])
89 AC_CHECK_HEADERS_ONCE(string.h)
90])
91#serial 5
92
93# Define some macros required for proper operation of code in lib/*.c
94# on MSDOS/Windows systems.
95
96# From Jim Meyering.
97
98AC_DEFUN([jm_AC_DOS],
99 [
100 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
101 [
102 AC_TRY_COMPILE([],
103 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
104neither MSDOS nor Windows
105#endif],
106 [ac_cv_win_or_dos=yes],
107 [ac_cv_win_or_dos=no])
108 ])
109
110 if test x"$ac_cv_win_or_dos" = xyes; then
111 ac_fs_accepts_drive_letter_prefix=1
112 ac_fs_backslash_is_file_name_separator=1
113 else
114 ac_fs_accepts_drive_letter_prefix=0
115 ac_fs_backslash_is_file_name_separator=0
116 fi
117
118 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
119 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
120# define FILESYSTEM_PREFIX_LEN(Filename) \
121 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
122#else
123# define FILESYSTEM_PREFIX_LEN(Filename) 0
124#endif])
125
126 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
127 $ac_fs_accepts_drive_letter_prefix,
128 [Define on systems for which file names may have a so-called
129 `drive letter' prefix, define this to compute the length of that
130 prefix, including the colon.])
131
132 AH_VERBATIM(ISSLASH,
133 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
134# define ISSLASH(C) ((C) == '/' || (C) == '\\')
135#else
136# define ISSLASH(C) ((C) == '/')
137#endif])
138
139 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
140 $ac_fs_backslash_is_file_name_separator,
141 [Define if the backslash character may also serve as a file name
142 component separator.])
143 ])
144#serial 7
145
146AC_DEFUN([gl_ERROR],
147[
148 AC_FUNC_ERROR_AT_LINE
149 dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
150 jm_PREREQ_ERROR
151])
152
153# Prerequisites of lib/error.c.
154AC_DEFUN([jm_PREREQ_ERROR],
155[
156 AC_REQUIRE([AC_HEADER_STDC])
157 AC_REQUIRE([AC_FUNC_VPRINTF])
158 AC_CHECK_FUNCS(strerror)
159 AC_CHECK_DECLS([strerror])
160 AC_FUNC_STRERROR_R
161])
162# getopt.m4 serial 1
163dnl Copyright (C) 2002 Free Software Foundation, Inc.
164dnl This file is free software, distributed under the terms of the GNU
165dnl General Public License. As a special exception to the GNU General
166dnl Public License, this file may be distributed as part of a program
167dnl that contains a configuration script generated by Autoconf, under
168dnl the same distribution terms as the rest of that program.
169
170AC_DEFUN([gl_GETOPT],
171[
172 dnl Prerequisites of lib/getopt.c.
173 AC_CHECK_HEADERS_ONCE(string.h)
174])
175# malloc.m4 serial 7
176dnl Copyright (C) 2002 Free Software Foundation, Inc.
177dnl This file is free software, distributed under the terms of the GNU
178dnl General Public License. As a special exception to the GNU General
179dnl Public License, this file may be distributed as part of a program
180dnl that contains a configuration script generated by Autoconf, under
181dnl the same distribution terms as the rest of that program.
182
183dnl From Jim Meyering.
184dnl Determine whether malloc accepts 0 as its argument.
185dnl If it doesn't, arrange to use the replacement function.
186
187AC_DEFUN([jm_FUNC_MALLOC],
188[
189 AC_REQUIRE([AC_FUNC_MALLOC])
190 dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works.
191 if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then
192 gl_PREREQ_MALLOC
193 fi
194])
195
196# Prerequisites of lib/malloc.c.
197AC_DEFUN([gl_PREREQ_MALLOC], [
198 :
199])
200# mbrtowc.m4 serial 5
201dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
202dnl This file is free software, distributed under the terms of the GNU
203dnl General Public License. As a special exception to the GNU General
204dnl Public License, this file may be distributed as part of a program
205dnl that contains a configuration script generated by Autoconf, under
206dnl the same distribution terms as the rest of that program.
207
208dnl From Paul Eggert
209
210dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
211dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
212
213AC_DEFUN([jm_FUNC_MBRTOWC],
214[
215 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
216 jm_cv_func_mbrtowc,
217 [AC_TRY_LINK(
218 [#include <wchar.h>],
219 [mbstate_t state; return ! (sizeof state && mbrtowc);],
220 jm_cv_func_mbrtowc=yes,
221 jm_cv_func_mbrtowc=no)])
222 if test $jm_cv_func_mbrtowc = yes; then
223 AC_DEFINE(HAVE_MBRTOWC, 1,
224 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
225 fi
226])
227# mbstate_t.m4 serial 9
228dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
229dnl This file is free software, distributed under the terms of the GNU
230dnl General Public License. As a special exception to the GNU General
231dnl Public License, this file may be distributed as part of a program
232dnl that contains a configuration script generated by Autoconf, under
233dnl the same distribution terms as the rest of that program.
234
235# From Paul Eggert.
236
237# BeOS 5 has <wchar.h> but does not define mbstate_t,
238# so you can't declare an object of that type.
239# Check for this incompatibility with Standard C.
240
241# AC_TYPE_MBSTATE_T
242# -----------------
243AC_DEFUN([AC_TYPE_MBSTATE_T],
244 [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
245 [AC_COMPILE_IFELSE(
246 [AC_LANG_PROGRAM(
247 [AC_INCLUDES_DEFAULT
248# include <wchar.h>],
249 [mbstate_t x; return sizeof x;])],
250 [ac_cv_type_mbstate_t=yes],
251 [ac_cv_type_mbstate_t=no])])
252 if test $ac_cv_type_mbstate_t = yes; then
253 AC_DEFINE([HAVE_MBSTATE_T], 1,
254 [Define to 1 if <wchar.h> declares mbstate_t.])
255 else
256 AC_DEFINE([mbstate_t], int,
257 [Define to a type if <wchar.h> does not define.])
258 fi])
259# memchr.m4 serial 1
260dnl Copyright (C) 2002 Free Software Foundation, Inc.
261dnl This file is free software, distributed under the terms of the GNU
262dnl General Public License. As a special exception to the GNU General
263dnl Public License, this file may be distributed as part of a program
264dnl that contains a configuration script generated by Autoconf, under
265dnl the same distribution terms as the rest of that program.
266
267AC_DEFUN([gl_FUNC_MEMCHR],
268[
269 AC_REPLACE_FUNCS(memchr)
270 if test $ac_cv_func_memchr = no; then
271 jm_PREREQ_MEMCHR
272 fi
273])
274
275# Prerequisites of lib/memchr.c.
276AC_DEFUN([jm_PREREQ_MEMCHR], [
277 AC_CHECK_HEADERS_ONCE(limits.h stdlib.h)
278 AC_CHECK_HEADERS(bp-sym.h)
279])
280#serial 1
281
282dnl From Mumit Khan and Paul Eggert
283dnl Determine whether mkdir accepts only one argument instead of the usual two.
284
285AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG],
286 [AC_CHECK_FUNCS(mkdir)
287 AC_CACHE_CHECK([whether mkdir takes only one argument],
288 patch_cv_mkdir_takes_one_arg,
289 [patch_cv_mkdir_takes_one_arg=no
290 if test $ac_cv_func_mkdir = yes; then
291 AC_TRY_COMPILE([
292#include <sys/types.h>
293#include <sys/stat.h>
294 ],
295 [mkdir (".", 0);],
296 ,
297 [AC_TRY_COMPILE([
298#include <sys/types.h>
299#include <sys/stat.h>
300 ],
301 [mkdir (".");],
302 patch_cv_mkdir_takes_one_arg=yes
303 )]
304 )
305 fi
306 ]
307 )
308 if test $patch_cv_mkdir_takes_one_arg = yes; then
309 AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
310 [Define if mkdir takes only one argument.])
311 fi
312 ]
313)
314# onceonly.m4 serial 3
315dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
316dnl This file is free software, distributed under the terms of the GNU
317dnl General Public License. As a special exception to the GNU General
318dnl Public License, this file may be distributed as part of a program
319dnl that contains a configuration script generated by Autoconf, under
320dnl the same distribution terms as the rest of that program.
321
322dnl This file defines some "once only" variants of standard autoconf macros.
323dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
324dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
325dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
326dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
327dnl The advantage is that the check for each of the headers/functions/decls
328dnl will be put only once into the 'configure' file. It keeps the size of
329dnl the 'configure' file down, and avoids redundant output when 'configure'
330dnl is run.
331dnl The drawback is that the checks cannot be conditionalized. If you write
332dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
333dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
334dnl empty, and the check will be inserted before the body of the AC_DEFUNed
335dnl function.
336
337dnl Autoconf version 2.57 or newer is recommended.
338AC_PREREQ(2.54)
339
340# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
341# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
342AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
343 :
344 AC_FOREACH([gl_HEADER_NAME], [$1], [
345 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]),
346 [-./], [___])), [
347 AC_CHECK_HEADERS(gl_HEADER_NAME)
348 ])
349 AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
350 [-./], [___])))
351 ])
352])
353
354# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
355# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
356AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
357 :
358 AC_FOREACH([gl_FUNC_NAME], [$1], [
359 AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
360 AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME]))
361 ])
362 AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
363 ])
364])
365
366# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
367# AC_CHECK_DECLS(DECL1, DECL2, ...).
368AC_DEFUN([AC_CHECK_DECLS_ONCE], [
369 :
370 AC_FOREACH([gl_DECL_NAME], [$1], [
371 AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
372 AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
373 ])
374 AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
375 ])
376])
377# quote.m4 serial 1
378dnl Copyright (C) 2002 Free Software Foundation, Inc.
379dnl This file is free software, distributed under the terms of the GNU
380dnl General Public License. As a special exception to the GNU General
381dnl Public License, this file may be distributed as part of a program
382dnl that contains a configuration script generated by Autoconf, under
383dnl the same distribution terms as the rest of that program.
384
385AC_DEFUN([gl_QUOTE],
386[
387 dnl Prerequisites of lib/quote.c.
388 AC_CHECK_HEADERS_ONCE(stddef.h)
389])
390# quotearg.m4 serial 1
391dnl Copyright (C) 2002 Free Software Foundation, Inc.
392dnl This file is free software, distributed under the terms of the GNU
393dnl General Public License. As a special exception to the GNU General
394dnl Public License, this file may be distributed as part of a program
395dnl that contains a configuration script generated by Autoconf, under
396dnl the same distribution terms as the rest of that program.
397
398AC_DEFUN([gl_QUOTEARG],
399[
400 dnl Prerequisites of lib/quotearg.c.
401 AC_CHECK_HEADERS_ONCE(wchar.h wctype.h)
402 AC_CHECK_FUNCS_ONCE(iswprint mbsinit)
403 AC_TYPE_MBSTATE_T
404 jm_FUNC_MBRTOWC
405])
406# realloc.m4 serial 7
407dnl Copyright (C) 2002 Free Software Foundation, Inc.
408dnl This file is free software, distributed under the terms of the GNU
409dnl General Public License. As a special exception to the GNU General
410dnl Public License, this file may be distributed as part of a program
411dnl that contains a configuration script generated by Autoconf, under
412dnl the same distribution terms as the rest of that program.
413
414dnl From Jim Meyering.
415dnl Determine whether realloc works when both arguments are 0.
416dnl If it doesn't, arrange to use the replacement function.
417
418AC_DEFUN([jm_FUNC_REALLOC],
419[
420 AC_REQUIRE([AC_FUNC_REALLOC])
421 dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
422 if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then
423 gl_PREREQ_REALLOC
424 fi
425])
426
427# Prerequisites of lib/realloc.c.
428AC_DEFUN([gl_PREREQ_REALLOC], [
429 :
430])
431# rmdir.m4 serial 1
432dnl Copyright (C) 2002 Free Software Foundation, Inc.
433dnl This file is free software, distributed under the terms of the GNU
434dnl General Public License. As a special exception to the GNU General
435dnl Public License, this file may be distributed as part of a program
436dnl that contains a configuration script generated by Autoconf, under
437dnl the same distribution terms as the rest of that program.
438
439AC_DEFUN([gl_FUNC_RMDIR],
440[
441 AC_REPLACE_FUNCS(rmdir)
442 if test $ac_cv_func_rmdir = no; then
443 gl_PREREQ_RMDIR
444 fi
445])
446
447# Prerequisites of lib/rmdir.c.
448AC_DEFUN([gl_PREREQ_RMDIR], [
449 AC_REQUIRE([AC_HEADER_STAT])
450 :
451])
452
453# Check for setmode, DOS style.
454
455# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
456
457# This program is free software; you can redistribute it and/or modify
458# it under the terms of the GNU General Public License as published by
459# the Free Software Foundation; either version 2, or (at your option)
460# any later version.
461
462# This program is distributed in the hope that it will be useful,
463# but WITHOUT ANY WARRANTY; without even the implied warranty of
464# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
465# GNU General Public License for more details.
466
467# You should have received a copy of the GNU General Public License
468# along with this program; if not, write to the Free Software
469# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
470# 02111-1307, USA.
471
472AC_DEFUN([AC_FUNC_SETMODE_DOS],
473 [AC_CHECK_HEADERS(fcntl.h unistd.h)
474 AC_CACHE_CHECK([for DOS-style setmode],
475 [ac_cv_func_setmode_dos],
476 [AC_TRY_LINK(
477 [#include <io.h>
478 #if HAVE_FCNTL_H
479 # include <fcntl.h>
480 #endif
481 #if HAVE_UNISTD_H
482 # include <unistd.h>
483 #endif],
484 [int ret = setmode && setmode (1, O_BINARY);],
485 [ac_cv_func_setmode_dos=yes],
486 [ac_cv_func_setmode_dos=no])])
487 if test $ac_cv_func_setmode_dos = yes; then
488 AC_DEFINE(HAVE_SETMODE_DOS, 1,
489 [Define to 1 if you have the DOS-style `setmode' function.])
490 fi])
491# Check for stdbool.h that conforms to C99.
492
493# Copyright (C) 2002-2003 Free Software Foundation, Inc.
494
495# This program is free software; you can redistribute it and/or modify
496# it under the terms of the GNU General Public License as published by
497# the Free Software Foundation; either version 2, or (at your option)
498# any later version.
499
500# This program is distributed in the hope that it will be useful,
501# but WITHOUT ANY WARRANTY; without even the implied warranty of
502# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
503# GNU General Public License for more details.
504
505# You should have received a copy of the GNU General Public License
506# along with this program; if not, write to the Free Software
507# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
508# 02111-1307, USA.
509
510# Prepare for substituting <stdbool.h> if it is not supported.
511
512AC_DEFUN([AM_STDBOOL_H],
513[
514 AC_REQUIRE([AC_HEADER_STDBOOL])
515
516 # Define two additional variables used in the Makefile substitution.
517
518 if test "$ac_cv_header_stdbool_h" = yes; then
519 STDBOOL_H=''
520 else
521 STDBOOL_H='stdbool.h'
522 fi
523 AC_SUBST([STDBOOL_H])
524
525 if test "$ac_cv_type__Bool" = yes; then
526 HAVE__BOOL=1
527 else
528 HAVE__BOOL=0
529 fi
530 AC_SUBST([HAVE__BOOL])
531])
532
533# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf
534# have this macro built-in.
535
536AC_DEFUN([AC_HEADER_STDBOOL],
537 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
538 [ac_cv_header_stdbool_h],
539 [AC_TRY_COMPILE(
540 [
541 #include <stdbool.h>
542 #ifndef bool
543 "error: bool is not defined"
544 #endif
545 #ifndef false
546 "error: false is not defined"
547 #endif
548 #if false
549 "error: false is not 0"
550 #endif
551 #ifndef true
552 "error: false is not defined"
553 #endif
554 #if true != 1
555 "error: true is not 1"
556 #endif
557 #ifndef __bool_true_false_are_defined
558 "error: __bool_true_false_are_defined is not defined"
559 #endif
560
561 struct s { _Bool s: 1; _Bool t; } s;
562
563 char a[true == 1 ? 1 : -1];
564 char b[false == 0 ? 1 : -1];
565 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
566 char d[(bool) -0.5 == true ? 1 : -1];
567 bool e = &s;
568 char f[(_Bool) -0.0 == false ? 1 : -1];
569 char g[true];
570 char h[sizeof (_Bool)];
571 char i[sizeof s.t];
572 ],
573 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
574 [ac_cv_header_stdbool_h=yes],
575 [ac_cv_header_stdbool_h=no])])
576 AC_CHECK_TYPES([_Bool])
577 if test $ac_cv_header_stdbool_h = yes; then
578 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
579 fi])
580#serial 7 -*- autoconf -*-
581
582dnl From Jim Meyering.
583dnl
584dnl See if the glibc *_unlocked I/O macros or functions are available.
585dnl Use only those *_unlocked macros or functions that are declared
586dnl (because some of them were declared in Solaris 2.5.1 but were removed
587dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
588dnl on Solaris 2.6).
589
590AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
591[
592 dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked()
593 dnl etc.
594 AC_REQUIRE([AC_GNU_SOURCE])
595
596 AC_CHECK_DECLS_ONCE(
597 [clearerr_unlocked feof_unlocked ferror_unlocked
598 fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
599 fread_unlocked fwrite_unlocked getc_unlocked
600 getchar_unlocked putc_unlocked putchar_unlocked])
601])
602#serial 5
603
604dnl From Jim Meyering
605
606dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
607dnl usually in <utime.h>.
608dnl Some systems have utime.h but don't declare the struct anywhere.
609
610AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
611[
612 AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
613 AC_REQUIRE([AC_HEADER_TIME])
614 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
615 [AC_TRY_COMPILE(
616 [
617#ifdef TIME_WITH_SYS_TIME
618# include <sys/time.h>
619# include <time.h>
620#else
621# ifdef HAVE_SYS_TIME_H
622# include <sys/time.h>
623# else
624# include <time.h>
625# endif
626#endif
627#ifdef HAVE_UTIME_H
628# include <utime.h>
629#endif
630 ],
631 [static struct utimbuf x; x.actime = x.modtime;],
632 fu_cv_sys_struct_utimbuf=yes,
633 fu_cv_sys_struct_utimbuf=no)
634 ])
635
636 if test $fu_cv_sys_struct_utimbuf = yes; then
637 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
638 [Define if struct utimbuf is declared -- usually in <utime.h>.
639 Some systems have utime.h but don't declare the struct anywhere. ])
640 fi
641])
642# xalloc.m4 serial 1
643dnl Copyright (C) 2002 Free Software Foundation, Inc.
644dnl This file is free software, distributed under the terms of the GNU
645dnl General Public License. As a special exception to the GNU General
646dnl Public License, this file may be distributed as part of a program
647dnl that contains a configuration script generated by Autoconf, under
648dnl the same distribution terms as the rest of that program.
649
650AC_DEFUN([gl_XALLOC],
651[
652 gl_PREREQ_XMALLOC
653 gl_PREREQ_XSTRDUP
654])
655
656# Prerequisites of lib/xmalloc.c.
657AC_DEFUN([gl_PREREQ_XMALLOC], [
658 AC_REQUIRE([AC_HEADER_STDC])
659 AC_REQUIRE([jm_FUNC_MALLOC])
660 AC_REQUIRE([jm_FUNC_REALLOC])
661])
662
663# Prerequisites of lib/xstrdup.c.
664AC_DEFUN([gl_PREREQ_XSTRDUP], [
665 AC_REQUIRE([AC_HEADER_STDC])
666 AC_CHECK_HEADERS_ONCE(string.h)
667])
Note: See TracBrowser for help on using the repository browser.