openbsd-ports/devel/glib/patches/patch-configure
jakemsr cb3832e975 use -pthread instead of -lpthread for pthread linkage
bulk build tested by steven@

sync w/update-patches while here
2007-12-11 10:57:25 +00:00

41 lines
1.0 KiB
Plaintext

$OpenBSD: patch-configure,v 1.5 2007/12/11 10:57:25 jakemsr Exp $
--- configure.orig Thu Mar 15 07:44:01 2001
+++ configure Sun Oct 21 01:39:52 2007
@@ -4385,6 +4385,13 @@ else
fi
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,13 @@ G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_REENTRANT" # good
# 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" -o \
+ "x$G_THREAD_LIBS" = "x-lpthread" ; then
+ G_THREAD_LIBS="-pthread"
+ fi
+ ;;
esac
# if we are not finding the ctime_r function, then we probably are
@@ -5468,8 +5482,6 @@ EOF
-
-CFLAGS="$CFLAGS $G_THREAD_CFLAGS"
case "$mutex_has_default" in