summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-10 12:03:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-10 12:05:02 +0100
commit27b4d154cad0387277d8640ba804a4ac1c83cf14 (patch)
treed1f56fa26fcaab5783cbb86ba257bd85ead14924 /configure
parent4c63beeefe9fcd42f12fe5545a63bb8114e8bea0 (diff)
parente854b8f9f4097a3c560b746895e9da6721aa4cdb (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: Work around broken floating point limits on some systems. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure14
1 files changed, 14 insertions, 0 deletions
diff --git a/configure b/configure
index 39ffe0437d..3c21cb9328 100755
--- a/configure
+++ b/configure
@@ -1114,6 +1114,16 @@ check_builtin(){
check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
}
+check_compile_assert(){
+ log check_compile_assert "$@"
+ name=$1
+ headers=$2
+ condition=$3
+ shift 3
+ disable "$name"
+ check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
+}
+
require(){
name="$1"
header="$2"
@@ -1574,6 +1584,7 @@ HAVE_LIST="
fast_clz
fast_cmov
fcntl
+ flt_lim
fork
getaddrinfo
gethrtime
@@ -4000,6 +4011,9 @@ if enabled_all ccc libc_glibc; then
add_ldflags -Wl,-z,now # calls to libots crash without this
fi
+check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
+ add_cppflags '-I\$(SRC_PATH)/compat/float'
+
esc(){
echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
}