X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=configure.in;h=6b94c4be8747fa701440de19dec4bda1f0bf81ea;hb=7b7d6baf7b730cc095cb96a3c83ee34409ca4624;hp=6271634c056c33871cae351405b8a94bfe37a093;hpb=4f4d2de14733c9cb180f632bd30de01293abbd9f;p=openldap diff --git a/configure.in b/configure.in index 6271634c05..6b94c4be87 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl $OpenLDAP$ dnl This work is part of OpenLDAP Software . dnl -dnl Copyright 1998-2006 The OpenLDAP Foundation. +dnl Copyright 1998-2008 The OpenLDAP Foundation. dnl All rights reserved. dnl dnl Redistribution and use in source and binary forms, with or without @@ -23,7 +23,7 @@ define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])dnl dnl ================================================================ dnl Configure.in for OpenLDAP -AC_COPYRIGHT([[Copyright 1998-2006 The OpenLDAP Foundation. All rights reserved. +AC_COPYRIGHT([[Copyright 1998-2008 The OpenLDAP Foundation. All rights reserved. Restrictions apply, see COPYRIGHT and LICENSE files.]]) AC_REVISION([$OpenLDAP$]) AC_INIT([OpenLDAP],,[http://www.openldap.org/its/]) @@ -93,7 +93,7 @@ AH_TOP([ /* begin of portable.h.pre */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2006 The OpenLDAP Foundation + * Copyright 1998-2008 The OpenLDAP Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -2378,14 +2378,43 @@ AC_CHECK_TYPE(size_t, unsigned) AC_CHECK_TYPES([long long]) AC_CHECK_TYPES([ptrdiff_t]) -AC_CHECK_TYPE([socklen_t],, - [AC_DEFINE_UNQUOTED([socklen_t], [int], - [Define to `int' if does not define.])], - [$ac_includes_default + +AC_CHECK_TYPE([socklen_t],,, [$ac_includes_default +#ifdef HAVE_SYS_SOCKET_H +#include +#endif]) + +dnl socklen_t-like type in accept(), default socklen_t or int: +dnl - The OS might define socklen_t without using it. POSIX moved from +dnl int to size_t to socklen_t, hoping to stay at a 32-bit type, and +dnl HP-UX now has selectors for what to use. +dnl - On Solaris 2.8 the prototype has void *len, but the default is OK. +AC_MSG_CHECKING([the type of arg 3 to accept()]) +AC_CACHE_VAL(ol_cv_type_ber_socklen_t, [ + set socklen_t int unsigned "unsigned long" long size_t + test "$ac_cv_type_socklen_t" = yes || shift + ol_cv_type_ber_socklen_t=$1 guessing="guessing " + for lentype in "$@" ; do for addrtype in "struct sockaddr" void ; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_includes_default #ifdef HAVE_SYS_SOCKET_H #include #endif - ]) +extern int accept(int s, $addrtype *ap, $lentype *lp); +], [ +accept(0, (struct sockaddr *) 0, ($lentype *) 0); +])], [ol_cv_type_ber_socklen_t=$lentype guessing= ; break 2]) + done ; done]) +AC_MSG_RESULT([$guessing$ol_cv_type_ber_socklen_t *]) +AC_DEFINE_UNQUOTED(ber_socklen_t, $ol_cv_type_ber_socklen_t, + [Define to the type of arg 3 for `accept'.]) + +dnl Modules should use ber_socklen_t, not socklen_t. Define socklen_t +dnl for the time being anyway, for backwards compatibility. +if test "$ac_cv_type_socklen_t" != yes; then + AC_DEFINE_UNQUOTED([socklen_t], [$ol_cv_type_ber_socklen_t], + [Define like ber_socklen_t if does not define.]) +fi + AC_TYPE_SIGNAL @@ -3203,7 +3232,7 @@ rm -f $BACKENDSC cat > $BACKENDSC << ENDX /* This work is part of OpenLDAP Software . * - * Copyright 1998-2006 The OpenLDAP Foundation. + * Copyright 1998-2008 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -3254,7 +3283,7 @@ rm -f $OVERLAYSC cat > $OVERLAYSC << ENDX /* This work is part of OpenLDAP Software . * - * Copyright 1998-2006 The OpenLDAP Foundation. + * Copyright 1998-2008 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without