Mercurial > gnulib
annotate m4/ioctl.m4 @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
15438
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14987
diff
changeset
|
1 # ioctl.m4 serial 4 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. |
13245
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 AC_DEFUN([gl_FUNC_IOCTL], |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 [ |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS]) |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 AC_REQUIRE([gl_HEADER_SYS_SOCKET]) |
14987
205da32df725
ioctl: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
14685
diff
changeset
|
11 HAVE_IOCTL=1 |
13245
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 if test "$ac_cv_header_winsock2_h" = yes; then |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 dnl Even if the 'socket' module is not used here, another part of the |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 dnl application may use it and pass file descriptors that refer to |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 dnl sockets to the ioctl() function. So enable the support for sockets. |
14987
205da32df725
ioctl: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
14685
diff
changeset
|
16 HAVE_IOCTL=0 |
13245
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 else |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 AC_CHECK_FUNCS([ioctl]) |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 dnl On glibc systems, the second parameter is 'unsigned long int request', |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 dnl not 'int request'. We cannot simply cast the function pointer, but |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 dnl instead need a wrapper. |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 AC_CACHE_CHECK([for ioctl with POSIX signature], |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 [gl_cv_func_ioctl_posix_signature], |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 [AC_COMPILE_IFELSE( |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 [AC_LANG_PROGRAM( |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 [[#include <sys/ioctl.h>]], |
15438
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14987
diff
changeset
|
27 [[extern |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14987
diff
changeset
|
28 #ifdef __cplusplus |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14987
diff
changeset
|
29 "C" |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14987
diff
changeset
|
30 #endif |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14987
diff
changeset
|
31 int ioctl (int, int, ...); |
591ddd1ddd1a
Declare system functions in a way that works with C++.
Bruno Haible <bruno@clisp.org>
parents:
14987
diff
changeset
|
32 ]]) |
13245
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 ], |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 [gl_cv_func_ioctl_posix_signature=yes], |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 [gl_cv_func_ioctl_posix_signature=no]) |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 ]) |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 if test $gl_cv_func_ioctl_posix_signature != yes; then |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 REPLACE_IOCTL=1 |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 fi |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 fi |
46c3f440d469
ioctl: Move autoconf macro to a .m4 file.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 ]) |