On Tue, 2014-02-18 at 21:25 -0800, Samuel Thibault wrote: > Gabriele Giacone, le Tue 18 Feb 2014 23:49:14 +0100, a écrit : > > [1] > > http://anonscm.debian.org/viewvc/pkg-glibc/glibc-package/branches/eglibc-2.17/debian/patches/hurd-i386/local-clock_gettime_MONOTONIC.diff?revision=5436&view=markup > > > > How should it be fixed? > > Ideally, implementing timer_create and friends, and thus be able to set > _POSIX_TIMERS to 200809L.
Attached are two simple patches to build vlc on GNU/Hurd. vlc runs fine in kvm with the vout_sdl output module. The xcb_* options does not work well. There are several things yet to investigate, e.g. when loading a file from the vlc window the program segfaults (dlopen...), but running from the command line is OK, we have [0x805ff2c] dbus interface error: poll() failed: Interrupted system call when exiting vls, so ^C (twice) is needed to get rid of the vlc window, etc... The first patch is contains a Hurd workaround, that is probably not accepted upstream. Moreover, the configure.ac patch is strictly not needed, it is not used. Gabriele used it to enable vcd and cdda. I've chosen to disable oss, vcd, and not enable cdda, see the second patch. Maybe that is possible to enable cdda, I haven't checked. Then the corresponding change would be reflected in configure.ac. Thanks!
--- a/src/posix/thread.c 2013-06-24 20:00:40.000000000 +0200 +++ b/src/posix/thread.c 2014-02-20 10:35:08.000000000 +0100 @@ -68,12 +68,16 @@ # define _POSIX_MONOTONIC_CLOCK (-1) #endif -#if (_POSIX_TIMERS > 0) +#if (_POSIX_TIMERS >= 0) static unsigned vlc_clock_prec; # if (_POSIX_MONOTONIC_CLOCK > 0) && (_POSIX_CLOCK_SELECTION > 0) /* Compile-time POSIX monotonic clock support */ +#ifdef __GNU__ /* FIXME: GNU/Hurd quirk */ +# define vlc_clock_id (CLOCK_REALTIME) +#else # define vlc_clock_id (CLOCK_MONOTONIC) +#endif # elif (_POSIX_MONOTONIC_CLOCK == 0) && (_POSIX_CLOCK_SELECTION > 0) /* Run-time POSIX monotonic clock support (see clock_setup() below) */ @@ -903,7 +907,7 @@ */ mtime_t mdate (void) { -#if (_POSIX_TIMERS > 0) +#if (_POSIX_TIMERS >= 0) struct timespec ts; vlc_clock_setup (); --- a/configure.ac 2013-12-07 17:16:19.000000000 +0100 +++ b/configure.ac 2014-02-19 14:41:38.000000000 +0100 @@ -122,6 +122,9 @@ netbsd*) SYS=netbsd ;; + gnu*) + SYS=hurd + ;; dragonfly*) SYS=dragonfly ;;
--- a/debian/rules.orig 2013-12-21 22:52:19.000000000 +0100 +++ b/debian/rules 2014-02-21 12:44:15.000000000 +0100 @@ -78,7 +78,6 @@ --enable-notify \ --enable-ogg \ --enable-opus \ - --enable-oss \ --enable-pulse \ --enable-qt \ --enable-realrtsp \ @@ -95,7 +94,6 @@ --enable-theora \ --enable-twolame \ --enable-upnp \ - --enable-vcd \ --enable-vcdx \ --enable-vorbis \ --enable-x264 \ @@ -169,6 +167,25 @@ $(NULL) endif +# Hurd specific flags +ifeq ($(DEB_HOST_ARCH_OS),hurd) +confflags += \ + --disable-oss \ + --disable-vcd \ + $(NULL) +removeplugins += \ + liboss \ + libaccess_oss \ + libvcd \ + libcdda \ + $(NULL) +else +confflags += \ + --enable-oss \ + --enable-vcd \ + $(NULL) +endif + # Linux and kFreeBSD specific flags ifeq (,$(filter-out linux kfreebsd,$(DEB_HOST_ARCH_OS))) confflags += --enable-libva