diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-03-05 09:08:34 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-03-05 22:38:34 +1000 |
commit | bd7037fdd108729999cfb32a1304abd0eec1d1ad (patch) | |
tree | 17249b496cbcbe72d6e8238ddca83aed054f0810 /auto.def | |
parent | 2e8d9d5014cac46b9486a88307436f74a7a3784c (diff) | |
download | jimtcl-bd7037fdd108729999cfb32a1304abd0eec1d1ad.zip jimtcl-bd7037fdd108729999cfb32a1304abd0eec1d1ad.tar.gz jimtcl-bd7037fdd108729999cfb32a1304abd0eec1d1ad.tar.bz2 |
build: Check for 32-bit time_t at configure time
To warn of Y2038 problems, and suggest use of -D__MINGW_USE_VC2005_COMPAT
on mingw32. Do this instead of the previous runtime test.
Add -D__MINGW_USE_VC2005_COMPAT to the appveyor build.
Fixes msteveb/jimtcl#145
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'auto.def')
-rw-r--r-- | auto.def | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -99,9 +99,14 @@ if {[cctest -cflags -fno-asynchronous-unwind-tables]} { define-append CCOPTS -fno-asynchronous-unwind-tables } -cc-check-includes sys/time.h sys/socket.h netinet/in.h arpa/inet.h netdb.h +cc-check-includes time.h sys/time.h sys/socket.h netinet/in.h arpa/inet.h netdb.h cc-check-includes sys/un.h dlfcn.h unistd.h dirent.h crt_externs.h +# Check sizeof time_t so we can warn on non-Y2038 compliance +cc-with {-includes time.h} { + cc-check-sizeof time_t +} + define LDLIBS "" # Haiku needs -lnetwork, Solaris needs -lnsl @@ -545,3 +550,12 @@ make-template build-jim-ext.in make-template jimtcl.pc.in catch {exec chmod +x build-jim-ext} + +# Finally produce any warnings +if {[get-define SIZEOF_TIME_T] <= 4} { + set note "" + if {[have-feature windows]} { + set note ", consider CFLAGS=-D__MINGW_USE_VC2005_COMPAT on mingw32" + } + user-notice "Warning: sizeof(time_t) is [get-define SIZEOF_TIME_T] -- not Y2038 compliant$note" +} |