Mercurial > gnulib
annotate m4/fdatasync.m4 @ 40132:6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
* m4/fdatasync.m4 (gl_FUNC_FDATASYNC): On platforms other than Solaris,
test whether fdatasync() exists.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 25 Jan 2019 00:15:50 +0100 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
40132
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
1 # fdatasync.m4 serial 5 |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 dnl Copyright (C) 2008-2019 Free Software Foundation, Inc. |
15622 | 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_FDATASYNC], | |
8 [ | |
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) | |
40132
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
10 AC_REQUIRE([AC_CANONICAL_HOST]) |
15626
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
11 |
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
12 dnl Using AC_CHECK_FUNCS_ONCE would break our subsequent AC_SEARCH_LIBS |
15625
eab059ee71cc
fdatasync: port to MacOS X 10.7
Eric Blake <eblake@redhat.com>
parents:
15622
diff
changeset
|
13 AC_CHECK_DECLS_ONCE([fdatasync]) |
15626
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
14 LIB_FDATASYNC= |
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
15 AC_SUBST([LIB_FDATASYNC]) |
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
16 |
15625
eab059ee71cc
fdatasync: port to MacOS X 10.7
Eric Blake <eblake@redhat.com>
parents:
15622
diff
changeset
|
17 if test $ac_cv_have_decl_fdatasync = no; then |
eab059ee71cc
fdatasync: port to MacOS X 10.7
Eric Blake <eblake@redhat.com>
parents:
15622
diff
changeset
|
18 HAVE_DECL_FDATASYNC=0 |
16935
498a2211d839
Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
19 dnl Mac OS X 10.7 has fdatasync but does not declare it. |
15626
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
20 AC_CHECK_FUNCS([fdatasync]) |
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
21 if test $ac_cv_func_fdatasync = no; then |
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
22 HAVE_FDATASYNC=0 |
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
23 fi |
a508d7847f6d
fdatasync: port to Solaris
Eric Blake <eblake@redhat.com>
parents:
15625
diff
changeset
|
24 else |
40132
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
25 case "$host_os" in |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
26 solaris*) |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
27 dnl Solaris <= 2.6 has fdatasync() in libposix4. |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
28 dnl Solaris 7..10 has it in librt. |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
29 gl_saved_libs=$LIBS |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
30 AC_SEARCH_LIBS([fdatasync], [rt posix4], |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
31 [test "$ac_cv_search_fdatasync" = "none required" || |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
32 LIB_FDATASYNC=$ac_cv_search_fdatasync]) |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
33 LIBS=$gl_saved_libs |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
34 ;; |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
35 *) |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
36 dnl Android 4.3 does not have fdatasync but declares it. |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
37 AC_CHECK_FUNCS([fdatasync]) |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
38 if test $ac_cv_func_fdatasync = no; then |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
39 HAVE_FDATASYNC=0 |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
40 fi |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
41 ;; |
6bcaf5dcb02b
fdatasync: Fix compilation error on Android 4.3.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
42 esac |
15625
eab059ee71cc
fdatasync: port to MacOS X 10.7
Eric Blake <eblake@redhat.com>
parents:
15622
diff
changeset
|
43 fi |
15622 | 44 ]) |