Drop a lot of dead configury for threads

Much of this became obsolete by the recent rewrite of our
threading support.
This commit is contained in:
Matthias Clasen 2011-12-27 17:12:39 -05:00
parent 8cea99741b
commit a176008826

View File

@ -283,7 +283,6 @@ if test "x$enable_debug" = "xyes"; then
*) CFLAGS="$CFLAGS -g" ;; *) CFLAGS="$CFLAGS -g" ;;
esac esac
fi fi
GLIB_DEBUG_FLAGS="-DG_ENABLE_DEBUG" GLIB_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
else else
GLIB_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS" GLIB_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
@ -1864,18 +1863,13 @@ dnl ***********************
AC_ARG_WITH(threads, AC_ARG_WITH(threads,
[AC_HELP_STRING([--with-threads=@<:@posix/win32@:>@], [AC_HELP_STRING([--with-threads=@<:@posix/win32@:>@],
[specify a thread implementation to use])], [specify a thread implementation to use])],
[if test "x$with_threads" = x; then [],
want_threads=yes [with_threads=yes])
else
want_threads=$with_threads
fi],
[want_threads=yes])
dnl error and warning message dnl error and warning message
dnl ************************* dnl *************************
THREAD_NO_IMPLEMENTATION="You do not have any known thread system on your THREAD_NO_IMPLEMENTATION="No thread implementation found."
computer."
FLAG_DOES_NOT_WORK="I can't find the MACRO to enable thread safety on your FLAG_DOES_NOT_WORK="I can't find the MACRO to enable thread safety on your
platform (normally it's "_REENTRANT"). I'll not use any flag on platform (normally it's "_REENTRANT"). I'll not use any flag on
@ -1883,10 +1877,10 @@ FLAG_DOES_NOT_WORK="I can't find the MACRO to enable thread safety on your
Please provide information on how it is done on your system." Please provide information on how it is done on your system."
LIBS_NOT_FOUND_1="I can't find the libraries for the thread implementation LIBS_NOT_FOUND_1="I can't find the libraries for the thread implementation
" "
LIBS_NOT_FOUND_2=". Please choose another thread implementation or LIBS_NOT_FOUND_2=". Please choose another thread implementation or
provide information on your thread implementation." provide information on your thread implementation."
FUNC_NO_GETPWUID_R="the 'g_get_(user_name|real_name|home_dir|tmp_dir)' FUNC_NO_GETPWUID_R="the 'g_get_(user_name|real_name|home_dir|tmp_dir)'
functions will not be MT-safe during their first call because functions will not be MT-safe during their first call because
@ -1895,16 +1889,6 @@ FUNC_NO_GETPWUID_R="the 'g_get_(user_name|real_name|home_dir|tmp_dir)'
FUNC_NO_LOCALTIME_R="the 'g_date_set_time' function will not be MT-safe FUNC_NO_LOCALTIME_R="the 'g_date_set_time' function will not be MT-safe
because there is no 'localtime_r' on your system." because there is no 'localtime_r' on your system."
POSIX_NO_YIELD="I can not find a yield functions for your platform. A rather
crude surrogate will be used. If you happen to know a
yield function for your system, please inform the GLib
developers."
POSIX_NO_PRIORITIES="I can not find the minimal and maximal priorities for
threads on your system. Thus threads can only have the default
priority. If you happen to know these main/max
priorities, please inform the GLib developers."
AIX_COMPILE_INFO="AIX's C compiler needs to be called by a different name, when AIX_COMPILE_INFO="AIX's C compiler needs to be called by a different name, when
linking threaded applications. As GLib cannot do that linking threaded applications. As GLib cannot do that
automatically, you will get an linkg error everytime you are automatically, you will get an linkg error everytime you are
@ -1915,9 +1899,10 @@ AIX_COMPILE_INFO="AIX's C compiler needs to be called by a different name, when
dnl determination of thread implementation dnl determination of thread implementation
dnl *************************************** dnl ***************************************
AC_MSG_CHECKING(for thread implementation)
have_threads=no have_threads=no
if test "x$want_threads" = xyes || test "x$want_threads" = xposix \ if test "x$with_threads" = xyes || test "x$with_threads" = xposix; then
|| test "x$want_threads" = xdce; then
# -D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE is for DG/UX # -D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE is for DG/UX
# -U_OSF_SOURCE is for Digital UNIX 4.0d # -U_OSF_SOURCE is for Digital UNIX 4.0d
GTHREAD_COMPILE_IMPL_DEFINES="-D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE -U_OSF_SOURCE" GTHREAD_COMPILE_IMPL_DEFINES="-D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE -U_OSF_SOURCE"
@ -1937,21 +1922,19 @@ if test "x$want_threads" = xyes || test "x$want_threads" = xposix \
fi fi
CPPFLAGS="$glib_save_CPPFLAGS" CPPFLAGS="$glib_save_CPPFLAGS"
fi fi
if test "x$want_threads" = xyes || test "x$want_threads" = xwin32; then if test "x$with_threads" = xyes || test "x$with_threads" = xwin32; then
case $host in case $host in
*-*-mingw*) *-*-mingw*)
have_threads=win32 have_threads=win32
;; ;;
esac esac
fi fi
AC_MSG_CHECKING(for thread implementation)
if test "x$have_threads" = xno; then if test "x$have_threads" = xno; then
AC_MSG_RESULT(none available) AC_MSG_RESULT(none available)
AC_MSG_ERROR($THREAD_NO_IMPLEMENTATION) AC_MSG_ERROR($THREAD_NO_IMPLEMENTATION)
else else
AC_MSG_RESULT($have_threads) AC_MSG_RESULT($have_threads)
fi fi
@ -1977,18 +1960,6 @@ int main()
return (check_me != 42 || ret != &check_me); return (check_me != 42 || ret != &check_me);
}]) }])
dnl
dnl Test program for sched_get_priority_min()
dnl
m4_define([glib_sched_priority_test],[
#include <sched.h>
#include <errno.h>
int main() {
errno = 0;
return sched_get_priority_min(SCHED_OTHER)==-1
&& errno != 0;
}])
if test x"$have_threads" = xposix; then if test x"$have_threads" = xposix; then
# First we test for posix, whether -pthread or -pthreads do the trick as # First we test for posix, whether -pthread or -pthreads do the trick as
# both CPPFLAG and LIBS. # both CPPFLAG and LIBS.
@ -2146,34 +2117,6 @@ case $have_threads in
esac esac
fi fi
glib_save_LIBS="$LIBS"
for thread_lib in "" rt rte; do
if test x"$thread_lib" = x; then
add_thread_lib=""
IN=""
else
add_thread_lib="-l$thread_lib"
IN=" in -l$thread_lib"
fi
LIBS="$add_thread_lib $glib_save_LIBS"
AC_MSG_CHECKING(for sched_get_priority_min$IN)
AC_TRY_RUN(glib_sched_priority_test,
glib_result=yes,
glib_result=no,
[AC_LINK_IFELSE([AC_LANG_SOURCE(glib_sched_priority_test)],
glib_result=yes,
glib_result=no)])
AC_MSG_RESULT($glib_result)
if test "$glib_result" = "yes" ; then
G_THREAD_LIBS="$G_THREAD_LIBS $add_thread_lib"
posix_priority_min="sched_get_priority_min(SCHED_OTHER)"
posix_priority_max="sched_get_priority_max(SCHED_OTHER)"
break
fi
done
LIBS="$glib_save_LIBS"
g_threads_impl="POSIX" g_threads_impl="POSIX"
AC_SUBST(GTHREAD_COMPILE_IMPL_DEFINES) AC_SUBST(GTHREAD_COMPILE_IMPL_DEFINES)
CPPFLAGS="$glib_save_CPPFLAGS" CPPFLAGS="$glib_save_CPPFLAGS"
@ -2291,78 +2234,17 @@ int main () {
fi fi
LIBS="$G_THREAD_LIBS $LIBS" LIBS="$G_THREAD_LIBS $LIBS"
if test x"$have_threads" = xposix; then if test x"$have_threads" = xposix; then
glib_save_CPPFLAGS="$CPPFLAGS" glib_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES"
dnl we might grow sizeof(pthread_t) later on, so use a dummy name here # This is not AC_CHECK_FUNC to also work with function
GLIB_SIZEOF([#include <pthread.h>], pthread_t, system_thread) # name mangling in header files.
# This is not AC_CHECK_FUNC to also work with function AC_MSG_CHECKING(for pthread_attr_setstacksize)
# name mangling in header files. AC_TRY_LINK([#include <pthread.h>],
AC_MSG_CHECKING(for pthread_attr_setstacksize) [pthread_attr_t t; pthread_attr_setstacksize(&t,0)],
AC_TRY_LINK([#include <pthread.h>], [AC_MSG_RESULT(yes)
[pthread_attr_t t; pthread_attr_setstacksize(&t,0)], AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE,1,[Have function pthread_attr_setstacksize])],
[AC_MSG_RESULT(yes) [AC_MSG_RESULT(no)])
AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE,1, CPPFLAGS="$glib_save_CPPFLAGS"
[Have function pthread_attr_setstacksize])],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING(for minimal/maximal thread priority)
if test x"$posix_priority_min" = x; then
AC_EGREP_CPP(PX_PRIO_MIN,[#include <pthread.h>
PX_PRIO_MIN],,[
posix_priority_min=PX_PRIO_MIN
posix_priority_max=PX_PRIO_MAX])
fi
if test x"$posix_priority_min" = x; then
# AIX
AC_EGREP_CPP(PTHREAD_PRIO_MIN,[#include <pthread.h>
PTHREAD_PRIO_MIN],,[
posix_priority_min=PTHREAD_PRIO_MIN
posix_priority_max=PTHREAD_PRIO_MAX])
fi
if test x"$posix_priority_min" = x; then
AC_EGREP_CPP(PRI_OTHER_MIN,[#include <pthread.h>
PRI_OTHER_MIN],,[
posix_priority_min=PRI_OTHER_MIN
posix_priority_max=PRI_OTHER_MAX])
fi
if test x"$posix_priority_min" = x; then
AC_MSG_RESULT(none found)
AC_MSG_WARN($POSIX_NO_PRIORITIES)
posix_priority_min=-1
posix_priority_max=-1
else
AC_MSG_RESULT($posix_priority_min/$posix_priority_max)
AC_MSG_CHECKING(for pthread_setschedparam)
AC_TRY_LINK([#include <pthread.h>],
[pthread_t t; pthread_setschedparam(t, 0, NULL)],
[AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(POSIX_MIN_PRIORITY,$posix_priority_min,[Minimum POSIX RT priority])
AC_DEFINE_UNQUOTED(POSIX_MAX_PRIORITY,$posix_priority_max,[Maximum POSIX RT priority])],
[AC_MSG_RESULT(no)
AC_MSG_WARN($POSIX_NO_PRIORITIES)])
fi
posix_yield_func=none
AC_MSG_CHECKING(for posix yield function)
for yield_func in sched_yield pthread_yield_np pthread_yield \
thr_yield; do
AC_TRY_LINK([#include <pthread.h>],
[$yield_func()],
[posix_yield_func="$yield_func"
break])
done
if test x"$posix_yield_func" = xnone; then
AC_MSG_RESULT(none found)
AC_MSG_WARN($POSIX_NO_YIELD)
posix_yield_func="g_usleep(1000)"
else
AC_MSG_RESULT($posix_yield_func)
posix_yield_func="$posix_yield_func()"
fi
AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield function])
CPPFLAGS="$glib_save_CPPFLAGS"
elif test x"$have_threads" = xwin32; then
# It's a pointer to a private struct
GLIB_SIZEOF(,struct _GThreadData *, system_thread)
fi fi
LIBS="$glib_save_LIBS" LIBS="$glib_save_LIBS"
@ -2376,11 +2258,6 @@ if test "$ac_cv_func_localtime_r" != "yes"; then
AC_MSG_WARN($FUNC_NO_LOCALTIME_R) AC_MSG_WARN($FUNC_NO_LOCALTIME_R)
fi fi
if test x"$glib_cv_sizeof_system_thread" = x; then
# use a pointer as a fallback.
GLIB_SIZEOF(,void *, system_thread)
fi
# #
# Hack to deal with: # Hack to deal with:
# #
@ -3483,8 +3360,6 @@ g_have_eilseq=$have_eilseq
g_threads_impl_def=$g_threads_impl g_threads_impl_def=$g_threads_impl
g_system_thread_sizeof="$glib_cv_sizeof_system_thread"
g_atomic_lock_free="$glib_cv_g_atomic_lock_free" g_atomic_lock_free="$glib_cv_g_atomic_lock_free"
g_memory_barrier_needed="$glib_memory_barrier_needed" g_memory_barrier_needed="$glib_memory_barrier_needed"
g_gcc_atomic_ops="$glib_cv_gcc_has_builtin_atomic_operations" g_gcc_atomic_ops="$glib_cv_gcc_has_builtin_atomic_operations"