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.

53 lines
1.8KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_strftime.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_STRFTIME
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check for existence and functioning of strftime routine.
  12. #
  13. # LICENSE
  14. #
  15. # Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
  16. #
  17. # Copying and distribution of this file, with or without modification, are
  18. # permitted in any medium without royalty provided the copyright notice
  19. # and this notice are preserved. This file is offered as-is, without any
  20. # warranty.
  21. #serial 6
  22. AU_ALIAS([AG_CHECK_STRFTIME], [AX_CHECK_STRFTIME])
  23. AC_DEFUN([AX_CHECK_STRFTIME],[
  24. AC_MSG_CHECKING([whether strftime() works])
  25. AC_CACHE_VAL([ax_cv_strftime],[
  26. AC_TRY_RUN([#include <time.h>
  27. char t_buf[ 64 ];
  28. int main() {
  29. static const char z[] = "Thursday Aug 28 240";
  30. struct tm tm;
  31. tm.tm_sec = 36; /* seconds after the minute [0, 61] */
  32. tm.tm_min = 44; /* minutes after the hour [0, 59] */
  33. tm.tm_hour = 12; /* hour since midnight [0, 23] */
  34. tm.tm_mday = 28; /* day of the month [1, 31] */
  35. tm.tm_mon = 7; /* months since January [0, 11] */
  36. tm.tm_year = 86; /* years since 1900 */
  37. tm.tm_wday = 4; /* days since Sunday [0, 6] */
  38. tm.tm_yday = 239; /* days since January 1 [0, 365] */
  39. tm.tm_isdst = 1; /* flag for daylight savings time */
  40. strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
  41. return (strcmp( t_buf, z ) != 0); }],[ax_cv_strftime=yes],[ax_cv_strftime=no],[ax_cv_strftime=no]
  42. ) # end of TRY_RUN]) # end of CACHE_VAL
  43. AC_MSG_RESULT([$ax_cv_strftime])
  44. if test x$ax_cv_strftime = xyes
  45. then
  46. AC_DEFINE(HAVE_STRFTIME, 1,
  47. [Define this if strftime() works])
  48. fi
  49. ]) # end of AC_DEFUN of AX_CHECK_STRFTIME