mainly the result of collapsing folds in vimdiff from 2.2

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ron Lee 2001-11-16 13:09:52 +00:00
parent a6c84d26fd
commit 7274f1c705
2 changed files with 554 additions and 548 deletions

766
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -3189,204 +3189,204 @@ dnl ---------------------------------------------------------------------------
dnl under MSW we always have thread support
if test "$TOOLKIT" != "MSW"; then
dnl the code below:
dnl defines THREADS_OBJ which contains the object files to build
dnl defines THREADS_LINK which contains the thread library to link with
dnl defines wxUSE_THREADS=1 if thread support is activated
dnl the code below:
dnl defines THREADS_OBJ which contains the object files to build
dnl defines THREADS_LINK which contains the thread library to link with
dnl defines wxUSE_THREADS=1 if thread support is activated
THREADS_LINK=
THREADS_OBJ=
CODE_GEN_FLAGS=
CODE_GEN_FLAGS_CXX=
THREADS_LINK=
THREADS_OBJ=
CODE_GEN_FLAGS=
CODE_GEN_FLAGS_CXX=
if test "$wxUSE_THREADS" = "yes" ; then
if test "$wxUSE_WINE" = 1 ; then
AC_MSG_WARN([Threads are not supported under WINE])
wxUSE_THREADS="no"
elif test "$USE_BEOS" = 1; then
AC_MSG_WARN([BeOS threads are not yet supported])
wxUSE_THREADS="no"
fi
fi
if test "$wxUSE_THREADS" = "yes" ; then
dnl find if POSIX threads are available
dnl AIX calls the library libpthreads - thanks IBM!
if test "$USE_AIX" = 1; then
THREADS_LIB=pthreads
else
THREADS_LIB=pthread
if test "$wxUSE_THREADS" = "yes" ; then
if test "$wxUSE_WINE" = 1 ; then
AC_MSG_WARN([Threads are not supported under WINE])
wxUSE_THREADS="no"
elif test "$USE_BEOS" = 1; then
AC_MSG_WARN([BeOS threads are not yet supported])
wxUSE_THREADS="no"
fi
fi
dnl standard lib name is pthread
dnl We no longer test for pthread-0.7 as it breaks compilation on some
dnl glibc2 systems, especially for static linkage.
AC_CHECK_LIB($THREADS_LIB, pthread_create, [
THREADS_OBJ="threadpsx.lo"
THREADS_LINK=$THREADS_LIB
], [
dnl thread functions are in libc_r under FreeBSD
AC_CHECK_LIB(c_r, pthread_create, [
if test "$wxUSE_THREADS" = "yes" ; then
dnl find if POSIX threads are available
dnl AIX calls the library libpthreads - thanks IBM!
if test "$USE_AIX" = 1; then
THREADS_LIB=pthreads
else
THREADS_LIB=pthread
fi
dnl standard lib name is pthread
dnl We no longer test for pthread-0.7 as it breaks compilation on some
dnl glibc2 systems, especially for static linkage.
AC_CHECK_LIB($THREADS_LIB, pthread_create, [
THREADS_OBJ="threadpsx.lo"
THREADS_LINK="c_r"
THREADS_LINK=$THREADS_LIB
], [
dnl VZ: SGI threads are not supported currently
AC_CHECK_HEADER(sys/prctl.h, [
THREADS_OBJ="threadsgi.lo"
dnl thread functions are in libc_r under FreeBSD
AC_CHECK_LIB(c_r, pthread_create, [
THREADS_OBJ="threadpsx.lo"
THREADS_LINK="c_r"
], [
dnl VZ: SGI threads are not supported currently
AC_CHECK_HEADER(sys/prctl.h, [
THREADS_OBJ="threadsgi.lo"
])
])
])
])
if test -z "$THREADS_OBJ" ; then
wxUSE_THREADS=no
AC_MSG_WARN(No thread support on this system)
if test -z "$THREADS_OBJ" ; then
wxUSE_THREADS=no
AC_MSG_WARN(No thread support on this system)
fi
fi
fi
dnl do other tests only if we are using threads
if test "$wxUSE_THREADS" = "yes" ; then
AC_CHECK_FUNCS(thr_setconcurrency)
dnl do other tests only if we are using threads
if test "$wxUSE_THREADS" = "yes" ; then
AC_CHECK_FUNCS(thr_setconcurrency)
dnl define autoconf macro to check for given function in both pthread and
dnl posix4 libraries
dnl usage: AC_FUNC_THREAD(FUNCTION_NAME)
dnl VZ: TODO
dnl AC_DEFUN(AC_FUNC_THREAD,
dnl [
dnl AC_CHECK_LIB($THREADS_LINK, $1,
dnl AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'),
dnl [AC_CHECK_LIB([posix4], $1,
dnl [AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'))
dnl POSIX4_LINK=" -lposix4"
dnl ])
dnl ])
dnl ])
dnl define autoconf macro to check for given function in both pthread and
dnl posix4 libraries
dnl usage: AC_FUNC_THREAD(FUNCTION_NAME)
dnl VZ: TODO
dnl AC_DEFUN(AC_FUNC_THREAD,
dnl [
dnl AC_CHECK_LIB($THREADS_LINK, $1,
dnl AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'),
dnl [AC_CHECK_LIB([posix4], $1,
dnl [AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'))
dnl POSIX4_LINK=" -lposix4"
dnl ])
dnl ])
dnl ])
AC_CHECK_HEADERS(sched.h)
AC_CHECK_HEADERS(sched.h)
AC_CHECK_LIB($THREADS_LINK, sched_yield,
AC_DEFINE(HAVE_SCHED_YIELD),
[AC_CHECK_LIB([posix4], sched_yield,
[AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"],
AC_MSG_WARN(wxThread::Yield will not work properly)
)]
)
dnl to be able to set the thread priority, we need to have all of the
dnl following functions:
dnl 1. pthread_attr_getschedpolicy
dnl 2. sched_get_priority_min and sched_get_priority_max
dnl (this one can be in either libpthread or libposix4 (under Solaris))
dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
HAVE_PRIOR_FUNCS=0
AC_CHECK_LIB($THREADS_LINK, pthread_attr_getschedpolicy,
AC_CHECK_LIB($THREADS_LINK, pthread_attr_setschedparam,
AC_CHECK_LIB($THREADS_LINK, sched_get_priority_max,
HAVE_PRIOR_FUNCS=1,
AC_CHECK_LIB([posix4], sched_get_priority_max,
[
HAVE_PRIOR_FUNCS=1
POSIX4_LINK=" -lposix4"
],
)
AC_CHECK_LIB($THREADS_LINK, sched_yield,
AC_DEFINE(HAVE_SCHED_YIELD),
[AC_CHECK_LIB([posix4], sched_yield,
[AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"],
AC_MSG_WARN(wxThread::Yield will not work properly)
)]
)
)
)
if test "$HAVE_PRIOR_FUNCS" = 1; then
AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
else
AC_MSG_WARN(Setting thread priority will not work)
fi
dnl to be able to set the thread priority, we need to have all of the
dnl following functions:
dnl 1. pthread_attr_getschedpolicy
dnl 2. sched_get_priority_min and sched_get_priority_max
dnl (this one can be in either libpthread or libposix4 (under Solaris))
dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
HAVE_PRIOR_FUNCS=0
AC_CHECK_LIB($THREADS_LINK, pthread_attr_getschedpolicy,
AC_CHECK_LIB($THREADS_LINK, pthread_attr_setschedparam,
AC_CHECK_LIB($THREADS_LINK, sched_get_priority_max,
HAVE_PRIOR_FUNCS=1,
AC_CHECK_LIB([posix4], sched_get_priority_max,
[
HAVE_PRIOR_FUNCS=1
POSIX4_LINK=" -lposix4"
],
)
)
)
)
AC_CHECK_LIB($THREADS_LINK, pthread_cancel,
AC_DEFINE(HAVE_PTHREAD_CANCEL),
AC_MSG_WARN([wxThread::Kill() will not work properly]))
if test "$HAVE_PRIOR_FUNCS" = 1; then
AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
else
AC_MSG_WARN(Setting thread priority will not work)
fi
AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push,
[
AC_TRY_COMPILE([#include <pthread.h>],
[
pthread_cleanup_push(NULL, NULL);
pthread_cleanup_pop(0);
], [
wx_cv_func_pthread_cleanup_push=yes
], [
wx_cv_func_pthread_cleanup_push=no
])
])
AC_CHECK_LIB($THREADS_LINK, pthread_cancel,
AC_DEFINE(HAVE_PTHREAD_CANCEL),
AC_MSG_WARN([wxThread::Kill() will not work properly]))
if test "$wx_cv_func_pthread_cleanup_push" = "yes"; then
AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS)
fi
AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push,
[
AC_TRY_COMPILE([#include <pthread.h>],
[
pthread_cleanup_push(NULL, NULL);
pthread_cleanup_pop(0);
], [
wx_cv_func_pthread_cleanup_push=yes
], [
wx_cv_func_pthread_cleanup_push=no
])
])
dnl mutexattr_t initialization is done in quite different ways on different
dnl platforms, so check for a few things:
dnl
dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes
dnl HAVE_MUTEXATTR_SETTYPE means that we do it using
dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not
dnl defined, we do it by directly assigned
dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
if test "$wx_cv_func_pthread_cleanup_push" = "yes"; then
AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS)
fi
dnl we need _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+
dnl (strictly speaking we only need _XOPEN_SOURCE=500 but just defining
dnl this disables _BSD_SOURCE which breaks libtiff compilation, so it is
dnl simpler to just define _GNU_SOURCE to get everything)
if test "x$wx_lib_glibc21" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
fi
dnl mutexattr_t initialization is done in quite different ways on different
dnl platforms, so check for a few things:
dnl
dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes
dnl HAVE_MUTEXATTR_SETTYPE means that we do it using
dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not
dnl defined, we do it by directly assigned
dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
[
AC_TRY_COMPILE([#include <pthread.h>],
[
pthread_mutexattr_t attr;
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
], [
wx_cv_type_pthread_mutexattr_t=yes
], [
wx_cv_type_pthread_mutexattr_t=no
]
)
])
dnl we need _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+
dnl (strictly speaking we only need _XOPEN_SOURCE=500 but just defining
dnl this disables _BSD_SOURCE which breaks libtiff compilation, so it is
dnl simpler to just define _GNU_SOURCE to get everything)
if test "x$wx_lib_glibc21" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
fi
if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T)
else
dnl don't despair, there may be another way to do it
AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER],
wx_cv_type_pthread_rec_mutex_init,
[
AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
[
AC_TRY_COMPILE([#include <pthread.h>],
[
pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
pthread_mutexattr_t attr;
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
], [
wx_cv_type_pthread_rec_mutex_init=yes
wx_cv_type_pthread_mutexattr_t=yes
], [
wx_cv_type_pthread_rec_mutex_init=no
wx_cv_type_pthread_mutexattr_t=no
]
)
])
if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
else
dnl this may break code working elsewhere, so at least warn about it
AC_MSG_WARN([wxMutex won't be recursive on this platform])
])
if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T)
else
dnl don't despair, there may be another way to do it
AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER],
wx_cv_type_pthread_rec_mutex_init,
[
AC_TRY_COMPILE([#include <pthread.h>],
[
pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
], [
wx_cv_type_pthread_rec_mutex_init=yes
], [
wx_cv_type_pthread_rec_mutex_init=no
]
)
])
if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
else
dnl this may break code working elsewhere, so at least warn about it
AC_MSG_WARN([wxMutex won't be recursive on this platform])
fi
fi
THREADS_LINK=" -l$THREADS_LINK"
dnl building MT programs under Solaris with the native compiler requires -mt
dnl switch
if test "$USE_SOLARIS" = "yes" -a "$GCC" != "yes"; then
CPPFLAGS="$CFLAGS -mt"
CXXFLAGS="$CXXFLAGS -mt"
LDFLAGS="$LDFLAGS -mt"
fi
fi
fi
THREADS_LINK=" -l$THREADS_LINK"
dnl building MT programs under Solaris with the native compiler requires -mt
dnl switch
if test "$USE_SOLARIS" = "yes" -a "$GCC" != "yes"; then
CPPFLAGS="$CFLAGS -mt"
CXXFLAGS="$CXXFLAGS -mt"
LDFLAGS="$LDFLAGS -mt"
fi
fi
dnl from if !MSW
fi