summaryrefslogtreecommitdiff
path: root/m4/curl-confopts.m4
diff options
context:
space:
mode:
authorMichaƂ Fita <michal.fita@gmail.com>2015-07-23 10:38:49 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-07-24 00:09:29 +0200
commitcee21eb6a7752f90fe3e2ee260a31ce0a9eeaaa0 (patch)
tree1ea3ef2efdbfaa2c5b59b65f6b8d7c9459b9c00f /m4/curl-confopts.m4
parentda650c1e544e3ebb7d43332d0570cd34d31e08b3 (diff)
downloadgnurl-cee21eb6a7752f90fe3e2ee260a31ce0a9eeaaa0.tar.gz
gnurl-cee21eb6a7752f90fe3e2ee260a31ce0a9eeaaa0.tar.bz2
gnurl-cee21eb6a7752f90fe3e2ee260a31ce0a9eeaaa0.zip
configure: add --disable-rt option
This option disables any attempts in configure to create dependency on stuff requiring linking to librt.so and libpthread.so, in this case this means clock_gettime(CLOCK_MONOTONIC, &mt). We were in need to build curl which doesn't link libpthread.so to avoid the following bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16628.
Diffstat (limited to 'm4/curl-confopts.m4')
-rw-r--r--m4/curl-confopts.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4
index 44b018e40..05c2d4b10 100644
--- a/m4/curl-confopts.m4
+++ b/m4/curl-confopts.m4
@@ -316,6 +316,42 @@ dnl AC_MSG_ERROR([options --enable-ares and --enable-threads are mutually ex
dnl fi
dnl ])
+dnl CURL_CHECK_OPTION_RT
+dnl -------------------------------------------------
+dnl Verify if configure has been involed with option
+dnl --disable-rt and set shell variable dontwant_rt
+dnl as appropriate.
+
+AC_DEFUN([CURL_CHECK_OPTION_RT], [
+ AC_BEFORE([$0], [CURL_CHECK_LIB_THREADS])dnl
+ AC_MSG_CHECKING([whether to disable dependency on -lrt])
+ OPT_RT="default"
+ AC_ARG_ENABLE(rt,
+ AC_HELP_STRING([--disable-rt],[disable dependency on -lrt]),
+ OPT_RT=$enableval)
+ case "$OPT_RT" in
+ no)
+ dnl --disable-rt used (reverse logic)
+ dontwant_rt="yes"
+ AC_MSG_RESULT([yes])
+ ;;
+ default)
+ dnl configure option not specified (so not disabled)
+ dontwant_rt="no"
+ AC_MSG_RESULT([(assumed no)]
+ ;;
+ *)
+ dnl --enable-rt option used (reverse logic)
+ dontwant_rt="no"
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+ dnl TODO: may require mutual exclusion
+ if test "$dontwant_rt" = "yes" && test "$want_thres" = "yes" ; then
+ AC_MSG_ERROR([options --disable-rt and --enable-thread-resolver are mutually exclusive, at most one can be selected.])
+ fi
+])
+
dnl CURL_CHECK_OPTION_WARNINGS
dnl -------------------------------------------------