Deleted Added
sdiff udiff text old ( 119610 ) new ( 136644 )
full compact
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,
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{
736 char lbuf[32];
737 popen_called = 0;
738 getcwd(lbuf, 32);
739 exit (popen_called);
740}
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]
744)])
745AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
746if test $bash_cv_getcwd_calls_popen = yes; 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,
984[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,
988 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=
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])
1064AC_MSG_CHECKING(if struct dirent has a d_ino member)
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
1091AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
1092fi
1093])
1094
1095AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO,
1096[AC_REQUIRE([AC_HEADER_DIRENT])
1097AC_MSG_CHECKING(if struct dirent has a d_fileno member)
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
1124AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO)
1125fi
1126])
1127
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
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,
1529[if test -d /dev/fd && test -r /dev/fd/0; then
1530 bash_cv_dev_fd=standard
1531 elif test -d /proc/self/fd && test -r /proc/self/fd/0; 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,
1550[if test -d /dev/fd && test -r /dev/stdin; then
1551 bash_cv_dev_stdin=present
1552 elif test -d /proc/self/fd && test -r /dev/stdin; 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))
1656AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
1657
1658AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
1659[AC_TRY_RUN([
1660#include
1661int
1662main ()
1663{
1664 mbstate_t ps;
1665 return 0;
1666}], 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
1715AC_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',
1731ac_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])