Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.6KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_off64_t.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_OFF64_T
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check if off64_t is defined. On true define HAVE_OFF64_T, also define
  12. # __LARGEFILE64_SOURCE where one is needed. (Note that an appropriative
  13. # entry must be in config.h.in.)
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2008 Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
  18. #
  19. # Copying and distribution of this file, with or without modification, are
  20. # permitted in any medium without royalty provided the copyright notice
  21. # and this notice are preserved. This file is offered as-is, without any
  22. # warranty.
  23. #serial 7
  24. AU_ALIAS([RSSH_CHECK_OFF64_T], [AX_CHECK_OFF64_T])
  25. AC_DEFUN([AX_CHECK_OFF64_T], [
  26. AC_REQUIRE([AC_SYS_LARGEFILE])dnl
  27. AC_CHECK_HEADER(unistd.h)
  28. AC_CACHE_CHECK([whether type off64_t support],
  29. [ax_cv_check_off64_t],
  30. [
  31. AC_COMPILE_IFELSE(
  32. AC_LANG_SOURCE([
  33. #ifdef HAVE_UNISTD_H
  34. #include <unistd.h>
  35. #endif
  36. extern off64_t x1;
  37. ])
  38. ,ax_have_off64t=1)
  39. if test "x$ax_have_off64t" = "x"
  40. then
  41. AC_COMPILE_IFELSE(
  42. AC_LANG_SOURCE([
  43. #define _LARGEFILE64_SOURCE
  44. #ifdef HAVE_UNISTD_H
  45. #include <unistd.h>
  46. #endif
  47. extern off64_t x1;
  48. ]),
  49. ax_cv_check_off64_t="_LARGEFILE64_SOURCE",
  50. ax_cv_check_off64_t="no"
  51. )dnl
  52. else
  53. ax_cv_check_off64_t=yes
  54. fi
  55. ])dnl
  56. if test "x$ax_cv_check_off64_t" = "x_LARGEFILE64_SOURCE"
  57. then
  58. AC_DEFINE(_LARGEFILE64_SOURCE)
  59. AC_DEFINE(HAVE_OFF64_T)
  60. elif test "x$ax_cv_check_off64_t" = "xyes"
  61. then
  62. AC_DEFINE(HAVE_OFF64_T)
  63. fi
  64. ])dnl