Rework patches and adapt comment about our monotonic clock support.

This commit is contained in:
ajacoutot 2011-05-24 09:10:23 +00:00
parent bf81eec5f8
commit e288a13063
4 changed files with 29 additions and 36 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.114 2011/05/23 16:36:13 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.115 2011/05/24 09:10:23 ajacoutot Exp $
COMMENT-main= general-purpose utility library
COMMENT-docs= glib2 documentation
@ -8,7 +8,7 @@ DISTNAME= glib-${VERSION}
PKGNAME-main= glib2-${VERSION}
PKGNAME-docs= glib2-docs-${VERSION}
REVISION-main= 0
REVISION-main= 1
CATEGORIES= devel
@ -71,6 +71,11 @@ CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \
--disable-selinux \
--disable-xattr \
--disable-silent-rules
# OpenBSD has support for monotonic clock (CLOCK_MONOTONIC), however we
# we currently don't have most of the _POSIX_* defines in unistd.h (e.g.
# _POSIX_MONOTONIC_CLOCK 200112L) and the associated sysconf(3)
# _SC_MONOTONIC_CLOCK variable.
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include \
-D_POSIX_MONOTONIC_CLOCK=200112L" \
LDFLAGS="-L${LOCALBASE}/lib -pthread"

View File

@ -1,25 +1,13 @@
$OpenBSD: patch-glib_gmain_c,v 1.1 2011/03/07 19:17:14 ajacoutot Exp $
--- glib/gmain.c.orig Fri Jan 28 18:10:26 2011
+++ glib/gmain.c Mon Jan 31 10:33:20 2011
@@ -2044,6 +2044,13 @@ g_get_monotonic_time (void)
struct timespec ts;
$OpenBSD: patch-glib_gmain_c,v 1.2 2011/05/24 09:10:23 ajacoutot Exp $
--- glib/gmain.c.orig Sat May 21 05:29:24 2011
+++ glib/gmain.c Tue May 24 10:50:15 2011
@@ -2054,7 +2054,9 @@ g_get_monotonic_time (void)
#ifdef HAVE_MONOTONIC_CLOCK
+# if defined(__OpenBSD__)
+ /*
+ OpenBSD has support for monotonic clock but does not has the
+ sysconf(3) _SC_MONOTONIC_CLOCK define
+ */
+ clockid = CLOCK_MONOTONIC;
+# else
/* We have to check if we actually have monotonic clock support.
*
* There is no thread safety issue here since there is no harm if we
@@ -2059,6 +2066,7 @@ g_get_monotonic_time (void)
if G_UNLIKELY (!checked)
{
+#ifndef __OpenBSD__
if (sysconf (_SC_MONOTONIC_CLOCK) >= 0)
+#endif
clockid = CLOCK_MONOTONIC;
checked = TRUE;
}
}
+# endif // !__OpenBSD__
#endif
clock_gettime (clockid, &ts);

View File

@ -1,21 +1,17 @@
$OpenBSD: patch-gthread_gthread-posix_c,v 1.1 2010/09/24 16:20:40 ajacoutot Exp $
--- gthread/gthread-posix.c.orig Fri Sep 24 17:51:34 2010
+++ gthread/gthread-posix.c Fri Sep 24 17:54:33 2010
@@ -148,10 +148,18 @@ g_thread_impl_init(void)
$OpenBSD: patch-gthread_gthread-posix_c,v 1.2 2011/05/24 09:10:23 ajacoutot Exp $
--- gthread/gthread-posix.c.orig Mon Sep 27 20:48:34 2010
+++ gthread/gthread-posix.c Tue May 24 10:49:23 2011
@@ -148,10 +148,14 @@ g_thread_impl_init(void)
#endif /* HAVE_PRIORITIES */
#ifdef USE_CLOCK_GETTIME
+# if defined(__OpenBSD__)
+ /*
+ OpenBSD has support for monotonic clock but does not has the
+ sysconf(3) _SC_MONOTONIC_CLOCK define
+ */
+ posix_clock = CLOCK_MONOTONIC;
+# else
+# ifndef __OpenBSD__
if (sysconf (_SC_MONOTONIC_CLOCK) >= 0)
posix_clock = CLOCK_MONOTONIC;
else
posix_clock = CLOCK_REALTIME;
+# else
+ posix_clock = CLOCK_MONOTONIC;
+# endif
#endif
}

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.22 2011/05/15 08:31:32 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.23 2011/05/24 09:10:23 ajacoutot Exp $
COMMENT = multimedia framework
@ -27,6 +27,10 @@ BUILD_DEPENDS = devel/flex
LIB_DEPENDS = textproc/libxml \
devel/glib2
# OpenBSD has support for monotonic clock (CLOCK_MONOTONIC), however we
# we currently don't have most of the _POSIX_* defines in unistd.h (e.g.
# _POSIX_MONOTONIC_CLOCK 200112L) and the associated sysconf(3)
# _SC_MONOTONIC_CLOCK variable.
CPPFLAGS += -D_POSIX_MONOTONIC_CLOCK=200112L
REGRESS_DEPENDS = ${BASE_PKGPATH}