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

« back to all changes in this revision

Viewing changes to gl/m4/ioctl.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
# ioctl.m4 serial 1
 
2
dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 
3
dnl This file is free software; the Free Software Foundation
 
4
dnl gives unlimited permission to copy and/or distribute it,
 
5
dnl with or without modifications, as long as this notice is preserved.
 
6
 
 
7
AC_DEFUN([gl_FUNC_IOCTL],
 
8
[
 
9
  AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
 
10
  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
 
11
  if test "$ac_cv_header_winsock2_h" = yes; then
 
12
    dnl Even if the 'socket' module is not used here, another part of the
 
13
    dnl application may use it and pass file descriptors that refer to
 
14
    dnl sockets to the ioctl() function. So enable the support for sockets.
 
15
    AC_LIBOBJ([ioctl])
 
16
    gl_REPLACE_SYS_IOCTL_H
 
17
  else
 
18
    AC_CHECK_FUNCS([ioctl])
 
19
    dnl On glibc systems, the second parameter is 'unsigned long int request',
 
20
    dnl not 'int request'. We cannot simply cast the function pointer, but
 
21
    dnl instead need a wrapper.
 
22
    AC_CACHE_CHECK([for ioctl with POSIX signature],
 
23
      [gl_cv_func_ioctl_posix_signature],
 
24
      [AC_COMPILE_IFELSE(
 
25
         [AC_LANG_PROGRAM(
 
26
            [[#include <sys/ioctl.h>]],
 
27
            [[extern int ioctl (int, int, ...);]])
 
28
         ],
 
29
         [gl_cv_func_ioctl_posix_signature=yes],
 
30
         [gl_cv_func_ioctl_posix_signature=no])
 
31
      ])
 
32
    if test $gl_cv_func_ioctl_posix_signature != yes; then
 
33
      REPLACE_IOCTL=1
 
34
      AC_LIBOBJ([ioctl])
 
35
      gl_REPLACE_SYS_IOCTL_H
 
36
    fi
 
37
  fi
 
38
])