exit(fl != 1);
}
], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
- [AC_MSG_ERROR(cannot check dup2 if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
bash_cv_dup2_broken=no])
])
AC_MSG_RESULT($bash_cv_dup2_broken)
exit(ok ? 0 : 5);
}
], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
- [AC_MSG_ERROR(cannot check pgrp synchronization if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
bash_cv_pgrp_pipe=no])
])
AC_MSG_RESULT($bash_cv_pgrp_pipe)
#endif
exit(1);
}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
- [AC_MSG_ERROR(cannot check quad_t if cross compiling -- defaulting to long)
+ [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
bash_cv_type_rlimit=long])])
])
AC_MSG_RESULT($bash_cv_type_rlimit)
#include <unistd.h>
#endif], [ char *msg = _sys_siglist[2]; ],
bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
- [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
+ [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
if test $bash_cv_decl_under_sys_siglist = yes; then
AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
exit(msg == 0);
}],
bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
- [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
bash_cv_under_sys_siglist=no])])
AC_MSG_RESULT($bash_cv_under_sys_siglist)
if test $bash_cv_under_sys_siglist = yes; then
exit(msg == 0);
}],
bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
- [AC_MSG_ERROR(cannot check for sys_siglist if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
bash_cv_sys_siglist=no])])
AC_MSG_RESULT($bash_cv_sys_siglist)
if test $bash_cv_sys_siglist = yes; then
main()
{
DIR *dir;
-int fd;
-unlink("/tmp/not_a_directory");
-fd = open("/tmp/not_a_directory", O_WRONLY|O_CREAT, 0666);
+int fd, err;
+err = mkdir("/tmp/bash-aclocal", 0700);
+if (err < 0) {
+ perror("mkdir");
+ exit(1);
+}
+unlink("/tmp/bash-aclocal/not_a_directory");
+fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
write(fd, "\n", 1);
close(fd);
-dir = opendir("/tmp/not_a_directory");
-unlink("/tmp/not_a_directory");
+dir = opendir("/tmp/bash-aclocal/not_a_directory");
+unlink("/tmp/bash-aclocal/not_a_directory");
+rmdir("/tmp/bash-aclocal");
exit (dir == 0);
}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
- [AC_MSG_ERROR(cannot check opendir if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
bash_cv_opendir_not_robust=no]
)])
AC_MSG_RESULT($bash_cv_opendir_not_robust)
fi
])
-AC_DEFUN(BASH_TYPE_INT32_T,
+dnl
+dnl A signed 16-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_BITS16_T,
[
-if test "X$bash_cv_type_int32_t" = "X"; then
-_bash_needmsg=yes
+if test "$ac_cv_sizeof_short" = 2; then
+ AC_CHECK_TYPE(bits16_t, short)
+elif test "$ac_cv_sizeof_char" = 2; then
+ AC_CHECK_TYPE(bits16_t, char)
else
-AC_MSG_CHECKING(which builtin C type is 32 bits wide)
-_bash_needmsg=
-fi
-AC_CACHE_VAL(bash_cv_type_int32_t,
-[AC_TRY_RUN([
-main()
-{
-#if SIZEOF_INT == 4
-exit (0);
-#else
-# if SIZEOF_LONG == 4
-exit (1);
-# else
-# error cannot find 32 bit type...
-# endif
-#endif
-}], bash_cv_type_int32_t=int, bash_cv_type_int32_t=long,
- [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
- bash_cv_type_int32_t=int]
-)])
-if test "X$_bash_needmsg" = "Xyes"; then
-AC_MSG_CHECKING(which builtin C type is 32 bits wide)
+ AC_CHECK_TYPE(bits16_t, short)
fi
-AC_MSG_RESULT($bash_cv_type_int32_t);
-if test "$bash_cv_type_int32_t" = "int"; then
-AC_DEFINE(int32_t, int)
+])
+
+dnl
+dnl An unsigned 16-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_U_BITS16_T,
+[
+if test "$ac_cv_sizeof_short" = 2; then
+ AC_CHECK_TYPE(u_bits16_t, unsigned short)
+elif test "$ac_cv_sizeof_char" = 2; then
+ AC_CHECK_TYPE(u_bits16_t, unsigned char)
else
-AC_DEFINE(int32_t, long)
+ AC_CHECK_TYPE(u_bits16_t, unsigned short)
fi
])
-AC_DEFUN(BASH_TYPE_U_INT32_T,
+dnl
+dnl A signed 32-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_BITS32_T,
[
-if test "X$bash_cv_type_u_int32_t" = "X"; then
-_bash_needmsg=yes
+if test "$ac_cv_sizeof_int" = 4; then
+ AC_CHECK_TYPE(bits32_t, int)
+elif test "$ac_cv_sizeof_long" = 4; then
+ AC_CHECK_TYPE(bits32_t, long)
else
-AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide)
-_bash_needmsg=
+ AC_CHECK_TYPE(bits32_t, int)
fi
-AC_CACHE_VAL(bash_cv_type_u_int32_t,
-[AC_TRY_RUN([
-main()
-{
-#if SIZEOF_INT == 4
-exit (0);
-#else
-# if SIZEOF_LONG == 4
-exit (1);
-# else
-# error cannot find 32 bit type...
-# endif
-#endif
-}], bash_cv_type_u_int32_t=int, bash_cv_type_u_int32_t=long,
- [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
- bash_cv_type_u_int32_t=int]
-)])
-if test "X$_bash_needmsg" = "Xyes"; then
-AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide)
-fi
-AC_MSG_RESULT($bash_cv_type_u_int32_t);
-if test "$bash_cv_type_u_int32_t" = "int"; then
-AC_DEFINE(u_int32_t, unsigned int)
+])
+
+dnl
+dnl An unsigned 32-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_U_BITS32_T,
+[
+if test "$ac_cv_sizeof_int" = 4; then
+ AC_CHECK_TYPE(u_bits32_t, unsigned int)
+elif test "$ac_cv_sizeof_long" = 4; then
+ AC_CHECK_TYPE(u_bits32_t, unsigned long)
else
-AC_DEFINE(u_int32_t, unsigned long)
+ AC_CHECK_TYPE(u_bits32_t, unsigned int)
fi
])
AC_DEFUN(BASH_TYPE_PTRDIFF_T,
[
-if test "X$bash_cv_type_ptrdiff_t" = "X"; then
-_bash_needmsg=yes
+if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
+ AC_CHECK_TYPE(ptrdiff_t, int)
+elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
+ AC_CHECK_TYPE(ptrdiff_t, long)
else
-AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t)
-_bash_needmsg=
+ AC_CHECK_TYPE(ptrdiff_t, int)
fi
-AC_CACHE_VAL(bash_cv_type_ptrdiff_t,
-[AC_TRY_RUN([
-main()
-{
-#if SIZEOF_CHAR_P == SIZEOF_INT
-exit (0);
-#else
-# if SIZEOF_CHAR_P == SIZEOF_LONG
-exit (1);
-# else
-# error cannot find type for pointer arithmetic...
-# endif
-#endif
-}], bash_cv_type_ptrdiff_t=int, bash_cv_type_ptrdiff_t=long,
- [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
- bash_cv_type_ptrdiff_t=int]
-)])
-if test "X$_bash_needmsg" = "Xyes"; then
-AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t)
-fi
-AC_MSG_RESULT($bash_cv_type_ptrdiff_t);
-if test "$bash_cv_type_ptrdiff_t" = "int"; then
-AC_DEFINE(ptrdiff_t, int)
+])
+
+dnl
+dnl A signed 64-bit quantity
+dnl
+AC_DEFUN(BASH_TYPE_BITS64_T,
+[
+if test "$ac_sv_sizeof_char_p" = 8; then
+ AC_CHECK_TYPE(bits64_t, char *)
+elif test "$ac_cv_sizeof_double" = 8; then
+ AC_CHECK_TYPE(bits64_t, double)
+elif test "$ac_cv_sizeof_long" = 8; then
+ AC_CHECK_TYPE(bits64_t, long)
else
-AC_DEFINE(ptrdiff_t, long)
+ AC_CHECK_TYPE(bits64_t, double)
fi
])
fi
])
+AC_DEFUN(BASH_FUNC_INET_ATON,
+[
+AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
+[AC_TRY_LINK([
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
+bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
+if test $bash_cv_func_inet_aton = yes; then
+ AC_DEFINE(HAVE_INET_ATON)
+fi
+])
+
AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
[AC_MSG_CHECKING([for a c_line member of struct termios])
AC_CACHE_VAL(bash_cv_termios_ldisc,
exit(s == 0); /* force optimizer to leave getenv in */
}
], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
- [AC_MSG_ERROR(cannot check getenv redefinition if cross compiling -- defaulting to yes)
+ [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
bash_cv_getenv_redef=yes]
)])
AC_MSG_RESULT($bash_cv_getenv_redef)
exit(pf == 0);
}
], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
- [AC_MSG_ERROR(cannot check printf declaration if cross compiling -- defaulting to yes)
+ [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
bash_cv_printf_declared=yes]
)])
AC_MSG_RESULT($bash_cv_printf_declared)
exit (maxfds == -1L);
}
], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
- [AC_MSG_ERROR(cannot check ulimit if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
bash_cv_ulimit_maxfds=no]
)])
AC_MSG_RESULT($bash_cv_ulimit_maxfds)
exit (popen_called);
}
], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
- [AC_MSG_ERROR(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
bash_cv_getcwd_calls_popen=no]
)])
AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
exit(nsigint != 2);
}
], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
- [AC_MSG_ERROR(cannot check signal handling if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
bash_cv_must_reinstall_sighandlers=no]
)])
AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
exit(0);
}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
- [AC_MSG_ERROR(cannot check job control if cross-compiling -- defaulting to missing)
+ [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
bash_cv_job_control_missing=missing]
)])
AC_MSG_RESULT($bash_cv_job_control_missing)
/* Add more tests in here as appropriate. */
main()
{
-int fd;
+int fd, err;
#if defined (HAVE_MKFIFO)
exit (0);
#if defined (NeXT)
exit (1);
#endif
-
-fd = mknod ("/tmp/sh-np-autoconf", 0666 | S_IFIFO, 0);
-if (fd == -1)
+err = mkdir("/tmp/bash-aclocal", 0700);
+if (err < 0) {
+ perror ("mkdir");
+ exit(1);
+}
+fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
+if (fd == -1) {
+ rmdir ("/tmp/bash-aclocal");
exit (1);
+}
close(fd);
-unlink ("/tmp/sh-np-autoconf");
+unlink ("/tmp/bash-aclocal/sh-np-autoconf");
+rmdir ("/tmp/bash-aclocal");
exit(0);
}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
- [AC_MSG_ERROR(cannot check for named pipes if cross-compiling -- defaulting to missing)
+ [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
bash_cv_sys_named_pipes=missing]
)])
AC_MSG_RESULT($bash_cv_sys_named_pipes)
exit(1);
#endif
}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
- [AC_MSG_ERROR(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
+ [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
bash_cv_func_sigsetjmp=missing]
)])
AC_MSG_RESULT($bash_cv_func_sigsetjmp)
fi
])
+AC_DEFUN(BASH_CHECK_DEV_STDIN,
+[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
+AC_CACHE_VAL(bash_cv_dev_stdin,
+[if test -d /dev/fd && test -r /dev/stdin; then
+ bash_cv_dev_stdin=present
+ elif test -d /proc/self/fd && test -r /dev/stdin; then
+ bash_cv_dev_stdin=present
+ else
+ bash_cv_dev_stdin=absent
+ fi
+])
+AC_MSG_RESULT($bash_cv_dev_stdin)
+if test $bash_cv_dev_stdin = "present"; then
+ AC_DEFINE(HAVE_DEV_STDIN)
+fi
+])
+
dnl
-dnl Check for the presence of getpeername (the only networking function
-dnl bash currently requires) in libsocket. If libsocket is present,
-dnl check for libnsl and add it to LIBS if it's there, since most
-dnl systems with libsocket require linking with libnsl as well.
-dnl This should only be called if getpeername was not found in libc.
+dnl Check for the presence of getpeername in libsocket.
+dnl If libsocket is present, check for libnsl and add it to LIBS if
+dnl it's there, since most systems with libsocket require linking
+dnl with libnsl as well. This should only be called if getpeername
+dnl was not found in libc.
+dnl
+dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
+dnl AS WELL
dnl
AC_DEFUN(BASH_CHECK_SOCKLIB,
[
fi
])
+dnl
+dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
+dnl system, we can't use AC_PREREQ
+dnl
+AC_DEFUN(BASH_FUNC_GETHOSTBYNAME,
+[if test "X$bash_cv_have_gethostbyname" = "X"; then
+_bash_needmsg=yes
+else
+AC_MSG_CHECKING(for gethostbyname in socket library)
+_bash_needmsg=
+fi
+AC_CACHE_VAL(bash_cv_have_gethostbyname,
+[AC_TRY_LINK([#include <netdb.h>],
+[ struct hostent *hp;
+ hp = gethostbyname("localhost");
+], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
+)
+if test "X$_bash_needmsg" = Xyes; then
+ AC_MSG_CHECKING(for gethostbyname in socket library)
+fi
+AC_MSG_RESULT($bash_cv_have_gethostbyname)
+if test "$bash_cv_have_gethostbyname" = yes; then
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+fi
+])
+
AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
[AC_MSG_CHECKING(for default mail directory)
AC_CACHE_VAL(bash_cv_mail_dir,
exit (r1 > 0 && r2 > 0);
}
], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
- [AC_MSG_ERROR(cannot check strcoll if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
bash_cv_func_strcoll_broken=no]
)])
AC_MSG_RESULT($bash_cv_func_strcoll_broken)
#endif
}
], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no,
- AC_MSG_ERROR(cannot check restartable syscalls if cross compiling))
+ AC_MSG_WARN(cannot check restartable syscalls if cross compiling))
])
if test $bash_cv_sys_restartable_syscalls = yes; then
AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
fi
])
+dnl
+dnl Check for 64-bit off_t -- used for malloc alignment
+dnl
+dnl C does not allow duplicate case labels, so the compile will fail if
+dnl sizeof(off_t) is > 4.
+dnl
+AC_DEFUN(BASH_CHECK_OFF_T_64,
+[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
+AC_TRY_COMPILE([
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+],[
+switch (0) case 0: case (sizeof (off_t) <= 4):;
+], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
+if test $bash_cv_off_t_64 = yes; then
+ AC_DEFINE(HAVE_OFF_T_64)
+fi])
+
+AC_DEFUN(BASH_STRUCT_TIMEVAL,
+[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
+AC_CACHE_VAL(bash_cv_struct_timeval,
+[
+AC_EGREP_HEADER(struct timeval, sys/time.h,
+ bash_cv_struct_timeval=yes,
+ AC_EGREP_HEADER(struct timeval, time.h,
+ bash_cv_struct_timeval=yes,
+ bash_cv_struct_timeval=no))
+])
+AC_MSG_RESULT($bash_cv_struct_timeval)
+if test $bash_cv_struct_timeval = yes; then
+ AC_DEFINE(HAVE_TIMEVAL)
+fi
+])