Bug 1747323 - Move tm_zone and tm_gmtoff check to python configure. r=firefox-build-system-reviewers,andi

Differential Revision: https://phabricator.services.mozilla.com/D134563
This commit is contained in:
Mike Hommey 2021-12-23 20:50:38 +00:00
parent efd23948af
commit 2f2cee3541
2 changed files with 13 additions and 16 deletions

View File

@ -1258,3 +1258,16 @@ set_config(
lambda x: x.version[-2] if str(x.version[-2]) in "ab" else None
),
)
# Check for tm_zone, tm_gmtoff in struct tm
# ===================================================
with only_when(compile_environment):
set_define(
"HAVE_TM_ZONE_TM_GMTOFF",
c_compiler.try_compile(
includes=["time.h"],
body="struct tm tm; tm.tm_zone = 0; tm.tm_gmtoff = 1;",
check_msg="for tm_zone and tm_gmtoff in struct tm",
),
)

View File

@ -1142,24 +1142,8 @@ else
AC_MSG_RESULT([no])
fi
AC_LANG_CPLUSPLUS
dnl ========================================================
dnl Check for tm_zone, tm_gmtoff in struct tm
dnl ========================================================
AC_CACHE_CHECK(for tm_zone tm_gmtoff in struct tm,
ac_cv_struct_tm_zone_tm_gmtoff,
[AC_TRY_COMPILE([#include <time.h>],
[struct tm tm; tm.tm_zone = 0; tm.tm_gmtoff = 1;],
[ac_cv_struct_tm_zone_tm_gmtoff="yes"],
[ac_cv_struct_tm_zone_tm_gmtoff="no"])])
if test "$ac_cv_struct_tm_zone_tm_gmtoff" = "yes" ; then
AC_DEFINE(HAVE_TM_ZONE_TM_GMTOFF)
fi
fi # ! SKIP_COMPILER_CHECKS
AC_LANG_C
MOZ_EXPAND_LIBS
dnl ========================================================