blob: a559fc47057bbcd8a0c498b2f2de412fe3320220 (
plain)
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
|
# $NetBSD: options.mk,v 1.65 2019/06/25 20:50:22 markd Exp $
.if defined(PKGNAME) && empty(PKGNAME:Mmplayer-share*)
# Note: This expression is the same as ${PKGBASE}, but the latter is
# not defined yet, so we cannot use it here.
PKG_OPTIONS_VAR= PKG_OPTIONS.${PKGNAME:C/-[0-9].*//}
.include "../../mk/oss.buildlink3.mk"
.include "../../multimedia/libvdpau/available.mk"
.include "../../comms/lirc/available.mk"
# -------------------------------------------------------------------------
# Define PKG_SUPPORTED_OPTIONS based on the current package and system.
# -------------------------------------------------------------------------
# Note: It is a good practice that all PKG_SUPPORTED_OPTIONS are
# enabled or disabled with --enable-option or --disable-option.
# It is better to add missing libs via EXTRA_LIBS, when it is possible,
# instead of patching the configure script in order to make the update of
# the packages easier.
# Options supported by both mplayer* or mencoder*.
PKG_SUPPORTED_OPTIONS= gif jpeg mad dts dv png theora vorbis x264 debug
PKG_SUPPORTED_OPTIONS+= dvdread dvdnav libmpg123 opus
.if ${OSS_TYPE} != "none"
PKG_SUPPORTED_OPTIONS+= oss
.endif
PKG_SUPPORTED_OPTIONS+= faad
# Set options based on the specific package being built.
.if !empty(PKGNAME:M*mplayer*)
PKG_SUPPORTED_OPTIONS+= aalib alsa caca esound ggi mplayer-menu nas pulseaudio sdl
.if ${VDPAU_AVAILABLE} == "yes"
PKG_SUPPORTED_OPTIONS+= vdpau
.endif
.if ${LIRC_AVAILABLE} == "yes"
PKG_SUPPORTED_OPTIONS+= lirc
.endif
.elif !empty(PKGNAME:M*mencoder*)
PKG_SUPPORTED_OPTIONS+= faac lame
.endif
# OS-specific options.
.if ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux" || ${OPSYS} == "NetBSD"
PKG_SUPPORTED_OPTIONS+= cdparanoia
.endif
PKG_SUPPORTED_OPTIONS.SunOS+= mlib
PKG_SUPPORTED_OPTIONS.Linux+= vidix
# TODO: v4l2 option probably could be supported on Linux and OpenBSD too
.if ${OPSYS} == "NetBSD" && exists(/usr/include/sys/videoio.h)
PKG_SUPPORTED_OPTIONS+= v4l2
PKG_SUGGESTED_OPTIONS+= v4l2
.endif
# Platform-specific options.
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
${MACHINE_ARCH} == "powerpc"
PKG_SUPPORTED_OPTIONS+= mplayer-runtime-cpudetection
.endif
.if ${MACHINE_ARCH} == "i386"
PKG_SUPPORTED_OPTIONS+= mplayer-default-cflags mplayer-win32
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
PKG_SUPPORTED_OPTIONS+= mplayer-ssse3
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
PKG_SUPPORTED_OPTIONS+= xvid
.endif
# -------------------------------------------------------------------------
# Define PKG_SUGGESTED_OPTIONS.
# -------------------------------------------------------------------------
.for o in dvdread dvdnav gif jpeg \
mplayer-menu \
mplayer-default-cflags mplayer-runtime-cpudetection \
oss png pulseaudio sdl vdpau lirc
. if !empty(PKG_SUPPORTED_OPTIONS:M${o})
PKG_SUGGESTED_OPTIONS+= ${o}
. endif
.endfor
.if !empty(PKGNAME:M*mplayer*)
PKG_SUGGESTED_OPTIONS.Linux+= alsa
.endif
PKG_SUGGESTED_OPTIONS.Linux+= vidix
# -------------------------------------------------------------------------
# Handle extra libraries (part 1)
# -------------------------------------------------------------------------
EXTRA_LIBS=
# -------------------------------------------------------------------------
# Handle chosen options.
# -------------------------------------------------------------------------
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:Maalib)
CONFIGURE_ARGS+= --enable-aa
. include "../../graphics/aalib/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-aa
.endif
.if !empty(PKG_OPTIONS:Malsa)
CONFIGURE_ARGS+= --enable-alsa
. include "../../audio/alsa-lib/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-alsa
.endif
.if !empty(PKG_OPTIONS:Mcaca)
CONFIGURE_ARGS+= --enable-caca
. include "../../graphics/libcaca/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-caca
.endif
.if !empty(PKG_OPTIONS:Mcdparanoia)
CONFIGURE_ARGS+= --enable-cdparanoia
. include "../../audio/cdparanoia/buildlink3.mk"
CFLAGS+= -I${BUILDLINK_PREFIX.cdparanoia}/include/cdparanoia
.else
CONFIGURE_ARGS+= --disable-cdparanoia
.endif
.if !empty(PKG_OPTIONS:Mdebug)
CONFIGURE_ARGS+= --enable-debug --disable-sighandler
INSTALL_UNSTRIPPED= yes
.endif
.if !empty(PKG_OPTIONS:Mdts)
# The configure handling for --enable-libdca is broken.
# However, it works if you omit the argument and let
# configure autodetect support.
#CONFIGURE_ARGS+= --enable-libdca
. include "../../audio/libdca/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-libdca
.endif
.if !empty(PKG_OPTIONS:Mdv)
CONFIGURE_ARGS+= --enable-libdv
. include "../../multimedia/libdv/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-libdv
.endif
.if !empty(PKG_OPTIONS:Mdvdread)
. include "../../multimedia/libdvdread/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-dvdread
.endif
.if !empty(PKG_OPTIONS:Mdvdnav)
CONFIGURE_ARGS+= --enable-dvdnav
. include "../../multimedia/libdvdnav/buildlink3.mk"
#CFLAGS+= -I${BUILDLINK_PREFIX.libdvdnav}/include/dvdnav
.else
CONFIGURE_ARGS+= --disable-dvdnav
.endif
.if !empty(PKG_OPTIONS:Mesound)
CONFIGURE_ARGS+= --enable-esd
. include "../../audio/esound/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-esd
.endif
.if !empty(PKG_OPTIONS:Mfaac)
CONFIGURE_ARGS+= --enable-faac
EXTRA_LIBS+= -lfaac
. include "../../audio/faac/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-faac
.endif
.if !empty(PKG_OPTIONS:Mfaad)
CONFIGURE_ARGS+= --enable-faad
. include "../../audio/faad2/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-faad
.endif
.if !empty(PKG_OPTIONS:Mggi)
CONFIGURE_ARGS+= --enable-ggi
. include "../../graphics/libggi/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-ggi
.endif
.if !empty(PKG_OPTIONS:Mgif)
CONFIGURE_ARGS+= --enable-gif
. include "../../graphics/giflib/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-gif
.endif
.if !empty(PKG_OPTIONS:Mjpeg)
CONFIGURE_ARGS+= --enable-jpeg
. include "../../mk/jpeg.buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-jpeg
.endif
.if !empty(PKG_OPTIONS:Mlibmpg123)
# no --enable-mpg123: configure forgets to add -lmpg123.
. include "../../audio/mpg123/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-mpg123
.endif
.if !empty(PKG_OPTIONS:Mlame)
CONFIGURE_ARGS+= --enable-mp3lame
. include "../../audio/lame/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-mp3lame
.endif
.if !empty(PKG_OPTIONS:Mopus)
CONFIGURE_ARGS+= --enable-libopus
. include "../../audio/libopus/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-libopus
.endif
.if !empty(PKG_OPTIONS:Mmad)
CONFIGURE_ARGS+= --enable-mad
. include "../../audio/libmad/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-mad
.endif
.if !empty(PKG_OPTIONS:Mmlib)
CONFIGURE_ARGS+= --enable-mlib
.else
CONFIGURE_ARGS+= --disable-mlib
.endif
.if !empty(PKG_OPTIONS:Mmplayer-menu)
CONFIGURE_ARGS+= --enable-menu
.else
CONFIGURE_ARGS+= --disable-menu
.endif
.if !empty(PKG_OPTIONS:Mmplayer-runtime-cpudetection)
CONFIGURE_ARGS+= --enable-runtime-cpudetection
.else
CONFIGURE_ARGS+= --disable-runtime-cpudetection
.endif
.if !empty(PKG_OPTIONS:Mmplayer-win32)
CONFIGURE_ARGS+= --enable-win32dll
DEPENDS+= win32-codecs>=011227:../../multimedia/win32-codecs
.else
CONFIGURE_ARGS+= --disable-win32dll
.endif
.if !empty(PKG_OPTIONS:Mnas)
CONFIGURE_ARGS+= --enable-nas
. include "../../audio/nas/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-nas
.endif
.if ${OSS_TYPE} != "none" && !empty(PKG_OPTIONS:Moss)
CONFIGURE_ARGS+= --enable-ossaudio
.else
CONFIGURE_ARGS+= --disable-ossaudio
.endif
.if !empty(PKG_OPTIONS:Mpng)
CONFIGURE_ARGS+= --enable-png
. include "../../graphics/png/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-png
.endif
.if !empty(PKG_OPTIONS:Mpulseaudio)
CONFIGURE_ARGS+= --enable-pulse
. include "../../devel/glib2/buildlink3.mk"
. include "../../audio/pulseaudio/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-pulse
.endif
.if !empty(PKG_OPTIONS:Msdl)
CONFIGURE_ARGS+= --enable-sdl
. include "../../devel/SDL/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-sdl
.endif
.if !empty(PKG_OPTIONS:Mtheora)
CONFIGURE_ARGS+= --enable-theora
. include "../../multimedia/libtheora/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-theora
.endif
.if empty(PKG_OPTIONS:Mv4l2)
CONFIGURE_ARGS+= --disable-tv-v4l2
.endif
# disable vidix if not in options
.if empty(PKG_OPTIONS:Mvidix)
CONFIGURE_ARGS+= --disable-vidix
.endif
.if !empty(PKG_OPTIONS:Mvorbis)
. include "../../audio/libvorbis/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-libvorbis
.endif
.if !empty(PKG_OPTIONS:Mx264)
CONFIGURE_ARGS+= --enable-x264
EXTRA_LIBS+= -lx264
. include "../../multimedia/x264-devel/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-x264
.endif
.if !empty(PKG_OPTIONS:Mxvid)
CONFIGURE_ARGS+= --enable-xvid
EXTRA_LIBS+= -lxvidcore
. include "../../multimedia/xvidcore/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-xvid
.endif
.if empty(PKG_OPTIONS:Mmplayer-ssse3)
CONFIGURE_ARGS+= --disable-ssse3
.endif
.if !empty(PKG_OPTIONS:Mvdpau)
CONFIGURE_ARGS+= --enable-vdpau
. include "../../multimedia/libvdpau/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-vdpau
.endif
.if !empty(PKG_OPTIONS:Mlirc)
CONFIGURE_ARGS+= --enable-lirc
. include "../../comms/lirc/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-lirc
.endif
# -------------------------------------------------------------------------
# Handle extra libraries (part 1)
# -------------------------------------------------------------------------
.if ${EXTRA_LIBS} != ""
CONFIGURE_ARGS+= --extra-libs=${EXTRA_LIBS:C/^ //:Q}
.endif
.endif # defined(PKGNAME) && empty(PKGNAME:Mmplayer-share*)
|