forked from andoma/movian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.osx
executable file
·150 lines (128 loc) · 3.4 KB
/
configure.osx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/bin/bash
#
# HTS configure script for Mac OS X
#
# Copyright (c) 2009-2010 Mattias Wadman
#
# Based on FFmpeg's configure script:
#
# Copyright (c) 2000-2002 Fabrice Bellard
# Copyright (c) 2005-2008 Diego Biurrun
# Copyright (c) 2005-2008 Mans Rullgard
#
PLATFORM="osx"
DEFAULT_UI="glw"
CONFIGURE_POSTFIX="osx"
source support/configure.inc
CPU=generic
ARCH=`uname -m`
MACOSXTARGET=""
MACOSXSDK=""
CC=cc
CXX=c++
show_help(){
common_help
echo " --prefix=PREFIX Install in PREFIX [$PREFIX]"
echo " --arch=arch Build for this architecture [$ARCH]"
echo " --cpu=cpu Build and optimize for specific CPU"
echo " --cc=CC Build using the given compiler"
echo " --release Stage for release"
echo " --macosxsdk=PATH Mac OS X SDK path [$MACOSXSDK]"
exit 1
}
enable sqlite_internal
enable libfreetype
enable glw
enable glw_frontend_cocoa
enable glw_backend_opengl
enable coreaudio
enable bonjour
enable spotlight
enable stdin
enable httpserver
enable timegm
enable realpath
enable polarssl
enable librtmp
enable dvd
enable fsevents
enable webpopup
enable libpthread
enable zlib
enable vmir
[ -f project.config ] && source project.config
for opt do
optval="${opt#*=}"
case "$opt" in
--prefix=*) PREFIX="$optval"
;;
--cpu=*) CPU="$optval"
;;
--help) show_help
;;
--release)
enable release
;;
--cc=*) CC="$optval"
;;
--arch=*) ARCH="$optval"
;;
--macosx-sdk=*) MACOSXSDK="$optval"
;;
*)
common_opt $opt $optval
esac
done
setup_env "$@"
if enabled openssl; then
# Assumes installed from brew or equivivalent
disable polarssl
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -L/usr/local/opt/openssl/lib -lssl -lcrypto"
echo >>${CONFIG_MAK} "CFLAGS_cfg += -I/usr/local/opt/openssl/include"
fi
MACOSXSDK_CFLAGS="-mmacosx-version-min=10.8"
MACOSXSDK_LDFLAGS="$MACOSXSDK_CFLAGS"
LIBAV_CFLAGS="$MACOSXSDK_CFLAGS"
LIBAV_LDFLAGS="$MACOSXSDK_CFLAGS"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += $MACOSXSDK_LDFLAGS"
echo >>${CONFIG_MAK} "CFLAGS_cfg += $MACOSXSDK_CFLAGS -D_FILE_OFFSET_BITS=64"
echo >>${CONFIG_MAK} "CFLAGS_ext += $MACOSXSDK_CFLAGS"
#
# Standard Mac OS X frameworks
#
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework Foundation"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework CoreFoundation"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework Cocoa"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework Webkit"
# IOKit for dvd
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework IOKit"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework OpenGL"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework CoreVideo"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -weak_framework VideoDecodeAcceleration"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -weak_framework VideoToolbox"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -weak_framework CoreMedia"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework CoreAudio"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework AudioToolBox"
export CFLAGS="$MACOSXSDK_CFLAGS"
freetype_setup
export -n CFLAGS
LIBAV_ARCH_FLAGS="--disable-shared --enable-static"
ext_setup
#
# Some compatibility defines
#
cat >> ${CONFIG_H} << EOF
/* Darwin is default 64 bit */
#define off64_t off_t
#define lseek64 lseek
/* Different name on darwin */
#define MAP_ANONYMOUS MAP_ANON
/* dvdcss, not defined on darwin is default large file and binary */
#define O_LARGEFILE 0
#define O_BINARY 0
EOF
#
# Finalize
#
echo >>${CONFIG_MAK} LDFLAGS_cfg += -lpthread
finalize