strftime() and %z
  • Order of the Butterfly
    Order of the Butterfly
    emeck
    Posts: 168 from 2014/7/15
    Hello,

    I'm having a problem trying to port a program. The configure runs a test that fails for an option of the strftime() function that is supposed to be C99 standard.

    I have tried adding -std=c99 to the CFLAGS but no difference. This is the piece of code causing the failure:


    ---
    AC_CACHE_CHECK([whether strftime supports %z], ob_cv_strftime_z,
    [AC_TRY_RUN(
    [#include <time.h>
    #include <string.h>

    int main(void)
    {
    time_t t = 0;
    char buf[32];
    strftime(buf, sizeof(buf), "%z", localtime(&t));
    return !(buf[0] == '+' || buf[0] == '-');
    }
    ], [ob_cv_strftime_z=yes], [ob_cv_strftime_z=no], [ob_cv_strftime_z="yes (assumed)"])])
    if test "x$ob_cv_strftime_z" = x"no"; then
    AC_MSG_ERROR([libc lacks necessary feature])
    fi
    ---

    Any ideas how to solve it?
    TIA!
    PowerBook 5.8 MorphOS 3.18
    Mac Mini MorphOS 3.18
  • »01.03.15 - 17:21
    Profile