| 1 | # backupfile.m4 serial 1 | 
|---|
| 2 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 3 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 4 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 5 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 6 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 7 | dnl the same distribution terms as the rest of that program. | 
|---|
| 8 |  | 
|---|
| 9 | AC_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 |  | 
|---|
| 26 | dnl From Jim Meyering. | 
|---|
| 27 | dnl | 
|---|
| 28 | dnl Check whether struct dirent has a member named d_ino. | 
|---|
| 29 | dnl | 
|---|
| 30 |  | 
|---|
| 31 | AC_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 | 
|---|
| 67 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 68 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 69 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 70 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 71 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 72 | dnl the same distribution terms as the rest of that program. | 
|---|
| 73 |  | 
|---|
| 74 | AC_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 |  | 
|---|
| 98 | AC_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__ | 
|---|
| 104 | neither 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 |  | 
|---|
| 146 | AC_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. | 
|---|
| 154 | AC_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 | 
|---|
| 163 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 164 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 165 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 166 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 167 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 168 | dnl the same distribution terms as the rest of that program. | 
|---|
| 169 |  | 
|---|
| 170 | AC_DEFUN([gl_GETOPT], | 
|---|
| 171 | [ | 
|---|
| 172 | dnl Prerequisites of lib/getopt.c. | 
|---|
| 173 | AC_CHECK_HEADERS_ONCE(string.h) | 
|---|
| 174 | ]) | 
|---|
| 175 | # malloc.m4 serial 7 | 
|---|
| 176 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 177 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 178 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 179 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 180 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 181 | dnl the same distribution terms as the rest of that program. | 
|---|
| 182 |  | 
|---|
| 183 | dnl From Jim Meyering. | 
|---|
| 184 | dnl Determine whether malloc accepts 0 as its argument. | 
|---|
| 185 | dnl If it doesn't, arrange to use the replacement function. | 
|---|
| 186 |  | 
|---|
| 187 | AC_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. | 
|---|
| 197 | AC_DEFUN([gl_PREREQ_MALLOC], [ | 
|---|
| 198 | : | 
|---|
| 199 | ]) | 
|---|
| 200 | # mbrtowc.m4 serial 5 | 
|---|
| 201 | dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. | 
|---|
| 202 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 203 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 204 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 205 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 206 | dnl the same distribution terms as the rest of that program. | 
|---|
| 207 |  | 
|---|
| 208 | dnl From Paul Eggert | 
|---|
| 209 |  | 
|---|
| 210 | dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with | 
|---|
| 211 | dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere. | 
|---|
| 212 |  | 
|---|
| 213 | AC_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 | 
|---|
| 228 | dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. | 
|---|
| 229 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 230 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 231 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 232 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 233 | dnl 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 | # ----------------- | 
|---|
| 243 | AC_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 | 
|---|
| 260 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 261 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 262 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 263 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 264 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 265 | dnl the same distribution terms as the rest of that program. | 
|---|
| 266 |  | 
|---|
| 267 | AC_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. | 
|---|
| 276 | AC_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 |  | 
|---|
| 282 | dnl From Mumit Khan and Paul Eggert | 
|---|
| 283 | dnl Determine whether mkdir accepts only one argument instead of the usual two. | 
|---|
| 284 |  | 
|---|
| 285 | AC_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 | 
|---|
| 315 | dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc. | 
|---|
| 316 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 317 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 318 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 319 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 320 | dnl the same distribution terms as the rest of that program. | 
|---|
| 321 |  | 
|---|
| 322 | dnl This file defines some "once only" variants of standard autoconf macros. | 
|---|
| 323 | dnl   AC_CHECK_HEADERS_ONCE         like  AC_CHECK_HEADERS | 
|---|
| 324 | dnl   AC_CHECK_FUNCS_ONCE           like  AC_CHECK_FUNCS | 
|---|
| 325 | dnl   AC_CHECK_DECLS_ONCE           like  AC_CHECK_DECLS | 
|---|
| 326 | dnl   AC_REQUIRE([AC_HEADER_STDC])  like  AC_HEADER_STDC | 
|---|
| 327 | dnl The advantage is that the check for each of the headers/functions/decls | 
|---|
| 328 | dnl will be put only once into the 'configure' file. It keeps the size of | 
|---|
| 329 | dnl the 'configure' file down, and avoids redundant output when 'configure' | 
|---|
| 330 | dnl is run. | 
|---|
| 331 | dnl The drawback is that the checks cannot be conditionalized. If you write | 
|---|
| 332 | dnl   if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi | 
|---|
| 333 | dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to | 
|---|
| 334 | dnl empty, and the check will be inserted before the body of the AC_DEFUNed | 
|---|
| 335 | dnl function. | 
|---|
| 336 |  | 
|---|
| 337 | dnl Autoconf version 2.57 or newer is recommended. | 
|---|
| 338 | AC_PREREQ(2.54) | 
|---|
| 339 |  | 
|---|
| 340 | # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of | 
|---|
| 341 | # AC_CHECK_HEADERS(HEADER1 HEADER2 ...). | 
|---|
| 342 | AC_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 ...). | 
|---|
| 356 | AC_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, ...). | 
|---|
| 368 | AC_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 | 
|---|
| 378 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 379 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 380 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 381 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 382 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 383 | dnl the same distribution terms as the rest of that program. | 
|---|
| 384 |  | 
|---|
| 385 | AC_DEFUN([gl_QUOTE], | 
|---|
| 386 | [ | 
|---|
| 387 | dnl Prerequisites of lib/quote.c. | 
|---|
| 388 | AC_CHECK_HEADERS_ONCE(stddef.h) | 
|---|
| 389 | ]) | 
|---|
| 390 | # quotearg.m4 serial 1 | 
|---|
| 391 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 392 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 393 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 394 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 395 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 396 | dnl the same distribution terms as the rest of that program. | 
|---|
| 397 |  | 
|---|
| 398 | AC_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 | 
|---|
| 407 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 408 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 409 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 410 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 411 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 412 | dnl the same distribution terms as the rest of that program. | 
|---|
| 413 |  | 
|---|
| 414 | dnl From Jim Meyering. | 
|---|
| 415 | dnl Determine whether realloc works when both arguments are 0. | 
|---|
| 416 | dnl If it doesn't, arrange to use the replacement function. | 
|---|
| 417 |  | 
|---|
| 418 | AC_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. | 
|---|
| 428 | AC_DEFUN([gl_PREREQ_REALLOC], [ | 
|---|
| 429 | : | 
|---|
| 430 | ]) | 
|---|
| 431 | # rmdir.m4 serial 1 | 
|---|
| 432 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 433 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 434 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 435 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 436 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 437 | dnl the same distribution terms as the rest of that program. | 
|---|
| 438 |  | 
|---|
| 439 | AC_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. | 
|---|
| 448 | AC_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 |  | 
|---|
| 472 | AC_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 |  | 
|---|
| 512 | AC_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 |  | 
|---|
| 536 | AC_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 |  | 
|---|
| 582 | dnl From Jim Meyering. | 
|---|
| 583 | dnl | 
|---|
| 584 | dnl See if the glibc *_unlocked I/O macros or functions are available. | 
|---|
| 585 | dnl Use only those *_unlocked macros or functions that are declared | 
|---|
| 586 | dnl (because some of them were declared in Solaris 2.5.1 but were removed | 
|---|
| 587 | dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run | 
|---|
| 588 | dnl on Solaris 2.6). | 
|---|
| 589 |  | 
|---|
| 590 | AC_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 |  | 
|---|
| 604 | dnl From Jim Meyering | 
|---|
| 605 |  | 
|---|
| 606 | dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared -- | 
|---|
| 607 | dnl usually in <utime.h>. | 
|---|
| 608 | dnl Some systems have utime.h but don't declare the struct anywhere. | 
|---|
| 609 |  | 
|---|
| 610 | AC_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 | 
|---|
| 643 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | 
|---|
| 644 | dnl This file is free software, distributed under the terms of the GNU | 
|---|
| 645 | dnl General Public License.  As a special exception to the GNU General | 
|---|
| 646 | dnl Public License, this file may be distributed as part of a program | 
|---|
| 647 | dnl that contains a configuration script generated by Autoconf, under | 
|---|
| 648 | dnl the same distribution terms as the rest of that program. | 
|---|
| 649 |  | 
|---|
| 650 | AC_DEFUN([gl_XALLOC], | 
|---|
| 651 | [ | 
|---|
| 652 | gl_PREREQ_XMALLOC | 
|---|
| 653 | gl_PREREQ_XSTRDUP | 
|---|
| 654 | ]) | 
|---|
| 655 |  | 
|---|
| 656 | # Prerequisites of lib/xmalloc.c. | 
|---|
| 657 | AC_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. | 
|---|
| 664 | AC_DEFUN([gl_PREREQ_XSTRDUP], [ | 
|---|
| 665 | AC_REQUIRE([AC_HEADER_STDC]) | 
|---|
| 666 | AC_CHECK_HEADERS_ONCE(string.h) | 
|---|
| 667 | ]) | 
|---|