2 dnl Bash specific tests
4 dnl Some derived from PDKSH 5.1.3 autoconf tests
7 AC_DEFUN(BASH_C_LONG_LONG,
8 [AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
9 [if test "$GCC" = yes; then
17 exit(sizeof(long long) < sizeof(long));
19 ], ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
21 if test $ac_cv_c_long_long = yes; then
22 AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.])
27 dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX
28 dnl (< changed to <=) added.
30 AC_DEFUN(BASH_C_LONG_DOUBLE,
31 [AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
32 [if test "$GCC" = yes; then
33 ac_cv_c_long_double=yes
39 /* The Stardent Vistra knows sizeof(long double), but does not
41 long double foo = 0.0;
42 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
43 /* On IRIX 5.3, the compiler converts long double to double with a warning,
44 but compiles this successfully. */
45 exit(sizeof(long double) <= sizeof(double));
47 ], ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
49 if test $ac_cv_c_long_double = yes; then
50 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.])
55 dnl Check for <inttypes.h>. This is separated out so that it can be
58 dnl BASH_HEADER_INTTYPES
59 AC_DEFUN(BASH_HEADER_INTTYPES,
61 AC_CHECK_HEADERS(inttypes.h)
65 dnl check for typedef'd symbols in header files, but allow the caller to
66 dnl specify the include files to be checked in addition to the default
68 dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND])
69 AC_DEFUN(BASH_CHECK_TYPE,
71 AC_REQUIRE([AC_HEADER_STDC])dnl
72 AC_REQUIRE([BASH_HEADER_INTTYPES])
73 AC_MSG_CHECKING(for $1)
74 AC_CACHE_VAL(bash_cv_type_$1,
75 [AC_EGREP_CPP($1, [#include <sys/types.h>
87 ], bash_cv_type_$1=yes, bash_cv_type_$1=no)])
88 AC_MSG_RESULT($bash_cv_type_$1)
89 ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then
92 if test $bash_cv_type_$1 = no; then
93 AC_DEFINE_UNQUOTED($1, $3)
98 dnl BASH_CHECK_DECL(FUNC)
100 dnl Check for a declaration of FUNC in stdlib.h and inttypes.h like
103 AC_DEFUN(BASH_CHECK_DECL,
105 AC_REQUIRE([AC_HEADER_STDC])
106 AC_REQUIRE([BASH_HEADER_INTTYPES])
107 AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1,
114 # include <inttypes.h>
118 bash_cv_decl_$1=yes, bash_cv_decl_$1=no)])
119 bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
120 if test $bash_cv_decl_$1 = yes; then
121 AC_DEFINE_UNQUOTED($bash_tr_func, 1)
123 AC_DEFINE_UNQUOTED($bash_tr_func, 0)
127 AC_DEFUN(BASH_DECL_PRINTF,
128 [AC_MSG_CHECKING(for declaration of printf in <stdio.h>)
129 AC_CACHE_VAL(bash_cv_printf_declared,
133 typedef int (*_bashfunc)(const char *, ...);
135 typedef int (*_bashfunc)();
140 pf = (_bashfunc) printf;
143 ], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
144 [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
145 bash_cv_printf_declared=yes]
147 AC_MSG_RESULT($bash_cv_printf_declared)
148 if test $bash_cv_printf_declared = yes; then
149 AC_DEFINE(PRINTF_DECLARED)
153 AC_DEFUN(BASH_DECL_SBRK,
154 [AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)
155 AC_CACHE_VAL(bash_cv_sbrk_declared,
156 [AC_EGREP_HEADER(sbrk, unistd.h,
157 bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)])
158 AC_MSG_RESULT($bash_cv_sbrk_declared)
159 if test $bash_cv_sbrk_declared = yes; then
160 AC_DEFINE(SBRK_DECLARED)
165 dnl Check for sys_siglist[] or _sys_siglist[]
167 AC_DEFUN(BASH_DECL_UNDER_SYS_SIGLIST,
168 [AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h])
169 AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
171 #include <sys/types.h>
175 #endif], [ char *msg = _sys_siglist[2]; ],
176 bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
177 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
178 AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
179 if test $bash_cv_decl_under_sys_siglist = yes; then
180 AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
184 AC_DEFUN(BASH_UNDER_SYS_SIGLIST,
185 [AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
186 AC_MSG_CHECKING([for _sys_siglist in system C library])
187 AC_CACHE_VAL(bash_cv_under_sys_siglist,
189 #include <sys/types.h>
194 #ifndef UNDER_SYS_SIGLIST_DECLARED
195 extern char *_sys_siglist[];
199 char *msg = (char *)_sys_siglist[2];
202 bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
203 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
204 bash_cv_under_sys_siglist=no])])
205 AC_MSG_RESULT($bash_cv_under_sys_siglist)
206 if test $bash_cv_under_sys_siglist = yes; then
207 AC_DEFINE(HAVE_UNDER_SYS_SIGLIST)
211 AC_DEFUN(BASH_SYS_SIGLIST,
212 [AC_REQUIRE([AC_DECL_SYS_SIGLIST])
213 AC_MSG_CHECKING([for sys_siglist in system C library])
214 AC_CACHE_VAL(bash_cv_sys_siglist,
216 #include <sys/types.h>
221 #if !HAVE_DECL_SYS_SIGLIST
222 extern char *sys_siglist[];
226 char *msg = sys_siglist[2];
229 bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
230 [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
231 bash_cv_sys_siglist=no])])
232 AC_MSG_RESULT($bash_cv_sys_siglist)
233 if test $bash_cv_sys_siglist = yes; then
234 AC_DEFINE(HAVE_SYS_SIGLIST)
238 dnl Check for the various permutations of sys_siglist and make sure we
239 dnl compile in siglist.o if they're not defined
240 AC_DEFUN(BASH_CHECK_SYS_SIGLIST, [
241 AC_REQUIRE([BASH_SYS_SIGLIST])
242 AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
243 AC_REQUIRE([BASH_FUNC_STRSIGNAL])
244 if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then
249 AC_SUBST([SIGLIST_O])
252 dnl Check for sys_errlist[] and sys_nerr, check for declaration
253 AC_DEFUN(BASH_SYS_ERRLIST,
254 [AC_MSG_CHECKING([for sys_errlist and sys_nerr])
255 AC_CACHE_VAL(bash_cv_sys_errlist,
256 [AC_TRY_LINK([#include <errno.h>],
257 [extern char *sys_errlist[];
259 char *msg = sys_errlist[sys_nerr - 1];],
260 bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl
261 AC_MSG_RESULT($bash_cv_sys_errlist)
262 if test $bash_cv_sys_errlist = yes; then
263 AC_DEFINE(HAVE_SYS_ERRLIST)
268 dnl Check if dup2() does not clear the close on exec flag
270 AC_DEFUN(BASH_FUNC_DUP2_CLOEXEC_CHECK,
271 [AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag)
272 AC_CACHE_VAL(bash_cv_dup2_broken,
274 #include <sys/types.h>
279 fd1 = open("/dev/null", 2);
280 if (fcntl(fd1, 2, 1) < 0)
285 fl = fcntl(fd2, 1, 0);
286 /* fl will be 1 if dup2 did not reset the close-on-exec flag. */
289 ], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
290 [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
291 bash_cv_dup2_broken=no])
293 AC_MSG_RESULT($bash_cv_dup2_broken)
294 if test $bash_cv_dup2_broken = yes; then
295 AC_DEFINE(DUP2_BROKEN)
299 AC_DEFUN(BASH_FUNC_STRSIGNAL,
300 [AC_MSG_CHECKING([for the existence of strsignal])
301 AC_CACHE_VAL(bash_cv_have_strsignal,
302 [AC_TRY_LINK([#include <sys/types.h>
303 #include <signal.h>],
304 [char *s = (char *)strsignal(2);],
305 bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
306 AC_MSG_RESULT($bash_cv_have_strsignal)
307 if test $bash_cv_have_strsignal = yes; then
308 AC_DEFINE(HAVE_STRSIGNAL)
312 dnl Check to see if opendir will open non-directories (not a nice thing)
313 AC_DEFUN(BASH_FUNC_OPENDIR_CHECK,
314 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
315 AC_MSG_CHECKING(if opendir() opens non-directories)
316 AC_CACHE_VAL(bash_cv_opendir_not_robust,
319 #include <sys/types.h>
323 #endif /* HAVE_UNISTD_H */
324 #if defined(HAVE_DIRENT_H)
327 # define dirent direct
328 # ifdef HAVE_SYS_NDIR_H
329 # include <sys/ndir.h>
330 # endif /* SYSNDIR */
331 # ifdef HAVE_SYS_DIR_H
332 # include <sys/dir.h>
337 #endif /* HAVE_DIRENT_H */
342 err = mkdir("bash-aclocal", 0700);
347 unlink("bash-aclocal/not_a_directory");
348 fd = open("bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
351 dir = opendir("bash-aclocal/not_a_directory");
352 unlink("bash-aclocal/not_a_directory");
353 rmdir("bash-aclocal");
355 }], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
356 [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
357 bash_cv_opendir_not_robust=no]
359 AC_MSG_RESULT($bash_cv_opendir_not_robust)
360 if test $bash_cv_opendir_not_robust = yes; then
361 AC_DEFINE(OPENDIR_NOT_ROBUST)
366 AC_DEFUN(BASH_TYPE_SIGHANDLER,
367 [AC_MSG_CHECKING([whether signal handlers are of type void])
368 AC_CACHE_VAL(bash_cv_void_sighandler,
369 [AC_TRY_COMPILE([#include <sys/types.h>
377 void (*signal ()) ();],
378 [int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl
379 AC_MSG_RESULT($bash_cv_void_sighandler)
380 if test $bash_cv_void_sighandler = yes; then
381 AC_DEFINE(VOID_SIGHANDLER)
386 dnl A signed 16-bit integer quantity
388 AC_DEFUN(BASH_TYPE_BITS16_T,
390 if test "$ac_cv_sizeof_short" = 2; then
391 AC_CHECK_TYPE(bits16_t, short)
392 elif test "$ac_cv_sizeof_char" = 2; then
393 AC_CHECK_TYPE(bits16_t, char)
395 AC_CHECK_TYPE(bits16_t, short)
400 dnl An unsigned 16-bit integer quantity
402 AC_DEFUN(BASH_TYPE_U_BITS16_T,
404 if test "$ac_cv_sizeof_short" = 2; then
405 AC_CHECK_TYPE(u_bits16_t, unsigned short)
406 elif test "$ac_cv_sizeof_char" = 2; then
407 AC_CHECK_TYPE(u_bits16_t, unsigned char)
409 AC_CHECK_TYPE(u_bits16_t, unsigned short)
414 dnl A signed 32-bit integer quantity
416 AC_DEFUN(BASH_TYPE_BITS32_T,
418 if test "$ac_cv_sizeof_int" = 4; then
419 AC_CHECK_TYPE(bits32_t, int)
420 elif test "$ac_cv_sizeof_long" = 4; then
421 AC_CHECK_TYPE(bits32_t, long)
423 AC_CHECK_TYPE(bits32_t, int)
428 dnl An unsigned 32-bit integer quantity
430 AC_DEFUN(BASH_TYPE_U_BITS32_T,
432 if test "$ac_cv_sizeof_int" = 4; then
433 AC_CHECK_TYPE(u_bits32_t, unsigned int)
434 elif test "$ac_cv_sizeof_long" = 4; then
435 AC_CHECK_TYPE(u_bits32_t, unsigned long)
437 AC_CHECK_TYPE(u_bits32_t, unsigned int)
441 AC_DEFUN(BASH_TYPE_PTRDIFF_T,
443 if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
444 AC_CHECK_TYPE(ptrdiff_t, int)
445 elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
446 AC_CHECK_TYPE(ptrdiff_t, long)
447 elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then
448 AC_CHECK_TYPE(ptrdiff_t, [long long])
450 AC_CHECK_TYPE(ptrdiff_t, int)
455 dnl A signed 64-bit quantity
457 AC_DEFUN(BASH_TYPE_BITS64_T,
459 if test "$ac_cv_sizeof_char_p" = 8; then
460 AC_CHECK_TYPE(bits64_t, char *)
461 elif test "$ac_cv_sizeof_double" = 8; then
462 AC_CHECK_TYPE(bits64_t, double)
463 elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then
464 AC_CHECK_TYPE(bits64_t, [long long])
465 elif test "$ac_cv_sizeof_long" = 8; then
466 AC_CHECK_TYPE(bits64_t, long)
468 AC_CHECK_TYPE(bits64_t, double)
472 AC_DEFUN(BASH_TYPE_LONG_LONG,
474 AC_CACHE_CHECK([for long long], bash_cv_type_long_long,
476 long long ll = 1; int i = 63;],
478 long long llm = (long long) -1;
479 return ll << i | ll >> i | llm / ll | llm % ll;
480 ], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')])
481 if test "$bash_cv_type_long_long" = 'long long'; then
482 AC_DEFINE(HAVE_LONG_LONG, 1)
486 AC_DEFUN(BASH_TYPE_UNSIGNED_LONG_LONG,
488 AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long,
490 unsigned long long ull = 1; int i = 63;],
492 unsigned long long ullmax = (unsigned long long) -1;
493 return ull << i | ull >> i | ullmax / ull | ullmax % ull;
494 ], bash_cv_type_unsigned_long_long='unsigned long long',
495 bash_cv_type_unsigned_long_long='unsigned long')])
496 if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then
497 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1)
502 dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)
503 dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use
504 dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify
505 dnl matters, this just checks for rlim_t, quad_t, or long.
507 AC_DEFUN(BASH_TYPE_RLIMIT,
508 [AC_MSG_CHECKING(for size and type of struct rlimit fields)
509 AC_CACHE_VAL(bash_cv_type_rlimit,
510 [AC_TRY_COMPILE([#include <sys/types.h>
511 #include <sys/resource.h>],
512 [rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
514 #include <sys/types.h>
515 #include <sys/time.h>
516 #include <sys/resource.h>
521 if (sizeof(rl.rlim_cur) == sizeof(quad_t))
525 }], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
526 [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
527 bash_cv_type_rlimit=long])])
529 AC_MSG_RESULT($bash_cv_type_rlimit)
530 if test $bash_cv_type_rlimit = quad_t; then
531 AC_DEFINE(RLIMTYPE, quad_t)
532 elif test $bash_cv_type_rlimit = rlim_t; then
533 AC_DEFINE(RLIMTYPE, rlim_t)
537 AC_DEFUN(BASH_TYPE_SIG_ATOMIC_T,
538 [AC_CACHE_CHECK([for sig_atomic_t in signal.h], ac_cv_have_sig_atomic_t,
541 ],[ sig_atomic_t x; ],
542 ac_cv_have_sig_atomic_t=yes, ac_cv_have_sig_atomic_t=no)])
543 if test "$ac_cv_have_sig_atomic_t" = "no"
545 AC_CHECK_TYPE(sig_atomic_t,int)
549 AC_DEFUN(BASH_FUNC_LSTAT,
550 [dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
551 dnl inline function in <sys/stat.h>.
552 AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
554 #include <sys/types.h>
555 #include <sys/stat.h>
556 ],[ lstat(".",(struct stat *)0); ],
557 bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
558 if test $bash_cv_func_lstat = yes; then
559 AC_DEFINE(HAVE_LSTAT)
563 AC_DEFUN(BASH_FUNC_INET_ATON,
565 AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
567 #include <sys/types.h>
568 #include <netinet/in.h>
569 #include <arpa/inet.h>
570 struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
571 bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
572 if test $bash_cv_func_inet_aton = yes; then
573 AC_DEFINE(HAVE_INET_ATON)
579 AC_DEFUN(BASH_FUNC_GETENV,
580 [AC_MSG_CHECKING(to see if getenv can be redefined)
581 AC_CACHE_VAL(bash_cv_getenv_redef,
593 #if defined (__linux__) || defined (__bsdi__) || defined (convex)
597 #endif /* !__linux__ && !__bsdi__ && !convex */
604 /* The next allows this program to run, but does not allow bash to link
605 when it redefines getenv. I'm not really interested in figuring out
611 exit(s == 0); /* force optimizer to leave getenv in */
613 ], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
614 [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
615 bash_cv_getenv_redef=yes]
617 AC_MSG_RESULT($bash_cv_getenv_redef)
618 if test $bash_cv_getenv_redef = yes; then
619 AC_DEFINE(CAN_REDEFINE_GETENV)
623 # We should check for putenv before calling this
624 AC_DEFUN(BASH_FUNC_STD_PUTENV,
626 AC_REQUIRE([AC_HEADER_STDC])
627 AC_REQUIRE([AC_C_PROTOTYPES])
628 AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv,
640 extern int putenv (char *);
642 extern int putenv ();
645 [return (putenv == 0);],
646 bash_cv_std_putenv=yes, bash_cv_std_putenv=no
648 if test $bash_cv_std_putenv = yes; then
649 AC_DEFINE(HAVE_STD_PUTENV)
653 # We should check for unsetenv before calling this
654 AC_DEFUN(BASH_FUNC_STD_UNSETENV,
656 AC_REQUIRE([AC_HEADER_STDC])
657 AC_REQUIRE([AC_C_PROTOTYPES])
658 AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv,
670 extern int unsetenv (const char *);
672 extern int unsetenv ();
675 [return (unsetenv == 0);],
676 bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no
678 if test $bash_cv_std_unsetenv = yes; then
679 AC_DEFINE(HAVE_STD_UNSETENV)
683 AC_DEFUN(BASH_FUNC_ULIMIT_MAXFDS,
684 [AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)
685 AC_CACHE_VAL(bash_cv_ulimit_maxfds,
689 long maxfds = ulimit(4, 0L);
690 exit (maxfds == -1L);
692 ], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
693 [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
694 bash_cv_ulimit_maxfds=no]
696 AC_MSG_RESULT($bash_cv_ulimit_maxfds)
697 if test $bash_cv_ulimit_maxfds = yes; then
698 AC_DEFINE(ULIMIT_MAXFDS)
702 AC_DEFUN(BASH_FUNC_GETCWD,
703 [AC_MSG_CHECKING([if getcwd() will dynamically allocate memory with 0 size])
704 AC_CACHE_VAL(bash_cv_getcwd_malloc,
717 ], bash_cv_getcwd_malloc=yes, bash_cv_getcwd_malloc=no,
718 [AC_MSG_WARN(cannot check whether getcwd allocates memory when cross-compiling -- defaulting to no)
719 bash_cv_getcwd_malloc=no]
721 AC_MSG_RESULT($bash_cv_getcwd_malloc)
722 if test $bash_cv_getcwd_malloc = no; then
723 AC_DEFINE(GETCWD_BROKEN)
729 dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
730 dnl system, we can't use AC_PREREQ
732 AC_DEFUN(BASH_FUNC_GETHOSTBYNAME,
733 [if test "X$bash_cv_have_gethostbyname" = "X"; then
736 AC_MSG_CHECKING(for gethostbyname in socket library)
739 AC_CACHE_VAL(bash_cv_have_gethostbyname,
740 [AC_TRY_LINK([#include <netdb.h>],
741 [ struct hostent *hp;
742 hp = gethostbyname("localhost");
743 ], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
745 if test "X$_bash_needmsg" = Xyes; then
746 AC_MSG_CHECKING(for gethostbyname in socket library)
748 AC_MSG_RESULT($bash_cv_have_gethostbyname)
749 if test "$bash_cv_have_gethostbyname" = yes; then
750 AC_DEFINE(HAVE_GETHOSTBYNAME)
754 AC_DEFUN(BASH_FUNC_FNMATCH_EXTMATCH,
755 [AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH)
756 AC_CACHE_VAL(bash_cv_fnm_extmatch,
768 ], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no,
769 [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no)
770 bash_cv_fnm_extmatch=no])
772 AC_MSG_RESULT($bash_cv_fnm_extmatch)
773 if test $bash_cv_fnm_extmatch = yes; then
774 AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH)
778 AC_DEFUN(BASH_FUNC_POSIX_SETJMP,
779 [AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
780 AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp)
781 AC_CACHE_VAL(bash_cv_func_sigsetjmp,
786 #include <sys/types.h>
792 #if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
803 sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
804 sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
807 code = sigsetjmp(xx, 1);
809 exit(0); /* could get sigmask and compare to oset here. */
812 sigaddset(&set, SIGINT);
813 sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
819 }], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
820 [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
821 bash_cv_func_sigsetjmp=missing]
823 AC_MSG_RESULT($bash_cv_func_sigsetjmp)
824 if test $bash_cv_func_sigsetjmp = present; then
825 AC_DEFINE(HAVE_POSIX_SIGSETJMP)
829 AC_DEFUN(BASH_FUNC_STRCOLL,
831 AC_MSG_CHECKING(whether or not strcoll and strcmp differ)
832 AC_CACHE_VAL(bash_cv_func_strcoll_broken,
835 #if defined (HAVE_LOCALE_H)
844 char *deflocale, *defcoll;
846 #ifdef HAVE_SETLOCALE
847 deflocale = setlocale(LC_ALL, "");
848 defcoll = setlocale(LC_COLLATE, "");
852 /* These two values are taken from tests/glob-test. */
853 r1 = strcoll("abd", "aXd");
857 r2 = strcmp("abd", "aXd");
859 /* These two should both be greater than 0. It is permissible for
860 a system to return different values, as long as the sign is the
863 /* Exit with 1 (failure) if these two values are both > 0, since
864 this tests whether strcoll(3) is broken with respect to strcmp(3)
865 in the default locale. */
866 exit (r1 > 0 && r2 > 0);
868 ], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
869 [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
870 bash_cv_func_strcoll_broken=no]
872 AC_MSG_RESULT($bash_cv_func_strcoll_broken)
873 if test $bash_cv_func_strcoll_broken = yes; then
874 AC_DEFINE(STRCOLL_BROKEN)
878 AC_DEFUN(BASH_FUNC_PRINTF_A_FORMAT,
879 [AC_MSG_CHECKING([for printf floating point output in hex notation])
880 AC_CACHE_VAL(bash_cv_printf_a_format,
891 sprintf(abuf, "%A", y);
892 exit(strchr(abuf, 'P') == (char *)0);
894 ], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no,
895 [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no)
896 bash_cv_printf_a_format=no]
898 AC_MSG_RESULT($bash_cv_printf_a_format)
899 if test $bash_cv_printf_a_format = yes; then
900 AC_DEFINE(HAVE_PRINTF_A_FORMAT)
904 AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
906 AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[
907 #include <sys/types.h>
912 AC_DEFUN(BASH_STRUCT_TERMIO_LDISC,
914 AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[
915 #include <sys/types.h>
921 dnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJS
923 dnl sets bash_cv_struct_stat_st_blocks
925 dnl unused for now; we'll see how AC_CHECK_MEMBERS works
927 AC_DEFUN(BASH_STRUCT_ST_BLOCKS,
929 AC_MSG_CHECKING([for struct stat.st_blocks])
930 AC_CACHE_VAL(bash_cv_struct_stat_st_blocks,
933 #include <sys/types.h>
934 #include <sys/stat.h>
939 static struct stat a;
940 if (a.st_blocks) return 0;
943 ], bash_cv_struct_stat_st_blocks=yes, bash_cv_struct_stat_st_blocks=no)
945 AC_MSG_RESULT($bash_cv_struct_stat_st_blocks)
946 if test "$bash_cv_struct_stat_st_blocks" = "yes"; then
947 AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
951 AC_DEFUN([BASH_CHECK_LIB_TERMCAP],
953 if test "X$bash_cv_termcap_lib" = "X"; then
956 AC_MSG_CHECKING(which library has the termcap functions)
959 AC_CACHE_VAL(bash_cv_termcap_lib,
960 [AC_CHECK_FUNC(tgetent, bash_cv_termcap_lib=libc,
961 [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
962 [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo,
963 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
964 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
965 bash_cv_termcap_lib=gnutermcap)])])])])])
966 if test "X$_bash_needmsg" = "Xyes"; then
967 AC_MSG_CHECKING(which library has the termcap functions)
969 AC_MSG_RESULT(using $bash_cv_termcap_lib)
970 if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
971 LDFLAGS="$LDFLAGS -L./lib/termcap"
972 TERMCAP_LIB="./lib/termcap/libtermcap.a"
973 TERMCAP_DEP="./lib/termcap/libtermcap.a"
974 elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
975 TERMCAP_LIB=-ltermcap
977 elif test $bash_cv_termcap_lib = libtinfo; then
980 elif test $bash_cv_termcap_lib = libncurses; then
981 TERMCAP_LIB=-lncurses
983 elif test $bash_cv_termcap_lib = libc; then
993 dnl Check for the presence of getpeername in libsocket.
994 dnl If libsocket is present, check for libnsl and add it to LIBS if
995 dnl it's there, since most systems with libsocket require linking
996 dnl with libnsl as well. This should only be called if getpeername
997 dnl was not found in libc.
999 dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
1002 AC_DEFUN(BASH_CHECK_LIB_SOCKET,
1004 if test "X$bash_cv_have_socklib" = "X"; then
1007 AC_MSG_CHECKING(for socket library)
1010 AC_CACHE_VAL(bash_cv_have_socklib,
1011 [AC_CHECK_LIB(socket, getpeername,
1012 bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)])
1013 if test "X$_bash_needmsg" = Xyes; then
1014 AC_MSG_RESULT($bash_cv_have_socklib)
1017 if test $bash_cv_have_socklib = yes; then
1018 # check for libnsl, add it to LIBS if present
1019 if test "X$bash_cv_have_libnsl" = "X"; then
1022 AC_MSG_CHECKING(for libnsl)
1025 AC_CACHE_VAL(bash_cv_have_libnsl,
1026 [AC_CHECK_LIB(nsl, t_open,
1027 bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)])
1028 if test "X$_bash_needmsg" = Xyes; then
1029 AC_MSG_RESULT($bash_cv_have_libnsl)
1032 if test $bash_cv_have_libnsl = yes; then
1033 LIBS="-lsocket -lnsl $LIBS"
1035 LIBS="-lsocket $LIBS"
1037 AC_DEFINE(HAVE_LIBSOCKET)
1038 AC_DEFINE(HAVE_GETPEERNAME)
1042 AC_DEFUN(BASH_STRUCT_DIRENT_D_INO,
1043 [AC_REQUIRE([AC_HEADER_DIRENT])
1044 AC_MSG_CHECKING(for struct dirent.d_ino)
1045 AC_CACHE_VAL(bash_cv_dirent_has_dino,
1048 #include <sys/types.h>
1049 #ifdef HAVE_UNISTD_H
1050 # include <unistd.h>
1051 #endif /* HAVE_UNISTD_H */
1052 #if defined(HAVE_DIRENT_H)
1053 # include <dirent.h>
1055 # define dirent direct
1056 # ifdef HAVE_SYS_NDIR_H
1057 # include <sys/ndir.h>
1058 # endif /* SYSNDIR */
1059 # ifdef HAVE_SYS_DIR_H
1060 # include <sys/dir.h>
1061 # endif /* SYSDIR */
1065 #endif /* HAVE_DIRENT_H */
1067 struct dirent d; int z; z = d.d_ino;
1068 ], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)])
1069 AC_MSG_RESULT($bash_cv_dirent_has_dino)
1070 if test $bash_cv_dirent_has_dino = yes; then
1071 AC_DEFINE(HAVE_STRUCT_DIRENT_D_INO)
1075 AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO,
1076 [AC_REQUIRE([AC_HEADER_DIRENT])
1077 AC_MSG_CHECKING(for struct dirent.d_fileno)
1078 AC_CACHE_VAL(bash_cv_dirent_has_d_fileno,
1081 #include <sys/types.h>
1082 #ifdef HAVE_UNISTD_H
1083 # include <unistd.h>
1084 #endif /* HAVE_UNISTD_H */
1085 #if defined(HAVE_DIRENT_H)
1086 # include <dirent.h>
1088 # define dirent direct
1089 # ifdef HAVE_SYS_NDIR_H
1090 # include <sys/ndir.h>
1091 # endif /* SYSNDIR */
1092 # ifdef HAVE_SYS_DIR_H
1093 # include <sys/dir.h>
1094 # endif /* SYSDIR */
1098 #endif /* HAVE_DIRENT_H */
1100 struct dirent d; int z; z = d.d_fileno;
1101 ], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)])
1102 AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
1103 if test $bash_cv_dirent_has_d_fileno = yes; then
1104 AC_DEFINE(HAVE_STRUCT_DIRENT_D_FILENO)
1108 AC_DEFUN(BASH_STRUCT_DIRENT_D_NAMLEN,
1109 [AC_REQUIRE([AC_HEADER_DIRENT])
1110 AC_MSG_CHECKING(for struct dirent.d_namlen)
1111 AC_CACHE_VAL(bash_cv_dirent_has_d_namlen,
1114 #include <sys/types.h>
1115 #ifdef HAVE_UNISTD_H
1116 # include <unistd.h>
1117 #endif /* HAVE_UNISTD_H */
1118 #if defined(HAVE_DIRENT_H)
1119 # include <dirent.h>
1121 # define dirent direct
1122 # ifdef HAVE_SYS_NDIR_H
1123 # include <sys/ndir.h>
1124 # endif /* SYSNDIR */
1125 # ifdef HAVE_SYS_DIR_H
1126 # include <sys/dir.h>
1127 # endif /* SYSDIR */
1131 #endif /* HAVE_DIRENT_H */
1133 struct dirent d; int z; z = d.d_namlen;
1134 ], bash_cv_dirent_has_d_namlen=yes, bash_cv_dirent_has_d_namlen=no)])
1135 AC_MSG_RESULT($bash_cv_dirent_has_d_namlen)
1136 if test $bash_cv_dirent_has_d_namlen = yes; then
1137 AC_DEFINE(HAVE_STRUCT_DIRENT_D_NAMLEN)
1141 AC_DEFUN(BASH_STRUCT_TIMEVAL,
1142 [AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
1143 AC_CACHE_VAL(bash_cv_struct_timeval,
1145 AC_EGREP_HEADER(struct timeval, sys/time.h,
1146 bash_cv_struct_timeval=yes,
1147 AC_EGREP_HEADER(struct timeval, time.h,
1148 bash_cv_struct_timeval=yes,
1149 bash_cv_struct_timeval=no))
1151 AC_MSG_RESULT($bash_cv_struct_timeval)
1152 if test $bash_cv_struct_timeval = yes; then
1153 AC_DEFINE(HAVE_TIMEVAL)
1157 AC_DEFUN(BASH_STRUCT_TIMEZONE,
1158 [AC_MSG_CHECKING(for struct timezone in sys/time.h and time.h)
1159 AC_CACHE_VAL(bash_cv_struct_timezone,
1161 AC_EGREP_HEADER(struct timezone, sys/time.h,
1162 bash_cv_struct_timezone=yes,
1163 AC_EGREP_HEADER(struct timezone, time.h,
1164 bash_cv_struct_timezone=yes,
1165 bash_cv_struct_timezone=no))
1167 AC_MSG_RESULT($bash_cv_struct_timezone)
1168 if test $bash_cv_struct_timezone = yes; then
1169 AC_DEFINE(HAVE_STRUCT_TIMEZONE)
1173 AC_DEFUN(BASH_STRUCT_WINSIZE,
1174 [AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
1175 AC_CACHE_VAL(bash_cv_struct_winsize_header,
1176 [AC_TRY_COMPILE([#include <sys/types.h>
1177 #include <sys/ioctl.h>], [struct winsize x;],
1178 bash_cv_struct_winsize_header=ioctl_h,
1179 [AC_TRY_COMPILE([#include <sys/types.h>
1180 #include <termios.h>], [struct winsize x;],
1181 bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other)
1183 if test $bash_cv_struct_winsize_header = ioctl_h; then
1184 AC_MSG_RESULT(sys/ioctl.h)
1185 AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL)
1186 elif test $bash_cv_struct_winsize_header = termios_h; then
1187 AC_MSG_RESULT(termios.h)
1188 AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS)
1190 AC_MSG_RESULT(not found)
1194 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
1195 AC_DEFUN(BASH_SYS_SIGNAL_VINTAGE,
1196 [AC_REQUIRE([AC_TYPE_SIGNAL])
1197 AC_MSG_CHECKING(for type of signal functions)
1198 AC_CACHE_VAL(bash_cv_signal_vintage,
1200 AC_TRY_LINK([#include <signal.h>],[
1202 struct sigaction sa;
1203 sigemptyset(&ss); sigsuspend(&ss);
1204 sigaction(SIGINT, &sa, (struct sigaction *) 0);
1205 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
1206 ], bash_cv_signal_vintage=posix,
1208 AC_TRY_LINK([#include <signal.h>], [
1209 int mask = sigmask(SIGINT);
1210 sigsetmask(mask); sigblock(mask); sigpause(mask);
1211 ], bash_cv_signal_vintage=4.2bsd,
1215 RETSIGTYPE foo() { }], [
1216 int mask = sigmask(SIGINT);
1217 sigset(SIGINT, foo); sigrelse(SIGINT);
1218 sighold(SIGINT); sigpause(SIGINT);
1219 ], bash_cv_signal_vintage=svr3, bash_cv_signal_vintage=v7
1224 AC_MSG_RESULT($bash_cv_signal_vintage)
1225 if test "$bash_cv_signal_vintage" = posix; then
1226 AC_DEFINE(HAVE_POSIX_SIGNALS)
1227 elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
1228 AC_DEFINE(HAVE_BSD_SIGNALS)
1229 elif test "$bash_cv_signal_vintage" = svr3; then
1230 AC_DEFINE(HAVE_USG_SIGHOLD)
1234 dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process.
1235 AC_DEFUN(BASH_SYS_PGRP_SYNC,
1236 [AC_REQUIRE([AC_FUNC_GETPGRP])
1237 AC_MSG_CHECKING(whether pgrps need synchronization)
1238 AC_CACHE_VAL(bash_cv_pgrp_pipe,
1240 #ifdef HAVE_UNISTD_H
1241 # include <unistd.h>
1245 # ifdef GETPGRP_VOID
1246 # define getpgID() getpgrp()
1248 # define getpgID() getpgrp(0)
1249 # define setpgid(x,y) setpgrp(x,y)
1251 int pid1, pid2, fds[2];
1255 switch (pid1 = fork()) {
1259 setpgid(0, getpid());
1262 setpgid(pid1, pid1);
1264 sleep(2); /* let first child die */
1269 switch (pid2 = fork()) {
1274 ok = getpgID() == pid1;
1275 write(fds[1], &ok, 1);
1278 setpgid(pid2, pid1);
1281 if (read(fds[0], &ok, 1) != 1)
1287 ], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
1288 [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
1289 bash_cv_pgrp_pipe=no])
1291 AC_MSG_RESULT($bash_cv_pgrp_pipe)
1292 if test $bash_cv_pgrp_pipe = yes; then
1293 AC_DEFINE(PGRP_PIPE)
1297 AC_DEFUN(BASH_SYS_REINSTALL_SIGHANDLERS,
1298 [AC_REQUIRE([AC_TYPE_SIGNAL])
1299 AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
1300 AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked])
1301 AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers,
1304 #ifdef HAVE_UNISTD_H
1308 typedef RETSIGTYPE sigfunc();
1312 #ifdef HAVE_POSIX_SIGNALS
1314 set_signal_handler(sig, handler)
1318 struct sigaction act, oact;
1319 act.sa_handler = handler;
1321 sigemptyset (&act.sa_mask);
1322 sigemptyset (&oact.sa_mask);
1323 sigaction (sig, &act, &oact);
1324 return (oact.sa_handler);
1327 #define set_signal_handler(s, h) signal(s, h)
1340 set_signal_handler(SIGINT, sigint);
1341 kill((int)getpid(), SIGINT);
1342 kill((int)getpid(), SIGINT);
1345 ], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
1346 [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
1347 bash_cv_must_reinstall_sighandlers=no]
1349 AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
1350 if test $bash_cv_must_reinstall_sighandlers = yes; then
1351 AC_DEFINE(MUST_REINSTALL_SIGHANDLERS)
1355 dnl check that some necessary job control definitions are present
1356 AC_DEFUN(BASH_SYS_JOB_CONTROL_MISSING,
1357 [AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
1358 AC_MSG_CHECKING(for presence of necessary job control definitions)
1359 AC_CACHE_VAL(bash_cv_job_control_missing,
1361 #include <sys/types.h>
1362 #ifdef HAVE_SYS_WAIT_H
1363 #include <sys/wait.h>
1365 #ifdef HAVE_UNISTD_H
1370 /* Add more tests in here as appropriate. */
1374 #if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS)
1378 /* signals and tty control. */
1379 #if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT)
1383 /* process control */
1384 #if !defined (WNOHANG) || !defined (WUNTRACED)
1388 /* Posix systems have tcgetpgrp and waitpid. */
1389 #if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP)
1393 #if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID)
1397 /* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */
1398 #if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3)
1403 }], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
1404 [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
1405 bash_cv_job_control_missing=missing]
1407 AC_MSG_RESULT($bash_cv_job_control_missing)
1408 if test $bash_cv_job_control_missing = missing; then
1409 AC_DEFINE(JOB_CONTROL_MISSING)
1413 dnl check whether named pipes are present
1414 dnl this requires a previous check for mkfifo, but that is awkward to specify
1415 AC_DEFUN(BASH_SYS_NAMED_PIPES,
1416 [AC_MSG_CHECKING(for presence of named pipes)
1417 AC_CACHE_VAL(bash_cv_sys_named_pipes,
1419 #include <sys/types.h>
1420 #include <sys/stat.h>
1421 #ifdef HAVE_UNISTD_H
1425 /* Add more tests in here as appropriate. */
1430 #if defined (HAVE_MKFIFO)
1434 #if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO))
1441 err = mkdir("bash-aclocal", 0700);
1446 fd = mknod ("bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
1448 rmdir ("bash-aclocal");
1452 unlink ("bash-aclocal/sh-np-autoconf");
1453 rmdir ("bash-aclocal");
1455 }], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
1456 [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
1457 bash_cv_sys_named_pipes=missing]
1459 AC_MSG_RESULT($bash_cv_sys_named_pipes)
1460 if test $bash_cv_sys_named_pipes = missing; then
1461 AC_DEFINE(NAMED_PIPES_MISSING)
1465 AC_DEFUN(BASH_SYS_DEFAULT_MAIL_DIR,
1466 [AC_MSG_CHECKING(for default mail directory)
1467 AC_CACHE_VAL(bash_cv_mail_dir,
1468 [if test -d /var/mail; then
1469 bash_cv_mail_dir=/var/mail
1470 elif test -d /var/spool/mail; then
1471 bash_cv_mail_dir=/var/spool/mail
1472 elif test -d /usr/mail; then
1473 bash_cv_mail_dir=/usr/mail
1474 elif test -d /usr/spool/mail; then
1475 bash_cv_mail_dir=/usr/spool/mail
1477 bash_cv_mail_dir=unknown
1480 AC_MSG_RESULT($bash_cv_mail_dir)
1481 AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir")
1484 AC_DEFUN(BASH_HAVE_TIOCGWINSZ,
1485 [AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
1486 AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,
1487 [AC_TRY_COMPILE([#include <sys/types.h>
1488 #include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
1489 bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])
1490 AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)
1491 if test $bash_cv_tiocgwinsz_in_ioctl = yes; then
1492 AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
1496 AC_DEFUN(BASH_HAVE_TIOCSTAT,
1497 [AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
1498 AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,
1499 [AC_TRY_COMPILE([#include <sys/types.h>
1500 #include <sys/ioctl.h>], [int x = TIOCSTAT;],
1501 bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)])
1502 AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl)
1503 if test $bash_cv_tiocstat_in_ioctl = yes; then
1504 AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)
1508 AC_DEFUN(BASH_HAVE_FIONREAD,
1509 [AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
1510 AC_CACHE_VAL(bash_cv_fionread_in_ioctl,
1511 [AC_TRY_COMPILE([#include <sys/types.h>
1512 #include <sys/ioctl.h>], [int x = FIONREAD;],
1513 bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)])
1514 AC_MSG_RESULT($bash_cv_fionread_in_ioctl)
1515 if test $bash_cv_fionread_in_ioctl = yes; then
1516 AC_DEFINE(FIONREAD_IN_SYS_IOCTL)
1521 dnl See if speed_t is declared in <sys/types.h>. Some versions of linux
1522 dnl require a definition of speed_t each time <termcap.h> is included,
1523 dnl but you can only get speed_t if you include <termios.h> (on some
1524 dnl versions) or <sys/types.h> (on others).
1526 AC_DEFUN(BASH_CHECK_SPEED_T,
1527 [AC_MSG_CHECKING(for speed_t in sys/types.h)
1528 AC_CACHE_VAL(bash_cv_speed_t_in_sys_types,
1529 [AC_TRY_COMPILE([#include <sys/types.h>], [speed_t x;],
1530 bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)])
1531 AC_MSG_RESULT($bash_cv_speed_t_in_sys_types)
1532 if test $bash_cv_speed_t_in_sys_types = yes; then
1533 AC_DEFINE(SPEED_T_IN_SYS_TYPES)
1537 AC_DEFUN(BASH_CHECK_GETPW_FUNCS,
1538 [AC_MSG_CHECKING(whether getpw functions are declared in pwd.h)
1539 AC_CACHE_VAL(bash_cv_getpw_declared,
1540 [AC_EGREP_CPP(getpwuid,
1542 #include <sys/types.h>
1543 #ifdef HAVE_UNISTD_H
1544 # include <unistd.h>
1548 bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)])
1549 AC_MSG_RESULT($bash_cv_getpw_declared)
1550 if test $bash_cv_getpw_declared = yes; then
1551 AC_DEFINE(HAVE_GETPW_DECLS)
1555 AC_DEFUN(BASH_CHECK_DEV_FD,
1556 [AC_MSG_CHECKING(whether /dev/fd is available)
1557 AC_CACHE_VAL(bash_cv_dev_fd,
1559 if test -d /dev/fd && (exec test -r /dev/fd/0 < /dev/null) ; then
1560 # check for systems like FreeBSD 5 that only provide /dev/fd/[012]
1561 if (exec test -r /dev/fd/3 3</dev/null) ; then
1562 bash_cv_dev_fd=standard
1564 bash_cv_dev_fd=absent
1567 if test -z "$bash_cv_dev_fd" ; then
1568 if test -d /proc/self/fd && (exec test -r /proc/self/fd/0 < /dev/null) ; then
1569 bash_cv_dev_fd=whacky
1571 bash_cv_dev_fd=absent
1575 AC_MSG_RESULT($bash_cv_dev_fd)
1576 if test $bash_cv_dev_fd = "standard"; then
1577 AC_DEFINE(HAVE_DEV_FD)
1578 AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
1579 elif test $bash_cv_dev_fd = "whacky"; then
1580 AC_DEFINE(HAVE_DEV_FD)
1581 AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
1585 AC_DEFUN(BASH_CHECK_DEV_STDIN,
1586 [AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
1587 AC_CACHE_VAL(bash_cv_dev_stdin,
1588 [if test -d /dev/fd && (exec test -r /dev/stdin < /dev/null) ; then
1589 bash_cv_dev_stdin=present
1590 elif test -d /proc/self/fd && (exec test -r /dev/stdin < /dev/null) ; then
1591 bash_cv_dev_stdin=present
1593 bash_cv_dev_stdin=absent
1596 AC_MSG_RESULT($bash_cv_dev_stdin)
1597 if test $bash_cv_dev_stdin = "present"; then
1598 AC_DEFINE(HAVE_DEV_STDIN)
1603 dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions
1605 AC_DEFUN(BASH_CHECK_KERNEL_RLIMIT,
1606 [AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines])
1607 AC_CACHE_VAL(bash_cv_kernel_rlimit,
1609 #include <sys/types.h>
1610 #include <sys/resource.h>
1615 ], bash_cv_kernel_rlimit=no,
1617 #include <sys/types.h>
1619 #include <sys/resource.h>
1625 ], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
1627 AC_MSG_RESULT($bash_cv_kernel_rlimit)
1628 if test $bash_cv_kernel_rlimit = yes; then
1629 AC_DEFINE(RLIMIT_NEEDS_KERNEL)
1634 dnl Check for 64-bit off_t -- used for malloc alignment
1636 dnl C does not allow duplicate case labels, so the compile will fail if
1637 dnl sizeof(off_t) is > 4.
1639 AC_DEFUN(BASH_CHECK_OFF_T_64,
1640 [AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
1642 #ifdef HAVE_UNISTD_H
1645 #include <sys/types.h>
1647 switch (0) case 0: case (sizeof (off_t) <= 4):;
1648 ], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
1649 if test $bash_cv_off_t_64 = yes; then
1650 AC_DEFINE(HAVE_OFF_T_64)
1653 AC_DEFUN(BASH_CHECK_RTSIGS,
1654 [AC_MSG_CHECKING(for unusable real-time signals due to large values)
1655 AC_CACHE_VAL(bash_cv_unusable_rtsigs,
1657 #include <sys/types.h>
1666 int n_sigs = 2 * NSIG;
1668 int rtmin = SIGRTMIN;
1673 exit(rtmin < n_sigs);
1674 }], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no,
1675 [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes)
1676 bash_cv_unusable_rtsigs=yes]
1678 AC_MSG_RESULT($bash_cv_unusable_rtsigs)
1679 if test $bash_cv_unusable_rtsigs = yes; then
1680 AC_DEFINE(UNUSABLE_RT_SIGNALS)
1685 dnl check for availability of multibyte characters and functions
1687 dnl geez, I wish I didn't have to check for all of this stuff separately
1689 AC_DEFUN(BASH_CHECK_MULTIBYTE,
1691 AC_CHECK_HEADERS(wctype.h)
1692 AC_CHECK_HEADERS(wchar.h)
1693 AC_CHECK_HEADERS(langinfo.h)
1695 AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN))
1696 AC_CHECK_FUNC(mbscasecmp, AC_DEFINE(HAVE_MBSCMP))
1697 AC_CHECK_FUNC(mbscmp, AC_DEFINE(HAVE_MBSCMP))
1698 AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
1700 AC_REPLACE_FUNCS(mbschr)
1702 AC_CHECK_FUNC(wcrtomb, AC_DEFINE(HAVE_WCRTOMB))
1703 AC_CHECK_FUNC(wcscoll, AC_DEFINE(HAVE_WCSCOLL))
1704 AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP))
1705 AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
1706 AC_CHECK_FUNC(wctype, AC_DEFINE(HAVE_WCTYPE))
1708 dnl checks for both mbrtowc and mbstate_t
1710 if test $ac_cv_func_mbrtowc = yes; then
1711 AC_DEFINE(HAVE_MBSTATE_T)
1714 AC_CHECK_FUNCS(iswlower iswupper towlower towupper iswctype)
1716 AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset,
1718 [#include <langinfo.h>],
1719 [char* cs = nl_langinfo(CODESET);],
1720 bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)])
1721 if test $bash_cv_langinfo_codeset = yes; then
1722 AC_DEFINE(HAVE_LANGINFO_CODESET)
1725 dnl check for wchar_t in <wchar.h>
1726 AC_CACHE_CHECK([for wchar_t in wchar.h], bash_cv_type_wchar_t,
1733 ], bash_cv_type_wchar_t=yes, bash_cv_type_wchar_t=no)])
1734 if test $bash_cv_type_wchar_t = yes; then
1735 AC_DEFINE(HAVE_WCHAR_T, 1, [systems should define this type here])
1738 dnl check for wctype_t in <wctype.h>
1739 AC_CACHE_CHECK([for wctype_t in wctype.h], bash_cv_type_wctype_t,
1741 [#include <wctype.h>],
1745 ], bash_cv_type_wctype_t=yes, bash_cv_type_wctype_t=no)])
1746 if test $bash_cv_type_wctype_t = yes; then
1747 AC_DEFINE(HAVE_WCTYPE_T, 1, [systems should define this type here])
1750 dnl check for wint_t in <wctype.h>
1751 AC_CACHE_CHECK([for wint_t in wctype.h], bash_cv_type_wint_t,
1753 [#include <wctype.h>],
1757 ], bash_cv_type_wint_t=yes, bash_cv_type_wint_t=no)])
1758 if test $bash_cv_type_wint_t = yes; then
1759 AC_DEFINE(HAVE_WINT_T, 1, [systems should define this type here])
1762 if test "$am_cv_func_iconv" = yes; then
1764 LIBS="$LIBS $LIBICONV"
1765 AC_CHECK_FUNCS(locale_charset)
1771 dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB
1774 dnl BASH_CHECK_LIB_TERMCAP
1776 AC_DEFUN([RL_LIB_READLINE_VERSION],
1778 AC_REQUIRE([BASH_CHECK_LIB_TERMCAP])
1780 AC_MSG_CHECKING([version of installed readline library])
1782 # What a pain in the ass this is.
1784 # save cpp and ld options
1785 _save_CFLAGS="$CFLAGS"
1786 _save_LDFLAGS="$LDFLAGS"
1789 # Don't set ac_cv_rl_prefix if the caller has already assigned a value. This
1790 # allows the caller to do something like $_rl_prefix=$withval if the user
1791 # specifies --with-installed-readline=PREFIX as an argument to configure
1793 if test -z "$ac_cv_rl_prefix"; then
1794 test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix}
1797 eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include
1798 eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib
1800 LIBS="$LIBS -lreadline ${TERMCAP_LIB}"
1801 CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}"
1802 LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}"
1804 AC_CACHE_VAL(ac_cv_rl_version,
1807 #include <readline/readline.h>
1809 extern int rl_gnu_readline_p;
1814 fp = fopen("conftest.rlv", "w");
1817 if (rl_gnu_readline_p != 1)
1818 fprintf(fp, "0.0\n");
1820 fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0");
1825 ac_cv_rl_version=`cat conftest.rlv`,
1826 ac_cv_rl_version='0.0',
1827 ac_cv_rl_version='4.2')])
1829 CFLAGS="$_save_CFLAGS"
1830 LDFLAGS="$_save_LDFLAGS"
1837 case "$ac_cv_rl_version" in
1838 2*|3*|4*|5*|6*|7*|8*|9*)
1839 RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'`
1840 RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'`
1846 [[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;;
1847 [[0-9]]) _RL_MAJOR=0$RL_MAJOR ;;
1853 [[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;;
1854 [[0-9]]) _RL_MINOR=0$RL_MINOR ;;
1858 RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}"
1860 # Readline versions greater than 4.2 have these defines in readline.h
1862 if test $ac_cv_rl_version = '0.0' ; then
1863 AC_MSG_WARN([Could not test version of installed readline library.])
1864 elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then
1865 # set these for use by the caller
1866 RL_PREFIX=$ac_cv_rl_prefix
1867 RL_LIBDIR=$ac_cv_rl_libdir
1868 RL_INCLUDEDIR=$ac_cv_rl_includedir
1869 AC_MSG_RESULT($ac_cv_rl_version)
1872 AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library])
1873 AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library])
1874 AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library])
1876 AC_SUBST(RL_VERSION)
1880 # set these for use by the caller
1881 RL_PREFIX=$ac_cv_rl_prefix
1882 RL_LIBDIR=$ac_cv_rl_libdir
1883 RL_INCLUDEDIR=$ac_cv_rl_includedir
1885 AC_MSG_RESULT($ac_cv_rl_version)
1890 AC_DEFUN(BASH_FUNC_CTYPE_NONASCII,
1892 AC_MSG_CHECKING(whether the ctype macros accept non-ascii characters)
1893 AC_CACHE_VAL(bash_cv_func_ctype_nonascii,
1895 #ifdef HAVE_LOCALE_H
1909 #ifdef HAVE_SETLOCALE
1910 /* We take a shot here. If that locale is not known, try the
1911 system default. We try this one because '\342' (226) is
1912 known to be a printable character in that locale. */
1913 deflocale = setlocale(LC_ALL, "en_US.ISO8859-1");
1915 deflocale = setlocale(LC_ALL, "");
1922 exit (r1 == 0 || r2 == 0);
1924 ], bash_cv_func_ctype_nonascii=yes, bash_cv_func_ctype_nonascii=no,
1925 [AC_MSG_WARN(cannot check ctype macros if cross compiling -- defaulting to no)
1926 bash_cv_func_ctype_nonascii=no]
1928 AC_MSG_RESULT($bash_cv_func_ctype_nonascii)
1929 if test $bash_cv_func_ctype_nonascii = yes; then
1930 AC_DEFINE(CTYPE_NON_ASCII)
1934 AC_DEFUN(BASH_CHECK_WCONTINUED,
1936 AC_MSG_CHECKING(whether WCONTINUED flag to waitpid is unavailable or available but broken)
1937 AC_CACHE_VAL(bash_cv_wcontinued_broken,
1939 #include <sys/types.h>
1940 #include <sys/wait.h>
1951 x = waitpid(-1, (int *)0, WNOHANG|WCONTINUED);
1952 if (x == -1 && errno == EINVAL)
1957 ], bash_cv_wcontinued_broken=no,bash_cv_wcontinued_broken=yes,
1958 [AC_MSG_WARN(cannot check WCONTINUED if cross compiling -- defaulting to no)
1959 bash_cv_wcontinued_broken=no]
1961 AC_MSG_RESULT($bash_cv_wcontinued_broken)
1962 if test $bash_cv_wcontinued_broken = yes; then
1963 AC_DEFINE(WCONTINUED_BROKEN)
1968 dnl tests added for bashdb
1972 AC_DEFUN([AM_PATH_LISPDIR],
1973 [AC_ARG_WITH(lispdir, AC_HELP_STRING([--with-lispdir], [override the default lisp directory]),
1974 [ lispdir="$withval"
1975 AC_MSG_CHECKING([where .elc files should go])
1976 AC_MSG_RESULT([$lispdir])],
1978 # If set to t, that means we are running in a shell under Emacs.
1979 # If you have an Emacs named "t", then use the full path.
1980 test x"$EMACS" = xt && EMACS=
1981 AC_CHECK_PROGS(EMACS, emacs xemacs, no)
1982 if test $EMACS != "no"; then
1983 if test x${lispdir+set} != xset; then
1984 AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [dnl
1985 am_cv_lispdir=`$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' | sed -n -e 's,/$,,' -e '/.*\/lib\/\(x\?emacs\/site-lisp\)$/{s,,${libdir}/\1,;p;q;}' -e '/.*\/share\/\(x\?emacs\/site-lisp\)$/{s,,${datadir}/\1,;p;q;}'`
1986 if test -z "$am_cv_lispdir"; then
1987 am_cv_lispdir='${datadir}/emacs/site-lisp'
1990 lispdir="$am_cv_lispdir"
1998 dnl tests added for gettext
2000 # codeset.m4 serial AM1 (gettext-0.10.40)
2001 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2002 dnl This file is free software, distributed under the terms of the GNU
2003 dnl General Public License. As a special exception to the GNU General
2004 dnl Public License, this file may be distributed as part of a program
2005 dnl that contains a configuration script generated by Autoconf, under
2006 dnl the same distribution terms as the rest of that program.
2008 dnl From Bruno Haible.
2010 AC_DEFUN([AM_LANGINFO_CODESET],
2012 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2013 [AC_TRY_LINK([#include <langinfo.h>],
2014 [char* cs = nl_langinfo(CODESET);],
2015 am_cv_langinfo_codeset=yes,
2016 am_cv_langinfo_codeset=no)
2018 if test $am_cv_langinfo_codeset = yes; then
2019 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2020 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2023 # gettext.m4 serial 20 (gettext-0.12)
2024 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
2025 dnl This file is free software, distributed under the terms of the GNU
2026 dnl General Public License. As a special exception to the GNU General
2027 dnl Public License, this file may be distributed as part of a program
2028 dnl that contains a configuration script generated by Autoconf, under
2029 dnl the same distribution terms as the rest of that program.
2031 dnl This file can can be used in projects which are not available under
2032 dnl the GNU General Public License or the GNU Library General Public
2033 dnl License but which still want to provide support for the GNU gettext
2035 dnl Please note that the actual code of the GNU gettext library is covered
2036 dnl by the GNU Library General Public License, and the rest of the GNU
2037 dnl gettext package package is covered by the GNU General Public License.
2038 dnl They are *not* in the public domain.
2041 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2042 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2044 dnl Macro to add for using GNU gettext.
2046 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
2047 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
2048 dnl default (if it is not specified or empty) is 'no-libtool'.
2049 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
2050 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
2051 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
2052 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
2053 dnl depending on --{enable,disable}-{shared,static} and on the presence of
2054 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
2055 dnl $(top_builddir)/intl/libintl.a will be created.
2056 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
2057 dnl implementations (in libc or libintl) without the ngettext() function
2058 dnl will be ignored. If NEEDSYMBOL is specified and is
2059 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
2060 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
2061 dnl INTLDIR is used to find the intl libraries. If empty,
2062 dnl the value `$(top_builddir)/intl/' is used.
2064 dnl The result of the configuration is one of three cases:
2065 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
2067 dnl Catalog format: GNU --> install in $(datadir)
2068 dnl Catalog extension: .mo after installation, .gmo in source tree
2069 dnl 2) GNU gettext has been found in the system's C library.
2070 dnl Catalog format: GNU --> install in $(datadir)
2071 dnl Catalog extension: .mo after installation, .gmo in source tree
2072 dnl 3) No internationalization, always use English msgid.
2073 dnl Catalog format: none
2074 dnl Catalog extension: none
2075 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
2076 dnl The use of .gmo is historical (it was needed to avoid overwriting the
2077 dnl GNU format catalogs when building on a platform with an X/Open gettext),
2078 dnl but we keep it in order not to force irrelevant filename changes on the
2081 AC_DEFUN([AM_GNU_GETTEXT],
2083 dnl Argument checking.
2084 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
2085 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
2087 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
2088 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
2090 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
2091 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
2093 AC_REQUIRE([AM_PO_SUBDIRS])dnl
2094 ifelse(gt_included_intl, yes, [
2095 AC_REQUIRE([AM_INTL_SUBDIR])dnl
2098 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2099 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2100 AC_REQUIRE([AC_LIB_RPATH])
2102 dnl Sometimes libintl requires libiconv, so first search for libiconv.
2103 dnl Ideally we would do this search only after the
2104 dnl if test "$USE_NLS" = "yes"; then
2105 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
2106 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
2107 dnl the configure script would need to contain the same shell code
2108 dnl again, outside any 'if'. There are two solutions:
2109 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
2110 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
2111 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
2112 dnl documented, we avoid it.
2113 ifelse(gt_included_intl, yes, , [
2114 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2120 ifelse(gt_included_intl, yes, [
2121 BUILD_INCLUDED_LIBINTL=no
2122 USE_INCLUDED_LIBINTL=no
2128 dnl If we use NLS figure out what method
2129 if test "$USE_NLS" = "yes"; then
2130 gt_use_preinstalled_gnugettext=no
2131 ifelse(gt_included_intl, yes, [
2132 AC_MSG_CHECKING([whether included gettext is requested])
2133 AC_ARG_WITH(included-gettext,
2134 [ --with-included-gettext use the GNU gettext library included here],
2135 nls_cv_force_use_gnu_gettext=$withval,
2136 nls_cv_force_use_gnu_gettext=no)
2137 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
2139 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2140 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2142 dnl User does not insist on using GNU NLS library. Figure out what
2143 dnl to use. If GNU gettext is available we use this. Else we have
2144 dnl to fall back to GNU NLS library.
2146 dnl Add a version number to the cache macros.
2147 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
2148 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
2149 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
2151 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
2152 [AC_TRY_LINK([#include <libintl.h>
2153 ]ifelse([$2], [need-formatstring-macros],
2154 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
2155 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
2158 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
2160 ], [])[extern int _nl_msg_cat_cntr;
2161 extern int *_nl_domain_bindings;],
2162 [bindtextdomain ("", "");
2163 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
2164 gt_cv_func_gnugettext_libc=yes,
2165 gt_cv_func_gnugettext_libc=no)])
2167 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
2168 dnl Sometimes libintl requires libiconv, so first search for libiconv.
2169 ifelse(gt_included_intl, yes, , [
2172 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
2173 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
2174 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
2175 dnl even if libiconv doesn't exist.
2176 AC_LIB_LINKFLAGS_BODY([intl])
2177 AC_CACHE_CHECK([for GNU gettext in libintl],
2178 gt_cv_func_gnugettext_libintl,
2179 [gt_save_CPPFLAGS="$CPPFLAGS"
2180 CPPFLAGS="$CPPFLAGS $INCINTL"
2181 gt_save_LIBS="$LIBS"
2182 LIBS="$LIBS $LIBINTL"
2183 dnl Now see whether libintl exists and does not depend on libiconv.
2184 AC_TRY_LINK([#include <libintl.h>
2185 ]ifelse([$2], [need-formatstring-macros],
2186 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
2187 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
2190 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
2192 ], [])[extern int _nl_msg_cat_cntr;
2197 const char *_nl_expand_alias ();],
2198 [bindtextdomain ("", "");
2199 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
2200 gt_cv_func_gnugettext_libintl=yes,
2201 gt_cv_func_gnugettext_libintl=no)
2202 dnl Now see whether libintl exists and depends on libiconv.
2203 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
2204 LIBS="$LIBS $LIBICONV"
2205 AC_TRY_LINK([#include <libintl.h>
2206 ]ifelse([$2], [need-formatstring-macros],
2207 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
2208 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
2211 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
2213 ], [])[extern int _nl_msg_cat_cntr;
2218 const char *_nl_expand_alias ();],
2219 [bindtextdomain ("", "");
2220 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
2221 [LIBINTL="$LIBINTL $LIBICONV"
2222 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
2223 gt_cv_func_gnugettext_libintl=yes
2226 CPPFLAGS="$gt_save_CPPFLAGS"
2227 LIBS="$gt_save_LIBS"])
2230 dnl If an already present or preinstalled GNU gettext() is found,
2231 dnl use it. But if this macro is used in GNU gettext, and GNU
2232 dnl gettext is already preinstalled in libintl, we update this
2233 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
2234 if test "$gt_cv_func_gnugettext_libc" = "yes" \
2235 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
2236 && test "$PACKAGE" != gettext-runtime \
2237 && test "$PACKAGE" != gettext-tools; }; then
2238 gt_use_preinstalled_gnugettext=yes
2240 dnl Reset the values set by searching for libintl.
2246 ifelse(gt_included_intl, yes, [
2247 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
2248 dnl GNU gettext is not found in the C library.
2249 dnl Fall back on included GNU gettext library.
2250 nls_cv_use_gnu_gettext=yes
2254 if test "$nls_cv_use_gnu_gettext" = "yes"; then
2255 dnl Mark actions used to generate GNU NLS library.
2256 BUILD_INCLUDED_LIBINTL=yes
2257 USE_INCLUDED_LIBINTL=yes
2258 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
2259 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
2260 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
2263 if test "$gt_use_preinstalled_gnugettext" = "yes" \
2264 || test "$nls_cv_use_gnu_gettext" = "yes"; then
2265 dnl Mark actions to use GNU gettext tools.
2270 if test "$gt_use_preinstalled_gnugettext" = "yes" \
2271 || test "$nls_cv_use_gnu_gettext" = "yes"; then
2272 AC_DEFINE(ENABLE_NLS, 1,
2273 [Define to 1 if translation of program messages to the user's native language
2280 AC_MSG_CHECKING([whether to use NLS])
2281 AC_MSG_RESULT([$USE_NLS])
2282 if test "$USE_NLS" = "yes"; then
2283 AC_MSG_CHECKING([where the gettext function comes from])
2284 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
2285 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
2286 gt_source="external libintl"
2291 gt_source="included intl directory"
2293 AC_MSG_RESULT([$gt_source])
2296 if test "$USE_NLS" = "yes"; then
2298 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
2299 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
2300 AC_MSG_CHECKING([how to link with libintl])
2301 AC_MSG_RESULT([$LIBINTL])
2302 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
2305 dnl For backward compatibility. Some packages may be using this.
2306 AC_DEFINE(HAVE_GETTEXT, 1,
2307 [Define if the GNU gettext() function is already present or preinstalled.])
2308 AC_DEFINE(HAVE_DCGETTEXT, 1,
2309 [Define if the GNU dcgettext() function is already present or preinstalled.])
2312 dnl We need to process the po/ directory.
2316 ifelse(gt_included_intl, yes, [
2317 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
2318 dnl to 'yes' because some of the testsuite requires it.
2319 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
2320 BUILD_INCLUDED_LIBINTL=yes
2323 dnl Make all variables we use known to autoconf.
2324 AC_SUBST(BUILD_INCLUDED_LIBINTL)
2325 AC_SUBST(USE_INCLUDED_LIBINTL)
2328 dnl For backward compatibility. Some configure.ins may be using this.
2330 nls_cv_header_libgt=
2332 dnl For backward compatibility. Some Makefiles may be using this.
2334 AC_SUBST(DATADIRNAME)
2336 dnl For backward compatibility. Some Makefiles may be using this.
2338 AC_SUBST(INSTOBJEXT)
2340 dnl For backward compatibility. Some Makefiles may be using this.
2344 dnl For backward compatibility. Some Makefiles may be using this.
2345 if test "$USE_INCLUDED_LIBINTL" = yes; then
2346 INTLOBJS="\$(GETTOBJS)"
2350 dnl Enable libtool support if the surrounding package wishes it.
2351 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
2352 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
2355 dnl For backward compatibility. Some Makefiles may be using this.
2359 dnl Make all documented variables known to autoconf.
2366 dnl Checks for all prerequisites of the intl subdirectory,
2367 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
2368 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
2369 AC_DEFUN([AM_INTL_SUBDIR],
2371 AC_REQUIRE([AC_PROG_INSTALL])dnl
2372 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
2373 AC_REQUIRE([AC_PROG_CC])dnl
2374 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2375 AC_REQUIRE([AC_PROG_RANLIB])dnl
2376 AC_REQUIRE([AC_ISC_POSIX])dnl
2377 AC_REQUIRE([AC_HEADER_STDC])dnl
2378 AC_REQUIRE([AC_C_CONST])dnl
2379 AC_REQUIRE([AC_C_INLINE])dnl
2380 AC_REQUIRE([AC_TYPE_OFF_T])dnl
2381 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2382 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2383 AC_REQUIRE([AC_FUNC_MMAP])dnl
2384 AC_REQUIRE([jm_GLIBC21])dnl
2385 AC_REQUIRE([gt_INTDIV0])dnl
2386 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
2387 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
2388 AC_REQUIRE([gt_INTTYPES_PRI])dnl
2390 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
2391 stdlib.h string.h unistd.h sys/param.h])
2392 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
2393 geteuid getgid getuid mempcpy munmap putenv setenv setlocale localeconv stpcpy \
2394 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
2399 if test $ac_cv_header_locale_h = yes; then
2403 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
2404 dnl because plural.y uses bison specific features. It requires at least
2405 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
2407 dnl bison is only needed for the maintainer (who touches plural.y). But in
2408 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
2409 dnl the rule in general Makefile. Now, some people carelessly touch the
2410 dnl files or have a broken "make" program, hence the plural.c rule will
2411 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
2412 dnl present or too old.
2413 AC_CHECK_PROGS([INTLBISON], [bison])
2414 if test -z "$INTLBISON"; then
2417 dnl Found it, now check the version.
2418 AC_MSG_CHECKING([version of bison])
2419 changequote(<<,>>)dnl
2420 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
2421 case $ac_prog_version in
2422 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
2423 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
2425 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
2426 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
2428 AC_MSG_RESULT([$ac_prog_version])
2430 if test $ac_verc_fail = yes; then
2436 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
2437 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
2438 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2439 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2440 dnl This file is free software, distributed under the terms of the GNU
2441 dnl General Public License. As a special exception to the GNU General
2442 dnl Public License, this file may be distributed as part of a program
2443 dnl that contains a configuration script generated by Autoconf, under
2444 dnl the same distribution terms as the rest of that program.
2446 # Test for the GNU C Library, version 2.1 or newer.
2447 # From Bruno Haible.
2449 AC_DEFUN([jm_GLIBC21],
2451 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2452 ac_cv_gnu_library_2_1,
2453 [AC_EGREP_CPP([Lucky GNU user],
2455 #include <features.h>
2456 #ifdef __GNU_LIBRARY__
2457 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2462 ac_cv_gnu_library_2_1=yes,
2463 ac_cv_gnu_library_2_1=no)
2467 GLIBC21="$ac_cv_gnu_library_2_1"
2470 # iconv.m4 serial AM4 (gettext-0.11.3)
2471 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2472 dnl This file is free software, distributed under the terms of the GNU
2473 dnl General Public License. As a special exception to the GNU General
2474 dnl Public License, this file may be distributed as part of a program
2475 dnl that contains a configuration script generated by Autoconf, under
2476 dnl the same distribution terms as the rest of that program.
2478 dnl From Bruno Haible.
2480 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2482 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2483 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2484 AC_REQUIRE([AC_LIB_RPATH])
2486 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2488 AC_LIB_LINKFLAGS_BODY([iconv])
2491 AC_DEFUN([AM_ICONV_LINK],
2493 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2494 dnl those with the standalone portable GNU libiconv installed).
2496 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2498 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2500 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2501 dnl because if the user has installed libiconv and not disabled its use
2502 dnl via --without-libiconv-prefix, he wants to use it. The first
2503 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2504 am_save_CPPFLAGS="$CPPFLAGS"
2505 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2507 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2508 am_cv_func_iconv="no, consider installing GNU libiconv"
2510 AC_TRY_LINK([#include <stdlib.h>
2511 #include <iconv.h>],
2512 [iconv_t cd = iconv_open("","");
2513 iconv(cd,NULL,NULL,NULL,NULL);
2515 am_cv_func_iconv=yes)
2516 if test "$am_cv_func_iconv" != yes; then
2517 am_save_LIBS="$LIBS"
2518 LIBS="$LIBS $LIBICONV"
2519 AC_TRY_LINK([#include <stdlib.h>
2520 #include <iconv.h>],
2521 [iconv_t cd = iconv_open("","");
2522 iconv(cd,NULL,NULL,NULL,NULL);
2525 am_cv_func_iconv=yes)
2526 LIBS="$am_save_LIBS"
2529 if test "$am_cv_func_iconv" = yes; then
2530 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2532 if test "$am_cv_lib_iconv" = yes; then
2533 AC_MSG_CHECKING([how to link with libiconv])
2534 AC_MSG_RESULT([$LIBICONV])
2536 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2538 CPPFLAGS="$am_save_CPPFLAGS"
2543 AC_SUBST(LTLIBICONV)
2546 AC_DEFUN([AM_ICONV],
2549 if test "$am_cv_func_iconv" = yes; then
2550 AC_MSG_CHECKING([for iconv declaration])
2551 AC_CACHE_VAL(am_cv_proto_iconv, [
2559 #if defined(__STDC__) || defined(__cplusplus)
2560 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2564 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2565 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
2566 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2567 AC_MSG_RESULT([$]{ac_t:-
2568 }[$]am_cv_proto_iconv)
2569 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2570 [Define as const if the declaration of iconv() needs const.])
2573 # intdiv0.m4 serial 1 (gettext-0.11.3)
2574 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2575 dnl This file is free software, distributed under the terms of the GNU
2576 dnl General Public License. As a special exception to the GNU General
2577 dnl Public License, this file may be distributed as part of a program
2578 dnl that contains a configuration script generated by Autoconf, under
2579 dnl the same distribution terms as the rest of that program.
2581 dnl From Bruno Haible.
2583 AC_DEFUN([gt_INTDIV0],
2585 AC_REQUIRE([AC_PROG_CC])dnl
2586 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2588 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2589 gt_cv_int_divbyzero_sigfpe,
2597 sigfpe_handler (int sig)
2599 sigfpe_handler (sig) int sig;
2602 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
2603 exit (sig != SIGFPE);
2613 signal (SIGFPE, sigfpe_handler);
2614 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
2615 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2616 signal (SIGTRAP, sigfpe_handler);
2618 /* Linux/SPARC yields signal SIGILL. */
2619 #if defined (__sparc__) && defined (__linux__)
2620 signal (SIGILL, sigfpe_handler);
2627 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2629 # Guess based on the CPU.
2631 alpha* | i[34567]86 | m68k | s390*)
2632 gt_cv_int_divbyzero_sigfpe="guessing yes";;
2634 gt_cv_int_divbyzero_sigfpe="guessing no";;
2638 case "$gt_cv_int_divbyzero_sigfpe" in
2642 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2643 [Define if integer division by zero raises signal SIGFPE.])
2645 # inttypes.m4 serial 1 (gettext-0.11.4)
2646 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2647 dnl This file is free software, distributed under the terms of the GNU
2648 dnl General Public License. As a special exception to the GNU General
2649 dnl Public License, this file may be distributed as part of a program
2650 dnl that contains a configuration script generated by Autoconf, under
2651 dnl the same distribution terms as the rest of that program.
2653 dnl From Paul Eggert.
2655 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2658 AC_DEFUN([gt_HEADER_INTTYPES_H],
2660 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2663 [#include <sys/types.h>
2664 #include <inttypes.h>],
2665 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2667 if test $gt_cv_header_inttypes_h = yes; then
2668 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2669 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2672 # inttypes_h.m4 serial 5 (gettext-0.12)
2673 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2674 dnl This file is free software, distributed under the terms of the GNU
2675 dnl General Public License. As a special exception to the GNU General
2676 dnl Public License, this file may be distributed as part of a program
2677 dnl that contains a configuration script generated by Autoconf, under
2678 dnl the same distribution terms as the rest of that program.
2680 dnl From Paul Eggert.
2682 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2683 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2685 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2687 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2689 [#include <sys/types.h>
2690 #include <inttypes.h>],
2691 [uintmax_t i = (uintmax_t) -1;],
2692 jm_ac_cv_header_inttypes_h=yes,
2693 jm_ac_cv_header_inttypes_h=no)])
2694 if test $jm_ac_cv_header_inttypes_h = yes; then
2695 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2696 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2697 and declares uintmax_t. ])
2700 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
2701 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2702 dnl This file is free software, distributed under the terms of the GNU
2703 dnl General Public License. As a special exception to the GNU General
2704 dnl Public License, this file may be distributed as part of a program
2705 dnl that contains a configuration script generated by Autoconf, under
2706 dnl the same distribution terms as the rest of that program.
2708 dnl From Bruno Haible.
2710 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2711 # macros to non-string values. This is the case on AIX 4.3.3.
2713 AC_DEFUN([gt_INTTYPES_PRI],
2715 AC_REQUIRE([gt_HEADER_INTTYPES_H])
2716 if test $gt_cv_header_inttypes_h = yes; then
2717 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2718 gt_cv_inttypes_pri_broken,
2720 AC_TRY_COMPILE([#include <inttypes.h>
2724 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2727 if test "$gt_cv_inttypes_pri_broken" = yes; then
2728 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2729 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
2732 # isc-posix.m4 serial 2 (gettext-0.11.2)
2733 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2734 dnl This file is free software, distributed under the terms of the GNU
2735 dnl General Public License. As a special exception to the GNU General
2736 dnl Public License, this file may be distributed as part of a program
2737 dnl that contains a configuration script generated by Autoconf, under
2738 dnl the same distribution terms as the rest of that program.
2740 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
2742 # This test replaces the one in autoconf.
2743 # Currently this macro should have the same name as the autoconf macro
2744 # because gettext's gettext.m4 (distributed in the automake package)
2745 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
2746 # give these diagnostics:
2747 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2748 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2750 undefine([AC_ISC_POSIX])
2752 AC_DEFUN([AC_ISC_POSIX],
2754 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2755 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2758 # lcmessage.m4 serial 3 (gettext-0.11.3)
2759 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2760 dnl This file is free software, distributed under the terms of the GNU
2761 dnl General Public License. As a special exception to the GNU General
2762 dnl Public License, this file may be distributed as part of a program
2763 dnl that contains a configuration script generated by Autoconf, under
2764 dnl the same distribution terms as the rest of that program.
2766 dnl This file can can be used in projects which are not available under
2767 dnl the GNU General Public License or the GNU Library General Public
2768 dnl License but which still want to provide support for the GNU gettext
2770 dnl Please note that the actual code of the GNU gettext library is covered
2771 dnl by the GNU Library General Public License, and the rest of the GNU
2772 dnl gettext package package is covered by the GNU General Public License.
2773 dnl They are *not* in the public domain.
2776 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2778 # Check whether LC_MESSAGES is available in <locale.h>.
2780 AC_DEFUN([AM_LC_MESSAGES],
2782 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2783 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2784 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2785 if test $am_cv_val_LC_MESSAGES = yes; then
2786 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2787 [Define if your <locale.h> file defines LC_MESSAGES.])
2790 # lib-ld.m4 serial 2 (gettext-0.12)
2791 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2792 dnl This file is free software, distributed under the terms of the GNU
2793 dnl General Public License. As a special exception to the GNU General
2794 dnl Public License, this file may be distributed as part of a program
2795 dnl that contains a configuration script generated by Autoconf, under
2796 dnl the same distribution terms as the rest of that program.
2798 dnl Subroutines of libtool.m4,
2799 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2800 dnl with libtool.m4.
2802 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2803 AC_DEFUN([AC_LIB_PROG_LD_GNU],
2804 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2805 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2806 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2807 acl_cv_prog_gnu_ld=yes
2809 acl_cv_prog_gnu_ld=no
2811 with_gnu_ld=$acl_cv_prog_gnu_ld
2814 dnl From libtool-1.4. Sets the variable LD.
2815 AC_DEFUN([AC_LIB_PROG_LD],
2816 [AC_ARG_WITH(gnu-ld,
2817 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
2818 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2819 AC_REQUIRE([AC_PROG_CC])dnl
2820 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2821 # Prepare PATH_SEPARATOR.
2822 # The user is always right.
2823 if test "${PATH_SEPARATOR+set}" != set; then
2824 echo "#! /bin/sh" >conf$$.sh
2825 echo "exit 0" >>conf$$.sh
2827 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2835 if test "$GCC" = yes; then
2836 # Check if gcc -print-prog-name=ld gives a path.
2837 AC_MSG_CHECKING([for ld used by GCC])
2840 # gcc leaves a trailing carriage return which upsets mingw
2841 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2843 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2846 # Accept absolute paths.
2847 [[\\/]* | [A-Za-z]:[\\/]*)]
2848 [re_direlt='/[^/][^/]*/\.\./']
2849 # Canonicalize the path of ld
2850 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2851 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2852 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2854 test -z "$LD" && LD="$ac_prog"
2857 # If it fails, then pretend we aren't using GCC.
2861 # If it is relative, then search for the first ld in PATH.
2865 elif test "$with_gnu_ld" = yes; then
2866 AC_MSG_CHECKING([for GNU ld])
2868 AC_MSG_CHECKING([for non-GNU ld])
2870 AC_CACHE_VAL(acl_cv_path_LD,
2871 [if test -z "$LD"; then
2872 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2873 for ac_dir in $PATH; do
2874 test -z "$ac_dir" && ac_dir=.
2875 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2876 acl_cv_path_LD="$ac_dir/$ac_prog"
2877 # Check to see if the program is GNU ld. I'd rather use --version,
2878 # but apparently some GNU ld's only accept -v.
2879 # Break only if it was the GNU/non-GNU ld that we prefer.
2880 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2881 test "$with_gnu_ld" != no && break
2883 test "$with_gnu_ld" != yes && break
2889 acl_cv_path_LD="$LD" # Let the user override the test with a path.
2891 LD="$acl_cv_path_LD"
2892 if test -n "$LD"; then
2897 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2900 # lib-link.m4 serial 4 (gettext-0.12)
2901 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
2902 dnl This file is free software, distributed under the terms of the GNU
2903 dnl General Public License. As a special exception to the GNU General
2904 dnl Public License, this file may be distributed as part of a program
2905 dnl that contains a configuration script generated by Autoconf, under
2906 dnl the same distribution terms as the rest of that program.
2908 dnl From Bruno Haible.
2910 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
2911 dnl the libraries corresponding to explicit and implicit dependencies.
2912 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
2913 dnl augments the CPPFLAGS variable.
2914 AC_DEFUN([AC_LIB_LINKFLAGS],
2916 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2917 AC_REQUIRE([AC_LIB_RPATH])
2918 define([Name],[translit([$1],[./-], [___])])
2919 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2920 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2921 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
2922 AC_LIB_LINKFLAGS_BODY([$1], [$2])
2923 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
2924 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
2925 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
2927 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
2928 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
2929 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
2930 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2932 AC_SUBST([LTLIB]NAME)
2933 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
2934 dnl results of this search when this library appears as a dependency.
2940 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
2941 dnl searches for libname and the libraries corresponding to explicit and
2942 dnl implicit dependencies, together with the specified include files and
2943 dnl the ability to compile and link the specified testcode. If found, it
2944 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
2945 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
2946 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
2947 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
2948 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
2950 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2951 AC_REQUIRE([AC_LIB_RPATH])
2952 define([Name],[translit([$1],[./-], [___])])
2953 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2954 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2956 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2958 AC_LIB_LINKFLAGS_BODY([$1], [$2])
2960 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
2961 dnl because if the user has installed lib[]Name and not disabled its use
2962 dnl via --without-lib[]Name-prefix, he wants to use it.
2963 ac_save_CPPFLAGS="$CPPFLAGS"
2964 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2966 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
2967 ac_save_LIBS="$LIBS"
2968 LIBS="$LIBS $LIB[]NAME"
2969 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
2970 LIBS="$ac_save_LIBS"
2972 if test "$ac_cv_lib[]Name" = yes; then
2974 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
2975 AC_MSG_CHECKING([how to link with lib[]$1])
2976 AC_MSG_RESULT([$LIB[]NAME])
2979 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
2980 dnl $INC[]NAME either.
2981 CPPFLAGS="$ac_save_CPPFLAGS"
2985 AC_SUBST([HAVE_LIB]NAME)
2987 AC_SUBST([LTLIB]NAME)
2992 dnl Determine the platform dependent parameters needed to use rpath:
2993 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
2994 dnl hardcode_direct, hardcode_minus_L.
2995 AC_DEFUN([AC_LIB_RPATH],
2997 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
2998 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
2999 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
3000 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
3001 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
3002 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
3003 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
3009 libext="$acl_cv_libext"
3010 shlibext="$acl_cv_shlibext"
3011 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
3012 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
3013 hardcode_direct="$acl_cv_hardcode_direct"
3014 hardcode_minus_L="$acl_cv_hardcode_minus_L"
3015 dnl Determine whether the user wants rpath handling at all.
3016 AC_ARG_ENABLE(rpath,
3017 [ --disable-rpath do not hardcode runtime library paths],
3018 :, enable_rpath=yes)
3021 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
3022 dnl the libraries corresponding to explicit and implicit dependencies.
3023 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
3024 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
3026 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
3027 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
3028 dnl By default, look in $includedir and $libdir.
3030 AC_LIB_WITH_FINAL_PREFIX([
3031 eval additional_includedir=\"$includedir\"
3032 eval additional_libdir=\"$libdir\"
3034 AC_LIB_ARG_WITH([lib$1-prefix],
3035 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
3036 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
3038 if test "X$withval" = "Xno"; then
3041 if test "X$withval" = "X"; then
3042 AC_LIB_WITH_FINAL_PREFIX([
3043 eval additional_includedir=\"$includedir\"
3044 eval additional_libdir=\"$libdir\"
3047 additional_includedir="$withval/include"
3048 additional_libdir="$withval/lib"
3052 dnl Search the library and its dependencies in $additional_libdir and
3053 dnl $LDFLAGS. Using breadth-first-seach.
3059 names_already_handled=
3060 names_next_round='$1 $2'
3061 while test -n "$names_next_round"; do
3062 names_this_round="$names_next_round"
3064 for name in $names_this_round; do
3066 for n in $names_already_handled; do
3067 if test "$n" = "$name"; then
3072 if test -z "$already_handled"; then
3073 names_already_handled="$names_already_handled $name"
3074 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
3075 dnl or AC_LIB_HAVE_LINKFLAGS call.
3076 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
3077 eval value=\"\$HAVE_LIB$uppername\"
3078 if test -n "$value"; then
3079 if test "$value" = yes; then
3080 eval value=\"\$LIB$uppername\"
3081 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
3082 eval value=\"\$LTLIB$uppername\"
3083 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
3085 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
3086 dnl that this library doesn't exist. So just drop it.
3090 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
3091 dnl and the already constructed $LIBNAME/$LTLIBNAME.
3096 if test $use_additional = yes; then
3097 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
3098 found_dir="$additional_libdir"
3099 found_so="$additional_libdir/lib$name.$shlibext"
3100 if test -f "$additional_libdir/lib$name.la"; then
3101 found_la="$additional_libdir/lib$name.la"
3104 if test -f "$additional_libdir/lib$name.$libext"; then
3105 found_dir="$additional_libdir"
3106 found_a="$additional_libdir/lib$name.$libext"
3107 if test -f "$additional_libdir/lib$name.la"; then
3108 found_la="$additional_libdir/lib$name.la"
3113 if test "X$found_dir" = "X"; then
3114 for x in $LDFLAGS $LTLIB[]NAME; do
3115 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3118 dir=`echo "X$x" | sed -e 's/^X-L//'`
3119 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
3121 found_so="$dir/lib$name.$shlibext"
3122 if test -f "$dir/lib$name.la"; then
3123 found_la="$dir/lib$name.la"
3126 if test -f "$dir/lib$name.$libext"; then
3128 found_a="$dir/lib$name.$libext"
3129 if test -f "$dir/lib$name.la"; then
3130 found_la="$dir/lib$name.la"
3136 if test "X$found_dir" != "X"; then
3141 if test "X$found_dir" != "X"; then
3142 dnl Found the library.
3143 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
3144 if test "X$found_so" != "X"; then
3145 dnl Linking with a shared library. We attempt to hardcode its
3146 dnl directory into the executable's runpath, unless it's the
3147 dnl standard /usr/lib.
3148 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
3149 dnl No hardcoding is needed.
3150 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
3152 dnl Use an explicit option to hardcode DIR into the resulting
3154 dnl Potentially add DIR to ltrpathdirs.
3155 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
3157 for x in $ltrpathdirs; do
3158 if test "X$x" = "X$found_dir"; then
3163 if test -z "$haveit"; then
3164 ltrpathdirs="$ltrpathdirs $found_dir"
3166 dnl The hardcoding into $LIBNAME is system dependent.
3167 if test "$hardcode_direct" = yes; then
3168 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
3169 dnl resulting binary.
3170 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
3172 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
3173 dnl Use an explicit option to hardcode DIR into the resulting
3175 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
3176 dnl Potentially add DIR to rpathdirs.
3177 dnl The rpathdirs will be appended to $LIBNAME at the end.
3179 for x in $rpathdirs; do
3180 if test "X$x" = "X$found_dir"; then
3185 if test -z "$haveit"; then
3186 rpathdirs="$rpathdirs $found_dir"
3189 dnl Rely on "-L$found_dir".
3190 dnl But don't add it if it's already contained in the LDFLAGS
3191 dnl or the already constructed $LIBNAME
3193 for x in $LDFLAGS $LIB[]NAME; do
3194 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3195 if test "X$x" = "X-L$found_dir"; then
3200 if test -z "$haveit"; then
3201 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
3203 if test "$hardcode_minus_L" != no; then
3204 dnl FIXME: Not sure whether we should use
3205 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
3207 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
3209 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
3210 dnl here, because this doesn't fit in flags passed to the
3211 dnl compiler. So give up. No hardcoding. This affects only
3212 dnl very old systems.
3213 dnl FIXME: Not sure whether we should use
3214 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
3216 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
3222 if test "X$found_a" != "X"; then
3223 dnl Linking with a static library.
3224 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
3226 dnl We shouldn't come here, but anyway it's good to have a
3228 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
3231 dnl Assume the include files are nearby.
3232 additional_includedir=
3233 case "$found_dir" in
3235 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
3236 additional_includedir="$basedir/include"
3239 if test "X$additional_includedir" != "X"; then
3240 dnl Potentially add $additional_includedir to $INCNAME.
3241 dnl But don't add it
3242 dnl 1. if it's the standard /usr/include,
3243 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
3244 dnl 3. if it's already present in $CPPFLAGS or the already
3245 dnl constructed $INCNAME,
3246 dnl 4. if it doesn't exist as a directory.
3247 if test "X$additional_includedir" != "X/usr/include"; then
3249 if test "X$additional_includedir" = "X/usr/local/include"; then
3250 if test -n "$GCC"; then
3252 linux*) haveit=yes;;
3256 if test -z "$haveit"; then
3257 for x in $CPPFLAGS $INC[]NAME; do
3258 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3259 if test "X$x" = "X-I$additional_includedir"; then
3264 if test -z "$haveit"; then
3265 if test -d "$additional_includedir"; then
3266 dnl Really add $additional_includedir to $INCNAME.
3267 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
3273 dnl Look for dependencies.
3274 if test -n "$found_la"; then
3275 dnl Read the .la file. It defines the variables
3276 dnl dlname, library_names, old_library, dependency_libs, current,
3277 dnl age, revision, installed, dlopen, dlpreopen, libdir.
3278 save_libdir="$libdir"
3280 */* | *\\*) . "$found_la" ;;
3281 *) . "./$found_la" ;;
3283 libdir="$save_libdir"
3284 dnl We use only dependency_libs.
3285 for dep in $dependency_libs; do
3288 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
3289 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
3290 dnl But don't add it
3291 dnl 1. if it's the standard /usr/lib,
3292 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
3293 dnl 3. if it's already present in $LDFLAGS or the already
3294 dnl constructed $LIBNAME,
3295 dnl 4. if it doesn't exist as a directory.
3296 if test "X$additional_libdir" != "X/usr/lib"; then
3298 if test "X$additional_libdir" = "X/usr/local/lib"; then
3299 if test -n "$GCC"; then
3301 linux*) haveit=yes;;
3305 if test -z "$haveit"; then
3307 for x in $LDFLAGS $LIB[]NAME; do
3308 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3309 if test "X$x" = "X-L$additional_libdir"; then
3314 if test -z "$haveit"; then
3315 if test -d "$additional_libdir"; then
3316 dnl Really add $additional_libdir to $LIBNAME.
3317 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
3321 for x in $LDFLAGS $LTLIB[]NAME; do
3322 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3323 if test "X$x" = "X-L$additional_libdir"; then
3328 if test -z "$haveit"; then
3329 if test -d "$additional_libdir"; then
3330 dnl Really add $additional_libdir to $LTLIBNAME.
3331 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
3338 dir=`echo "X$dep" | sed -e 's/^X-R//'`
3339 if test "$enable_rpath" != no; then
3340 dnl Potentially add DIR to rpathdirs.
3341 dnl The rpathdirs will be appended to $LIBNAME at the end.
3343 for x in $rpathdirs; do
3344 if test "X$x" = "X$dir"; then
3349 if test -z "$haveit"; then
3350 rpathdirs="$rpathdirs $dir"
3352 dnl Potentially add DIR to ltrpathdirs.
3353 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
3355 for x in $ltrpathdirs; do
3356 if test "X$x" = "X$dir"; then
3361 if test -z "$haveit"; then
3362 ltrpathdirs="$ltrpathdirs $dir"
3367 dnl Handle this in the next round.
3368 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
3371 dnl Handle this in the next round. Throw away the .la's
3372 dnl directory; it is already contained in a preceding -L
3374 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
3377 dnl Most likely an immediate library name.
3378 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
3379 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
3385 dnl Didn't find the library; assume it is in the system directories
3386 dnl known to the linker and runtime loader. (All the system
3387 dnl directories known to the linker should also be known to the
3388 dnl runtime loader, otherwise the system is severely misconfigured.)
3389 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
3390 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
3396 if test "X$rpathdirs" != "X"; then
3397 if test -n "$hardcode_libdir_separator"; then
3398 dnl Weird platform: only the last -rpath option counts, the user must
3399 dnl pass all path elements in one option. We can arrange that for a
3400 dnl single library, but not when more than one $LIBNAMEs are used.
3402 for found_dir in $rpathdirs; do
3403 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
3405 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
3406 acl_save_libdir="$libdir"
3408 eval flag=\"$hardcode_libdir_flag_spec\"
3409 libdir="$acl_save_libdir"
3410 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
3412 dnl The -rpath options are cumulative.
3413 for found_dir in $rpathdirs; do
3414 acl_save_libdir="$libdir"
3416 eval flag=\"$hardcode_libdir_flag_spec\"
3417 libdir="$acl_save_libdir"
3418 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
3422 if test "X$ltrpathdirs" != "X"; then
3423 dnl When using libtool, the option that works for both libraries and
3424 dnl executables is -R. The -R options are cumulative.
3425 for found_dir in $ltrpathdirs; do
3426 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
3431 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
3432 dnl unless already present in VAR.
3433 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
3434 dnl contains two or three consecutive elements that belong together.
3435 AC_DEFUN([AC_LIB_APPENDTOVAR],
3437 for element in [$2]; do
3440 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3441 if test "X$x" = "X$element"; then
3446 if test -z "$haveit"; then
3447 [$1]="${[$1]}${[$1]:+ }$element"
3451 # lib-prefix.m4 serial 2 (gettext-0.12)
3452 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
3453 dnl This file is free software, distributed under the terms of the GNU
3454 dnl General Public License. As a special exception to the GNU General
3455 dnl Public License, this file may be distributed as part of a program
3456 dnl that contains a configuration script generated by Autoconf, under
3457 dnl the same distribution terms as the rest of that program.
3459 dnl From Bruno Haible.
3461 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
3462 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
3463 dnl require excessive bracketing.
3464 ifdef([AC_HELP_STRING],
3465 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
3466 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
3468 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
3469 dnl to access previously installed libraries. The basic assumption is that
3470 dnl a user will want packages to use other packages he previously installed
3471 dnl with the same --prefix option.
3472 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
3473 dnl libraries, but is otherwise very convenient.
3474 AC_DEFUN([AC_LIB_PREFIX],
3476 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
3477 AC_REQUIRE([AC_PROG_CC])
3478 AC_REQUIRE([AC_CANONICAL_HOST])
3479 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3480 dnl By default, look in $includedir and $libdir.
3482 AC_LIB_WITH_FINAL_PREFIX([
3483 eval additional_includedir=\"$includedir\"
3484 eval additional_libdir=\"$libdir\"
3486 AC_LIB_ARG_WITH([lib-prefix],
3487 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
3488 --without-lib-prefix don't search for libraries in includedir and libdir],
3490 if test "X$withval" = "Xno"; then
3493 if test "X$withval" = "X"; then
3494 AC_LIB_WITH_FINAL_PREFIX([
3495 eval additional_includedir=\"$includedir\"
3496 eval additional_libdir=\"$libdir\"
3499 additional_includedir="$withval/include"
3500 additional_libdir="$withval/lib"
3504 if test $use_additional = yes; then
3505 dnl Potentially add $additional_includedir to $CPPFLAGS.
3506 dnl But don't add it
3507 dnl 1. if it's the standard /usr/include,
3508 dnl 2. if it's already present in $CPPFLAGS,
3509 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
3510 dnl 4. if it doesn't exist as a directory.
3511 if test "X$additional_includedir" != "X/usr/include"; then
3513 for x in $CPPFLAGS; do
3514 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3515 if test "X$x" = "X-I$additional_includedir"; then
3520 if test -z "$haveit"; then
3521 if test "X$additional_includedir" = "X/usr/local/include"; then
3522 if test -n "$GCC"; then
3524 linux*) haveit=yes;;
3528 if test -z "$haveit"; then
3529 if test -d "$additional_includedir"; then
3530 dnl Really add $additional_includedir to $CPPFLAGS.
3531 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
3536 dnl Potentially add $additional_libdir to $LDFLAGS.
3537 dnl But don't add it
3538 dnl 1. if it's the standard /usr/lib,
3539 dnl 2. if it's already present in $LDFLAGS,
3540 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
3541 dnl 4. if it doesn't exist as a directory.
3542 if test "X$additional_libdir" != "X/usr/lib"; then
3544 for x in $LDFLAGS; do
3545 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3546 if test "X$x" = "X-L$additional_libdir"; then
3551 if test -z "$haveit"; then
3552 if test "X$additional_libdir" = "X/usr/local/lib"; then
3553 if test -n "$GCC"; then
3555 linux*) haveit=yes;;
3559 if test -z "$haveit"; then
3560 if test -d "$additional_libdir"; then
3561 dnl Really add $additional_libdir to $LDFLAGS.
3562 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
3570 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
3571 dnl acl_final_exec_prefix, containing the values to which $prefix and
3572 dnl $exec_prefix will expand at the end of the configure script.
3573 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
3575 dnl Unfortunately, prefix and exec_prefix get only finally determined
3576 dnl at the end of configure.
3577 if test "X$prefix" = "XNONE"; then
3578 acl_final_prefix="$ac_default_prefix"
3580 acl_final_prefix="$prefix"
3582 if test "X$exec_prefix" = "XNONE"; then
3583 acl_final_exec_prefix='${prefix}'
3585 acl_final_exec_prefix="$exec_prefix"
3587 acl_save_prefix="$prefix"
3588 prefix="$acl_final_prefix"
3589 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
3590 prefix="$acl_save_prefix"
3593 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
3594 dnl variables prefix and exec_prefix bound to the values they will have
3595 dnl at the end of the configure script.
3596 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
3598 acl_save_prefix="$prefix"
3599 prefix="$acl_final_prefix"
3600 acl_save_exec_prefix="$exec_prefix"
3601 exec_prefix="$acl_final_exec_prefix"
3603 exec_prefix="$acl_save_exec_prefix"
3604 prefix="$acl_save_prefix"
3606 # nls.m4 serial 1 (gettext-0.12)
3607 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
3608 dnl This file is free software, distributed under the terms of the GNU
3609 dnl General Public License. As a special exception to the GNU General
3610 dnl Public License, this file may be distributed as part of a program
3611 dnl that contains a configuration script generated by Autoconf, under
3612 dnl the same distribution terms as the rest of that program.
3614 dnl This file can can be used in projects which are not available under
3615 dnl the GNU General Public License or the GNU Library General Public
3616 dnl License but which still want to provide support for the GNU gettext
3618 dnl Please note that the actual code of the GNU gettext library is covered
3619 dnl by the GNU Library General Public License, and the rest of the GNU
3620 dnl gettext package package is covered by the GNU General Public License.
3621 dnl They are *not* in the public domain.
3624 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3625 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3629 AC_MSG_CHECKING([whether NLS is requested])
3630 dnl Default is enabled NLS
3632 [ --disable-nls do not use Native Language Support],
3633 USE_NLS=$enableval, USE_NLS=yes)
3634 AC_MSG_RESULT($USE_NLS)
3638 AC_DEFUN([AM_MKINSTALLDIRS],
3640 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
3641 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
3642 dnl Try to locate it.
3644 if test -n "$ac_aux_dir"; then
3645 case "$ac_aux_dir" in
3646 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
3647 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
3650 if test -z "$MKINSTALLDIRS"; then
3651 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
3653 AC_SUBST(MKINSTALLDIRS)
3655 # po.m4 serial 1 (gettext-0.12)
3656 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
3657 dnl This file is free software, distributed under the terms of the GNU
3658 dnl General Public License. As a special exception to the GNU General
3659 dnl Public License, this file may be distributed as part of a program
3660 dnl that contains a configuration script generated by Autoconf, under
3661 dnl the same distribution terms as the rest of that program.
3663 dnl This file can can be used in projects which are not available under
3664 dnl the GNU General Public License or the GNU Library General Public
3665 dnl License but which still want to provide support for the GNU gettext
3667 dnl Please note that the actual code of the GNU gettext library is covered
3668 dnl by the GNU Library General Public License, and the rest of the GNU
3669 dnl gettext package package is covered by the GNU General Public License.
3670 dnl They are *not* in the public domain.
3673 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3674 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3676 dnl Checks for all prerequisites of the po subdirectory.
3677 AC_DEFUN([AM_PO_SUBDIRS],
3679 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3680 AC_REQUIRE([AC_PROG_INSTALL])dnl
3681 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
3682 AC_REQUIRE([AM_NLS])dnl
3684 dnl Perform the following tests also if --disable-nls has been given,
3685 dnl because they are needed for "make dist" to work.
3687 dnl Search for GNU msgfmt in the PATH.
3688 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
3689 dnl The second test excludes FreeBSD msgfmt.
3690 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
3691 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
3692 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3694 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3696 dnl Search for GNU xgettext 0.12 or newer in the PATH.
3697 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
3698 dnl The second test excludes FreeBSD xgettext.
3699 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
3700 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
3701 (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3703 dnl Remove leftover from FreeBSD xgettext call.
3706 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
3707 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
3708 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
3710 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
3711 dnl Test whether we really found GNU msgfmt.
3712 if test "$GMSGFMT" != ":"; then
3713 dnl If it is no GNU msgfmt we define it as : so that the
3714 dnl Makefiles still can work.
3715 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
3716 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
3719 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
3721 [found $GMSGFMT program is not GNU msgfmt; ignore it])
3726 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
3727 dnl Test whether we really found GNU xgettext.
3728 if test "$XGETTEXT" != ":"; then
3729 dnl If it is no GNU xgettext we define it as : so that the
3730 dnl Makefiles still can work.
3731 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
3732 (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
3736 [found xgettext program is not GNU xgettext; ignore it])
3739 dnl Remove leftover from FreeBSD xgettext call.
3743 AC_OUTPUT_COMMANDS([
3744 for ac_file in $CONFIG_FILES; do
3745 # Support "outfile[:infile[:infile...]]"
3747 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3749 # PO directories have a Makefile.in generated from Makefile.in.in.
3750 case "$ac_file" in */Makefile.in)
3751 # Adjust a relative srcdir.
3752 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3753 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
3754 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3755 # In autoconf-2.13 it is called $ac_given_srcdir.
3756 # In autoconf-2.50 it is called $srcdir.
3757 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3758 case "$ac_given_srcdir" in
3759 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3760 /*) top_srcdir="$ac_given_srcdir" ;;
3761 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3763 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
3764 rm -f "$ac_dir/POTFILES"
3765 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
3766 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
3767 POMAKEFILEDEPS="POTFILES.in"
3768 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
3769 # on $ac_dir but don't depend on user-specified configuration
3771 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3772 # The LINGUAS file contains the set of available languages.
3773 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3774 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3776 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3777 # Hide the ALL_LINGUAS assigment from automake.
3778 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3779 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3781 # The set of available languages was given in configure.in.
3782 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
3784 case "$ac_given_srcdir" in
3786 *) srcdirpre='$(srcdir)/' ;;
3792 for lang in $ALL_LINGUAS; do
3793 POFILES="$POFILES $srcdirpre$lang.po"
3794 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3795 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3796 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3798 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3799 # environment variable.
3801 if test -n "$ALL_LINGUAS"; then
3802 for presentlang in $ALL_LINGUAS; do
3804 if test "%UNSET%" != "$LINGUAS"; then
3805 desiredlanguages="$LINGUAS"
3807 desiredlanguages="$ALL_LINGUAS"
3809 for desiredlang in $desiredlanguages; do
3810 # Use the presentlang catalog if desiredlang is
3811 # a. equal to presentlang, or
3812 # b. a variant of presentlang (because in this case,
3813 # presentlang can be used as a fallback for messages
3814 # which are not translated in the desiredlang catalog).
3815 case "$desiredlang" in
3816 "$presentlang"*) useit=yes;;
3819 if test $useit = yes; then
3820 INST_LINGUAS="$INST_LINGUAS $presentlang"
3825 if test -n "$INST_LINGUAS"; then
3826 for lang in $INST_LINGUAS; do
3827 CATALOGS="$CATALOGS $lang.gmo"
3830 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
3831 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
3832 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
3833 if test -f "$f"; then
3835 *.orig | *.bak | *~) ;;
3836 *) cat "$f" >> "$ac_dir/Makefile" ;;
3844 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
3845 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
3847 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
3848 # Capture the value of LINGUAS because we need it to compute CATALOGS.
3849 LINGUAS="${LINGUAS-%UNSET%}"
3852 # progtest.m4 serial 3 (gettext-0.12)
3853 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
3854 dnl This file is free software, distributed under the terms of the GNU
3855 dnl General Public License. As a special exception to the GNU General
3856 dnl Public License, this file may be distributed as part of a program
3857 dnl that contains a configuration script generated by Autoconf, under
3858 dnl the same distribution terms as the rest of that program.
3860 dnl This file can can be used in projects which are not available under
3861 dnl the GNU General Public License or the GNU Library General Public
3862 dnl License but which still want to provide support for the GNU gettext
3864 dnl Please note that the actual code of the GNU gettext library is covered
3865 dnl by the GNU Library General Public License, and the rest of the GNU
3866 dnl gettext package package is covered by the GNU General Public License.
3867 dnl They are *not* in the public domain.
3870 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
3872 # Search path for a program which passes the given test.
3874 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3875 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3876 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3878 # Prepare PATH_SEPARATOR.
3879 # The user is always right.
3880 if test "${PATH_SEPARATOR+set}" != set; then
3881 echo "#! /bin/sh" >conf$$.sh
3882 echo "exit 0" >>conf$$.sh
3884 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
3892 # Find out how to test for executable files. Don't use a zero-byte file,
3893 # as systems may use methods other than mode bits to determine executability.
3894 cat >conf$$.file <<_ASEOF
3898 chmod +x conf$$.file
3899 if test -x conf$$.file >/dev/null 2>&1; then
3900 ac_executable_p="test -x"
3902 ac_executable_p="test -f"
3906 # Extract the first word of "$2", so it can be a program name with args.
3907 set dummy $2; ac_word=[$]2
3908 AC_MSG_CHECKING([for $ac_word])
3909 AC_CACHE_VAL(ac_cv_path_$1,
3911 [[\\/]]* | ?:[[\\/]]*)
3912 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3915 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
3916 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3918 test -z "$ac_dir" && ac_dir=.
3919 for ac_exec_ext in '' $ac_executable_extensions; do
3920 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
3922 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
3929 dnl If no 4th arg is given, leave the cache variable unset,
3930 dnl so AC_PATH_PROGS will keep looking.
3931 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3936 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
3937 AC_MSG_RESULT([$]$1)
3943 # stdint_h.m4 serial 3 (gettext-0.12)
3944 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3945 dnl This file is free software, distributed under the terms of the GNU
3946 dnl General Public License. As a special exception to the GNU General
3947 dnl Public License, this file may be distributed as part of a program
3948 dnl that contains a configuration script generated by Autoconf, under
3949 dnl the same distribution terms as the rest of that program.
3951 dnl From Paul Eggert.
3953 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
3954 # doesn't clash with <sys/types.h>, and declares uintmax_t.
3956 AC_DEFUN([jm_AC_HEADER_STDINT_H],
3958 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
3960 [#include <sys/types.h>
3961 #include <stdint.h>],
3962 [uintmax_t i = (uintmax_t) -1;],
3963 jm_ac_cv_header_stdint_h=yes,
3964 jm_ac_cv_header_stdint_h=no)])
3965 if test $jm_ac_cv_header_stdint_h = yes; then
3966 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
3967 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
3968 and declares uintmax_t. ])
3971 # uintmax_t.m4 serial 7 (gettext-0.12)
3972 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3973 dnl This file is free software, distributed under the terms of the GNU
3974 dnl General Public License. As a special exception to the GNU General
3975 dnl Public License, this file may be distributed as part of a program
3976 dnl that contains a configuration script generated by Autoconf, under
3977 dnl the same distribution terms as the rest of that program.
3979 dnl From Paul Eggert.
3983 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
3984 # if it is not already defined in <stdint.h> or <inttypes.h>.
3986 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
3988 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3989 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3990 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3991 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3992 test $ac_cv_type_unsigned_long_long = yes \
3993 && ac_type='unsigned long long' \
3994 || ac_type='unsigned long'
3995 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
3996 [Define to unsigned long or unsigned long long
3997 if <stdint.h> and <inttypes.h> don't define.])
3999 AC_DEFINE(HAVE_UINTMAX_T, 1,
4000 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
4003 # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
4004 dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
4005 dnl This file is free software, distributed under the terms of the GNU
4006 dnl General Public License. As a special exception to the GNU General
4007 dnl Public License, this file may be distributed as part of a program
4008 dnl that contains a configuration script generated by Autoconf, under
4009 dnl the same distribution terms as the rest of that program.
4011 dnl From Paul Eggert.
4013 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
4015 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
4016 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
4017 [unsigned long long ullmax = (unsigned long long) -1;
4018 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
4019 ac_cv_type_unsigned_long_long=yes,
4020 ac_cv_type_unsigned_long_long=no)])
4021 if test $ac_cv_type_unsigned_long_long = yes; then
4022 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
4023 [Define if you have the unsigned long long type.])
4028 AC_DEFUN([BASH_FUNC_FPURGE],
4030 AC_CHECK_FUNCS_ONCE([fpurge])
4031 AC_CHECK_FUNCS_ONCE([__fpurge])
4032 AC_CHECK_DECLS([fpurge], , , [#include <stdio.h>])
4035 AC_DEFUN([BASH_FUNC_SNPRINTF],
4037 AC_CHECK_FUNCS_ONCE([snprintf])
4038 if test X$ac_cv_func_snprintf = Xyes; then
4039 AC_CACHE_CHECK([for standard-conformant snprintf], [bash_cv_func_snprintf],
4046 n = snprintf (0, 0, "%s", "0123456");
4049 ], bash_cv_func_snprintf=yes, bash_cv_func_snprintf=no,
4050 [AC_MSG_WARN([cannot check standard snprintf if cross-compiling])
4051 bash_cv_func_snprintf=yes]
4053 if test $bash_cv_func_snprintf = no; then
4054 ac_cv_func_snprintf=no
4057 if test $ac_cv_func_snprintf = no; then
4058 AC_DEFINE(HAVE_SNPRINTF, 0,
4059 [Define if you have a standard-conformant snprintf function.])
4063 AC_DEFUN([BASH_FUNC_VSNPRINTF],
4065 AC_CHECK_FUNCS_ONCE([vsnprintf])
4066 if test X$ac_cv_func_vsnprintf = Xyes; then
4067 AC_CACHE_CHECK([for standard-conformant vsnprintf], [bash_cv_func_vsnprintf],
4072 #include <varargs.h>
4079 foo(const char *fmt, ...)
4081 foo(format, va_alist)
4090 va_start(args, fmt);
4094 n = vsnprintf(0, 0, fmt, args);
4102 n = foo("%s", "0123456");
4105 ], bash_cv_func_vsnprintf=yes, bash_cv_func_vsnprintf=no,
4106 [AC_MSG_WARN([cannot check standard vsnprintf if cross-compiling])
4107 bash_cv_func_vsnprintf=yes]
4109 if test $bash_cv_func_vsnprintf = no; then
4110 ac_cv_func_vsnprintf=no
4113 if test $ac_cv_func_vsnprintf = no; then
4114 AC_DEFINE(HAVE_VSNPRINTF, 0,
4115 [Define if you have a standard-conformant vsnprintf function.])