summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 28 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9daace7..3c1dc1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6703,6 +6703,34 @@ then
[Define if year with century should be normalized for strftime.])
fi
+AC_CACHE_CHECK([whether C99-specific strftime specifiers are supported], [ac_cv_strftime_c99_support], [
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <time.h>
+#include <string.h>
+
+int main(void)
+{
+ char full_date[11];
+ struct tm date = {
+ .tm_year = 0,
+ .tm_mon = 0,
+ .tm_mday = 1
+ };
+ if (strftime(full_date, sizeof(full_date), "%F", &date) && !strcmp(full_date, "1900-01-01")) {
+ return 0;
+ }
+ return 1;
+}
+]])],
+[ac_cv_strftime_c99_support=yes],
+[ac_cv_strftime_c99_support=no],
+[ac_cv_strftime_c99_support=no])])
+if test "$ac_cv_strftime_c99_support" = yes
+then
+ AC_DEFINE([Py_STRFTIME_C99_SUPPORT], [1],
+ [Define if C99-specific strftime specifiers are supported.])
+fi
+
dnl check for ncursesw/ncurses and panelw/panel
dnl NOTE: old curses is not detected.
dnl have_curses=[no, yes]