Fixed configure/linkage for non-threaded case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
7e72761c5e
commit
80cb83bef2
13
configure.in
13
configure.in
@ -458,6 +458,7 @@ AC_FUNC_VPRINTF
|
|||||||
dnl check for several standard functions we use if they are available
|
dnl check for several standard functions we use if they are available
|
||||||
AC_CHECK_FUNCS(vsnprintf vfork)
|
AC_CHECK_FUNCS(vsnprintf vfork)
|
||||||
|
|
||||||
|
POSIX4_LINK=
|
||||||
dnl check for usleep() and nanosleep() which is better in MT programs
|
dnl check for usleep() and nanosleep() which is better in MT programs
|
||||||
dnl AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP),
|
dnl AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP),
|
||||||
dnl [
|
dnl [
|
||||||
@ -467,7 +468,9 @@ dnl AC_CHECK_FUNCS(usleep))
|
|||||||
dnl ]
|
dnl ]
|
||||||
dnl )
|
dnl )
|
||||||
AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP),
|
AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP),
|
||||||
[AC_CHECK_LIB(posix4, nanosleep, AC_DEFINE(HAVE_NANOSLEEP),
|
[AC_CHECK_LIB(posix4, nanosleep, [
|
||||||
|
AC_DEFINE(HAVE_NANOSLEEP)
|
||||||
|
POSIX4_LINK="-lposix4" ],
|
||||||
[AC_CHECK_FUNCS(usleep, AC_DEFINE(HAVE_USLEEP),
|
[AC_CHECK_FUNCS(usleep, AC_DEFINE(HAVE_USLEEP),
|
||||||
AC_MSG_WARN(Sleep() function will not work)
|
AC_MSG_WARN(Sleep() function will not work)
|
||||||
)]
|
)]
|
||||||
@ -1435,14 +1438,13 @@ fi
|
|||||||
|
|
||||||
dnl do other tests only if we are using threads
|
dnl do other tests only if we are using threads
|
||||||
if test "$wxUSE_THREADS" = "1"; then
|
if test "$wxUSE_THREADS" = "1"; then
|
||||||
THREADS_LINK2=""
|
|
||||||
|
|
||||||
AC_CHECK_HEADERS(sched.h)
|
AC_CHECK_HEADERS(sched.h)
|
||||||
|
|
||||||
AC_CHECK_LIB($THREADS_LINK, sched_yield,
|
AC_CHECK_LIB($THREADS_LINK, sched_yield,
|
||||||
AC_DEFINE(HAVE_SCHED_YIELD),
|
AC_DEFINE(HAVE_SCHED_YIELD),
|
||||||
[AC_CHECK_LIB("posix4", sched_yield,
|
[AC_CHECK_LIB("posix4", sched_yield,
|
||||||
[AC_DEFINE(HAVE_SCHED_YIELD) THREADS_LINK2="-lposix4"],
|
[AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK="-lposix4"],
|
||||||
AC_MSG_WARN(wxThread::Yield() will not work properly)
|
AC_MSG_WARN(wxThread::Yield() will not work properly)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@ -1450,7 +1452,7 @@ if test "$wxUSE_THREADS" = "1"; then
|
|||||||
AC_CHECK_LIB($THREADS_LINK, sched_get_priority_min,
|
AC_CHECK_LIB($THREADS_LINK, sched_get_priority_min,
|
||||||
AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS),
|
AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS),
|
||||||
[AC_CHECK_LIB("posix4", sched_get_priority_min,
|
[AC_CHECK_LIB("posix4", sched_get_priority_min,
|
||||||
[AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) THREADS_LINK2="-lposix4"],
|
[AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) POSIX4_LINK="-lposix4"],
|
||||||
AC_MSG_WARN(Setting thread priority will not work)
|
AC_MSG_WARN(Setting thread priority will not work)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@ -1459,11 +1461,12 @@ if test "$wxUSE_THREADS" = "1"; then
|
|||||||
AC_DEFINE(HAVE_PTHREAD_CANCEL),
|
AC_DEFINE(HAVE_PTHREAD_CANCEL),
|
||||||
AC_MSG_WARN(wxThread::Kill() will not work properly))
|
AC_MSG_WARN(wxThread::Kill() will not work properly))
|
||||||
|
|
||||||
THREADS_LINK="-l$THREADS_LINK $THREADS_LINK2"
|
THREADS_LINK="-l$THREADS_LINK"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(UNIX_THREAD)
|
AC_SUBST(UNIX_THREAD)
|
||||||
AC_SUBST(THREADS_LINK)
|
AC_SUBST(THREADS_LINK)
|
||||||
|
AC_SUBST(POSIX4_LINK)
|
||||||
|
|
||||||
dnl ------------------------------------------------------------------------
|
dnl ------------------------------------------------------------------------
|
||||||
dnl compiler options for shared libs
|
dnl compiler options for shared libs
|
||||||
|
@ -13,10 +13,6 @@
|
|||||||
#ifndef __THREADH__
|
#ifndef __THREADH__
|
||||||
#define __THREADH__
|
#define __THREADH__
|
||||||
|
|
||||||
#ifdef __GNUG__
|
|
||||||
#pragma interface "thread.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// headers
|
// headers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@ -25,6 +21,10 @@
|
|||||||
#include "wx/setup.h"
|
#include "wx/setup.h"
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
|
/* otherwise we get undefined references for non-thread case (KB)*/
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "thread.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Windows headers define it
|
// Windows headers define it
|
||||||
#ifdef Yield
|
#ifdef Yield
|
||||||
|
@ -90,6 +90,7 @@ WX_LINK = @WX_LINK@
|
|||||||
THREADS_LINK = @THREADS_LINK@
|
THREADS_LINK = @THREADS_LINK@
|
||||||
EXTRA_LINK = @EXTRA_LINK@
|
EXTRA_LINK = @EXTRA_LINK@
|
||||||
JPEG_LINK = @JPEG_LINK@
|
JPEG_LINK = @JPEG_LINK@
|
||||||
|
POSIX4_LINK=@POSIX4_LINK@
|
||||||
|
|
||||||
# INCLUDES
|
# INCLUDES
|
||||||
WX_INCLUDES = \
|
WX_INCLUDES = \
|
||||||
@ -112,6 +113,7 @@ LINK_LIBS= \
|
|||||||
$(X_EXTRA_LIBS) \
|
$(X_EXTRA_LIBS) \
|
||||||
$(X_PRE_LIBS) \
|
$(X_PRE_LIBS) \
|
||||||
$(THREADS_LINK) \
|
$(THREADS_LINK) \
|
||||||
|
$(POSIX4_LINK) \
|
||||||
$(EXTRA_LINK) \
|
$(EXTRA_LINK) \
|
||||||
$(JPEG_LINK)
|
$(JPEG_LINK)
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ s|*TOOLKIT*|@TOOLKIT@|g
|
|||||||
s|*TOOLKIT_DEF*|@TOOLKIT_DEF@|g
|
s|*TOOLKIT_DEF*|@TOOLKIT_DEF@|g
|
||||||
s|*THREADS*|@THREADS@|g
|
s|*THREADS*|@THREADS@|g
|
||||||
s|*THREADS_LINK*|@THREADS_LINK@|g
|
s|*THREADS_LINK*|@THREADS_LINK@|g
|
||||||
|
s|*POSIX4_LINK*|@POSIX4_LINK@|g
|
||||||
s|*EXTRA_LINK*|@EXTRA_LINK@|g
|
s|*EXTRA_LINK*|@EXTRA_LINK@|g
|
||||||
s|*GTK_JOYSTICK*|@GTK_JOYSTICK@|g
|
s|*GTK_JOYSTICK*|@GTK_JOYSTICK@|g
|
||||||
s|*UNIX_THREAD*|@UNIX_THREAD@|g
|
s|*UNIX_THREAD*|@UNIX_THREAD@|g
|
||||||
|
@ -778,3 +778,4 @@ void wxMutexGuiLeave()
|
|||||||
{
|
{
|
||||||
gs_mutexGui->Unlock();
|
gs_mutexGui->Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user