pthreads related fixes.

This commit is contained in:
brad 2001-10-06 03:46:35 +00:00
parent 817863e35f
commit ce6f690367
3 changed files with 86 additions and 13 deletions

View File

@ -1,12 +1,38 @@
$OpenBSD: patch-configure,v 1.3 2001/04/03 14:42:48 brad Exp $
--- configure.orig Thu Mar 15 10:44:01 2001
+++ configure Tue Apr 3 10:18:32 2001
@@ -4911,7 +4911,7 @@ LIBS="$ac_save_LIBS"
+++ configure Mon Oct 1 21:52:58 2001
@@ -4385,6 +4385,13 @@ else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- G_THREAD_LIBS="-lc_r"
+ G_THREAD_LIBS="-pthread"
else
echo "$ac_t""no" 1>&6
fi
+
+if test "x`uname -s`" = "xOpenBSD" -a "x$enable_shared" = "xyes"; then
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ G_MODULE_LDFLAGS="-Wl,-E"
+ fi
+fi
+
if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then
case "$host_os" in
linux*)
@@ -5183,6 +5190,12 @@ G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_REE
# FreeBSD 2.2.x shiped with gcc 2.7.2.x, which doesn't support
# -mthreads flag.
;;
+ *-openbsd*)
+ G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_THREAD_SAFE"
+ if test "x$G_THREAD_LIBS" = "x-lc_r"; then
+ G_THREAD_LIBS="-pthread"
+ fi
+ ;;
esac
# if we are not finding the ctime_r function, then we probably are
@@ -5468,8 +5481,6 @@ EOF
-
-CFLAGS="$CFLAGS $G_THREAD_CFLAGS"
case "$mutex_has_default" in

View File

@ -0,0 +1,38 @@
--- configure.in.orig Thu Mar 15 10:37:37 2001
+++ configure.in Mon Oct 1 21:52:37 2001
@@ -544,6 +544,13 @@ if test -z "$G_MODULE_IMPL"; then
G_MODULE_IMPL=G_MODULE_IMPL_DLD
,)
fi
+
+if test "x`uname -s`" = "xOpenBSD" -a "x$enable_shared" = "xyes"; then
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ G_MODULE_LDFLAGS="-Wl,-E"
+ fi
+fi
+
dnl *** additional checks for G_MODULE_IMPL_DL
if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then
case "$host_os" in
@@ -800,6 +807,12 @@ G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_REE
# FreeBSD 2.2.x shiped with gcc 2.7.2.x, which doesn't support
# -mthreads flag.
;;
+ *-openbsd*)
+ G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_THREAD_SAFE"
+ if test "x$G_THREAD_LIBS" = "x-lc_r"; then
+ G_THREAD_LIBS="-pthread"
+ fi
+ ;;
esac
# if we are not finding the ctime_r function, then we probably are
@@ -914,8 +927,6 @@ fi
AC_DEFINE_UNQUOTED(G_THREAD_SOURCE,"gthread-$have_threads.c")
AC_SUBST(G_THREAD_CFLAGS)
AC_SUBST(G_THREAD_LIBS)
-
-CFLAGS="$CFLAGS $G_THREAD_CFLAGS"
dnl **********************************************
dnl *** GDefaultMutex setup and initialization ***

View File

@ -1,6 +1,6 @@
--- gthread/Makefile.in.orig Tue Mar 6 13:10:30 2001
+++ gthread/Makefile.in Tue Mar 6 13:11:08 2001
@@ -102,7 +102,7 @@
--- gthread/Makefile.in.orig Thu Mar 15 10:48:51 2001
+++ gthread/Makefile.in Thu Sep 20 11:20:12 2001
@@ -102,7 +102,7 @@ libglib = $(top_builddir)/libglib.la # -
lib_LTLIBRARIES = libgthread.la
libgthread_la_SOURCES = gthread.c
@ -9,7 +9,16 @@
libgthread_la_LIBADD = @G_THREAD_LIBS@
@@ -300,7 +300,7 @@
@@ -127,7 +127,7 @@ testgthread_SOURCES = testgthread.c
testgthread_OBJECTS = testgthread.o
testgthread_DEPENDENCIES = ../libglib.la libgthread.la
testgthread_LDFLAGS =
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ @G_THREAD_CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
@@ -300,7 +300,7 @@ install-am: all-am
install: install-am
uninstall-am: uninstall-libLTLIBRARIES
uninstall: uninstall-am