Allow caching have_qsort_r which re-enables cross-compiling

https://bugzilla.gnome.org/show_bug.cgi?id=646309
This commit is contained in:
Maciej Piechotka 2011-03-31 09:00:27 +02:00 committed by Matthias Clasen
parent fdf83b5108
commit 70a1981532
2 changed files with 12 additions and 3 deletions

View File

@ -574,7 +574,7 @@ AC_FUNC_ALLOCA
AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2) AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2)
AC_CHECK_FUNCS(atexit on_exit timegm gmtime_r) AC_CHECK_FUNCS(atexit on_exit timegm gmtime_r)
# BSD has a qsort_r with wrong argument order # BSD has a qsort_r with wrong argument order
AC_MSG_CHECKING([for qsort_r]) AC_CACHE_CHECK([for qsort_r], glib_cv_have_qsort_r, [
AC_RUN_IFELSE([[ AC_RUN_IFELSE([[
#define _GNU_SOURCE #define _GNU_SOURCE
#include <stdlib.h> #include <stdlib.h>
@ -605,9 +605,9 @@ main (int argc, char **argv)
return 0; return 0;
else else
return 1; return 1;
}]],[have_qsort_r=yes],[have_qsort_r=no]) }]],[glib_cv_have_qsort_r=yes],[glib_cv_have_qsort_r=no])])
if test $have_qsort_r = yes ; then if test $glib_cv_have_qsort_r = yes ; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_QSORT_R, 1, [Define to 1 if you have the 'qsort_r' function]) AC_DEFINE(HAVE_QSORT_R, 1, [Define to 1 if you have the 'qsort_r' function])
else else

View File

@ -109,6 +109,15 @@ chmod a-w win32.cache # prevent configure from changing it
built-in version in that case. built-in version in that case.
</para> </para>
</formalpara> </formalpara>
<formalpara>
<title>glib_cv_have_qsort_r=[yes/no]</title>
<para>
Whether you have <function>qsort_r()</function> that matches
BSD. Defaults to "no", which is safe, since GLib uses a
built-in version in that case.
</para>
</formalpara>
<formalpara> <formalpara>
<title>glib_cv_va_val_copy=[yes/no]</title> <title>glib_cv_va_val_copy=[yes/no]</title>