summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ecb71ce..c3fcba9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,18 @@ AM_PROG_CC_C_O
AC_CHECK_FUNCS([mkstemp])
+# Math libraries & functions
+# - some compilers use builtin inlines for floor when optimizing
+# - lrint() is a C99 addition not found on some older systems
+# - must do the libm check first so that the lrint check will have it in $LIBS
+save_LIBS="$LIBS"
+AC_SEARCH_LIBS([floor], [m])
+AC_SEARCH_LIBS([lrint], [m])
+AC_CHECK_FUNCS([lrint])
+MATH_LIBS="$LIBS"
+LIBS="$save_LIBS"
+AC_SUBST([MATH_LIBS])
+
# Obtain compiler/linker options from dependencies
PKG_CHECK_MODULES(BMTOA, x11 xmu)
PKG_CHECK_MODULES(ATOBM, xproto)