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.

96 lines
3.8KB

  1. # ==============================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_var_timezone_externals.html
  3. # ==============================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_VAR_TIMEZONE_EXTERNALS
  8. #
  9. # DESCRIPTION
  10. #
  11. # Use instead of `AC_STRUCT_TIMEZONE' to determine whether the external
  12. # timezone variables `timezone', `altzone' and `daylight' exist, defining
  13. # `HAVE_TIMEZONE', `HAVE_ALTZONE' and `HAVE_DAYLIGHT' respectively (as
  14. # well as gaining the macros defined by `AC_STRUCT_TIMEZONE').
  15. #
  16. # Rewritten for Autoconf 2.68, and made robust against BSD's timezone()
  17. # function, by Daniel Richard G.
  18. #
  19. # LICENSE
  20. #
  21. # Copyright (c) 2008 Mark R. Bannister <markb@freedomware.co.uk>
  22. # Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
  23. #
  24. # This program is free software; you can redistribute it and/or modify it
  25. # under the terms of the GNU General Public License as published by the
  26. # Free Software Foundation; either version 2 of the License, or (at your
  27. # option) any later version.
  28. #
  29. # This program is distributed in the hope that it will be useful, but
  30. # WITHOUT ANY WARRANTY; without even the implied warranty of
  31. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  32. # Public License for more details.
  33. #
  34. # You should have received a copy of the GNU General Public License along
  35. # with this program. If not, see <https://www.gnu.org/licenses/>.
  36. #
  37. # As a special exception, the respective Autoconf Macro's copyright owner
  38. # gives unlimited permission to copy, distribute and modify the configure
  39. # scripts that are the output of Autoconf when processing the Macro. You
  40. # need not follow the terms of the GNU General Public License when using
  41. # or distributing such scripts, even though portions of the text of the
  42. # Macro appear in them. The GNU General Public License (GPL) does govern
  43. # all other use of the material that constitutes the Autoconf Macro.
  44. #
  45. # This special exception to the GPL applies to versions of the Autoconf
  46. # Macro released by the Autoconf Archive. When you make and distribute a
  47. # modified version of the Autoconf Macro, you may extend this special
  48. # exception to the GPL to apply to your modified version as well.
  49. #serial 7
  50. AU_ALIAS([AC_VAR_TIMEZONE_EXTERNALS], [AX_VAR_TIMEZONE_EXTERNALS])
  51. AC_DEFUN([AX_VAR_TIMEZONE_EXTERNALS],
  52. [ AC_REQUIRE([AC_STRUCT_TIMEZONE])dnl
  53. AC_LANG_PUSH([C])
  54. AC_CACHE_CHECK([for `timezone' variable in time.h], [mb_cv_var_timezone],
  55. [ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>],
  56. [int *foo = (int *)0xdeadbeef; return foo@<:@timezone@:>@ /* ; */])],
  57. [mb_cv_var_timezone=yes],
  58. [mb_cv_var_timezone=no])
  59. ])
  60. AC_CACHE_CHECK([for `altzone' variable in time.h], [mb_cv_var_altzone],
  61. [ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>],
  62. [int *foo = (int *)0xdeadbeef; return foo@<:@altzone@:>@ /* ; */])],
  63. [mb_cv_var_altzone=yes],
  64. [mb_cv_var_altzone=no])
  65. ])
  66. AC_CACHE_CHECK([for `daylight' variable in time.h], [mb_cv_var_daylight],
  67. [ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>],
  68. [int *foo = (int *)0xdeadbeef; return foo@<:@daylight@:>@ /* ; */])],
  69. [mb_cv_var_daylight=yes],
  70. [mb_cv_var_daylight=no])
  71. ])
  72. if test "$mb_cv_var_timezone" = "yes"; then
  73. AC_DEFINE([HAVE_TIMEZONE], [1],
  74. [Define to 1 if you have the external `timezone' variable.])
  75. fi
  76. if test "$mb_cv_var_altzone" = "yes"; then
  77. AC_DEFINE([HAVE_ALTZONE], [1],
  78. [Define to 1 if you have the external `altzone' variable.])
  79. fi
  80. if test "$mb_cv_var_daylight" = "yes"; then
  81. AC_DEFINE([HAVE_DAYLIGHT], [1],
  82. [Define to 1 if you have the external `daylight' variable.])
  83. fi
  84. AC_LANG_POP
  85. ])