Mercurial > gnulib
annotate m4/fopen.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 |
---|---|
17185
dd46d4e6beea
dup, execute, fatal-signal, etc.: no 'static inline'
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
1 # fopen.m4 serial 9 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
17185
diff
changeset
|
2 dnl Copyright (C) 2007-2013 Free Software Foundation, Inc. |
9301
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 AC_DEFUN([gl_FUNC_FOPEN], |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 [ |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS]) |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 AC_REQUIRE([AC_CANONICAL_HOST]) |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 case "$host_os" in |
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 mingw* | pw*) |
11032
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
13 dnl Replace fopen, for handling of "/dev/null". |
9301
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 REPLACE_FOPEN=1 |
11032
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
15 dnl fopen on mingw also has the trailing slash bug. |
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
16 gl_cv_func_fopen_slash="guessing no" |
9301
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 ;; |
10376
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
18 *) |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
19 dnl fopen("foo/", "w") should not create a file when the file name has a |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
20 dnl trailing slash. |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
21 AC_CACHE_CHECK([whether fopen recognizes a trailing slash], |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
22 [gl_cv_func_fopen_slash], |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
23 [ |
13579
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13490
diff
changeset
|
24 AC_RUN_IFELSE( |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13490
diff
changeset
|
25 [AC_LANG_SOURCE([[ |
10376
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
26 #include <stddef.h> |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
27 #include <stdio.h> |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
28 int main () |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
29 { |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
30 return fopen ("conftest.sl/", "w") != NULL; |
13579
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13490
diff
changeset
|
31 }]])], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13490
diff
changeset
|
32 [gl_cv_func_fopen_slash=yes], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13490
diff
changeset
|
33 [gl_cv_func_fopen_slash=no], |
10376
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
34 [ |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
35 changequote(,)dnl |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
36 case "$host_os" in |
13972
258e995bb973
Fix cross-compilation guesses on Solaris.
Bruno Haible <bruno@clisp.org>
parents:
13579
diff
changeset
|
37 aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) |
13490
e04f4ee19c1b
open, fopen: Update regarding AIX.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
38 gl_cv_func_fopen_slash="guessing no" ;; |
e04f4ee19c1b
open, fopen: Update regarding AIX.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
39 *) |
e04f4ee19c1b
open, fopen: Update regarding AIX.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
40 gl_cv_func_fopen_slash="guessing yes" ;; |
10376
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
41 esac |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
42 changequote([,])dnl |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
43 ]) |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
44 rm -f conftest.sl |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
45 ]) |
8532ecccedda
Work around bug with trailing slash on Solaris 9 and HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
9301
diff
changeset
|
46 ;; |
9301
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
47 esac |
11032
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
48 case "$gl_cv_func_fopen_slash" in |
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
49 *no) |
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
50 AC_DEFINE([FOPEN_TRAILING_SLASH_BUG], [1], |
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
51 [Define to 1 if fopen() fails to recognize a trailing slash.]) |
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
52 REPLACE_FOPEN=1 |
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
53 ;; |
58b810e18aa8
Fix test-fopen failure on mingw.
Bruno Haible <bruno@clisp.org>
parents:
11007
diff
changeset
|
54 esac |
9301
98e1721b4e40
New modules 'fopen' and 'freopen'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
55 ]) |
10531
e83a90adf243
Override fopen more carefully.
Bruno Haible <bruno@clisp.org>
parents:
10376
diff
changeset
|
56 |
e83a90adf243
Override fopen more carefully.
Bruno Haible <bruno@clisp.org>
parents:
10376
diff
changeset
|
57 # Prerequisites of lib/fopen.c. |
17185
dd46d4e6beea
dup, execute, fatal-signal, etc.: no 'static inline'
Paul Eggert <eggert@cs.ucla.edu>
parents:
16201
diff
changeset
|
58 AC_DEFUN([gl_PREREQ_FOPEN], [:]) |