time: work with mingw + pthreads-win32 library
When using the pthreads-win32 library with mingw, struct timespec
is available in <pthread.h>. Meanwhile, that header has some
rather buggy macros for localtime_r and gmtime_r that interfere
with proper gnulib replacement header actions.
Tested in a cross-compilation environment: Fedora 13 with mingw32-gcc
and mingw32-pthreads installed.
* m4/time_h.m4 (gl_CHECK_TYPE_STRUCT_TIMESPEC): Set new variable
if timespec is defined only in pthread.h.
* modules/time (Makefile.am): Substitute it.
* lib/time.in.h (!TIME_H_DEFINES_STRUCT_TIMESPEC): Include
<pthread.h>, when needed.
(GNULIB_TIME_R): Undefine broken localtime_r and gmtime_r macros
from the library.
Signed-off-by: Eric Blake <eblake@redhat.com>