1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 23:00:41 +00:00

build: fix shm detection on OpenBSD

Fixes 
This commit is contained in:
Stefano Pigozzi 2013-12-26 16:57:21 +01:00
parent dbf879be14
commit c7f9c060e4
3 changed files with 14 additions and 2 deletions

View File

@ -1504,8 +1504,19 @@ echores "$_termios"
echocheck "shm" echocheck "shm"
if test "$_shm" = auto ; then if test "$_shm" = auto ; then
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
int main(void) {
shmget(0, 0, 0);
shmat(0, 0, 0);
shmctl(0, 0, 0);
return 0;
}
EOF
_shm=no _shm=no
statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes cc_check && _shm=yes
fi fi
if test "$_shm" = yes ; then if test "$_shm" = yes ; then
def_shm='#define HAVE_SHM 1' def_shm='#define HAVE_SHM 1'

View File

@ -34,6 +34,7 @@
#include "config.h" #include "config.h"
#if HAVE_SHM && HAVE_XEXT #if HAVE_SHM && HAVE_XEXT
#include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/shm.h> #include <sys/shm.h>
#include <X11/extensions/XShm.h> #include <X11/extensions/XShm.h>

View File

@ -138,7 +138,7 @@ iconv support use --disable-iconv.",
}, { }, {
'name': '--shm', 'name': '--shm',
'desc': 'shm', 'desc': 'shm',
'func': check_statement('sys/shm.h', 'func': check_statement(['sys/types.h', 'sys/ipc.h', 'sys/shm.h'],
'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)') 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)')
}, { }, {
'name': 'posix-select', 'name': 'posix-select',