thread detection works on FreeBSD

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-03-05 13:50:47 +00:00
parent afce4c035f
commit c293350081
2 changed files with 137 additions and 82 deletions

60
configure vendored
View File

@@ -636,7 +636,7 @@ SEARCH_INCLUDE="\
/usr/Motif1.2/include \
/usr/dt/include \
/usr/include/Xm \
\
\
/usr/X11R6/include \
/usr/X11R5/include \
/usr/X11R4/include \
@@ -6500,8 +6500,8 @@ main ()
if (gtk_minor_version > 0) return FALSE;
return !((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
}
EOF
@@ -6728,7 +6728,7 @@ for ac_dir in $SEARCH_LIB;
GUI_TK_LINK="-lXm -lXpm -lXmu -lXt -lX11 -lm"
GUI_TK_LIBRARY="$CHECK_LIB $GUI_TK_LINK"
TOOLKIT=MOTIF
TOOLKIT_DEF="__WXMOTIF__ -D__LINUX__ -D__UNIX__"
TOOLKIT_DEF=__WXMOTIF__
WX_LINK=-lwx_motif2
MAKEINCLUDE=../motif.inc
fi
@@ -7396,6 +7396,52 @@ fi
fi
if test "x$THREADS_LINK" = "x"; then
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:7402: checking for pthread_create in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7410 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pthread_create();
int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:7421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
UNIX_THREAD="gtk/threadpsx.cpp"
THREADS_LINK="-lc_r"
else
echo "$ac_t""no" 1>&6
fi
fi
if test "$THREADS_LINK" != ""; then
cat >> confdefs.h <<\EOF
#define wxUSE_THREADS 1
@@ -7405,7 +7451,7 @@ EOF
echo $ac_n "checking for printf in -lposix4""... $ac_c" 1>&6
echo "configure:7409: checking for printf in -lposix4" >&5
echo "configure:7455: checking for printf in -lposix4" >&5
ac_lib_var=`echo posix4'_'printf | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7413,7 +7459,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7417 "configure"
#line 7463 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7424,7 +7470,7 @@ int main() {
printf()
; return 0; }
EOF
if { (eval echo configure:7428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else

View File

@@ -64,8 +64,8 @@ main ()
if (gtk_minor_version > 0) return FALSE;
return !((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
}
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
@@ -246,7 +246,7 @@ SEARCH_INCLUDE="\
/usr/Motif1.2/include \
/usr/dt/include \
/usr/include/Xm \
\
\
/usr/X11R6/include \
/usr/X11R5/include \
/usr/X11R4/include \
@@ -1100,7 +1100,7 @@ if test "$wxUSE_MOTIF" = 1; then
GUI_TK_LINK="-lXm -lXpm -lXmu -lXt -lX11 -lm"
GUI_TK_LIBRARY="$CHECK_LIB $GUI_TK_LINK"
TOOLKIT=MOTIF
TOOLKIT_DEF="__WXMOTIF__ -D__LINUX__ -D__UNIX__"
TOOLKIT_DEF=__WXMOTIF__
WX_LINK=-lwx_motif2
MAKEINCLUDE=../motif.inc
fi
@@ -1396,6 +1396,15 @@ if test "$wxUSE_THREADS" = "1"; then
])
])
if test "x$THREADS_LINK" = "x"; then
dnl thread functions are in libc_r under FreeBSD
AC_CHECK_LIB(c_r, pthread_create,
[
UNIX_THREAD="gtk/threadpsx.cpp"
THREADS_LINK="-lc_r"
])
fi
if test "$THREADS_LINK" != ""; then
AC_DEFINE(wxUSE_THREADS)
fi