[glib] Fix regression in qsort_r BSD detection



commit 28a9e91b136be5dc133651ae0ea2e70be3d99ba5
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Thu Jun 9 13:36:19 2011 +0200

    Fix regression in qsort_r BSD detection
    
    We can use AC_CHECK_FUNCS to detect if qsort_r is available on
    the system or not since it will unconditionnally define
    HAVE_QSORT_R, which we don't want since on BSD, qsort_r isn't usable
    for us, so we don't want to have HAVE_QSORT_R defined on such platforms.
    By using AC_CHECK_FUNC instead, we can defer defining HAVE_QSORT_R until
    we have actually tested it's usable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=651920

 configure.ac |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2f7f804..008532e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -579,7 +579,12 @@ AC_HEADER_STDC
 AC_FUNC_VPRINTF
 AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2)
-AC_CHECK_FUNCS(atexit on_exit timegm gmtime_r qsort_r)
+AC_CHECK_FUNCS(atexit on_exit timegm gmtime_r)
+
+dnl don't use AC_CHECK_FUNCS here, otherwise HAVE_QSORT_R will
+dnl be automatically defined, which we don't want to do
+dnl until we have checked this function is actually usable
+AC_CHECK_FUNC([qsort_r])
 
 # BSD has a qsort_r with wrong argument order
 if test x$ac_cv_func_qsort_r = xyes ; then



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]