mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 03:28:27 +00:00
jack: Support OSX
Previously, with JACK installed, the configure script would enable the JACK indev; this broke on OS X due to an incomplete pthreads implementation. Add some simple macros to map libdispatch to pthreads on OS X. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
5f02266681
commit
6bb99757b7
42
compat/dispatch_semaphore/semaphore.h
Normal file
42
compat/dispatch_semaphore/semaphore.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* This file is part of Libav.
|
||||
*
|
||||
* Libav is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Libav is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with Libav; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
|
||||
#define COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
|
||||
|
||||
#include <dispatch/dispatch.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define sem_t dispatch_semaphore_t
|
||||
#define sem_post(psem) dispatch_semaphore_signal(*psem)
|
||||
#define sem_wait(psem) dispatch_semaphore_wait(*psem, DISPATCH_TIME_FOREVER)
|
||||
#define sem_timedwait(psem, val) dispatch_semaphore_wait(*psem, dispatch_walltime(val, 0))
|
||||
#define sem_destroy(psem) dispatch_release(*psem)
|
||||
|
||||
static inline int compat_sem_init(dispatch_semaphore_t *psem,
|
||||
int unused, int val)
|
||||
{
|
||||
int ret = !!(*psem = dispatch_semaphore_create(val)) - 1;
|
||||
if (ret < 0)
|
||||
errno = ENOMEM;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define sem_init compat_sem_init
|
||||
|
||||
#endif /* COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H */
|
10
configure
vendored
10
configure
vendored
@ -1447,6 +1447,7 @@ BUILTIN_LIST="
|
||||
MemoryBarrier
|
||||
mm_empty
|
||||
rdtsc
|
||||
sem_timedwait
|
||||
sync_val_compare_and_swap
|
||||
"
|
||||
HAVE_LIST_CMDLINE="
|
||||
@ -1467,6 +1468,7 @@ HEADERS_LIST="
|
||||
arpa_inet_h
|
||||
cdio_paranoia_h
|
||||
cdio_paranoia_paranoia_h
|
||||
dispatch_dispatch_h
|
||||
dev_bktr_ioctl_bt848_h
|
||||
dev_bktr_ioctl_meteor_h
|
||||
dev_ic_bt8xx_h
|
||||
@ -2300,7 +2302,8 @@ bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr
|
||||
dv1394_indev_deps="dv1394"
|
||||
dv1394_indev_select="dv_demuxer"
|
||||
fbdev_indev_deps="linux_fb_h"
|
||||
jack_indev_deps="jack_jack_h pthreads"
|
||||
jack_indev_deps="jack_jack_h"
|
||||
jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
|
||||
libcdio_indev_deps="libcdio"
|
||||
libdc1394_indev_deps="libdc1394"
|
||||
oss_indev_deps_any="soundcard_h sys_soundcard_h"
|
||||
@ -3747,6 +3750,8 @@ case $target_os in
|
||||
enabled x86_64 && objformat="macho64"
|
||||
enabled_any pic shared ||
|
||||
{ check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
|
||||
check_header dispatch/dispatch.h &&
|
||||
add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
|
||||
;;
|
||||
msys*)
|
||||
die "Native MSYS builds are discouraged, please use the MINGW environment.";
|
||||
@ -4503,6 +4508,9 @@ if ! disabled pthreads && ! enabled w32threads; then
|
||||
fi
|
||||
fi
|
||||
|
||||
enabled pthreads &&
|
||||
check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
|
||||
|
||||
disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
|
||||
disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user