Hopefully fix threading problems.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@3201 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1998-11-11 23:05:50 +00:00
parent cfed0fc98e
commit c0f2925232
5 changed files with 93 additions and 22 deletions

View file

@ -1,3 +1,10 @@
Wed Nov 11 23:30:00 1998 Richard Frith-Macdonald <richard@brainstrom.co.uk>
* configure.in: Added checks for thread library on linux
* configure: generated from configure.in
* config.make.in: Set thread library value
* target.make: understand thread library option
Mon Nov 9 23:13:28 1998 Ovidiu Predescu <ovidiu@slip.net>
* debugapp.in: Added support for fd-xraw.

View file

@ -59,8 +59,12 @@ TAR = tar
# The default library combination
default_library_combo = @ac_cv_library_combo@
# Is libobjc threaded?
objc_threaded = @objc_threaded@
#
# Do threading stuff.
#
ifndef objc_threaded
objc_threaded:=@objc_threaded@
endif
#
# X Window System headers and libraries

68
configure vendored
View file

@ -1558,32 +1558,80 @@ fi
echo $ac_n "checking whether objc has thread support""... $ac_c" 1>&6
echo "configure:1560: checking whether objc has thread support" >&5
saved_LIBS="$LIBS"
LIBS="-lobjc $LIBS"
if test "$cross_compiling" = yes; then
objc_threaded=1
objc_thread_lib=""
if test $host_os = linux-gnu; then
LIBS="-lobjc -lpthread"
if test "$cross_compiling" = yes; then
objc_threaded=-lpthread
else
cat > conftest.$ac_ext <<EOF
#line 1567 "configure"
#line 1569 "configure"
#include "confdefs.h"
#include "config_thread.m"
EOF
if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
objc_threaded=1
objc_threaded=-lpthread
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
objc_threaded=0
objc_threaded=""
fi
rm -fr conftest*
fi
LIBS="$saved_LIBS"
if test $objc_threaded = 1; then
echo "$ac_t""yes" 1>&6
if test "$objc_threaded" = ""; then
LIBS="-lobjc -lpcthread"
if test "$cross_compiling" = yes; then
objc_threaded=-lpcthread
else
cat > conftest.$ac_ext <<EOF
#line 1591 "configure"
#include "confdefs.h"
#include "config_thread.m"
EOF
if { (eval echo configure:1595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
objc_threaded=-lpcthread
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
objc_threaded=""
fi
rm -fr conftest*
fi
fi
else
LIBS="-lobjc $LIBS"
if test "$cross_compiling" = yes; then
objc_threaded=-lthread
else
cat > conftest.$ac_ext <<EOF
#line 1614 "configure"
#include "confdefs.h"
#include "config_thread.m"
EOF
if { (eval echo configure:1618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
objc_threaded=-lthread
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
objc_threaded=""
fi
rm -fr conftest*
fi
fi
LIBS="$saved_LIBS"
if test "$objc_threaded" = ""; then
echo "$ac_t""no" 1>&6
else
echo "$ac_t""yes" 1>&6
fi

View file

@ -151,14 +151,26 @@ AC_SUBST(ac_cv_library_combo)
#--------------------------------------------------------------------
AC_MSG_CHECKING(whether objc has thread support)
saved_LIBS="$LIBS"
LIBS="-lobjc $LIBS"
AC_TRY_RUN([#include "config_thread.m"], objc_threaded=1,
objc_threaded=0, objc_threaded=1)
LIBS="$saved_LIBS"
if test $objc_threaded = 1; then
AC_MSG_RESULT(yes)
objc_thread_lib=""
if test $host_os = linux-gnu; then
LIBS="-lobjc -lpthread"
AC_TRY_RUN([#include "config_thread.m"], objc_threaded="-lpthread",
objc_threaded="", objc_threaded="-lpthread")
if test x"$objc_threaded" = x""; then
LIBS="-lobjc -lpcthread"
AC_TRY_RUN([#include "config_thread.m"], objc_threaded="-lpcthread",
objc_threaded="", objc_threaded="-lpcthread")
fi
else
LIBS="-lobjc $LIBS"
AC_TRY_RUN([#include "config_thread.m"], objc_threaded="-lthread",
objc_threaded="", objc_threaded="-lthread")
fi
LIBS="$saved_LIBS"
if test x"$objc_threaded" = x""; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
AC_SUBST(objc_threaded)

View file

@ -36,14 +36,14 @@ endif
# Target specific libraries
#
ifeq ($(GNUSTEP_TARGET_OS),linux-gnu)
ifeq ($(objc_threaded),1)
TARGET_SYSTEM_LIBS := $(CONFIG_SYSTEM_LIBS) -lpthread -ldl -lm
else
ifeq ("$(objc_threaded)","")
TARGET_SYSTEM_LIBS := $(CONFIG_SYSTEM_LIBS) -ldl -lm
else
TARGET_SYSTEM_LIBS := $(CONFIG_SYSTEM_LIBS) $(objc_threaded) -ldl -lm
endif
endif
ifeq ($(findstring solaris, $(GNUSTEP_TARGET_OS)), solaris)
ifeq ($(objc_threaded),1)
ifeq ("$(objc_threaded)","-lthread")
INTERNAL_CFLAGS = -D_REENTRANT
INTERNAL_OBJCFLAGS = -D_REENTRANT
TARGET_SYSTEM_LIBS := $(CONFIG_SYSTEM_LIBS) -lthread -lsocket -lnsl -ldl -lm