diff --git a/configure.ac b/configure.ac
index 38f89b3..81dbbd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -844,6 +844,12 @@ if test x$have_gettimeofday = xyes && test x$have_sys_time_h = xyes; then
    AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Whether we have gettimeofday()])
 fi
 
+AC_CHECK_FUNC(sqrtf, have_sqrtf=yes, have_sqrtf=no)
+if test x$have_sqrtf = xyes; then
+   AC_DEFINE(HAVE_SQRTF, 1, [Whether we have sqrtf()])
+fi
+
+
 dnl =====================================
 dnl Thread local storage
 
diff --git a/pixman/pixman-compiler.h b/pixman/pixman-compiler.h
index 9b190b4..39628d0 100644
--- a/pixman/pixman-compiler.h
+++ b/pixman/pixman-compiler.h
@@ -230,3 +230,8 @@
 #    error "Unknown thread local support for this system. Pixman will not work with multiple threads. Define PIXMAN_NO_TLS to acknowledge and accept this limitation and compile pixman without thread-safety support."
 
 #endif
+
+#if !defined(HAVE_SQRTF)
+#define sqrtf sqrt
+#endif
+
