- (dtucker) [configure.ac defines.h] Test for fd_mask, howmany and NFDBITS

rather than trying to enumerate the plaforms that don't have them.
   Based on a patch from Nathan Osman, with help from tim@.
This commit is contained in:
Darren Tucker 2013-06-02 07:18:47 +10:00
parent c0c3373216
commit c7aad0058c
3 changed files with 47 additions and 19 deletions

View File

@ -2,6 +2,9 @@
- (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to
using openssl's DES_crpyt function on platorms that don't have a native using openssl's DES_crpyt function on platorms that don't have a native
one, eg Android. Based on a patch from Nathan Osman. one, eg Android. Based on a patch from Nathan Osman.
- (dtucker) [configure.ac defines.h] Test for fd_mask, howmany and NFDBITS
rather than trying to enumerate the plaforms that don't have them.
Based on a patch from Nathan Osman, with help from tim@.
20130529 20130529
- (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null

View File

@ -1,4 +1,4 @@
# $Id: configure.ac,v 1.526 2013/06/01 20:28:04 dtucker Exp $ # $Id: configure.ac,v 1.527 2013/06/01 21:18:48 dtucker Exp $
# #
# Copyright (c) 1999-2004 Damien Miller # Copyright (c) 1999-2004 Damien Miller
# #
@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
AC_REVISION($Revision: 1.526 $) AC_REVISION($Revision: 1.527 $)
AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C]) AC_LANG([C])
@ -979,9 +979,6 @@ mips-sony-bsd|mips-sony-newsos4)
*-*-nto-qnx*) *-*-nto-qnx*)
AC_DEFINE([USE_PIPES]) AC_DEFINE([USE_PIPES])
AC_DEFINE([NO_X11_UNIX_SOCKETS]) AC_DEFINE([NO_X11_UNIX_SOCKETS])
AC_DEFINE([MISSING_NFDBITS], [1], [Define on *nto-qnx systems])
AC_DEFINE([MISSING_HOWMANY], [1], [Define on *nto-qnx systems])
AC_DEFINE([MISSING_FD_MASK], [1], [Define on *nto-qnx systems])
AC_DEFINE([DISABLE_LASTLOG]) AC_DEFINE([DISABLE_LASTLOG])
AC_DEFINE([SSHD_ACQUIRES_CTTY]) AC_DEFINE([SSHD_ACQUIRES_CTTY])
AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken])
@ -1002,7 +999,6 @@ mips-sony-bsd|mips-sony-newsos4)
*-*-lynxos) *-*-lynxos)
CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
AC_DEFINE([MISSING_HOWMANY])
AC_DEFINE([BROKEN_SETVBUF], [1], [LynxOS has broken setvbuf() implementation]) AC_DEFINE([BROKEN_SETVBUF], [1], [LynxOS has broken setvbuf() implementation])
;; ;;
esac esac
@ -1703,6 +1699,37 @@ AC_CHECK_DECLS([offsetof], , , [
#include <stddef.h> #include <stddef.h>
]) ])
# extra bits for select(2)
AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[
#include <sys/param.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
]])
AC_CHECK_TYPES([fd_mask], [], [], [[
#include <sys/param.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
]])
AC_CHECK_FUNCS([setresuid], [ AC_CHECK_FUNCS([setresuid], [
dnl Some platorms have setresuid that isn't implemented, test for this dnl Some platorms have setresuid that isn't implemented, test for this
AC_MSG_CHECKING([if setresuid seems to work]) AC_MSG_CHECKING([if setresuid seems to work])

View File

@ -25,7 +25,7 @@
#ifndef _DEFINES_H #ifndef _DEFINES_H
#define _DEFINES_H #define _DEFINES_H
/* $Id: defines.h,v 1.171 2013/03/07 09:06:13 dtucker Exp $ */ /* $Id: defines.h,v 1.172 2013/06/01 21:18:48 dtucker Exp $ */
/* Constants */ /* Constants */
@ -171,11 +171,6 @@ enum
# define MAP_FAILED ((void *)-1) # define MAP_FAILED ((void *)-1)
#endif #endif
/* *-*-nto-qnx doesn't define this constant in the system headers */
#ifdef MISSING_NFDBITS
# define NFDBITS (8 * sizeof(unsigned long))
#endif
/* /*
SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but
including rpc/rpc.h breaks Solaris 6 including rpc/rpc.h breaks Solaris 6
@ -355,11 +350,19 @@ struct winsize {
}; };
#endif #endif
/* *-*-nto-qnx does not define this type in the system headers */ /* bits needed for select that may not be in the system headers */
#ifdef MISSING_FD_MASK #ifndef HAVE_FD_MASK
typedef unsigned long int fd_mask; typedef unsigned long int fd_mask;
#endif #endif
#if defined(HAVE_DECL_NFDBITS) && HAVE_DECL_NFDBITS == 0
# define NFDBITS (8 * sizeof(unsigned long))
#endif
#if defined(HAVE_DECL_HOWMANY) && HAVE_DECL_HOWMANY == 0
# define howmany(x,y) (((x)+((y)-1))/(y))
#endif
/* Paths */ /* Paths */
#ifndef _PATH_BSHELL #ifndef _PATH_BSHELL
@ -484,11 +487,6 @@ struct winsize {
# define __nonnull__(x) # define __nonnull__(x)
#endif #endif
/* *-*-nto-qnx doesn't define this macro in the system headers */
#ifdef MISSING_HOWMANY
# define howmany(x,y) (((x)+((y)-1))/(y))
#endif
#ifndef OSSH_ALIGNBYTES #ifndef OSSH_ALIGNBYTES
#define OSSH_ALIGNBYTES (sizeof(int) - 1) #define OSSH_ALIGNBYTES (sizeof(int) - 1)
#endif #endif