~ubuntu-branches/ubuntu/quantal/gnutls26/quantal

« back to all changes in this revision

Viewing changes to gl/m4/socklen.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# socklen.m4 serial 6
2
 
dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 
1
# socklen.m4 serial 7
 
2
dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
20
20
   AC_CHECK_TYPE([socklen_t], ,
21
21
     [AC_MSG_CHECKING([for socklen_t equivalent])
22
22
      AC_CACHE_VAL([gl_cv_socklen_t_equiv],
23
 
        [# Systems have either "struct sockaddr *" or
24
 
         # "void *" as the second argument to getpeername
25
 
         gl_cv_socklen_t_equiv=
26
 
         for arg2 in "struct sockaddr" void; do
27
 
           for t in int size_t "unsigned int" "long int" "unsigned long int"; do
28
 
             AC_TRY_COMPILE(
29
 
               [#include <sys/types.h>
30
 
                #include <sys/socket.h>
 
23
        [# Systems have either "struct sockaddr *" or
 
24
         # "void *" as the second argument to getpeername
 
25
         gl_cv_socklen_t_equiv=
 
26
         for arg2 in "struct sockaddr" void; do
 
27
           for t in int size_t "unsigned int" "long int" "unsigned long int"; do
 
28
             AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 
29
                 [[#include <sys/types.h>
 
30
                   #include <sys/socket.h>
31
31
 
32
 
                int getpeername (int, $arg2 *, $t *);],
33
 
               [$t len;
34
 
                getpeername (0, 0, &len);],
35
 
               [gl_cv_socklen_t_equiv="$t"])
36
 
             test "$gl_cv_socklen_t_equiv" != "" && break
37
 
           done
38
 
           test "$gl_cv_socklen_t_equiv" != "" && break
39
 
         done
 
32
                   int getpeername (int, $arg2 *, $t *);]],
 
33
                 [[$t len;
 
34
                  getpeername (0, 0, &len);]])],
 
35
               [gl_cv_socklen_t_equiv="$t"])
 
36
             test "$gl_cv_socklen_t_equiv" != "" && break
 
37
           done
 
38
           test "$gl_cv_socklen_t_equiv" != "" && break
 
39
         done
40
40
      ])
41
41
      if test "$gl_cv_socklen_t_equiv" = ""; then
42
 
        AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
 
42
        AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
43
43
      fi
44
44
      AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
45
45
      AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
46
 
        [type to use in place of socklen_t if not defined])],
 
46
        [type to use in place of socklen_t if not defined])],
47
47
     [#include <sys/types.h>
48
48
      #if HAVE_SYS_SOCKET_H
49
49
      # include <sys/socket.h>