Deleted Added
full compact
aclocal.m4 (119610) aclocal.m4 (136644)
1dnl
2dnl Bash specific tests
3dnl
4dnl Some derived from PDKSH 5.1.3 autoconf tests
5dnl
6
7AC_DEFUN(BASH_C_LONG_LONG,
8[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,

--- 671 unchanged lines hidden (view full) ---

680)])
681AC_MSG_RESULT($bash_cv_ulimit_maxfds)
682if test $bash_cv_ulimit_maxfds = yes; then
683AC_DEFINE(ULIMIT_MAXFDS)
684fi
685])
686
687AC_DEFUN(BASH_FUNC_GETCWD,
1dnl
2dnl Bash specific tests
3dnl
4dnl Some derived from PDKSH 5.1.3 autoconf tests
5dnl
6
7AC_DEFUN(BASH_C_LONG_LONG,
8[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,

--- 671 unchanged lines hidden (view full) ---

680)])
681AC_MSG_RESULT($bash_cv_ulimit_maxfds)
682if test $bash_cv_ulimit_maxfds = yes; then
683AC_DEFINE(ULIMIT_MAXFDS)
684fi
685])
686
687AC_DEFUN(BASH_FUNC_GETCWD,
688[AC_MSG_CHECKING([if getcwd() calls popen()])
689AC_CACHE_VAL(bash_cv_getcwd_calls_popen,
688[AC_MSG_CHECKING([if getcwd() will dynamically allocate memory])
689AC_CACHE_VAL(bash_cv_getcwd_malloc,
690[AC_TRY_RUN([
691#include <stdio.h>
692#ifdef HAVE_UNISTD_H
693#include <unistd.h>
694#endif
695
690[AC_TRY_RUN([
691#include <stdio.h>
692#ifdef HAVE_UNISTD_H
693#include <unistd.h>
694#endif
695
696#ifndef __STDC__
697#ifndef const
698#define const
699#endif
700#endif
701
702int popen_called;
703
704FILE *
705popen(command, type)
706 const char *command;
707 const char *type;
708{
709 popen_called = 1;
710 return (FILE *)NULL;
711}
712
713FILE *_popen(command, type)
714 const char *command;
715 const char *type;
716{
717 return (popen (command, type));
718}
719
720int
721pclose(stream)
722FILE *stream;
723{
724 return 0;
725}
726
727int
728_pclose(stream)
729FILE *stream;
730{
731 return 0;
732}
733
734main()
735{
696main()
697{
736 char lbuf[32];
737 popen_called = 0;
738 getcwd(lbuf, 32);
739 exit (popen_called);
698 char *xpwd;
699 xpwd = getcwd(0, 0);
700 exit (xpwd == 0);
740}
701}
741], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
742 [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
743 bash_cv_getcwd_calls_popen=no]
702], bash_cv_getcwd_malloc=yes, bash_cv_getcwd_malloc=no,
703 [AC_MSG_WARN(cannot check whether getcwd allocates memory when cross-compiling -- defaulting to no)
704 bash_cv_getcwd_malloc=no]
744)])
705)])
745AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
746if test $bash_cv_getcwd_calls_popen = yes; then
706AC_MSG_RESULT($bash_cv_getcwd_malloc)
707if test $bash_cv_getcwd_malloc = no; then
747AC_DEFINE(GETCWD_BROKEN)
748AC_LIBOBJ(getcwd)
749fi
750])
751
752dnl
753dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
754dnl system, we can't use AC_PREREQ

--- 221 unchanged lines hidden (view full) ---

976[
977if test "X$bash_cv_termcap_lib" = "X"; then
978_bash_needmsg=yes
979else
980AC_MSG_CHECKING(which library has the termcap functions)
981_bash_needmsg=
982fi
983AC_CACHE_VAL(bash_cv_termcap_lib,
708AC_DEFINE(GETCWD_BROKEN)
709AC_LIBOBJ(getcwd)
710fi
711])
712
713dnl
714dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
715dnl system, we can't use AC_PREREQ

--- 221 unchanged lines hidden (view full) ---

937[
938if test "X$bash_cv_termcap_lib" = "X"; then
939_bash_needmsg=yes
940else
941AC_MSG_CHECKING(which library has the termcap functions)
942_bash_needmsg=
943fi
944AC_CACHE_VAL(bash_cv_termcap_lib,
984[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
945[AC_CHECK_FUNC(tgetent, bash_cv_termcap_lib=libc,
946 [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
985 [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo,
986 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
987 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
947 [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo,
948 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
949 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
988 bash_cv_termcap_lib=gnutermcap)])])])])
950 bash_cv_termcap_lib=gnutermcap)])])])])])
989if test "X$_bash_needmsg" = "Xyes"; then
990AC_MSG_CHECKING(which library has the termcap functions)
991fi
992AC_MSG_RESULT(using $bash_cv_termcap_lib)
993if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
994LDFLAGS="$LDFLAGS -L./lib/termcap"
995TERMCAP_LIB="./lib/termcap/libtermcap.a"
996TERMCAP_DEP="./lib/termcap/libtermcap.a"
997elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
998TERMCAP_LIB=-ltermcap
999TERMCAP_DEP=
1000elif test $bash_cv_termcap_lib = libtinfo; then
1001TERMCAP_LIB=-ltinfo
1002TERMCAP_DEP=
1003elif test $bash_cv_termcap_lib = libncurses; then
1004TERMCAP_LIB=-lncurses
1005TERMCAP_DEP=
951if test "X$_bash_needmsg" = "Xyes"; then
952AC_MSG_CHECKING(which library has the termcap functions)
953fi
954AC_MSG_RESULT(using $bash_cv_termcap_lib)
955if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
956LDFLAGS="$LDFLAGS -L./lib/termcap"
957TERMCAP_LIB="./lib/termcap/libtermcap.a"
958TERMCAP_DEP="./lib/termcap/libtermcap.a"
959elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
960TERMCAP_LIB=-ltermcap
961TERMCAP_DEP=
962elif test $bash_cv_termcap_lib = libtinfo; then
963TERMCAP_LIB=-ltinfo
964TERMCAP_DEP=
965elif test $bash_cv_termcap_lib = libncurses; then
966TERMCAP_LIB=-lncurses
967TERMCAP_DEP=
968elif test $bash_cv_termcap_lib = libc; then
969TERMCAP_LIB=
970TERMCAP_DEP=
1006else
1007TERMCAP_LIB=-lcurses
1008TERMCAP_DEP=
1009fi
1010])
1011
1012dnl
1013dnl Check for the presence of getpeername in libsocket.

--- 42 unchanged lines hidden (view full) ---

1056 fi
1057 AC_DEFINE(HAVE_LIBSOCKET)
1058 AC_DEFINE(HAVE_GETPEERNAME)
1059fi
1060])
1061
1062AC_DEFUN(BASH_STRUCT_DIRENT_D_INO,
1063[AC_REQUIRE([AC_HEADER_DIRENT])
971else
972TERMCAP_LIB=-lcurses
973TERMCAP_DEP=
974fi
975])
976
977dnl
978dnl Check for the presence of getpeername in libsocket.

--- 42 unchanged lines hidden (view full) ---

1021 fi
1022 AC_DEFINE(HAVE_LIBSOCKET)
1023 AC_DEFINE(HAVE_GETPEERNAME)
1024fi
1025])
1026
1027AC_DEFUN(BASH_STRUCT_DIRENT_D_INO,
1028[AC_REQUIRE([AC_HEADER_DIRENT])
1064AC_MSG_CHECKING(if struct dirent has a d_ino member)
1029AC_MSG_CHECKING(for struct dirent.d_ino)
1065AC_CACHE_VAL(bash_cv_dirent_has_dino,
1066[AC_TRY_COMPILE([
1067#include <stdio.h>
1068#include <sys/types.h>
1069#ifdef HAVE_UNISTD_H
1070# include <unistd.h>
1071#endif /* HAVE_UNISTD_H */
1072#if defined(HAVE_DIRENT_H)

--- 10 unchanged lines hidden (view full) ---

1083# include <ndir.h>
1084# endif
1085#endif /* HAVE_DIRENT_H */
1086],[
1087struct dirent d; int z; z = d.d_ino;
1088], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)])
1089AC_MSG_RESULT($bash_cv_dirent_has_dino)
1090if test $bash_cv_dirent_has_dino = yes; then
1030AC_CACHE_VAL(bash_cv_dirent_has_dino,
1031[AC_TRY_COMPILE([
1032#include <stdio.h>
1033#include <sys/types.h>
1034#ifdef HAVE_UNISTD_H
1035# include <unistd.h>
1036#endif /* HAVE_UNISTD_H */
1037#if defined(HAVE_DIRENT_H)

--- 10 unchanged lines hidden (view full) ---

1048# include <ndir.h>
1049# endif
1050#endif /* HAVE_DIRENT_H */
1051],[
1052struct dirent d; int z; z = d.d_ino;
1053], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)])
1054AC_MSG_RESULT($bash_cv_dirent_has_dino)
1055if test $bash_cv_dirent_has_dino = yes; then
1091AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
1056AC_DEFINE(HAVE_STRUCT_DIRENT_D_INO)
1092fi
1093])
1094
1095AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO,
1096[AC_REQUIRE([AC_HEADER_DIRENT])
1057fi
1058])
1059
1060AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO,
1061[AC_REQUIRE([AC_HEADER_DIRENT])
1097AC_MSG_CHECKING(if struct dirent has a d_fileno member)
1062AC_MSG_CHECKING(for struct dirent.d_fileno)
1098AC_CACHE_VAL(bash_cv_dirent_has_d_fileno,
1099[AC_TRY_COMPILE([
1100#include <stdio.h>
1101#include <sys/types.h>
1102#ifdef HAVE_UNISTD_H
1103# include <unistd.h>
1104#endif /* HAVE_UNISTD_H */
1105#if defined(HAVE_DIRENT_H)

--- 10 unchanged lines hidden (view full) ---

1116# include <ndir.h>
1117# endif
1118#endif /* HAVE_DIRENT_H */
1119],[
1120struct dirent d; int z; z = d.d_fileno;
1121], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)])
1122AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
1123if test $bash_cv_dirent_has_d_fileno = yes; then
1063AC_CACHE_VAL(bash_cv_dirent_has_d_fileno,
1064[AC_TRY_COMPILE([
1065#include <stdio.h>
1066#include <sys/types.h>
1067#ifdef HAVE_UNISTD_H
1068# include <unistd.h>
1069#endif /* HAVE_UNISTD_H */
1070#if defined(HAVE_DIRENT_H)

--- 10 unchanged lines hidden (view full) ---

1081# include <ndir.h>
1082# endif
1083#endif /* HAVE_DIRENT_H */
1084],[
1085struct dirent d; int z; z = d.d_fileno;
1086], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)])
1087AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
1088if test $bash_cv_dirent_has_d_fileno = yes; then
1124AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO)
1089AC_DEFINE(HAVE_STRUCT_DIRENT_D_FILENO)
1125fi
1126])
1127
1090fi
1091])
1092
1093AC_DEFUN(BASH_STRUCT_DIRENT_D_NAMLEN,
1094[AC_REQUIRE([AC_HEADER_DIRENT])
1095AC_MSG_CHECKING(for struct dirent.d_namlen)
1096AC_CACHE_VAL(bash_cv_dirent_has_d_namlen,
1097[AC_TRY_COMPILE([
1098#include <stdio.h>
1099#include <sys/types.h>
1100#ifdef HAVE_UNISTD_H
1101# include <unistd.h>
1102#endif /* HAVE_UNISTD_H */
1103#if defined(HAVE_DIRENT_H)
1104# include <dirent.h>
1105#else
1106# define dirent direct
1107# ifdef HAVE_SYS_NDIR_H
1108# include <sys/ndir.h>
1109# endif /* SYSNDIR */
1110# ifdef HAVE_SYS_DIR_H
1111# include <sys/dir.h>
1112# endif /* SYSDIR */
1113# ifdef HAVE_NDIR_H
1114# include <ndir.h>
1115# endif
1116#endif /* HAVE_DIRENT_H */
1117],[
1118struct dirent d; int z; z = d.d_namlen;
1119], bash_cv_dirent_has_d_namlen=yes, bash_cv_dirent_has_d_namlen=no)])
1120AC_MSG_RESULT($bash_cv_dirent_has_d_namlen)
1121if test $bash_cv_dirent_has_d_namlen = yes; then
1122AC_DEFINE(HAVE_STRUCT_DIRENT_D_NAMLEN)
1123fi
1124])
1125
1128AC_DEFUN(BASH_STRUCT_TIMEVAL,
1129[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
1130AC_CACHE_VAL(bash_cv_struct_timeval,
1131[
1132AC_EGREP_HEADER(struct timeval, sys/time.h,
1133 bash_cv_struct_timeval=yes,
1134 AC_EGREP_HEADER(struct timeval, time.h,
1135 bash_cv_struct_timeval=yes,
1136 bash_cv_struct_timeval=no))
1137])
1138AC_MSG_RESULT($bash_cv_struct_timeval)
1139if test $bash_cv_struct_timeval = yes; then
1140 AC_DEFINE(HAVE_TIMEVAL)
1141fi
1142])
1143
1126AC_DEFUN(BASH_STRUCT_TIMEVAL,
1127[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
1128AC_CACHE_VAL(bash_cv_struct_timeval,
1129[
1130AC_EGREP_HEADER(struct timeval, sys/time.h,
1131 bash_cv_struct_timeval=yes,
1132 AC_EGREP_HEADER(struct timeval, time.h,
1133 bash_cv_struct_timeval=yes,
1134 bash_cv_struct_timeval=no))
1135])
1136AC_MSG_RESULT($bash_cv_struct_timeval)
1137if test $bash_cv_struct_timeval = yes; then
1138 AC_DEFINE(HAVE_TIMEVAL)
1139fi
1140])
1141
1142AC_DEFUN(BASH_STRUCT_TIMEZONE,
1143[AC_MSG_CHECKING(for struct timezone in sys/time.h and time.h)
1144AC_CACHE_VAL(bash_cv_struct_timezone,
1145[
1146AC_EGREP_HEADER(struct timezone, sys/time.h,
1147 bash_cv_struct_timezone=yes,
1148 AC_EGREP_HEADER(struct timezone, time.h,
1149 bash_cv_struct_timezone=yes,
1150 bash_cv_struct_timezone=no))
1151])
1152AC_MSG_RESULT($bash_cv_struct_timezone)
1153if test $bash_cv_struct_timezone = yes; then
1154 AC_DEFINE(HAVE_STRUCT_TIMEZONE)
1155fi
1156])
1157
1144AC_DEFUN(BASH_STRUCT_WINSIZE,
1145[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
1146AC_CACHE_VAL(bash_cv_struct_winsize_header,
1147[AC_TRY_COMPILE([#include <sys/types.h>
1148#include <sys/ioctl.h>], [struct winsize x;],
1149 bash_cv_struct_winsize_header=ioctl_h,
1150 [AC_TRY_COMPILE([#include <sys/types.h>
1151#include <termios.h>], [struct winsize x;],

--- 369 unchanged lines hidden (view full) ---

1521if test $bash_cv_getpw_declared = yes; then
1522AC_DEFINE(HAVE_GETPW_DECLS)
1523fi
1524])
1525
1526AC_DEFUN(BASH_CHECK_DEV_FD,
1527[AC_MSG_CHECKING(whether /dev/fd is available)
1528AC_CACHE_VAL(bash_cv_dev_fd,
1158AC_DEFUN(BASH_STRUCT_WINSIZE,
1159[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
1160AC_CACHE_VAL(bash_cv_struct_winsize_header,
1161[AC_TRY_COMPILE([#include <sys/types.h>
1162#include <sys/ioctl.h>], [struct winsize x;],
1163 bash_cv_struct_winsize_header=ioctl_h,
1164 [AC_TRY_COMPILE([#include <sys/types.h>
1165#include <termios.h>], [struct winsize x;],

--- 369 unchanged lines hidden (view full) ---

1535if test $bash_cv_getpw_declared = yes; then
1536AC_DEFINE(HAVE_GETPW_DECLS)
1537fi
1538])
1539
1540AC_DEFUN(BASH_CHECK_DEV_FD,
1541[AC_MSG_CHECKING(whether /dev/fd is available)
1542AC_CACHE_VAL(bash_cv_dev_fd,
1529[if test -d /dev/fd && test -r /dev/fd/0; then
1543[if test -d /dev/fd && test -r /dev/fd/0 < /dev/null; then
1530 bash_cv_dev_fd=standard
1544 bash_cv_dev_fd=standard
1531 elif test -d /proc/self/fd && test -r /proc/self/fd/0; then
1545 elif test -d /proc/self/fd && test -r /proc/self/fd/0 < /dev/null; then
1532 bash_cv_dev_fd=whacky
1533 else
1534 bash_cv_dev_fd=absent
1535 fi
1536])
1537AC_MSG_RESULT($bash_cv_dev_fd)
1538if test $bash_cv_dev_fd = "standard"; then
1539 AC_DEFINE(HAVE_DEV_FD)
1540 AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
1541elif test $bash_cv_dev_fd = "whacky"; then
1542 AC_DEFINE(HAVE_DEV_FD)
1543 AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
1544fi
1545])
1546
1547AC_DEFUN(BASH_CHECK_DEV_STDIN,
1548[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
1549AC_CACHE_VAL(bash_cv_dev_stdin,
1546 bash_cv_dev_fd=whacky
1547 else
1548 bash_cv_dev_fd=absent
1549 fi
1550])
1551AC_MSG_RESULT($bash_cv_dev_fd)
1552if test $bash_cv_dev_fd = "standard"; then
1553 AC_DEFINE(HAVE_DEV_FD)
1554 AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
1555elif test $bash_cv_dev_fd = "whacky"; then
1556 AC_DEFINE(HAVE_DEV_FD)
1557 AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
1558fi
1559])
1560
1561AC_DEFUN(BASH_CHECK_DEV_STDIN,
1562[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
1563AC_CACHE_VAL(bash_cv_dev_stdin,
1550[if test -d /dev/fd && test -r /dev/stdin; then
1564[if test -d /dev/fd && test -r /dev/stdin < /dev/null; then
1551 bash_cv_dev_stdin=present
1565 bash_cv_dev_stdin=present
1552 elif test -d /proc/self/fd && test -r /dev/stdin; then
1566 elif test -d /proc/self/fd && test -r /dev/stdin < /dev/null; then
1553 bash_cv_dev_stdin=present
1554 else
1555 bash_cv_dev_stdin=absent
1556 fi
1557])
1558AC_MSG_RESULT($bash_cv_dev_stdin)
1559if test $bash_cv_dev_stdin = "present"; then
1560 AC_DEFINE(HAVE_DEV_STDIN)

--- 87 unchanged lines hidden (view full) ---

1648dnl
1649AC_DEFUN(BASH_CHECK_MULTIBYTE,
1650[
1651AC_CHECK_HEADERS(wctype.h)
1652AC_CHECK_HEADERS(wchar.h)
1653AC_CHECK_HEADERS(langinfo.h)
1654
1655AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
1567 bash_cv_dev_stdin=present
1568 else
1569 bash_cv_dev_stdin=absent
1570 fi
1571])
1572AC_MSG_RESULT($bash_cv_dev_stdin)
1573if test $bash_cv_dev_stdin = "present"; then
1574 AC_DEFINE(HAVE_DEV_STDIN)

--- 87 unchanged lines hidden (view full) ---

1662dnl
1663AC_DEFUN(BASH_CHECK_MULTIBYTE,
1664[
1665AC_CHECK_HEADERS(wctype.h)
1666AC_CHECK_HEADERS(wchar.h)
1667AC_CHECK_HEADERS(langinfo.h)
1668
1669AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
1670AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC))
1671AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN))
1672AC_CHECK_FUNC(wctomb, AC_DEFINE(HAVE_WCTOMB))
1656AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
1673AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
1674AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP))
1657
1658AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
1675
1676AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
1659[AC_TRY_RUN([
1660#include
1661int
1662main ()
1663{
1677[AC_TRY_COMPILE([
1678#include <wchar.h>], [
1664 mbstate_t ps;
1679 mbstate_t ps;
1665 return 0;
1666}], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)])
1680 mbstate_t *psp;
1681 psp = (mbstate_t *)0;
1682], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)])
1667if test $bash_cv_have_mbstate_t = yes; then
1668 AC_DEFINE(HAVE_MBSTATE_T)
1669fi
1670
1671AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset,
1672[AC_TRY_LINK(
1673[#include <langinfo.h>],
1674[char* cs = nl_langinfo(CODESET);],

--- 32 unchanged lines hidden (view full) ---

1707
1708eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include
1709eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib
1710
1711LIBS="$LIBS -lreadline ${TERMCAP_LIB}"
1712CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}"
1713LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}"
1714
1683if test $bash_cv_have_mbstate_t = yes; then
1684 AC_DEFINE(HAVE_MBSTATE_T)
1685fi
1686
1687AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset,
1688[AC_TRY_LINK(
1689[#include <langinfo.h>],
1690[char* cs = nl_langinfo(CODESET);],

--- 32 unchanged lines hidden (view full) ---

1723
1724eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include
1725eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib
1726
1727LIBS="$LIBS -lreadline ${TERMCAP_LIB}"
1728CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}"
1729LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}"
1730
1715AC_TRY_RUN([
1731AC_CACHE_VAL(ac_cv_rl_version,
1732[AC_TRY_RUN([
1716#include <stdio.h>
1717#include <readline/readline.h>
1718
1719main()
1720{
1721 FILE *fp;
1722 fp = fopen("conftest.rlv", "w");
1723 if (fp == 0) exit(1);
1724 fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0");
1725 fclose(fp);
1726 exit(0);
1727}
1728],
1729ac_cv_rl_version=`cat conftest.rlv`,
1730ac_cv_rl_version='0.0',
1733#include <stdio.h>
1734#include <readline/readline.h>
1735
1736main()
1737{
1738 FILE *fp;
1739 fp = fopen("conftest.rlv", "w");
1740 if (fp == 0) exit(1);
1741 fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0");
1742 fclose(fp);
1743 exit(0);
1744}
1745],
1746ac_cv_rl_version=`cat conftest.rlv`,
1747ac_cv_rl_version='0.0',
1731ac_cv_rl_version='4.2')
1748ac_cv_rl_version='4.2')])
1732
1733CFLAGS="$_save_CFLAGS"
1734LDFLAGS="$_save_LDFLAGS"
1735LIBS="$_save_LIBS"
1736
1737RL_MAJOR=0
1738RL_MINOR=0
1739

--- 45 unchanged lines hidden (view full) ---

1785RL_PREFIX=$ac_cv_rl_prefix
1786RL_LIBDIR=$ac_cv_rl_libdir
1787RL_INCLUDEDIR=$ac_cv_rl_includedir
1788
1789AC_MSG_RESULT($ac_cv_rl_version)
1790
1791fi
1792])
1749
1750CFLAGS="$_save_CFLAGS"
1751LDFLAGS="$_save_LDFLAGS"
1752LIBS="$_save_LIBS"
1753
1754RL_MAJOR=0
1755RL_MINOR=0
1756

--- 45 unchanged lines hidden (view full) ---

1802RL_PREFIX=$ac_cv_rl_prefix
1803RL_LIBDIR=$ac_cv_rl_libdir
1804RL_INCLUDEDIR=$ac_cv_rl_includedir
1805
1806AC_MSG_RESULT($ac_cv_rl_version)
1807
1808fi
1809])
1810
1811AC_DEFUN(BASH_FUNC_CTYPE_NONASCII,
1812[
1813AC_MSG_CHECKING(whether the ctype macros accept non-ascii characters)
1814AC_CACHE_VAL(bash_cv_func_ctype_nonascii,
1815[AC_TRY_RUN([
1816#ifdef HAVE_LOCALE_H
1817#include <locale.h>
1818#endif
1819#include <stdio.h>
1820#include <ctype.h>
1821
1822main(c, v)
1823int c;
1824char *v[];
1825{
1826 char *deflocale;
1827 unsigned char x;
1828 int r1, r2;
1829
1830#ifdef HAVE_SETLOCALE
1831 /* We take a shot here. If that locale is not known, try the
1832 system default. We try this one because '\342' (226) is
1833 known to be a printable character in that locale. */
1834 deflocale = setlocale(LC_ALL, "en_US.ISO8859-1");
1835 if (deflocale == 0)
1836 deflocale = setlocale(LC_ALL, "");
1837#endif
1838
1839 x = '\342';
1840 r1 = isprint(x);
1841 x -= 128;
1842 r2 = isprint(x);
1843 exit (r1 == 0 || r2 == 0);
1844}
1845], bash_cv_func_ctype_nonascii=yes, bash_cv_func_ctype_nonascii=no,
1846 [AC_MSG_WARN(cannot check ctype macros if cross compiling -- defaulting to no)
1847 bash_cv_func_ctype_nonascii=no]
1848)])
1849AC_MSG_RESULT($bash_cv_func_ctype_nonascii)
1850if test $bash_cv_func_ctype_nonascii = yes; then
1851AC_DEFINE(CTYPE_NON_ASCII)
1852fi
1853])
1854
1855dnl
1856dnl tests added for bashdb
1857dnl
1858
1859
1860AC_DEFUN([AM_PATH_LISPDIR],
1861 [AC_ARG_WITH(lispdir, AC_HELP_STRING([--with-lispdir], [override the default lisp directory]),
1862 [ lispdir="$withval"
1863 AC_MSG_CHECKING([where .elc files should go])
1864 AC_MSG_RESULT([$lispdir])],
1865 [
1866 # If set to t, that means we are running in a shell under Emacs.
1867 # If you have an Emacs named "t", then use the full path.
1868 test x"$EMACS" = xt && EMACS=
1869 AC_CHECK_PROGS(EMACS, emacs xemacs, no)
1870 if test $EMACS != "no"; then
1871 if test x${lispdir+set} != xset; then
1872 AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [dnl
1873 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;}'`
1874 if test -z "$am_cv_lispdir"; then
1875 am_cv_lispdir='${datadir}/emacs/site-lisp'
1876 fi
1877 ])
1878 lispdir="$am_cv_lispdir"
1879 fi
1880 fi
1881 ])
1882 AC_SUBST(lispdir)
1883])
1884
1885dnl
1886dnl tests added for gettext
1887dnl
1888# codeset.m4 serial AM1 (gettext-0.10.40)
1889dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1890dnl This file is free software, distributed under the terms of the GNU
1891dnl General Public License. As a special exception to the GNU General
1892dnl Public License, this file may be distributed as part of a program
1893dnl that contains a configuration script generated by Autoconf, under
1894dnl the same distribution terms as the rest of that program.
1895
1896dnl From Bruno Haible.
1897
1898AC_DEFUN([AM_LANGINFO_CODESET],
1899[
1900 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1901 [AC_TRY_LINK([#include <langinfo.h>],
1902 [char* cs = nl_langinfo(CODESET);],
1903 am_cv_langinfo_codeset=yes,
1904 am_cv_langinfo_codeset=no)
1905 ])
1906 if test $am_cv_langinfo_codeset = yes; then
1907 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1908 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1909 fi
1910])
1911# gettext.m4 serial 20 (gettext-0.12)
1912dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1913dnl This file is free software, distributed under the terms of the GNU
1914dnl General Public License. As a special exception to the GNU General
1915dnl Public License, this file may be distributed as part of a program
1916dnl that contains a configuration script generated by Autoconf, under
1917dnl the same distribution terms as the rest of that program.
1918dnl
1919dnl This file can can be used in projects which are not available under
1920dnl the GNU General Public License or the GNU Library General Public
1921dnl License but which still want to provide support for the GNU gettext
1922dnl functionality.
1923dnl Please note that the actual code of the GNU gettext library is covered
1924dnl by the GNU Library General Public License, and the rest of the GNU
1925dnl gettext package package is covered by the GNU General Public License.
1926dnl They are *not* in the public domain.
1927
1928dnl Authors:
1929dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1930dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1931
1932dnl Macro to add for using GNU gettext.
1933
1934dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1935dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1936dnl default (if it is not specified or empty) is 'no-libtool'.
1937dnl INTLSYMBOL should be 'external' for packages with no intl directory,
1938dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1939dnl If INTLSYMBOL is 'use-libtool', then a libtool library
1940dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1941dnl depending on --{enable,disable}-{shared,static} and on the presence of
1942dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1943dnl $(top_builddir)/intl/libintl.a will be created.
1944dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1945dnl implementations (in libc or libintl) without the ngettext() function
1946dnl will be ignored. If NEEDSYMBOL is specified and is
1947dnl 'need-formatstring-macros', then GNU gettext implementations that don't
1948dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1949dnl INTLDIR is used to find the intl libraries. If empty,
1950dnl the value `$(top_builddir)/intl/' is used.
1951dnl
1952dnl The result of the configuration is one of three cases:
1953dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1954dnl and used.
1955dnl Catalog format: GNU --> install in $(datadir)
1956dnl Catalog extension: .mo after installation, .gmo in source tree
1957dnl 2) GNU gettext has been found in the system's C library.
1958dnl Catalog format: GNU --> install in $(datadir)
1959dnl Catalog extension: .mo after installation, .gmo in source tree
1960dnl 3) No internationalization, always use English msgid.
1961dnl Catalog format: none
1962dnl Catalog extension: none
1963dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1964dnl The use of .gmo is historical (it was needed to avoid overwriting the
1965dnl GNU format catalogs when building on a platform with an X/Open gettext),
1966dnl but we keep it in order not to force irrelevant filename changes on the
1967dnl maintainers.
1968dnl
1969AC_DEFUN([AM_GNU_GETTEXT],
1970[
1971 dnl Argument checking.
1972 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1973 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1974])])])])])
1975 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1976 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1977])])])])
1978 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1979 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1980
1981 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1982 ifelse(gt_included_intl, yes, [
1983 AC_REQUIRE([AM_INTL_SUBDIR])dnl
1984 ])
1985
1986 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1987 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1988 AC_REQUIRE([AC_LIB_RPATH])
1989
1990 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1991 dnl Ideally we would do this search only after the
1992 dnl if test "$USE_NLS" = "yes"; then
1993 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1994 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1995 dnl the configure script would need to contain the same shell code
1996 dnl again, outside any 'if'. There are two solutions:
1997 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1998 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1999 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
2000 dnl documented, we avoid it.
2001 ifelse(gt_included_intl, yes, , [
2002 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2003 ])
2004
2005 dnl Set USE_NLS.
2006 AM_NLS
2007
2008 ifelse(gt_included_intl, yes, [
2009 BUILD_INCLUDED_LIBINTL=no
2010 USE_INCLUDED_LIBINTL=no
2011 ])
2012 LIBINTL=
2013 LTLIBINTL=
2014 POSUB=
2015
2016 dnl If we use NLS figure out what method
2017 if test "$USE_NLS" = "yes"; then
2018 gt_use_preinstalled_gnugettext=no
2019 ifelse(gt_included_intl, yes, [
2020 AC_MSG_CHECKING([whether included gettext is requested])
2021 AC_ARG_WITH(included-gettext,
2022 [ --with-included-gettext use the GNU gettext library included here],
2023 nls_cv_force_use_gnu_gettext=$withval,
2024 nls_cv_force_use_gnu_gettext=no)
2025 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
2026
2027 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2028 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2029 ])
2030 dnl User does not insist on using GNU NLS library. Figure out what
2031 dnl to use. If GNU gettext is available we use this. Else we have
2032 dnl to fall back to GNU NLS library.
2033
2034 dnl Add a version number to the cache macros.
2035 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
2036 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
2037 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
2038
2039 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
2040 [AC_TRY_LINK([#include <libintl.h>
2041]ifelse([$2], [need-formatstring-macros],
2042[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
2043#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
2044#endif
2045changequote(,)dnl
2046typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
2047changequote([,])dnl
2048], [])[extern int _nl_msg_cat_cntr;
2049extern int *_nl_domain_bindings;],
2050 [bindtextdomain ("", "");
2051return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
2052 gt_cv_func_gnugettext_libc=yes,
2053 gt_cv_func_gnugettext_libc=no)])
2054
2055 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
2056 dnl Sometimes libintl requires libiconv, so first search for libiconv.
2057 ifelse(gt_included_intl, yes, , [
2058 AM_ICONV_LINK
2059 ])
2060 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
2061 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
2062 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
2063 dnl even if libiconv doesn't exist.
2064 AC_LIB_LINKFLAGS_BODY([intl])
2065 AC_CACHE_CHECK([for GNU gettext in libintl],
2066 gt_cv_func_gnugettext_libintl,
2067 [gt_save_CPPFLAGS="$CPPFLAGS"
2068 CPPFLAGS="$CPPFLAGS $INCINTL"
2069 gt_save_LIBS="$LIBS"
2070 LIBS="$LIBS $LIBINTL"
2071 dnl Now see whether libintl exists and does not depend on libiconv.
2072 AC_TRY_LINK([#include <libintl.h>
2073]ifelse([$2], [need-formatstring-macros],
2074[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
2075#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
2076#endif
2077changequote(,)dnl
2078typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
2079changequote([,])dnl
2080], [])[extern int _nl_msg_cat_cntr;
2081extern
2082#ifdef __cplusplus
2083"C"
2084#endif
2085const char *_nl_expand_alias ();],
2086 [bindtextdomain ("", "");
2087return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
2088 gt_cv_func_gnugettext_libintl=yes,
2089 gt_cv_func_gnugettext_libintl=no)
2090 dnl Now see whether libintl exists and depends on libiconv.
2091 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
2092 LIBS="$LIBS $LIBICONV"
2093 AC_TRY_LINK([#include <libintl.h>
2094]ifelse([$2], [need-formatstring-macros],
2095[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
2096#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
2097#endif
2098changequote(,)dnl
2099typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
2100changequote([,])dnl
2101], [])[extern int _nl_msg_cat_cntr;
2102extern
2103#ifdef __cplusplus
2104"C"
2105#endif
2106const char *_nl_expand_alias ();],
2107 [bindtextdomain ("", "");
2108return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
2109 [LIBINTL="$LIBINTL $LIBICONV"
2110 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
2111 gt_cv_func_gnugettext_libintl=yes
2112 ])
2113 fi
2114 CPPFLAGS="$gt_save_CPPFLAGS"
2115 LIBS="$gt_save_LIBS"])
2116 fi
2117
2118 dnl If an already present or preinstalled GNU gettext() is found,
2119 dnl use it. But if this macro is used in GNU gettext, and GNU
2120 dnl gettext is already preinstalled in libintl, we update this
2121 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
2122 if test "$gt_cv_func_gnugettext_libc" = "yes" \
2123 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
2124 && test "$PACKAGE" != gettext-runtime \
2125 && test "$PACKAGE" != gettext-tools; }; then
2126 gt_use_preinstalled_gnugettext=yes
2127 else
2128 dnl Reset the values set by searching for libintl.
2129 LIBINTL=
2130 LTLIBINTL=
2131 INCINTL=
2132 fi
2133
2134 ifelse(gt_included_intl, yes, [
2135 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
2136 dnl GNU gettext is not found in the C library.
2137 dnl Fall back on included GNU gettext library.
2138 nls_cv_use_gnu_gettext=yes
2139 fi
2140 fi
2141
2142 if test "$nls_cv_use_gnu_gettext" = "yes"; then
2143 dnl Mark actions used to generate GNU NLS library.
2144 BUILD_INCLUDED_LIBINTL=yes
2145 USE_INCLUDED_LIBINTL=yes
2146 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
2147 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
2148 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
2149 fi
2150
2151 if test "$gt_use_preinstalled_gnugettext" = "yes" \
2152 || test "$nls_cv_use_gnu_gettext" = "yes"; then
2153 dnl Mark actions to use GNU gettext tools.
2154 CATOBJEXT=.gmo
2155 fi
2156 ])
2157
2158 if test "$gt_use_preinstalled_gnugettext" = "yes" \
2159 || test "$nls_cv_use_gnu_gettext" = "yes"; then
2160 AC_DEFINE(ENABLE_NLS, 1,
2161 [Define to 1 if translation of program messages to the user's native language
2162 is requested.])
2163 else
2164 USE_NLS=no
2165 fi
2166 fi
2167
2168 AC_MSG_CHECKING([whether to use NLS])
2169 AC_MSG_RESULT([$USE_NLS])
2170 if test "$USE_NLS" = "yes"; then
2171 AC_MSG_CHECKING([where the gettext function comes from])
2172 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
2173 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
2174 gt_source="external libintl"
2175 else
2176 gt_source="libc"
2177 fi
2178 else
2179 gt_source="included intl directory"
2180 fi
2181 AC_MSG_RESULT([$gt_source])
2182 fi
2183
2184 if test "$USE_NLS" = "yes"; then
2185
2186 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
2187 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
2188 AC_MSG_CHECKING([how to link with libintl])
2189 AC_MSG_RESULT([$LIBINTL])
2190 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
2191 fi
2192
2193 dnl For backward compatibility. Some packages may be using this.
2194 AC_DEFINE(HAVE_GETTEXT, 1,
2195 [Define if the GNU gettext() function is already present or preinstalled.])
2196 AC_DEFINE(HAVE_DCGETTEXT, 1,
2197 [Define if the GNU dcgettext() function is already present or preinstalled.])
2198 fi
2199
2200 dnl We need to process the po/ directory.
2201 POSUB=po
2202 fi
2203
2204 ifelse(gt_included_intl, yes, [
2205 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
2206 dnl to 'yes' because some of the testsuite requires it.
2207 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
2208 BUILD_INCLUDED_LIBINTL=yes
2209 fi
2210
2211 dnl Make all variables we use known to autoconf.
2212 AC_SUBST(BUILD_INCLUDED_LIBINTL)
2213 AC_SUBST(USE_INCLUDED_LIBINTL)
2214 AC_SUBST(CATOBJEXT)
2215
2216 dnl For backward compatibility. Some configure.ins may be using this.
2217 nls_cv_header_intl=
2218 nls_cv_header_libgt=
2219
2220 dnl For backward compatibility. Some Makefiles may be using this.
2221 DATADIRNAME=share
2222 AC_SUBST(DATADIRNAME)
2223
2224 dnl For backward compatibility. Some Makefiles may be using this.
2225 INSTOBJEXT=.mo
2226 AC_SUBST(INSTOBJEXT)
2227
2228 dnl For backward compatibility. Some Makefiles may be using this.
2229 GENCAT=gencat
2230 AC_SUBST(GENCAT)
2231
2232 dnl For backward compatibility. Some Makefiles may be using this.
2233 if test "$USE_INCLUDED_LIBINTL" = yes; then
2234 INTLOBJS="\$(GETTOBJS)"
2235 fi
2236 AC_SUBST(INTLOBJS)
2237
2238 dnl Enable libtool support if the surrounding package wishes it.
2239 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
2240 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
2241 ])
2242
2243 dnl For backward compatibility. Some Makefiles may be using this.
2244 INTLLIBS="$LIBINTL"
2245 AC_SUBST(INTLLIBS)
2246
2247 dnl Make all documented variables known to autoconf.
2248 AC_SUBST(LIBINTL)
2249 AC_SUBST(LTLIBINTL)
2250 AC_SUBST(POSUB)
2251])
2252
2253
2254dnl Checks for all prerequisites of the intl subdirectory,
2255dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
2256dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
2257AC_DEFUN([AM_INTL_SUBDIR],
2258[
2259 AC_REQUIRE([AC_PROG_INSTALL])dnl
2260 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
2261 AC_REQUIRE([AC_PROG_CC])dnl
2262 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2263 AC_REQUIRE([AC_PROG_RANLIB])dnl
2264 AC_REQUIRE([AC_ISC_POSIX])dnl
2265 AC_REQUIRE([AC_HEADER_STDC])dnl
2266 AC_REQUIRE([AC_C_CONST])dnl
2267 AC_REQUIRE([AC_C_INLINE])dnl
2268 AC_REQUIRE([AC_TYPE_OFF_T])dnl
2269 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2270 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2271 AC_REQUIRE([AC_FUNC_MMAP])dnl
2272 AC_REQUIRE([jm_GLIBC21])dnl
2273 AC_REQUIRE([gt_INTDIV0])dnl
2274 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
2275 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
2276 AC_REQUIRE([gt_INTTYPES_PRI])dnl
2277
2278 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
2279stdlib.h string.h unistd.h sys/param.h])
2280 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
2281geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
2282strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
2283__fsetlocking])
2284
2285 AM_ICONV
2286 AM_LANGINFO_CODESET
2287 if test $ac_cv_header_locale_h = yes; then
2288 AM_LC_MESSAGES
2289 fi
2290
2291 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
2292 dnl because plural.y uses bison specific features. It requires at least
2293 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
2294 dnl compile.
2295 dnl bison is only needed for the maintainer (who touches plural.y). But in
2296 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
2297 dnl the rule in general Makefile. Now, some people carelessly touch the
2298 dnl files or have a broken "make" program, hence the plural.c rule will
2299 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
2300 dnl present or too old.
2301 AC_CHECK_PROGS([INTLBISON], [bison])
2302 if test -z "$INTLBISON"; then
2303 ac_verc_fail=yes
2304 else
2305 dnl Found it, now check the version.
2306 AC_MSG_CHECKING([version of bison])
2307changequote(<<,>>)dnl
2308 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
2309 case $ac_prog_version in
2310 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
2311 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
2312changequote([,])dnl
2313 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
2314 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
2315 esac
2316 AC_MSG_RESULT([$ac_prog_version])
2317 fi
2318 if test $ac_verc_fail = yes; then
2319 INTLBISON=:
2320 fi
2321])
2322
2323
2324dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
2325AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
2326# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2327dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2328dnl This file is free software, distributed under the terms of the GNU
2329dnl General Public License. As a special exception to the GNU General
2330dnl Public License, this file may be distributed as part of a program
2331dnl that contains a configuration script generated by Autoconf, under
2332dnl the same distribution terms as the rest of that program.
2333
2334# Test for the GNU C Library, version 2.1 or newer.
2335# From Bruno Haible.
2336
2337AC_DEFUN([jm_GLIBC21],
2338 [
2339 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2340 ac_cv_gnu_library_2_1,
2341 [AC_EGREP_CPP([Lucky GNU user],
2342 [
2343#include <features.h>
2344#ifdef __GNU_LIBRARY__
2345 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2346 Lucky GNU user
2347 #endif
2348#endif
2349 ],
2350 ac_cv_gnu_library_2_1=yes,
2351 ac_cv_gnu_library_2_1=no)
2352 ]
2353 )
2354 AC_SUBST(GLIBC21)
2355 GLIBC21="$ac_cv_gnu_library_2_1"
2356 ]
2357)
2358# iconv.m4 serial AM4 (gettext-0.11.3)
2359dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2360dnl This file is free software, distributed under the terms of the GNU
2361dnl General Public License. As a special exception to the GNU General
2362dnl Public License, this file may be distributed as part of a program
2363dnl that contains a configuration script generated by Autoconf, under
2364dnl the same distribution terms as the rest of that program.
2365
2366dnl From Bruno Haible.
2367
2368AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2369[
2370 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2371 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2372 AC_REQUIRE([AC_LIB_RPATH])
2373
2374 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2375 dnl accordingly.
2376 AC_LIB_LINKFLAGS_BODY([iconv])
2377])
2378
2379AC_DEFUN([AM_ICONV_LINK],
2380[
2381 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2382 dnl those with the standalone portable GNU libiconv installed).
2383
2384 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2385 dnl accordingly.
2386 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2387
2388 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2389 dnl because if the user has installed libiconv and not disabled its use
2390 dnl via --without-libiconv-prefix, he wants to use it. The first
2391 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2392 am_save_CPPFLAGS="$CPPFLAGS"
2393 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2394
2395 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2396 am_cv_func_iconv="no, consider installing GNU libiconv"
2397 am_cv_lib_iconv=no
2398 AC_TRY_LINK([#include <stdlib.h>
2399#include <iconv.h>],
2400 [iconv_t cd = iconv_open("","");
2401 iconv(cd,NULL,NULL,NULL,NULL);
2402 iconv_close(cd);],
2403 am_cv_func_iconv=yes)
2404 if test "$am_cv_func_iconv" != yes; then
2405 am_save_LIBS="$LIBS"
2406 LIBS="$LIBS $LIBICONV"
2407 AC_TRY_LINK([#include <stdlib.h>
2408#include <iconv.h>],
2409 [iconv_t cd = iconv_open("","");
2410 iconv(cd,NULL,NULL,NULL,NULL);
2411 iconv_close(cd);],
2412 am_cv_lib_iconv=yes
2413 am_cv_func_iconv=yes)
2414 LIBS="$am_save_LIBS"
2415 fi
2416 ])
2417 if test "$am_cv_func_iconv" = yes; then
2418 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2419 fi
2420 if test "$am_cv_lib_iconv" = yes; then
2421 AC_MSG_CHECKING([how to link with libiconv])
2422 AC_MSG_RESULT([$LIBICONV])
2423 else
2424 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2425 dnl either.
2426 CPPFLAGS="$am_save_CPPFLAGS"
2427 LIBICONV=
2428 LTLIBICONV=
2429 fi
2430 AC_SUBST(LIBICONV)
2431 AC_SUBST(LTLIBICONV)
2432])
2433
2434AC_DEFUN([AM_ICONV],
2435[
2436 AM_ICONV_LINK
2437 if test "$am_cv_func_iconv" = yes; then
2438 AC_MSG_CHECKING([for iconv declaration])
2439 AC_CACHE_VAL(am_cv_proto_iconv, [
2440 AC_TRY_COMPILE([
2441#include <stdlib.h>
2442#include <iconv.h>
2443extern
2444#ifdef __cplusplus
2445"C"
2446#endif
2447#if defined(__STDC__) || defined(__cplusplus)
2448size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2449#else
2450size_t iconv();
2451#endif
2452], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2453 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);"])
2454 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2455 AC_MSG_RESULT([$]{ac_t:-
2456 }[$]am_cv_proto_iconv)
2457 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2458 [Define as const if the declaration of iconv() needs const.])
2459 fi
2460])
2461# intdiv0.m4 serial 1 (gettext-0.11.3)
2462dnl Copyright (C) 2002 Free Software Foundation, Inc.
2463dnl This file is free software, distributed under the terms of the GNU
2464dnl General Public License. As a special exception to the GNU General
2465dnl Public License, this file may be distributed as part of a program
2466dnl that contains a configuration script generated by Autoconf, under
2467dnl the same distribution terms as the rest of that program.
2468
2469dnl From Bruno Haible.
2470
2471AC_DEFUN([gt_INTDIV0],
2472[
2473 AC_REQUIRE([AC_PROG_CC])dnl
2474 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2475
2476 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2477 gt_cv_int_divbyzero_sigfpe,
2478 [
2479 AC_TRY_RUN([
2480#include <stdlib.h>
2481#include <signal.h>
2482
2483static void
2484#ifdef __cplusplus
2485sigfpe_handler (int sig)
2486#else
2487sigfpe_handler (sig) int sig;
2488#endif
2489{
2490 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
2491 exit (sig != SIGFPE);
2492}
2493
2494int x = 1;
2495int y = 0;
2496int z;
2497int nan;
2498
2499int main ()
2500{
2501 signal (SIGFPE, sigfpe_handler);
2502/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
2503#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2504 signal (SIGTRAP, sigfpe_handler);
2505#endif
2506/* Linux/SPARC yields signal SIGILL. */
2507#if defined (__sparc__) && defined (__linux__)
2508 signal (SIGILL, sigfpe_handler);
2509#endif
2510
2511 z = x / y;
2512 nan = y / y;
2513 exit (1);
2514}
2515], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2516 [
2517 # Guess based on the CPU.
2518 case "$host_cpu" in
2519 alpha* | i[34567]86 | m68k | s390*)
2520 gt_cv_int_divbyzero_sigfpe="guessing yes";;
2521 *)
2522 gt_cv_int_divbyzero_sigfpe="guessing no";;
2523 esac
2524 ])
2525 ])
2526 case "$gt_cv_int_divbyzero_sigfpe" in
2527 *yes) value=1;;
2528 *) value=0;;
2529 esac
2530 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2531 [Define if integer division by zero raises signal SIGFPE.])
2532])
2533# inttypes.m4 serial 1 (gettext-0.11.4)
2534dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2535dnl This file is free software, distributed under the terms of the GNU
2536dnl General Public License. As a special exception to the GNU General
2537dnl Public License, this file may be distributed as part of a program
2538dnl that contains a configuration script generated by Autoconf, under
2539dnl the same distribution terms as the rest of that program.
2540
2541dnl From Paul Eggert.
2542
2543# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2544# <sys/types.h>.
2545
2546AC_DEFUN([gt_HEADER_INTTYPES_H],
2547[
2548 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2549 [
2550 AC_TRY_COMPILE(
2551 [#include <sys/types.h>
2552#include <inttypes.h>],
2553 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2554 ])
2555 if test $gt_cv_header_inttypes_h = yes; then
2556 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2557 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2558 fi
2559])
2560# inttypes_h.m4 serial 5 (gettext-0.12)
2561dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2562dnl This file is free software, distributed under the terms of the GNU
2563dnl General Public License. As a special exception to the GNU General
2564dnl Public License, this file may be distributed as part of a program
2565dnl that contains a configuration script generated by Autoconf, under
2566dnl the same distribution terms as the rest of that program.
2567
2568dnl From Paul Eggert.
2569
2570# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2571# doesn't clash with <sys/types.h>, and declares uintmax_t.
2572
2573AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2574[
2575 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2576 [AC_TRY_COMPILE(
2577 [#include <sys/types.h>
2578#include <inttypes.h>],
2579 [uintmax_t i = (uintmax_t) -1;],
2580 jm_ac_cv_header_inttypes_h=yes,
2581 jm_ac_cv_header_inttypes_h=no)])
2582 if test $jm_ac_cv_header_inttypes_h = yes; then
2583 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2584 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2585 and declares uintmax_t. ])
2586 fi
2587])
2588# inttypes-pri.m4 serial 1 (gettext-0.11.4)
2589dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2590dnl This file is free software, distributed under the terms of the GNU
2591dnl General Public License. As a special exception to the GNU General
2592dnl Public License, this file may be distributed as part of a program
2593dnl that contains a configuration script generated by Autoconf, under
2594dnl the same distribution terms as the rest of that program.
2595
2596dnl From Bruno Haible.
2597
2598# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2599# macros to non-string values. This is the case on AIX 4.3.3.
2600
2601AC_DEFUN([gt_INTTYPES_PRI],
2602[
2603 AC_REQUIRE([gt_HEADER_INTTYPES_H])
2604 if test $gt_cv_header_inttypes_h = yes; then
2605 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2606 gt_cv_inttypes_pri_broken,
2607 [
2608 AC_TRY_COMPILE([#include <inttypes.h>
2609#ifdef PRId32
2610char *p = PRId32;
2611#endif
2612], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2613 ])
2614 fi
2615 if test "$gt_cv_inttypes_pri_broken" = yes; then
2616 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2617 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
2618 fi
2619])
2620# isc-posix.m4 serial 2 (gettext-0.11.2)
2621dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2622dnl This file is free software, distributed under the terms of the GNU
2623dnl General Public License. As a special exception to the GNU General
2624dnl Public License, this file may be distributed as part of a program
2625dnl that contains a configuration script generated by Autoconf, under
2626dnl the same distribution terms as the rest of that program.
2627
2628# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
2629
2630# This test replaces the one in autoconf.
2631# Currently this macro should have the same name as the autoconf macro
2632# because gettext's gettext.m4 (distributed in the automake package)
2633# still uses it. Otherwise, the use in gettext.m4 makes autoheader
2634# give these diagnostics:
2635# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2636# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2637
2638undefine([AC_ISC_POSIX])
2639
2640AC_DEFUN([AC_ISC_POSIX],
2641 [
2642 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2643 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2644 ]
2645)
2646# lcmessage.m4 serial 3 (gettext-0.11.3)
2647dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2648dnl This file is free software, distributed under the terms of the GNU
2649dnl General Public License. As a special exception to the GNU General
2650dnl Public License, this file may be distributed as part of a program
2651dnl that contains a configuration script generated by Autoconf, under
2652dnl the same distribution terms as the rest of that program.
2653dnl
2654dnl This file can can be used in projects which are not available under
2655dnl the GNU General Public License or the GNU Library General Public
2656dnl License but which still want to provide support for the GNU gettext
2657dnl functionality.
2658dnl Please note that the actual code of the GNU gettext library is covered
2659dnl by the GNU Library General Public License, and the rest of the GNU
2660dnl gettext package package is covered by the GNU General Public License.
2661dnl They are *not* in the public domain.
2662
2663dnl Authors:
2664dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2665
2666# Check whether LC_MESSAGES is available in <locale.h>.
2667
2668AC_DEFUN([AM_LC_MESSAGES],
2669[
2670 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2671 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2672 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2673 if test $am_cv_val_LC_MESSAGES = yes; then
2674 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2675 [Define if your <locale.h> file defines LC_MESSAGES.])
2676 fi
2677])
2678# lib-ld.m4 serial 2 (gettext-0.12)
2679dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2680dnl This file is free software, distributed under the terms of the GNU
2681dnl General Public License. As a special exception to the GNU General
2682dnl Public License, this file may be distributed as part of a program
2683dnl that contains a configuration script generated by Autoconf, under
2684dnl the same distribution terms as the rest of that program.
2685
2686dnl Subroutines of libtool.m4,
2687dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2688dnl with libtool.m4.
2689
2690dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2691AC_DEFUN([AC_LIB_PROG_LD_GNU],
2692[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2693[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2694if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2695 acl_cv_prog_gnu_ld=yes
2696else
2697 acl_cv_prog_gnu_ld=no
2698fi])
2699with_gnu_ld=$acl_cv_prog_gnu_ld
2700])
2701
2702dnl From libtool-1.4. Sets the variable LD.
2703AC_DEFUN([AC_LIB_PROG_LD],
2704[AC_ARG_WITH(gnu-ld,
2705[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
2706test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2707AC_REQUIRE([AC_PROG_CC])dnl
2708AC_REQUIRE([AC_CANONICAL_HOST])dnl
2709# Prepare PATH_SEPARATOR.
2710# The user is always right.
2711if test "${PATH_SEPARATOR+set}" != set; then
2712 echo "#! /bin/sh" >conf$$.sh
2713 echo "exit 0" >>conf$$.sh
2714 chmod +x conf$$.sh
2715 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2716 PATH_SEPARATOR=';'
2717 else
2718 PATH_SEPARATOR=:
2719 fi
2720 rm -f conf$$.sh
2721fi
2722ac_prog=ld
2723if test "$GCC" = yes; then
2724 # Check if gcc -print-prog-name=ld gives a path.
2725 AC_MSG_CHECKING([for ld used by GCC])
2726 case $host in
2727 *-*-mingw*)
2728 # gcc leaves a trailing carriage return which upsets mingw
2729 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2730 *)
2731 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2732 esac
2733 case $ac_prog in
2734 # Accept absolute paths.
2735 [[\\/]* | [A-Za-z]:[\\/]*)]
2736 [re_direlt='/[^/][^/]*/\.\./']
2737 # Canonicalize the path of ld
2738 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2739 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2740 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2741 done
2742 test -z "$LD" && LD="$ac_prog"
2743 ;;
2744 "")
2745 # If it fails, then pretend we aren't using GCC.
2746 ac_prog=ld
2747 ;;
2748 *)
2749 # If it is relative, then search for the first ld in PATH.
2750 with_gnu_ld=unknown
2751 ;;
2752 esac
2753elif test "$with_gnu_ld" = yes; then
2754 AC_MSG_CHECKING([for GNU ld])
2755else
2756 AC_MSG_CHECKING([for non-GNU ld])
2757fi
2758AC_CACHE_VAL(acl_cv_path_LD,
2759[if test -z "$LD"; then
2760 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2761 for ac_dir in $PATH; do
2762 test -z "$ac_dir" && ac_dir=.
2763 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2764 acl_cv_path_LD="$ac_dir/$ac_prog"
2765 # Check to see if the program is GNU ld. I'd rather use --version,
2766 # but apparently some GNU ld's only accept -v.
2767 # Break only if it was the GNU/non-GNU ld that we prefer.
2768 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2769 test "$with_gnu_ld" != no && break
2770 else
2771 test "$with_gnu_ld" != yes && break
2772 fi
2773 fi
2774 done
2775 IFS="$ac_save_ifs"
2776else
2777 acl_cv_path_LD="$LD" # Let the user override the test with a path.
2778fi])
2779LD="$acl_cv_path_LD"
2780if test -n "$LD"; then
2781 AC_MSG_RESULT($LD)
2782else
2783 AC_MSG_RESULT(no)
2784fi
2785test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2786AC_LIB_PROG_LD_GNU
2787])
2788# lib-link.m4 serial 4 (gettext-0.12)
2789dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
2790dnl This file is free software, distributed under the terms of the GNU
2791dnl General Public License. As a special exception to the GNU General
2792dnl Public License, this file may be distributed as part of a program
2793dnl that contains a configuration script generated by Autoconf, under
2794dnl the same distribution terms as the rest of that program.
2795
2796dnl From Bruno Haible.
2797
2798dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
2799dnl the libraries corresponding to explicit and implicit dependencies.
2800dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
2801dnl augments the CPPFLAGS variable.
2802AC_DEFUN([AC_LIB_LINKFLAGS],
2803[
2804 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2805 AC_REQUIRE([AC_LIB_RPATH])
2806 define([Name],[translit([$1],[./-], [___])])
2807 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2808 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2809 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
2810 AC_LIB_LINKFLAGS_BODY([$1], [$2])
2811 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
2812 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
2813 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
2814 ])
2815 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
2816 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
2817 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
2818 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2819 AC_SUBST([LIB]NAME)
2820 AC_SUBST([LTLIB]NAME)
2821 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
2822 dnl results of this search when this library appears as a dependency.
2823 HAVE_LIB[]NAME=yes
2824 undefine([Name])
2825 undefine([NAME])
2826])
2827
2828dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
2829dnl searches for libname and the libraries corresponding to explicit and
2830dnl implicit dependencies, together with the specified include files and
2831dnl the ability to compile and link the specified testcode. If found, it
2832dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
2833dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
2834dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
2835dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
2836AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
2837[
2838 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2839 AC_REQUIRE([AC_LIB_RPATH])
2840 define([Name],[translit([$1],[./-], [___])])
2841 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2842 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2843
2844 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2845 dnl accordingly.
2846 AC_LIB_LINKFLAGS_BODY([$1], [$2])
2847
2848 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
2849 dnl because if the user has installed lib[]Name and not disabled its use
2850 dnl via --without-lib[]Name-prefix, he wants to use it.
2851 ac_save_CPPFLAGS="$CPPFLAGS"
2852 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2853
2854 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
2855 ac_save_LIBS="$LIBS"
2856 LIBS="$LIBS $LIB[]NAME"
2857 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
2858 LIBS="$ac_save_LIBS"
2859 ])
2860 if test "$ac_cv_lib[]Name" = yes; then
2861 HAVE_LIB[]NAME=yes
2862 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
2863 AC_MSG_CHECKING([how to link with lib[]$1])
2864 AC_MSG_RESULT([$LIB[]NAME])
2865 else
2866 HAVE_LIB[]NAME=no
2867 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
2868 dnl $INC[]NAME either.
2869 CPPFLAGS="$ac_save_CPPFLAGS"
2870 LIB[]NAME=
2871 LTLIB[]NAME=
2872 fi
2873 AC_SUBST([HAVE_LIB]NAME)
2874 AC_SUBST([LIB]NAME)
2875 AC_SUBST([LTLIB]NAME)
2876 undefine([Name])
2877 undefine([NAME])
2878])
2879
2880dnl Determine the platform dependent parameters needed to use rpath:
2881dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
2882dnl hardcode_direct, hardcode_minus_L.
2883AC_DEFUN([AC_LIB_RPATH],
2884[
2885 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
2886 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
2887 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
2888 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
2889 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
2890 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
2891 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
2892 . ./conftest.sh
2893 rm -f ./conftest.sh
2894 acl_cv_rpath=done
2895 ])
2896 wl="$acl_cv_wl"
2897 libext="$acl_cv_libext"
2898 shlibext="$acl_cv_shlibext"
2899 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
2900 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
2901 hardcode_direct="$acl_cv_hardcode_direct"
2902 hardcode_minus_L="$acl_cv_hardcode_minus_L"
2903 dnl Determine whether the user wants rpath handling at all.
2904 AC_ARG_ENABLE(rpath,
2905 [ --disable-rpath do not hardcode runtime library paths],
2906 :, enable_rpath=yes)
2907])
2908
2909dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
2910dnl the libraries corresponding to explicit and implicit dependencies.
2911dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
2912AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
2913[
2914 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2915 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2916 dnl By default, look in $includedir and $libdir.
2917 use_additional=yes
2918 AC_LIB_WITH_FINAL_PREFIX([
2919 eval additional_includedir=\"$includedir\"
2920 eval additional_libdir=\"$libdir\"
2921 ])
2922 AC_LIB_ARG_WITH([lib$1-prefix],
2923[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
2924 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
2925[
2926 if test "X$withval" = "Xno"; then
2927 use_additional=no
2928 else
2929 if test "X$withval" = "X"; then
2930 AC_LIB_WITH_FINAL_PREFIX([
2931 eval additional_includedir=\"$includedir\"
2932 eval additional_libdir=\"$libdir\"
2933 ])
2934 else
2935 additional_includedir="$withval/include"
2936 additional_libdir="$withval/lib"
2937 fi
2938 fi
2939])
2940 dnl Search the library and its dependencies in $additional_libdir and
2941 dnl $LDFLAGS. Using breadth-first-seach.
2942 LIB[]NAME=
2943 LTLIB[]NAME=
2944 INC[]NAME=
2945 rpathdirs=
2946 ltrpathdirs=
2947 names_already_handled=
2948 names_next_round='$1 $2'
2949 while test -n "$names_next_round"; do
2950 names_this_round="$names_next_round"
2951 names_next_round=
2952 for name in $names_this_round; do
2953 already_handled=
2954 for n in $names_already_handled; do
2955 if test "$n" = "$name"; then
2956 already_handled=yes
2957 break
2958 fi
2959 done
2960 if test -z "$already_handled"; then
2961 names_already_handled="$names_already_handled $name"
2962 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2963 dnl or AC_LIB_HAVE_LINKFLAGS call.
2964 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
2965 eval value=\"\$HAVE_LIB$uppername\"
2966 if test -n "$value"; then
2967 if test "$value" = yes; then
2968 eval value=\"\$LIB$uppername\"
2969 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2970 eval value=\"\$LTLIB$uppername\"
2971 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2972 else
2973 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2974 dnl that this library doesn't exist. So just drop it.
2975 :
2976 fi
2977 else
2978 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2979 dnl and the already constructed $LIBNAME/$LTLIBNAME.
2980 found_dir=
2981 found_la=
2982 found_so=
2983 found_a=
2984 if test $use_additional = yes; then
2985 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
2986 found_dir="$additional_libdir"
2987 found_so="$additional_libdir/lib$name.$shlibext"
2988 if test -f "$additional_libdir/lib$name.la"; then
2989 found_la="$additional_libdir/lib$name.la"
2990 fi
2991 else
2992 if test -f "$additional_libdir/lib$name.$libext"; then
2993 found_dir="$additional_libdir"
2994 found_a="$additional_libdir/lib$name.$libext"
2995 if test -f "$additional_libdir/lib$name.la"; then
2996 found_la="$additional_libdir/lib$name.la"
2997 fi
2998 fi
2999 fi
3000 fi
3001 if test "X$found_dir" = "X"; then
3002 for x in $LDFLAGS $LTLIB[]NAME; do
3003 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3004 case "$x" in
3005 -L*)
3006 dir=`echo "X$x" | sed -e 's/^X-L//'`
3007 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
3008 found_dir="$dir"
3009 found_so="$dir/lib$name.$shlibext"
3010 if test -f "$dir/lib$name.la"; then
3011 found_la="$dir/lib$name.la"
3012 fi
3013 else
3014 if test -f "$dir/lib$name.$libext"; then
3015 found_dir="$dir"
3016 found_a="$dir/lib$name.$libext"
3017 if test -f "$dir/lib$name.la"; then
3018 found_la="$dir/lib$name.la"
3019 fi
3020 fi
3021 fi
3022 ;;
3023 esac
3024 if test "X$found_dir" != "X"; then
3025 break
3026 fi
3027 done
3028 fi
3029 if test "X$found_dir" != "X"; then
3030 dnl Found the library.
3031 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
3032 if test "X$found_so" != "X"; then
3033 dnl Linking with a shared library. We attempt to hardcode its
3034 dnl directory into the executable's runpath, unless it's the
3035 dnl standard /usr/lib.
3036 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
3037 dnl No hardcoding is needed.
3038 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
3039 else
3040 dnl Use an explicit option to hardcode DIR into the resulting
3041 dnl binary.
3042 dnl Potentially add DIR to ltrpathdirs.
3043 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
3044 haveit=
3045 for x in $ltrpathdirs; do
3046 if test "X$x" = "X$found_dir"; then
3047 haveit=yes
3048 break
3049 fi
3050 done
3051 if test -z "$haveit"; then
3052 ltrpathdirs="$ltrpathdirs $found_dir"
3053 fi
3054 dnl The hardcoding into $LIBNAME is system dependent.
3055 if test "$hardcode_direct" = yes; then
3056 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
3057 dnl resulting binary.
3058 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
3059 else
3060 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
3061 dnl Use an explicit option to hardcode DIR into the resulting
3062 dnl binary.
3063 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
3064 dnl Potentially add DIR to rpathdirs.
3065 dnl The rpathdirs will be appended to $LIBNAME at the end.
3066 haveit=
3067 for x in $rpathdirs; do
3068 if test "X$x" = "X$found_dir"; then
3069 haveit=yes
3070 break
3071 fi
3072 done
3073 if test -z "$haveit"; then
3074 rpathdirs="$rpathdirs $found_dir"
3075 fi
3076 else
3077 dnl Rely on "-L$found_dir".
3078 dnl But don't add it if it's already contained in the LDFLAGS
3079 dnl or the already constructed $LIBNAME
3080 haveit=
3081 for x in $LDFLAGS $LIB[]NAME; do
3082 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3083 if test "X$x" = "X-L$found_dir"; then
3084 haveit=yes
3085 break
3086 fi
3087 done
3088 if test -z "$haveit"; then
3089 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
3090 fi
3091 if test "$hardcode_minus_L" != no; then
3092 dnl FIXME: Not sure whether we should use
3093 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
3094 dnl here.
3095 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
3096 else
3097 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
3098 dnl here, because this doesn't fit in flags passed to the
3099 dnl compiler. So give up. No hardcoding. This affects only
3100 dnl very old systems.
3101 dnl FIXME: Not sure whether we should use
3102 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
3103 dnl here.
3104 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
3105 fi
3106 fi
3107 fi
3108 fi
3109 else
3110 if test "X$found_a" != "X"; then
3111 dnl Linking with a static library.
3112 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
3113 else
3114 dnl We shouldn't come here, but anyway it's good to have a
3115 dnl fallback.
3116 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
3117 fi
3118 fi
3119 dnl Assume the include files are nearby.
3120 additional_includedir=
3121 case "$found_dir" in
3122 */lib | */lib/)
3123 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
3124 additional_includedir="$basedir/include"
3125 ;;
3126 esac
3127 if test "X$additional_includedir" != "X"; then
3128 dnl Potentially add $additional_includedir to $INCNAME.
3129 dnl But don't add it
3130 dnl 1. if it's the standard /usr/include,
3131 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
3132 dnl 3. if it's already present in $CPPFLAGS or the already
3133 dnl constructed $INCNAME,
3134 dnl 4. if it doesn't exist as a directory.
3135 if test "X$additional_includedir" != "X/usr/include"; then
3136 haveit=
3137 if test "X$additional_includedir" = "X/usr/local/include"; then
3138 if test -n "$GCC"; then
3139 case $host_os in
3140 linux*) haveit=yes;;
3141 esac
3142 fi
3143 fi
3144 if test -z "$haveit"; then
3145 for x in $CPPFLAGS $INC[]NAME; do
3146 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3147 if test "X$x" = "X-I$additional_includedir"; then
3148 haveit=yes
3149 break
3150 fi
3151 done
3152 if test -z "$haveit"; then
3153 if test -d "$additional_includedir"; then
3154 dnl Really add $additional_includedir to $INCNAME.
3155 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
3156 fi
3157 fi
3158 fi
3159 fi
3160 fi
3161 dnl Look for dependencies.
3162 if test -n "$found_la"; then
3163 dnl Read the .la file. It defines the variables
3164 dnl dlname, library_names, old_library, dependency_libs, current,
3165 dnl age, revision, installed, dlopen, dlpreopen, libdir.
3166 save_libdir="$libdir"
3167 case "$found_la" in
3168 */* | *\\*) . "$found_la" ;;
3169 *) . "./$found_la" ;;
3170 esac
3171 libdir="$save_libdir"
3172 dnl We use only dependency_libs.
3173 for dep in $dependency_libs; do
3174 case "$dep" in
3175 -L*)
3176 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
3177 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
3178 dnl But don't add it
3179 dnl 1. if it's the standard /usr/lib,
3180 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
3181 dnl 3. if it's already present in $LDFLAGS or the already
3182 dnl constructed $LIBNAME,
3183 dnl 4. if it doesn't exist as a directory.
3184 if test "X$additional_libdir" != "X/usr/lib"; then
3185 haveit=
3186 if test "X$additional_libdir" = "X/usr/local/lib"; then
3187 if test -n "$GCC"; then
3188 case $host_os in
3189 linux*) haveit=yes;;
3190 esac
3191 fi
3192 fi
3193 if test -z "$haveit"; then
3194 haveit=
3195 for x in $LDFLAGS $LIB[]NAME; do
3196 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3197 if test "X$x" = "X-L$additional_libdir"; then
3198 haveit=yes
3199 break
3200 fi
3201 done
3202 if test -z "$haveit"; then
3203 if test -d "$additional_libdir"; then
3204 dnl Really add $additional_libdir to $LIBNAME.
3205 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
3206 fi
3207 fi
3208 haveit=
3209 for x in $LDFLAGS $LTLIB[]NAME; do
3210 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3211 if test "X$x" = "X-L$additional_libdir"; then
3212 haveit=yes
3213 break
3214 fi
3215 done
3216 if test -z "$haveit"; then
3217 if test -d "$additional_libdir"; then
3218 dnl Really add $additional_libdir to $LTLIBNAME.
3219 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
3220 fi
3221 fi
3222 fi
3223 fi
3224 ;;
3225 -R*)
3226 dir=`echo "X$dep" | sed -e 's/^X-R//'`
3227 if test "$enable_rpath" != no; then
3228 dnl Potentially add DIR to rpathdirs.
3229 dnl The rpathdirs will be appended to $LIBNAME at the end.
3230 haveit=
3231 for x in $rpathdirs; do
3232 if test "X$x" = "X$dir"; then
3233 haveit=yes
3234 break
3235 fi
3236 done
3237 if test -z "$haveit"; then
3238 rpathdirs="$rpathdirs $dir"
3239 fi
3240 dnl Potentially add DIR to ltrpathdirs.
3241 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
3242 haveit=
3243 for x in $ltrpathdirs; do
3244 if test "X$x" = "X$dir"; then
3245 haveit=yes
3246 break
3247 fi
3248 done
3249 if test -z "$haveit"; then
3250 ltrpathdirs="$ltrpathdirs $dir"
3251 fi
3252 fi
3253 ;;
3254 -l*)
3255 dnl Handle this in the next round.
3256 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
3257 ;;
3258 *.la)
3259 dnl Handle this in the next round. Throw away the .la's
3260 dnl directory; it is already contained in a preceding -L
3261 dnl option.
3262 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
3263 ;;
3264 *)
3265 dnl Most likely an immediate library name.
3266 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
3267 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
3268 ;;
3269 esac
3270 done
3271 fi
3272 else
3273 dnl Didn't find the library; assume it is in the system directories
3274 dnl known to the linker and runtime loader. (All the system
3275 dnl directories known to the linker should also be known to the
3276 dnl runtime loader, otherwise the system is severely misconfigured.)
3277 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
3278 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
3279 fi
3280 fi
3281 fi
3282 done
3283 done
3284 if test "X$rpathdirs" != "X"; then
3285 if test -n "$hardcode_libdir_separator"; then
3286 dnl Weird platform: only the last -rpath option counts, the user must
3287 dnl pass all path elements in one option. We can arrange that for a
3288 dnl single library, but not when more than one $LIBNAMEs are used.
3289 alldirs=
3290 for found_dir in $rpathdirs; do
3291 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
3292 done
3293 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
3294 acl_save_libdir="$libdir"
3295 libdir="$alldirs"
3296 eval flag=\"$hardcode_libdir_flag_spec\"
3297 libdir="$acl_save_libdir"
3298 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
3299 else
3300 dnl The -rpath options are cumulative.
3301 for found_dir in $rpathdirs; do
3302 acl_save_libdir="$libdir"
3303 libdir="$found_dir"
3304 eval flag=\"$hardcode_libdir_flag_spec\"
3305 libdir="$acl_save_libdir"
3306 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
3307 done
3308 fi
3309 fi
3310 if test "X$ltrpathdirs" != "X"; then
3311 dnl When using libtool, the option that works for both libraries and
3312 dnl executables is -R. The -R options are cumulative.
3313 for found_dir in $ltrpathdirs; do
3314 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
3315 done
3316 fi
3317])
3318
3319dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
3320dnl unless already present in VAR.
3321dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
3322dnl contains two or three consecutive elements that belong together.
3323AC_DEFUN([AC_LIB_APPENDTOVAR],
3324[
3325 for element in [$2]; do
3326 haveit=
3327 for x in $[$1]; do
3328 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3329 if test "X$x" = "X$element"; then
3330 haveit=yes
3331 break
3332 fi
3333 done
3334 if test -z "$haveit"; then
3335 [$1]="${[$1]}${[$1]:+ }$element"
3336 fi
3337 done
3338])
3339# lib-prefix.m4 serial 2 (gettext-0.12)
3340dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
3341dnl This file is free software, distributed under the terms of the GNU
3342dnl General Public License. As a special exception to the GNU General
3343dnl Public License, this file may be distributed as part of a program
3344dnl that contains a configuration script generated by Autoconf, under
3345dnl the same distribution terms as the rest of that program.
3346
3347dnl From Bruno Haible.
3348
3349dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
3350dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
3351dnl require excessive bracketing.
3352ifdef([AC_HELP_STRING],
3353[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
3354[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
3355
3356dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
3357dnl to access previously installed libraries. The basic assumption is that
3358dnl a user will want packages to use other packages he previously installed
3359dnl with the same --prefix option.
3360dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
3361dnl libraries, but is otherwise very convenient.
3362AC_DEFUN([AC_LIB_PREFIX],
3363[
3364 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
3365 AC_REQUIRE([AC_PROG_CC])
3366 AC_REQUIRE([AC_CANONICAL_HOST])
3367 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3368 dnl By default, look in $includedir and $libdir.
3369 use_additional=yes
3370 AC_LIB_WITH_FINAL_PREFIX([
3371 eval additional_includedir=\"$includedir\"
3372 eval additional_libdir=\"$libdir\"
3373 ])
3374 AC_LIB_ARG_WITH([lib-prefix],
3375[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
3376 --without-lib-prefix don't search for libraries in includedir and libdir],
3377[
3378 if test "X$withval" = "Xno"; then
3379 use_additional=no
3380 else
3381 if test "X$withval" = "X"; then
3382 AC_LIB_WITH_FINAL_PREFIX([
3383 eval additional_includedir=\"$includedir\"
3384 eval additional_libdir=\"$libdir\"
3385 ])
3386 else
3387 additional_includedir="$withval/include"
3388 additional_libdir="$withval/lib"
3389 fi
3390 fi
3391])
3392 if test $use_additional = yes; then
3393 dnl Potentially add $additional_includedir to $CPPFLAGS.
3394 dnl But don't add it
3395 dnl 1. if it's the standard /usr/include,
3396 dnl 2. if it's already present in $CPPFLAGS,
3397 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
3398 dnl 4. if it doesn't exist as a directory.
3399 if test "X$additional_includedir" != "X/usr/include"; then
3400 haveit=
3401 for x in $CPPFLAGS; do
3402 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3403 if test "X$x" = "X-I$additional_includedir"; then
3404 haveit=yes
3405 break
3406 fi
3407 done
3408 if test -z "$haveit"; then
3409 if test "X$additional_includedir" = "X/usr/local/include"; then
3410 if test -n "$GCC"; then
3411 case $host_os in
3412 linux*) haveit=yes;;
3413 esac
3414 fi
3415 fi
3416 if test -z "$haveit"; then
3417 if test -d "$additional_includedir"; then
3418 dnl Really add $additional_includedir to $CPPFLAGS.
3419 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
3420 fi
3421 fi
3422 fi
3423 fi
3424 dnl Potentially add $additional_libdir to $LDFLAGS.
3425 dnl But don't add it
3426 dnl 1. if it's the standard /usr/lib,
3427 dnl 2. if it's already present in $LDFLAGS,
3428 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
3429 dnl 4. if it doesn't exist as a directory.
3430 if test "X$additional_libdir" != "X/usr/lib"; then
3431 haveit=
3432 for x in $LDFLAGS; do
3433 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3434 if test "X$x" = "X-L$additional_libdir"; then
3435 haveit=yes
3436 break
3437 fi
3438 done
3439 if test -z "$haveit"; then
3440 if test "X$additional_libdir" = "X/usr/local/lib"; then
3441 if test -n "$GCC"; then
3442 case $host_os in
3443 linux*) haveit=yes;;
3444 esac
3445 fi
3446 fi
3447 if test -z "$haveit"; then
3448 if test -d "$additional_libdir"; then
3449 dnl Really add $additional_libdir to $LDFLAGS.
3450 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
3451 fi
3452 fi
3453 fi
3454 fi
3455 fi
3456])
3457
3458dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
3459dnl acl_final_exec_prefix, containing the values to which $prefix and
3460dnl $exec_prefix will expand at the end of the configure script.
3461AC_DEFUN([AC_LIB_PREPARE_PREFIX],
3462[
3463 dnl Unfortunately, prefix and exec_prefix get only finally determined
3464 dnl at the end of configure.
3465 if test "X$prefix" = "XNONE"; then
3466 acl_final_prefix="$ac_default_prefix"
3467 else
3468 acl_final_prefix="$prefix"
3469 fi
3470 if test "X$exec_prefix" = "XNONE"; then
3471 acl_final_exec_prefix='${prefix}'
3472 else
3473 acl_final_exec_prefix="$exec_prefix"
3474 fi
3475 acl_save_prefix="$prefix"
3476 prefix="$acl_final_prefix"
3477 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
3478 prefix="$acl_save_prefix"
3479])
3480
3481dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
3482dnl variables prefix and exec_prefix bound to the values they will have
3483dnl at the end of the configure script.
3484AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
3485[
3486 acl_save_prefix="$prefix"
3487 prefix="$acl_final_prefix"
3488 acl_save_exec_prefix="$exec_prefix"
3489 exec_prefix="$acl_final_exec_prefix"
3490 $1
3491 exec_prefix="$acl_save_exec_prefix"
3492 prefix="$acl_save_prefix"
3493])
3494# nls.m4 serial 1 (gettext-0.12)
3495dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
3496dnl This file is free software, distributed under the terms of the GNU
3497dnl General Public License. As a special exception to the GNU General
3498dnl Public License, this file may be distributed as part of a program
3499dnl that contains a configuration script generated by Autoconf, under
3500dnl the same distribution terms as the rest of that program.
3501dnl
3502dnl This file can can be used in projects which are not available under
3503dnl the GNU General Public License or the GNU Library General Public
3504dnl License but which still want to provide support for the GNU gettext
3505dnl functionality.
3506dnl Please note that the actual code of the GNU gettext library is covered
3507dnl by the GNU Library General Public License, and the rest of the GNU
3508dnl gettext package package is covered by the GNU General Public License.
3509dnl They are *not* in the public domain.
3510
3511dnl Authors:
3512dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3513dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3514
3515AC_DEFUN([AM_NLS],
3516[
3517 AC_MSG_CHECKING([whether NLS is requested])
3518 dnl Default is enabled NLS
3519 AC_ARG_ENABLE(nls,
3520 [ --disable-nls do not use Native Language Support],
3521 USE_NLS=$enableval, USE_NLS=yes)
3522 AC_MSG_RESULT($USE_NLS)
3523 AC_SUBST(USE_NLS)
3524])
3525
3526AC_DEFUN([AM_MKINSTALLDIRS],
3527[
3528 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
3529 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
3530 dnl Try to locate it.
3531 MKINSTALLDIRS=
3532 if test -n "$ac_aux_dir"; then
3533 case "$ac_aux_dir" in
3534 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
3535 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
3536 esac
3537 fi
3538 if test -z "$MKINSTALLDIRS"; then
3539 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
3540 fi
3541 AC_SUBST(MKINSTALLDIRS)
3542])
3543# po.m4 serial 1 (gettext-0.12)
3544dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
3545dnl This file is free software, distributed under the terms of the GNU
3546dnl General Public License. As a special exception to the GNU General
3547dnl Public License, this file may be distributed as part of a program
3548dnl that contains a configuration script generated by Autoconf, under
3549dnl the same distribution terms as the rest of that program.
3550dnl
3551dnl This file can can be used in projects which are not available under
3552dnl the GNU General Public License or the GNU Library General Public
3553dnl License but which still want to provide support for the GNU gettext
3554dnl functionality.
3555dnl Please note that the actual code of the GNU gettext library is covered
3556dnl by the GNU Library General Public License, and the rest of the GNU
3557dnl gettext package package is covered by the GNU General Public License.
3558dnl They are *not* in the public domain.
3559
3560dnl Authors:
3561dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3562dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3563
3564dnl Checks for all prerequisites of the po subdirectory.
3565AC_DEFUN([AM_PO_SUBDIRS],
3566[
3567 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3568 AC_REQUIRE([AC_PROG_INSTALL])dnl
3569 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
3570 AC_REQUIRE([AM_NLS])dnl
3571
3572 dnl Perform the following tests also if --disable-nls has been given,
3573 dnl because they are needed for "make dist" to work.
3574
3575 dnl Search for GNU msgfmt in the PATH.
3576 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
3577 dnl The second test excludes FreeBSD msgfmt.
3578 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
3579 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
3580 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3581 :)
3582 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3583
3584 dnl Search for GNU xgettext 0.12 or newer in the PATH.
3585 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
3586 dnl The second test excludes FreeBSD xgettext.
3587 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
3588 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
3589 (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)],
3590 :)
3591 dnl Remove leftover from FreeBSD xgettext call.
3592 rm -f messages.po
3593
3594 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
3595 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
3596 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
3597
3598 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
3599 dnl Test whether we really found GNU msgfmt.
3600 if test "$GMSGFMT" != ":"; then
3601 dnl If it is no GNU msgfmt we define it as : so that the
3602 dnl Makefiles still can work.
3603 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
3604 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
3605 : ;
3606 else
3607 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
3608 AC_MSG_RESULT(
3609 [found $GMSGFMT program is not GNU msgfmt; ignore it])
3610 GMSGFMT=":"
3611 fi
3612 fi
3613
3614 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
3615 dnl Test whether we really found GNU xgettext.
3616 if test "$XGETTEXT" != ":"; then
3617 dnl If it is no GNU xgettext we define it as : so that the
3618 dnl Makefiles still can work.
3619 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
3620 (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
3621 : ;
3622 else
3623 AC_MSG_RESULT(
3624 [found xgettext program is not GNU xgettext; ignore it])
3625 XGETTEXT=":"
3626 fi
3627 dnl Remove leftover from FreeBSD xgettext call.
3628 rm -f messages.po
3629 fi
3630
3631 AC_OUTPUT_COMMANDS([
3632 for ac_file in $CONFIG_FILES; do
3633 # Support "outfile[:infile[:infile...]]"
3634 case "$ac_file" in
3635 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3636 esac
3637 # PO directories have a Makefile.in generated from Makefile.in.in.
3638 case "$ac_file" in */Makefile.in)
3639 # Adjust a relative srcdir.
3640 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3641 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
3642 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3643 # In autoconf-2.13 it is called $ac_given_srcdir.
3644 # In autoconf-2.50 it is called $srcdir.
3645 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3646 case "$ac_given_srcdir" in
3647 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3648 /*) top_srcdir="$ac_given_srcdir" ;;
3649 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3650 esac
3651 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
3652 rm -f "$ac_dir/POTFILES"
3653 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
3654 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
3655 POMAKEFILEDEPS="POTFILES.in"
3656 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
3657 # on $ac_dir but don't depend on user-specified configuration
3658 # parameters.
3659 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3660 # The LINGUAS file contains the set of available languages.
3661 if test -n "$OBSOLETE_ALL_LINGUAS"; then
3662 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3663 fi
3664 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3665 # Hide the ALL_LINGUAS assigment from automake.
3666 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3667 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3668 else
3669 # The set of available languages was given in configure.in.
3670 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
3671 fi
3672 case "$ac_given_srcdir" in
3673 .) srcdirpre= ;;
3674 *) srcdirpre='$(srcdir)/' ;;
3675 esac
3676 POFILES=
3677 GMOFILES=
3678 UPDATEPOFILES=
3679 DUMMYPOFILES=
3680 for lang in $ALL_LINGUAS; do
3681 POFILES="$POFILES $srcdirpre$lang.po"
3682 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3683 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3684 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3685 done
3686 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3687 # environment variable.
3688 INST_LINGUAS=
3689 if test -n "$ALL_LINGUAS"; then
3690 for presentlang in $ALL_LINGUAS; do
3691 useit=no
3692 if test "%UNSET%" != "$LINGUAS"; then
3693 desiredlanguages="$LINGUAS"
3694 else
3695 desiredlanguages="$ALL_LINGUAS"
3696 fi
3697 for desiredlang in $desiredlanguages; do
3698 # Use the presentlang catalog if desiredlang is
3699 # a. equal to presentlang, or
3700 # b. a variant of presentlang (because in this case,
3701 # presentlang can be used as a fallback for messages
3702 # which are not translated in the desiredlang catalog).
3703 case "$desiredlang" in
3704 "$presentlang"*) useit=yes;;
3705 esac
3706 done
3707 if test $useit = yes; then
3708 INST_LINGUAS="$INST_LINGUAS $presentlang"
3709 fi
3710 done
3711 fi
3712 CATALOGS=
3713 if test -n "$INST_LINGUAS"; then
3714 for lang in $INST_LINGUAS; do
3715 CATALOGS="$CATALOGS $lang.gmo"
3716 done
3717 fi
3718 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
3719 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"
3720 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
3721 if test -f "$f"; then
3722 case "$f" in
3723 *.orig | *.bak | *~) ;;
3724 *) cat "$f" >> "$ac_dir/Makefile" ;;
3725 esac
3726 fi
3727 done
3728 fi
3729 ;;
3730 esac
3731 done],
3732 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
3733 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
3734 # from automake.
3735 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
3736 # Capture the value of LINGUAS because we need it to compute CATALOGS.
3737 LINGUAS="${LINGUAS-%UNSET%}"
3738 ])
3739])
3740# progtest.m4 serial 3 (gettext-0.12)
3741dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
3742dnl This file is free software, distributed under the terms of the GNU
3743dnl General Public License. As a special exception to the GNU General
3744dnl Public License, this file may be distributed as part of a program
3745dnl that contains a configuration script generated by Autoconf, under
3746dnl the same distribution terms as the rest of that program.
3747dnl
3748dnl This file can can be used in projects which are not available under
3749dnl the GNU General Public License or the GNU Library General Public
3750dnl License but which still want to provide support for the GNU gettext
3751dnl functionality.
3752dnl Please note that the actual code of the GNU gettext library is covered
3753dnl by the GNU Library General Public License, and the rest of the GNU
3754dnl gettext package package is covered by the GNU General Public License.
3755dnl They are *not* in the public domain.
3756
3757dnl Authors:
3758dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
3759
3760# Search path for a program which passes the given test.
3761
3762dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3763dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3764AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3765[
3766# Prepare PATH_SEPARATOR.
3767# The user is always right.
3768if test "${PATH_SEPARATOR+set}" != set; then
3769 echo "#! /bin/sh" >conf$$.sh
3770 echo "exit 0" >>conf$$.sh
3771 chmod +x conf$$.sh
3772 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
3773 PATH_SEPARATOR=';'
3774 else
3775 PATH_SEPARATOR=:
3776 fi
3777 rm -f conf$$.sh
3778fi
3779
3780# Find out how to test for executable files. Don't use a zero-byte file,
3781# as systems may use methods other than mode bits to determine executability.
3782cat >conf$$.file <<_ASEOF
3783#! /bin/sh
3784exit 0
3785_ASEOF
3786chmod +x conf$$.file
3787if test -x conf$$.file >/dev/null 2>&1; then
3788 ac_executable_p="test -x"
3789else
3790 ac_executable_p="test -f"
3791fi
3792rm -f conf$$.file
3793
3794# Extract the first word of "$2", so it can be a program name with args.
3795set dummy $2; ac_word=[$]2
3796AC_MSG_CHECKING([for $ac_word])
3797AC_CACHE_VAL(ac_cv_path_$1,
3798[case "[$]$1" in
3799 [[\\/]]* | ?:[[\\/]]*)
3800 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3801 ;;
3802 *)
3803 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
3804 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3805 IFS="$ac_save_IFS"
3806 test -z "$ac_dir" && ac_dir=.
3807 for ac_exec_ext in '' $ac_executable_extensions; do
3808 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
3809 if [$3]; then
3810 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
3811 break 2
3812 fi
3813 fi
3814 done
3815 done
3816 IFS="$ac_save_IFS"
3817dnl If no 4th arg is given, leave the cache variable unset,
3818dnl so AC_PATH_PROGS will keep looking.
3819ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3820])dnl
3821 ;;
3822esac])dnl
3823$1="$ac_cv_path_$1"
3824if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
3825 AC_MSG_RESULT([$]$1)
3826else
3827 AC_MSG_RESULT(no)
3828fi
3829AC_SUBST($1)dnl
3830])
3831# stdint_h.m4 serial 3 (gettext-0.12)
3832dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3833dnl This file is free software, distributed under the terms of the GNU
3834dnl General Public License. As a special exception to the GNU General
3835dnl Public License, this file may be distributed as part of a program
3836dnl that contains a configuration script generated by Autoconf, under
3837dnl the same distribution terms as the rest of that program.
3838
3839dnl From Paul Eggert.
3840
3841# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
3842# doesn't clash with <sys/types.h>, and declares uintmax_t.
3843
3844AC_DEFUN([jm_AC_HEADER_STDINT_H],
3845[
3846 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
3847 [AC_TRY_COMPILE(
3848 [#include <sys/types.h>
3849#include <stdint.h>],
3850 [uintmax_t i = (uintmax_t) -1;],
3851 jm_ac_cv_header_stdint_h=yes,
3852 jm_ac_cv_header_stdint_h=no)])
3853 if test $jm_ac_cv_header_stdint_h = yes; then
3854 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
3855 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
3856 and declares uintmax_t. ])
3857 fi
3858])
3859# uintmax_t.m4 serial 7 (gettext-0.12)
3860dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3861dnl This file is free software, distributed under the terms of the GNU
3862dnl General Public License. As a special exception to the GNU General
3863dnl Public License, this file may be distributed as part of a program
3864dnl that contains a configuration script generated by Autoconf, under
3865dnl the same distribution terms as the rest of that program.
3866
3867dnl From Paul Eggert.
3868
3869AC_PREREQ(2.13)
3870
3871# Define uintmax_t to 'unsigned long' or 'unsigned long long'
3872# if it is not already defined in <stdint.h> or <inttypes.h>.
3873
3874AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
3875[
3876 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3877 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3878 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3879 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3880 test $ac_cv_type_unsigned_long_long = yes \
3881 && ac_type='unsigned long long' \
3882 || ac_type='unsigned long'
3883 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
3884 [Define to unsigned long or unsigned long long
3885 if <stdint.h> and <inttypes.h> don't define.])
3886 else
3887 AC_DEFINE(HAVE_UINTMAX_T, 1,
3888 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
3889 fi
3890])
3891# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
3892dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
3893dnl This file is free software, distributed under the terms of the GNU
3894dnl General Public License. As a special exception to the GNU General
3895dnl Public License, this file may be distributed as part of a program
3896dnl that contains a configuration script generated by Autoconf, under
3897dnl the same distribution terms as the rest of that program.
3898
3899dnl From Paul Eggert.
3900
3901AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
3902[
3903 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
3904 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
3905 [unsigned long long ullmax = (unsigned long long) -1;
3906 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
3907 ac_cv_type_unsigned_long_long=yes,
3908 ac_cv_type_unsigned_long_long=no)])
3909 if test $ac_cv_type_unsigned_long_long = yes; then
3910 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
3911 [Define if you have the unsigned long long type.])
3912 fi
3913])