Skip to content

Commit 0312643

Browse files
authored
Merge pull request #2116 from jimklimov/issue-2115
configure.ac: relax the check warning for gmtime_[rs] and localtime_[rs]…
2 parents 0a7bfda + a1cc676 commit 0312643

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

configure.ac

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,31 @@ dnl# [], [AC_MSG_WARN([Required C library routine not found; try adding __EXTEN
728728
dnl These appear with CFLAGS="-std=c99 -D_POSIX_C_SOURCE=200112L":
729729
dnl# Methods below currently do not cause build errors for C99+ modes so are
730730
dnl# not tested as thoroughly as those further below:
731-
AC_CHECK_FUNCS(strtok_r fileno localtime_r localtime_s gmtime_r gmtime_s sigemptyset sigaction,
731+
AC_CHECK_FUNCS(strtok_r fileno sigemptyset sigaction,
732732
[], [AC_MSG_WARN([Required C library routine not found; try adding -D_POSIX_C_SOURCE=200112L])])
733733

734+
dnl For these we have a fallback implementation via the other,
735+
dnl if at least one is available, so initial check is quiet.
736+
dnl This typically pops up in POSIX vs. Windows builds:
737+
AC_CHECK_FUNCS(localtime_r localtime_s gmtime_r gmtime_s,
738+
[], [])
739+
740+
AC_MSG_CHECKING([for at least one gmtime implementation])
741+
AS_IF([test x"${ac_cv_func_gmtime_s}-${ac_cv_func_gmtime_r}" = "xno-no"], [
742+
AC_MSG_RESULT([no])
743+
AC_MSG_WARN([Required C library routine gmtime_s nor gmtime_r was not found; try adding -D_POSIX_C_SOURCE=200112L])
744+
],[
745+
AC_MSG_RESULT([yes])
746+
])
747+
748+
AC_MSG_CHECKING([for at least one localtime implementation])
749+
AS_IF([test x"${ac_cv_func_localtime_s}-${ac_cv_func_localtime_r}" = "xno-no"], [
750+
AC_MSG_RESULT([no])
751+
AC_MSG_WARN([Required C library routine localtime_s nor localtime_r was not found; try adding -D_POSIX_C_SOURCE=200112L])
752+
],[
753+
AC_MSG_RESULT([yes])
754+
])
755+
734756
AC_LANG_PUSH([C])
735757

736758
AC_CHECK_HEADER([string.h],

0 commit comments

Comments
 (0)