mcabber/macros/timezone.m4
changeset 800 103764a87777
equal deleted inserted replaced
799:7362ed14dee0 800:103764a87777
       
     1 dnl ac_var_timeszone_externals.m4
       
     2 
       
     3 # Define 'timezone', 'altzone' and 'daylight'
       
     4 # http://www.gnu.org/software/ac-archive/Miscellaneous/ac_var_timezone_externals.html
       
     5 # Use instead of 'AC_STRUCT_TIMEZONE' to determine whether the
       
     6 # the external timezone variables 'timezone', 'altzone' and 'daylight' exist,
       
     7 # defining 'HAVE_TIMEZONE', 'HAVE_ALTZONE' and 'HAVE_DAYLIGHT' respectively
       
     8 # (as well as gaining the macros defined by 'AC_STRUCT_TIMEZONE').
       
     9 # Mark R.Bannister <markb@freedomware.co.uk>
       
    10 AC_DEFUN([AC_VAR_TIMEZONE_EXTERNALS],
       
    11 [  AC_REQUIRE([AC_STRUCT_TIMEZONE])dnl
       
    12    AC_CACHE_CHECK(for timezone external, mb_cv_var_timezone,
       
    13    [  AC_TRY_LINK([#include <time.h>], [return (int)timezone;],
       
    14          mb_cv_var_timezone=yes,
       
    15          mb_cv_var_timezone=no)
       
    16    ])
       
    17    AC_CACHE_CHECK(for altzone external, mb_cv_var_altzone,
       
    18    [  AC_TRY_LINK([#include <time.h>], [return (int)altzone;],
       
    19          mb_cv_var_altzone=yes,
       
    20          mb_cv_var_altzone=no)
       
    21    ])
       
    22    AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight,
       
    23    [  AC_TRY_LINK([#include <time.h>], [return (int)daylight;],
       
    24          mb_cv_var_daylight=yes,
       
    25          mb_cv_var_daylight=no)
       
    26    ])
       
    27    if test $mb_cv_var_timezone = yes; then
       
    28       AC_DEFINE([HAVE_TIMEZONE], 1,
       
    29               [Define if you have the external 'timezone' variable.])
       
    30    fi
       
    31    if test $mb_cv_var_altzone = yes; then
       
    32       AC_DEFINE([HAVE_ALTZONE], 1,
       
    33               [Define if you have the external 'altzone' variable.])
       
    34    fi
       
    35    if test $mb_cv_var_daylight = yes; then
       
    36       AC_DEFINE([HAVE_DAYLIGHT], 1,
       
    37               [Define if you have the external 'daylight' variable.])
       
    38    fi
       
    39 ])