Remove code related to obsoleted thread libraries

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 99e229125e)
r14.1.x
Michele Calgaro 2 months ago
parent 8190f109c5
commit 306c3db992
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -165,18 +165,6 @@ General notes for the installation of the 3.4.0 release of KVIrc
If you don't have it (the configure script will tell you)
you can download it from your favorite GNU mirror.
On Solaris you can use the native libthread.so library instead
but you will have to pass the specific option to configure (see below).
FreeBSD has a native implementation of pthreads in libc_r and
the gcc compiler has a special -pthread flag to link to it.
If you're on FreeBSD, use the --with-freebsd-pthread configure
option and make sure that you don't have other pthread wrappers
installed (that might collide with the native header files).
The configure script will also fail if the library is
hidden somewhere on your system (eg. not in /lib , /usr/lib or
/usr/local/lib): you should probably move it.
- You need the dynamic linker interface library libdl.so.
@ -478,18 +466,6 @@ General notes for the installation of the 3.4.0 release of KVIrc
It also eats some executable size.
So this option allows to disable the pseudo-transparency.
--with-solaris-lthread
If you're on Solaris and don't have the pthread library (A wrapper
I guess) you might try this option: it attempts to use the native
Solaris threading support.
--with-freebsd-pthread
If you're on FreeBSD, you NEED this option. This enables the usage
of the native FreeBSD pthread implementation found in libc_r.
This requires you to use the native gcc compiler: it has a special
-pthread flag that enables the linkage to libc_r instead
of plain libc.
--with-libresolv
Link to libresolv. I guess that this is required for Solaris

@ -1181,84 +1181,37 @@ dnl ############################################################################
AC_DEFUN([AC_SS_CHECK_THREAD_STUFF],
[
SS_THREAD_LIBLINK=""
SS_THREAD_LIBLINK="-lpthread"
AC_MSG_CHECKING([if you want to use the solaris lthread])
AC_MSG_CHECKING([if your pthread implementation works])
SS_DO_IT="false"
AC_ARG_WITH(solaris-lthread, [ --with-solaris-lthread Use the Solaris native libthread],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes)
SS_THREAD_LIBLINK="-lthread"
AC_DEFINE([COMPILE_THREADS_USE_SOLARIS_LIBTHREAD], 1, [define if you want to use the solaris libthread])
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING([if you want to use freebsd native pthread support])
SS_DO_IT="false"
AC_ARG_WITH(freebsd-pthread, [ --with-freebsd-pthread Use the FreeBSD native libc_r for threading],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes)
SS_THREAD_LIBLINK="-pthread"
AC_DEFINE([COMPILE_THREADS_USE_POSIX], 1, [define if you want to use the pthreads library])
else
AC_MSG_RESULT(no..using lpthread)
SS_THREAD_LIBLINK="-lpthread"
AC_DEFINE([COMPILE_THREADS_USE_POSIX], 1, [define if you want to use the pthreads library])
fi
AC_MSG_CHECKING([if your pthread implementation works])
SS_DO_IT="false"
AC_ARG_WITH(no-pthread-check, [ --with-no-pthread-check Do not check if pthreads stuff compiles],SS_DO_IT="true")
if test "$SS_DO_IT" = "true"; then
AC_MSG_RESULT(yes, trusting you)
else
SS_SAVE_LIBS="$LIBS"
LIBS="$SS_THREAD_LIBLINK"
AC_TRY_LINK([
#include <pthread.h>
],[
pthread_mutex_lock(0);
],
eval "SS_PTHREAD_OK=yes"
,
eval "SS_PTHREAD_OK=no"
)
LIBS="$SS_SAVE_LIBS"
SS_SAVE_LIBS="$LIBS"
LIBS="$SS_THREAD_LIBLINK"
AC_TRY_LINK([
#include <pthread.h>
],[
pthread_mutex_lock(0);
],
eval "SS_PTHREAD_OK=yes"
,
eval "SS_PTHREAD_OK=no"
)
LIBS="$SS_SAVE_LIBS"
if test "$SS_PTHREAD_OK" = "yes"; then
AC_MSG_RESULT(yes, it seems to)
else
AC_MSG_RESULT(["FAILED"])
AC_SS_SET_REDINK
if test "$SS_THREAD_LIBLINK" = "-pthread"; then
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Failed to compile the pthread test program."
echo "### You have specified to use the native FreeBSD libc_r for threading"
echo "### but it looks that this does not work."
echo "### Make sure that you have libc_r floating around your system"
echo "### and that the -pthread special gcc flag works."
echo "### (You need to use the native FreeBSD gcc compiler for this to work)"
echo "################################################################################"
else
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Failed to compile the pthread test program."
echo "### It looks that you either don't have libpthread installed or"
echo "### it is not reachable by the linker."
echo "### Make sure that libpthread is in /lib or /usr/lib."
echo "### If you're on solaris you might try the --with-solaris-lthread"
echo "### configure option. If you're on FreeBSD you should use"
echo "### --with-freebsd-pthread."
echo "### Good luck :)"
echo "################################################################################"
fi
AC_SS_SET_NORMALINK
AC_MSG_ERROR(["This was fatal...aborting"])
fi
fi
if test "$SS_PTHREAD_OK" = "yes"; then
AC_MSG_RESULT(yes, it seems to)
else
AC_MSG_RESULT(["FAILED"])
AC_SS_SET_REDINK
echo "################################################################################"
echo "### CONFIGURE ERROR:"
echo "### Failed to compile the pthread test program."
echo "### It looks that you either don't have libpthread installed or"
echo "### it is not reachable by the linker."
echo "### Make sure that libpthread is in /lib or /usr/lib."
echo "################################################################################"
AC_SS_SET_NORMALINK
AC_MSG_ERROR(["This was fatal...aborting"])
fi
])

@ -73,12 +73,6 @@
/* define if you have openssl and want the ssl support in kvirc */
#undef COMPILE_SSL_SUPPORT
/* define if you want to use the pthreads library */
#undef COMPILE_THREADS_USE_POSIX
/* define if you want to use the solaris libthread */
#undef COMPILE_THREADS_USE_SOLARIS_LIBTHREAD
/* define if your compiler supports gotos do dynamic labels */
#undef COMPILE_USE_DYNAMIC_LABELS
@ -229,10 +223,6 @@
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE

@ -74,12 +74,6 @@
/* define if you want zlib support */
#define COMPILE_ZLIB_SUPPORT 1
/* define if you want to use the pthreads library */
/* #undef COMPILE_THREADS_USE_POSIX */
/* define if you want to use the solaris libthread */
/* #undef COMPILE_THREADS_USE_SOLARIS_LIBTHREAD */
#define COMPILE_PSEUDO_TRANSPARENCY
/* define if you have the SIOCGIFADDR ioctl and the related headers */

@ -72,7 +72,6 @@
#define kvi_threadExit() ExitThread(0)
#else
#ifdef COMPILE_THREADS_USE_POSIX
// Glibc pthread implementation
#include <pthread.h>
@ -109,40 +108,6 @@
// We don't care about exit codes at all
#define kvi_threadExit() pthread_exit(0)
#else
#ifdef COMPILE_THREADS_USE_SOLARIS_LIBTHREAD
// Native solaris implementation
#include <thread.h>
#include <synch.h>
#include <errno.h>
// Mutex stuff
#define kvi_mutex_t mutex_t
#define kvi_threadMutexInit(_pMutex_t) mutex_init(_pMutex_t,0,0)
#define kvi_threadMutexLock(_pMutex_t) mutex_lock(_pMutex_t)
#define kvi_threadMutexUnlock(_pMutex_t) mutex_unlock(_pMutex_t)
#define kvi_threadMutexDestroy(_pMutex_t) mutex_destroy(_pMutex_t)
inline bool kvi_threadMutexTryLock(kvi_mutex_t *_pMutex_t)
{
return (mutex_trylock(_pMutex_t) != EBUSY);
};
// Actually unused
// #define kvi_threadMutexTryLock(_pMutex_t) mutex_trylock(_pMutex_t)
// Thread stuff
#define kvi_thread_t thread_t
inline bool kvi_threadCreate(kvi_thread_t *t,void * (*start_routine)(void *),void *arg)
{
return (thr_create(0,0,start_routine,arg,THR_DETACHED,t) == 0);
}
// We don't care about exit codes at all
#define kvi_threadExit() thr_exit(0)
#else
// FIXME: #warning "Missing a decent thread implementation: we're going to fail , sorry!"
#endif
#endif
#endif
class KVILIB_API KviMutex : public KviHeapObject

Loading…
Cancel
Save