summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2022-12-29 01:10:53 +0800
committerJia Tan <jiat0218@gmail.com>2022-12-30 23:34:31 +0800
commit74dae7d30091e906d6a92a57952dea4354473f9b (patch)
tree128a776f1c62de4504aa5e6448c9ec3fc130d211 /configure.ac
parent7339e39dc060df6eda74a2c5b69961befc3d5d24 (diff)
downloadxz-74dae7d30091e906d6a92a57952dea4354473f9b.tar.gz
Build: No longer require HAVE_DECL_CLOCK_MONOTONIC to always be set.
Previously, if threading was enabled HAVE_DECL_CLOCK_MONOTONIC would always be set to 0 or 1. However, this macro was needed in xz so if xz was not built with threading and HAVE_DECL_CLOCK_MONOTONIC was not defined but HAVE_CLOCK_GETTIME was, it caused a warning during build. Now, HAVE_DECL_CLOCK_MONOTONIC has been renamed to HAVE_CLOCK_MONOTONIC and will only be set if it is 1.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 4 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 7c77215..a16031b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -638,7 +638,10 @@ case $enable_threads in
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock])
- AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
+ AC_CHECK_DECL([CLOCK_MONOTONIC], [AC_DEFINE(
+ [HAVE_CLOCK_MONOTONIC], [1], [Define to 1 if
+ CLOCK_MONOTONIC is declared in <time.h>])], [],
+ [[#include <time.h>]])
CFLAGS=$OLD_CFLAGS
;;
win95)