summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-01-02 20:34:14 +0100
committerwm4 <wm4@nowhere>2014-01-06 20:21:14 +0100
commit5a81f7678e3429e1aa73d5b9d7854f64b8ce5443 (patch)
treeeec1c3011c874a1bca19bb87fe63a5c9b8d9762e
parente26286dfdbf2624412a3d338acd2aea6b104823b (diff)
downloadmpv-5a81f7678e3429e1aa73d5b9d7854f64b8ce5443.tar.bz2
mpv-5a81f7678e3429e1aa73d5b9d7854f64b8ce5443.tar.xz
build: fix cocoa configure check on OS X 10.7
It failed because the 10.7 SDK doesn't natively support array and dictionary subscripting.
-rw-r--r--waftools/checks/custom.py13
-rw-r--r--waftools/fragments/cocoa.m2
-rw-r--r--wscript6
3 files changed, 15 insertions, 6 deletions
diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py
index 1b698ec086..16f876e4a2 100644
--- a/waftools/checks/custom.py
+++ b/waftools/checks/custom.py
@@ -3,7 +3,8 @@ from waftools.checks.generic import *
from waflib import Utils
import os
-__all__ = ["check_pthreads", "check_iconv", "check_lua", "check_oss_4front"]
+__all__ = ["check_pthreads", "check_iconv", "check_lua", "check_oss_4front",
+ "check_cocoa"]
pthreads_program = load_fragment('pthreads.c')
@@ -101,3 +102,13 @@ def check_oss_4front(ctx, dependency_identifier):
fragment=load_fragment('oss_audio.c'))
return fn(ctx, dependency_identifier)
+
+def check_cocoa(ctx, dependency_identifier):
+ fn = check_cc(
+ fragment = load_fragment('cocoa.m'),
+ compile_filename = 'test.m',
+ framework_name = ['Cocoa', 'IOKit', 'OpenGL'],
+ includes = ctx.srcnode.abspath(),
+ linkflags = '-fobjc-arc')
+
+ return fn(ctx, dependency_identifier)
diff --git a/waftools/fragments/cocoa.m b/waftools/fragments/cocoa.m
index 6e0e4d32b4..8096afb613 100644
--- a/waftools/fragments/cocoa.m
+++ b/waftools/fragments/cocoa.m
@@ -2,6 +2,8 @@
#import <OpenGL/OpenGL.h>
#import <Cocoa/Cocoa.h>
+#include "osdep/macosx_compat.h"
+
int main(int argc, char **argv) {
@autoreleasepool {
NSArray *ary = @[@1, @2, @3];
diff --git a/wscript b/wscript
index e6e0a83a72..eda8d4f7c1 100644
--- a/wscript
+++ b/wscript
@@ -498,11 +498,7 @@ video_output_features = [
{
'name': '--cocoa',
'desc': 'Cocoa',
- 'func': check_cc(
- fragment=load_fragment('cocoa.m'),
- compile_filename='test.m',
- framework_name=['Cocoa', 'IOKit', 'OpenGL'],
- linkflags='-fobjc-arc')
+ 'func': check_cocoa
} , {
'name': 'gdi',
'desc': 'GDI',