fdatasync.m4 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # fdatasync.m4 serial 4
  2. dnl Copyright (C) 2008-2017 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. AC_DEFUN([gl_FUNC_FDATASYNC],
  7. [
  8. AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
  9. dnl Using AC_CHECK_FUNCS_ONCE would break our subsequent AC_SEARCH_LIBS
  10. AC_CHECK_DECLS_ONCE([fdatasync])
  11. LIB_FDATASYNC=
  12. AC_SUBST([LIB_FDATASYNC])
  13. if test $ac_cv_have_decl_fdatasync = no; then
  14. HAVE_DECL_FDATASYNC=0
  15. dnl Mac OS X 10.7 has fdatasync but does not declare it.
  16. AC_CHECK_FUNCS([fdatasync])
  17. if test $ac_cv_func_fdatasync = no; then
  18. HAVE_FDATASYNC=0
  19. fi
  20. else
  21. dnl Solaris <= 2.6 has fdatasync() in libposix4.
  22. dnl Solaris 7..10 has it in librt.
  23. gl_saved_libs=$LIBS
  24. AC_SEARCH_LIBS([fdatasync], [rt posix4],
  25. [test "$ac_cv_search_fdatasync" = "none required" ||
  26. LIB_FDATASYNC=$ac_cv_search_fdatasync])
  27. LIBS=$gl_saved_libs
  28. fi
  29. ])