Commit | Line | Data |
---|---|---|
de6d9b64 | 1 | #!/bin/sh |
0f3cb305 | 2 | # |
5cbcf02c | 3 | # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard |
0f3cb305 | 4 | # |
cf9d24ad | 5 | |
cde2d79a | 6 | # make sure we are running under a compatible shell |
5237ce67 MR |
7 | unset foo |
8 | (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null | |
cde2d79a MR |
9 | if test "$?" != 0; then |
10 | if test "x$FFMPEG_CONFIGURE_EXEC" = x; then | |
11 | FFMPEG_CONFIGURE_EXEC=1 | |
12 | export FFMPEG_CONFIGURE_EXEC | |
13 | exec bash "$0" "$@" | |
14 | exec ksh "$0" "$@" | |
15 | exec /usr/xpg4/bin/sh "$0" "$@" | |
16 | fi | |
17 | echo "No compatible shell script interpreter found." | |
18 | exit 1 | |
19 | fi | |
20 | ||
74c53c2d MR |
21 | show_help(){ |
22 | echo "Usage: configure [options]" | |
23 | echo "Options: [defaults in brackets after descriptions]" | |
24 | echo | |
25 | echo "Standard options:" | |
26 | echo " --help print this message" | |
2ba042a7 | 27 | echo " --log[=FILE|yes|no] log tests and output to FILE [config.err]" |
2266e085 | 28 | echo " --prefix=PREFIX install in PREFIX [$PREFIX]" |
74c53c2d | 29 | echo " --libdir=DIR install libs in DIR [PREFIX/lib]" |
84c22efd | 30 | echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]" |
74c53c2d MR |
31 | echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]" |
32 | echo " --mandir=DIR install man page in DIR [PREFIX/man]" | |
33 | echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]" | |
f956e129 | 34 | echo " --enable-libnut enable NUT support via libnut [default=no]" |
74c53c2d MR |
35 | echo " --enable-libogg enable Ogg support via libogg [default=no]" |
36 | echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]" | |
74c53c2d MR |
37 | echo " --enable-faad enable FAAD support via libfaad [default=no]" |
38 | echo " --enable-faadbin build FAAD support with runtime linking [default=no]" | |
39 | echo " --enable-faac enable FAAC support via libfaac [default=no]" | |
40 | echo " --enable-libgsm enable GSM support via libgsm [default=no]" | |
41 | echo " --enable-xvid enable XviD support via xvidcore [default=no]" | |
42 | echo " --enable-x264 enable H.264 encoding via x264 [default=no]" | |
43 | echo " --enable-mingw32 enable MinGW native/cross Windows compile" | |
44 | echo " --enable-mingwce enable MinGW native/cross WinCE compile" | |
45 | echo " --enable-a52 enable GPLed A52 support [default=no]" | |
46 | echo " --enable-a52bin open liba52.so.0 at runtime [default=no]" | |
47 | echo " --enable-dts enable GPLed DTS support [default=no]" | |
48 | echo " --enable-pp enable GPLed postprocessing support [default=no]" | |
49 | echo " --enable-static build static libraries [default=yes]" | |
50 | echo " --disable-static do not build static libraries [default=no]" | |
51 | echo " --enable-shared build shared libraries [default=no]" | |
52 | echo " --disable-shared do not build shared libraries [default=yes]" | |
53 | echo " --enable-amr_nb enable amr_nb float audio codec" | |
54 | echo " --enable-amr_nb-fixed use fixed point for amr-nb codec" | |
55 | echo " --enable-amr_wb enable amr_wb float audio codec" | |
56 | echo " --enable-amr_if2 enable amr_wb IF2 audio codec" | |
57 | echo " --enable-sunmlib use Sun medialib [default=no]" | |
58 | echo " --enable-pthreads use pthreads [default=no]" | |
59 | echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394" | |
60 | echo " and libraw1394 [default=no]" | |
790c9ca7 | 61 | echo " --enable-swscaler software scaler support [default=no]" |
8ac17293 | 62 | echo " --enable-avisynth allow reading AVISynth script files [default=no]" |
74c53c2d MR |
63 | echo " --enable-gpl allow use of GPL code, the resulting libav*" |
64 | echo " and ffmpeg will be under GPL [default=no]" | |
65 | echo "" | |
66 | echo "Advanced options (experts only):" | |
67 | echo " --source-path=PATH path to source code [$source_path]" | |
68 | echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" | |
fac252f9 | 69 | echo " --cross-compile assume a cross-compiler is used" |
74c53c2d MR |
70 | echo " --cc=CC use C compiler CC [$cc]" |
71 | echo " --make=MAKE use specified make [$make]" | |
72 | echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]" | |
73 | echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]" | |
74 | echo " --extra-libs=ELIBS add ELIBS [$ELIBS]" | |
75 | echo " --build-suffix=SUFFIX suffix for application specific build []" | |
cc6a90dd | 76 | echo " --arch=ARCH select architecture [$arch]" |
38d0a8aa GP |
77 | echo " --cpu=CPU selects the minimum cpu required (affects |
78 | instruction selection, may crash on older CPUs)" | |
74c53c2d MR |
79 | echo " --powerpc-perf-enable enable performance report on PPC" |
80 | echo " (requires enabling PMC)" | |
81 | echo " --disable-mmx disable MMX usage" | |
1839e854 | 82 | echo " --disable-armv5te disable armv5te usage" |
74c53c2d MR |
83 | echo " --disable-iwmmxt disable iwmmxt usage" |
84 | echo " --disable-altivec disable AltiVec usage" | |
85 | echo " --disable-audio-oss disable OSS audio support [default=no]" | |
86 | echo " --disable-audio-beos disable BeOS audio support [default=no]" | |
87 | echo " --disable-v4l disable video4linux grabbing [default=no]" | |
88 | echo " --disable-v4l2 disable video4linux2 grabbing [default=no]" | |
89 | echo " --disable-bktr disable bktr video grabbing [default=no]" | |
90 | echo " --disable-dv1394 disable DV1394 grabbing [default=no]" | |
91 | echo " --disable-network disable network support [default=no]" | |
0c7bb0e5 | 92 | echo " --disable-ipv6 disable ipv6 support [default=no]" |
74c53c2d | 93 | echo " --disable-zlib disable zlib [default=no]" |
74c53c2d MR |
94 | echo " --disable-vhook disable video hooking support" |
95 | echo " --enable-gprof enable profiling with gprof [$gprof]" | |
96 | echo " --disable-debug disable debugging symbols" | |
97 | echo " --disable-opts disable compiler optimizations" | |
78fcba8f | 98 | echo " --enable-extra-warnings enable more compiler warnings" |
74c53c2d MR |
99 | echo " --disable-mpegaudio-hp faster (but less accurate)" |
100 | echo " MPEG audio decoding [default=no]" | |
101 | echo " --disable-protocols disable I/O protocols support [default=no]" | |
786b30af | 102 | echo " --disable-ffmpeg disable ffmpeg build" |
74c53c2d MR |
103 | echo " --disable-ffserver disable ffserver build" |
104 | echo " --disable-ffplay disable ffplay build" | |
105 | echo " --enable-small optimize for size instead of speed" | |
106 | echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers" | |
107 | echo " --disable-strip disable stripping of executables and shared libraries" | |
108 | echo " --disable-encoder=NAME disables encoder NAME" | |
109 | echo " --enable-encoder=NAME enables encoder NAME" | |
110 | echo " --disable-decoder=NAME disables decoder NAME" | |
111 | echo " --enable-decoder=NAME enables decoder NAME" | |
112 | echo " --disable-encoders disables all encoders" | |
113 | echo " --disable-decoders disables all decoders" | |
ff70e601 MR |
114 | echo " --disable-muxer=NAME disables muxer NAME" |
115 | echo " --enable-muxer=NAME enables muxer NAME" | |
74c53c2d | 116 | echo " --disable-muxers disables all muxers" |
ff70e601 MR |
117 | echo " --disable-demuxer=NAME disables demuxer NAME" |
118 | echo " --enable-demuxer=NAME enables demuxer NAME" | |
74c53c2d | 119 | echo " --disable-demuxers disables all demuxers" |
af9e7d18 MR |
120 | echo " --enable-parser=NAME enables parser NAME" |
121 | echo " --disable-parser=NAME disables parser NAME" | |
122 | echo " --disable-parsers disables all parsers" | |
74c53c2d MR |
123 | echo "" |
124 | echo "NOTE: Object files are built at the place where configure is launched." | |
125 | exit 1 | |
126 | } | |
cf9d24ad | 127 | |
57bd82d4 MR |
128 | log(){ |
129 | echo "$@" >>$logfile | |
130 | } | |
131 | ||
720c69da | 132 | log_file(){ |
c8e9f801 MR |
133 | log BEGIN $1 |
134 | cat -n $1 >>$logfile | |
135 | log END $1 | |
136 | } | |
137 | ||
2ba042a7 | 138 | echolog(){ |
c8e9f801 | 139 | log "$@" |
57bd82d4 | 140 | echo "$@" |
2ba042a7 MR |
141 | } |
142 | ||
143 | die(){ | |
144 | echolog "$@" | |
145 | cat <<EOF | |
146 | If you think configure made a mistake, make sure you are using the latest | |
147 | version from SVN. If the latest version fails, report the problem to the | |
148 | ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net. | |
149 | EOF | |
720c69da | 150 | if enabled logging; then |
2ba042a7 MR |
151 | cat <<EOF |
152 | Include the log file "$logfile" produced by configure as this will help | |
153 | solving the problem. | |
154 | EOF | |
155 | else | |
156 | cat <<EOF | |
157 | Rerun configure with logging enabled (do not use --log=no), and include the | |
158 | log this produces with your report. | |
159 | EOF | |
160 | fi | |
57bd82d4 MR |
161 | rm -f $TMPC $TMPO $TMPE $TMPS $TMPH |
162 | exit 1 | |
163 | } | |
164 | ||
44161118 MR |
165 | toupper(){ |
166 | echo "$@" | tr '[a-z]' '[A-Z]' | |
167 | } | |
168 | ||
a8d04fba MR |
169 | set_all(){ |
170 | value=$1 | |
171 | shift | |
172 | for var in $*; do | |
173 | eval $var=$value | |
174 | done | |
175 | } | |
176 | ||
177 | enable(){ | |
178 | set_all yes $* | |
179 | } | |
180 | ||
181 | disable(){ | |
182 | set_all no $* | |
183 | } | |
184 | ||
57bd82d4 | 185 | enabled(){ |
44161118 MR |
186 | eval test "x\$$1" = "xyes" |
187 | } | |
188 | ||
189 | enabled_all(){ | |
190 | for opt; do | |
191 | enabled $opt || return 1 | |
192 | done | |
193 | } | |
194 | ||
195 | enabled_any(){ | |
196 | for opt; do | |
197 | enabled $opt && return 0 | |
198 | done | |
199 | } | |
200 | ||
201 | print_config(){ | |
202 | pfx=$1 | |
203 | header=$2 | |
204 | makefile=$3 | |
205 | shift 3 | |
206 | for cfg; do | |
207 | if enabled $cfg; then | |
208 | ucname="${pfx}`toupper $cfg`" | |
209 | echo "#define ${ucname} 1" >> $header | |
210 | echo "${ucname}=yes" >> $makefile | |
211 | fi | |
212 | done | |
57bd82d4 MR |
213 | } |
214 | ||
215 | flags_saved(){ | |
216 | (: ${SAVE_CFLAGS?}) 2>/dev/null | |
217 | } | |
218 | ||
dcd479c0 | 219 | save_flags(){ |
57bd82d4 | 220 | flags_saved && return |
dcd479c0 MR |
221 | SAVE_CFLAGS="$CFLAGS" |
222 | SAVE_LDFLAGS="$LDFLAGS" | |
223 | SAVE_extralibs="$extralibs" | |
224 | } | |
225 | ||
226 | restore_flags(){ | |
227 | CFLAGS="$SAVE_CFLAGS" | |
228 | LDFLAGS="$SAVE_LDFLAGS" | |
229 | extralibs="$SAVE_extralibs" | |
230 | unset SAVE_CFLAGS | |
231 | unset SAVE_LDFLAGS | |
232 | unset SAVE_extralibs | |
233 | } | |
234 | ||
235 | temp_cflags(){ | |
236 | save_flags | |
237 | CFLAGS="$CFLAGS $*" | |
238 | } | |
239 | ||
240 | temp_ldflags(){ | |
241 | save_flags | |
242 | LDFLAGS="$LDFLAGS $*" | |
243 | } | |
244 | ||
245 | temp_extralibs(){ | |
246 | save_flags | |
247 | extralibs="$extralibs $*" | |
248 | } | |
249 | ||
57bd82d4 MR |
250 | append(){ |
251 | var=$1 | |
252 | shift | |
253 | flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\"" | |
254 | eval "$var=\"\$$var $*\"" | |
255 | } | |
256 | ||
257 | add_cflags(){ | |
258 | append CFLAGS "$@" | |
259 | } | |
260 | ||
261 | add_ldflags(){ | |
262 | append LDFLAGS "$@" | |
263 | } | |
264 | ||
265 | add_extralibs(){ | |
266 | append extralibs "$@" | |
267 | } | |
268 | ||
b0cfb663 | 269 | check_cmd(){ |
b3cb5d51 | 270 | log "$@" |
9b4f605c | 271 | "$@" >>$logfile 2>&1 |
b0cfb663 MR |
272 | } |
273 | ||
dcd479c0 | 274 | check_cc(){ |
57bd82d4 MR |
275 | log check_cc "$@" |
276 | cat >$TMPC | |
720c69da | 277 | log_file $TMPC |
b0cfb663 | 278 | check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC |
57bd82d4 MR |
279 | } |
280 | ||
281 | check_cpp(){ | |
282 | log check_cpp "$@" | |
dcd479c0 | 283 | cat >$TMPC |
720c69da | 284 | log_file $TMPC |
b0cfb663 | 285 | check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC |
dcd479c0 MR |
286 | } |
287 | ||
288 | check_ld(){ | |
57bd82d4 | 289 | log check_ld "$@" |
0607887f | 290 | check_cc || return |
b0cfb663 | 291 | check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs |
dcd479c0 MR |
292 | } |
293 | ||
294 | check_cflags(){ | |
57bd82d4 MR |
295 | log check_cflags "$@" |
296 | check_cc "$@" <<EOF && add_cflags "$@" | |
dcd479c0 MR |
297 | int x; |
298 | EOF | |
299 | } | |
300 | ||
301 | check_ldflags(){ | |
57bd82d4 MR |
302 | log check_ldflags "$@" |
303 | check_ld "$@" <<EOF && add_ldflags "$@" | |
304 | int main(){ | |
305 | return 0; | |
306 | } | |
dcd479c0 MR |
307 | EOF |
308 | } | |
309 | ||
310 | check_header(){ | |
57bd82d4 | 311 | log check_header "$@" |
dcd479c0 MR |
312 | header=$1 |
313 | shift | |
57bd82d4 | 314 | check_cpp "$@" <<EOF |
dcd479c0 MR |
315 | #include <$header> |
316 | int x; | |
317 | EOF | |
318 | } | |
319 | ||
320 | check_func(){ | |
57bd82d4 | 321 | log check_func "$@" |
dcd479c0 MR |
322 | func=$1 |
323 | shift | |
324 | check_ld "$@" <<EOF | |
325 | extern int $func(); | |
326 | int main(){ | |
327 | $func(); | |
328 | } | |
329 | EOF | |
330 | } | |
331 | ||
57bd82d4 MR |
332 | check_lib(){ |
333 | log check_lib "$@" | |
334 | header="$1" | |
335 | func="$2" | |
336 | shift 2 | |
337 | temp_extralibs "$@" | |
338 | check_header $header && check_func $func && add_extralibs "$@" | |
339 | err=$? | |
340 | restore_flags | |
341 | return $err | |
342 | } | |
343 | ||
dcd479c0 | 344 | check_exec(){ |
bd4700b1 | 345 | check_ld "$@" && { test "$cross_compile" = yes || $TMPE >>$logfile 2>&1; } |
57bd82d4 MR |
346 | } |
347 | ||
348 | require(){ | |
349 | name="$1" | |
350 | header="$2" | |
351 | func="$3" | |
352 | shift 3 | |
353 | check_lib $header $func "$@" || die "ERROR: $name not found" | |
dcd479c0 MR |
354 | } |
355 | ||
9ddbcae6 | 356 | CONFIG_LIST='encoders decoders parsers muxers demuxers a52 a52bin amr amr_nb amr_nb_fixed amr_wb audio_beos audio_oss avisynth beos_netserver bktr dc1394 dts dv1394 faac faad faadbin ffmpeg ffplay ffserver gpl ipv6 libgsm libnut libogg libvorbis memalign_hack mp3lame mpegaudio_hp network pp protocols swscaler vhook video4linux video4linux2 x264 xvid zlib' |
44161118 MR |
357 | |
358 | HAVE_LIST='altivec_h byteswap_h dcbzl dlfcn dlopen freetype2 gprof imlib2 localtime_r lrintf malloc_h memalign mlib sdl sdl_video_size' | |
359 | ||
0f3cb305 | 360 | # set temporary file name |
57514323 | 361 | if test ! -z "$TMPDIR" ; then |
0f3cb305 | 362 | TMPDIR1="${TMPDIR}" |
57514323 | 363 | elif test ! -z "$TEMPDIR" ; then |
0f3cb305 | 364 | TMPDIR1="${TEMPDIR}" |
3d204385 | 365 | else |
0f3cb305 | 366 | TMPDIR1="/tmp" |
3d204385 NK |
367 | fi |
368 | ||
0f3cb305 FB |
369 | TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c" |
370 | TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o" | |
f3ec2d46 | 371 | TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}" |
0f3cb305 FB |
372 | TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S" |
373 | TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h" | |
374 | ||
de6d9b64 | 375 | # default parameters |
720c69da | 376 | logging="yes" |
2ba042a7 | 377 | logfile="config.err" |
2266e085 DB |
378 | PREFIX="/usr/local" |
379 | libdir='${PREFIX}/lib' | |
84c22efd | 380 | shlibdir="$libdir" |
2266e085 DB |
381 | incdir='${PREFIX}/include/ffmpeg' |
382 | mandir='${PREFIX}/man' | |
383 | bindir='${PREFIX}/bin' | |
0f3cb305 | 384 | cross_prefix="" |
fac252f9 | 385 | cross_compile="no" |
de6d9b64 FB |
386 | cc="gcc" |
387 | ar="ar" | |
be7109c1 | 388 | ranlib="ranlib" |
4a908fbc | 389 | make="make" |
0f3cb305 | 390 | strip="strip" |
cc6a90dd | 391 | arch=`uname -m` |
38d0a8aa | 392 | cpu="generic" |
e45a2872 | 393 | powerpc_perf="no" |
0f3cb305 | 394 | mmx="default" |
e7768fc5 | 395 | cmov="no" |
94e4c3a3 | 396 | cmov_is_fast="no" |
1839e854 | 397 | armv5te="default" |
eba9ae3c | 398 | iwmmxt="default" |
ab6c65f6 | 399 | altivec="default" |
87ea51e0 | 400 | dcbzl="no" |
d46aba26 | 401 | mmi="default" |
cc6a90dd | 402 | case "$arch" in |
ef0bc4c9 | 403 | i386|i486|i586|i686|i86pc|BePC) |
419b8784 | 404 | arch="x86_32" |
de6d9b64 | 405 | ;; |
7bf9648e | 406 | x86_64|amd64) |
a63e5f1c | 407 | arch="x86_32" |
32255f6c | 408 | canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`" |
7bf9648e JM |
409 | if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then |
410 | if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then | |
cc6a90dd | 411 | arch="x86_64" |
7bf9648e | 412 | fi |
053dea12 AJ |
413 | fi |
414 | ;; | |
6dc7b6b3 DB |
415 | # armv4l is a subset of armv[567]*l |
416 | arm|armv[4567]*l) | |
cc6a90dd | 417 | arch="armv4l" |
6ed7422a | 418 | ;; |
91d1f1a4 | 419 | alpha) |
cc6a90dd | 420 | arch="alpha" |
91d1f1a4 | 421 | ;; |
2645e80f | 422 | "Power Macintosh"|ppc|ppc64|powerpc) |
cc6a90dd | 423 | arch="powerpc" |
90cee0c3 | 424 | ;; |
b028a866 | 425 | mips|mipsel|IP*) |
cc6a90dd | 426 | arch="mips" |
d46aba26 | 427 | ;; |
bb476ff3 | 428 | sun4u|sparc64) |
cc6a90dd | 429 | arch="sparc64" |
a7beab73 | 430 | ;; |
bb476ff3 | 431 | sparc) |
cc6a90dd | 432 | arch="sparc" |
bb476ff3 | 433 | ;; |
bdb2e37c | 434 | sh4) |
cc6a90dd | 435 | arch="sh4" |
bdb2e37c | 436 | ;; |
67860b26 | 437 | parisc|parisc64) |
cc6a90dd | 438 | arch="parisc" |
67860b26 SH |
439 | ;; |
440 | s390|s390x) | |
cc6a90dd | 441 | arch="s390" |
67860b26 SH |
442 | ;; |
443 | m68k) | |
cc6a90dd | 444 | arch="m68k" |
67860b26 SH |
445 | ;; |
446 | ia64) | |
cc6a90dd | 447 | arch="ia64" |
67860b26 | 448 | ;; |
81a9b052 | 449 | bfin) |
cc6a90dd | 450 | arch="bfin" |
81a9b052 | 451 | ;; |
de6d9b64 | 452 | *) |
cc6a90dd | 453 | arch="unknown" |
de6d9b64 FB |
454 | ;; |
455 | esac | |
456 | gprof="no" | |
9d2a0f1c MR |
457 | video4linux="yes" |
458 | video4linux2="yes" | |
6beefa40 | 459 | bktr="no" |
5cbcf02c | 460 | audio_oss="yes" |
dfdfa47c | 461 | audio_beos="no" |
8aa3ee32 | 462 | dv1394="yes" |
f02be79d | 463 | dc1394="no" |
5cbcf02c | 464 | network="yes" |
0c7bb0e5 | 465 | ipv6="yes" |
0147f198 | 466 | zlib="yes" |
bb4c2140 | 467 | libgsm="no" |
a6741398 | 468 | mp3lame="no" |
f956e129 | 469 | libnut="no" |
9146ca37 | 470 | libogg="no" |
be74741c | 471 | libvorbis="no" |
0fc50e58 ZK |
472 | faad="no" |
473 | faadbin="no" | |
29d48296 | 474 | faac="no" |
1ddadfa9 | 475 | xvid="no" |
6662ec29 | 476 | x264="no" |
ba9261e5 | 477 | a52="no" |
57514323 | 478 | a52bin="no" |
23c99253 | 479 | dts="no" |
ba9261e5 | 480 | pp="no" |
732d9245 | 481 | mingw32="no" |
ac44871c | 482 | mingwce="no" |
f3ec2d46 | 483 | os2="no" |
320d060a | 484 | lstatic="yes" |
83286d2a | 485 | lshared="no" |
cddf3f45 GM |
486 | optimize="yes" |
487 | debug="yes" | |
78fcba8f | 488 | extrawarnings="no" |
65d1bea2 | 489 | dostrip="yes" |
da186ae2 | 490 | installstrip="-s" |
ef0bc4c9 | 491 | extralibs="-lm" |
0f3cb305 | 492 | bigendian="no" |
7f965c1c | 493 | inttypes="yes" |
b5c950c4 | 494 | emu_fast_int="no" |
a8721c09 | 495 | vhook="default" |
8ac17293 | 496 | avisynth="no" |
adbc0510 PG |
497 | dlfcn="no" |
498 | dlopen="no" | |
1eb2212e | 499 | mpegaudio_hp="yes" |
baa3a937 | 500 | SHFLAGS='-shared -Wl,-soname,$@' |
cab3ef82 | 501 | VHOOKSHFLAGS='$(SHFLAGS)' |
8e72b130 | 502 | beos_netserver="no" |
4baca069 | 503 | need_inet_aton="no" |
04f46ced | 504 | protocols="yes" |
786b30af | 505 | ffmpeg="yes" |
8154d2e0 | 506 | ffserver="yes" |
a86b921c | 507 | ffplay="yes" |
80581e98 | 508 | LIBOBJFLAGS="" |
e89b8b0a | 509 | FFLDFLAGS=-Wl,--warn-common |
e240ee67 | 510 | LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil' |
c536cb09 | 511 | FFSERVERLDFLAGS=-Wl,-E |
f39e56a8 | 512 | LDCONFIG="ldconfig" |
f3ec2d46 SG |
513 | LIBPREF="lib" |
514 | LIBSUF=".a" | |
4bdd05e7 | 515 | LIB='$(LIBPREF)$(NAME)$(LIBSUF)' |
f3ec2d46 SG |
516 | SLIBPREF="lib" |
517 | SLIBSUF=".so" | |
4bdd05e7 | 518 | SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)' |
b29bddab DB |
519 | SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)' |
520 | SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)' | |
951bf3e6 | 521 | EXESUF="" |
eb94aca9 | 522 | BUILDSUF="" |
891f64b3 | 523 | amr_nb="no" |
d663a1fd | 524 | amr_wb="no" |
bc634f6f | 525 | amr_nb_fixed="no" |
2a515c08 | 526 | amr_if2="no" |
bde24d6e | 527 | mlib="no" |
9c3d33d6 | 528 | pthreads="no" |
790c9ca7 | 529 | swscaler="no" |
b2e3c528 | 530 | gpl="no" |
9ddbcae6 | 531 | memalign_hack="no" |
4454dc1b | 532 | asmalign_pot="unknown" |
d4596ae3 | 533 | LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"' |
ef0bc4c9 FR |
534 | |
535 | # OS specific | |
536 | targetos=`uname -s` | |
537 | case $targetos in | |
538 | BeOS) | |
2266e085 | 539 | PREFIX="/boot/home/config" |
ef0bc4c9 | 540 | # helps building libavcodec |
30a3e5d4 | 541 | add_cflags "-DPIC -fomit-frame-pointer" |
31ba0b4d | 542 | # 3 gcc releases known for BeOS, each with ugly bugs |
b2924696 | 543 | gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`" |
31ba0b4d FR |
544 | case "$gcc_version" in |
545 | 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc" | |
546 | mmx="no" | |
547 | ;; | |
548 | *20010315*) echo "BeBits gcc" | |
30a3e5d4 | 549 | add_cflags "-fno-expensive-optimizations" |
31ba0b4d FR |
550 | ;; |
551 | esac | |
e1707f52 | 552 | SHFLAGS=-nostart |
29799f8b | 553 | # disable Linux things |
e1707f52 | 554 | audio_oss="no" |
9d2a0f1c MR |
555 | video4linux="no" |
556 | video4linux2="no" | |
8aa3ee32 | 557 | dv1394="no" |
29799f8b | 558 | # enable BeOS things |
dfdfa47c | 559 | audio_beos="yes" |
ef0bc4c9 FR |
560 | # no need for libm, but the inet stuff |
561 | # Check for BONE | |
562 | if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then | |
563 | extralibs="-lbind -lsocket" | |
564 | else | |
8e72b130 | 565 | beos_netserver="yes" |
4baca069 | 566 | need_inet_aton="yes" |
26b35efb | 567 | extralibs="-lnet" |
ef0bc4c9 | 568 | fi ;; |
4baca069 | 569 | SunOS) |
9d2a0f1c MR |
570 | video4linux="no" |
571 | video4linux2="no" | |
4baca069 | 572 | audio_oss="no" |
8aa3ee32 | 573 | dv1394="no" |
4baca069 | 574 | make="gmake" |
e89b8b0a | 575 | FFLDFLAGS="" |
c536cb09 | 576 | FFSERVERLDFLAGS="" |
813457e5 | 577 | SHFLAGS="-shared -Wl,-h,\$@" |
4baca069 | 578 | need_inet_aton="yes" |
30a3e5d4 | 579 | add_extralibs "-lsocket -lnsl" |
4baca069 | 580 | ;; |
b7aa4a59 | 581 | NetBSD) |
9d2a0f1c MR |
582 | video4linux="no" |
583 | video4linux2="no" | |
6beefa40 | 584 | bktr="yes" |
b7aa4a59 SS |
585 | audio_oss="yes" |
586 | dv1394="no" | |
587 | make="gmake" | |
30a3e5d4 | 588 | add_extralibs "-lossaudio" |
b7aa4a59 | 589 | ;; |
8c802695 | 590 | OpenBSD) |
9d2a0f1c MR |
591 | video4linux="no" |
592 | video4linux2="no" | |
6beefa40 | 593 | bktr="yes" |
8c802695 JM |
594 | audio_oss="yes" |
595 | dv1394="no" | |
596 | make="gmake" | |
80581e98 | 597 | LIBOBJFLAGS="\$(PIC)" |
a1309f8f | 598 | LDCONFIG="ldconfig -m \$(shlibdir)" |
30a3e5d4 | 599 | add_extralibs "-lossaudio" |
8c802695 | 600 | ;; |
9c938e77 | 601 | FreeBSD) |
9d2a0f1c MR |
602 | video4linux="no" |
603 | video4linux2="no" | |
6beefa40 | 604 | bktr="yes" |
9c938e77 | 605 | audio_oss="yes" |
8aa3ee32 | 606 | dv1394="no" |
9c938e77 | 607 | make="gmake" |
30a3e5d4 | 608 | add_cflags "-pthread" |
9c938e77 | 609 | ;; |
38f0d3ce | 610 | GNU/kFreeBSD) |
9d2a0f1c MR |
611 | video4linux="no" |
612 | video4linux2="no" | |
38f0d3ce DB |
613 | bktr="yes" |
614 | audio_oss="yes" | |
615 | dv1394="no" | |
30a3e5d4 | 616 | add_cflags "-pthread" |
38f0d3ce | 617 | ;; |
4a908fbc | 618 | BSD/OS) |
9d2a0f1c MR |
619 | video4linux="no" |
620 | video4linux2="no" | |
6beefa40 | 621 | bktr="yes" |
6063bce7 | 622 | audio_oss="yes" |
8aa3ee32 | 623 | dv1394="no" |
4a908fbc AB |
624 | extralibs="-lpoll -lgnugetopt -lm" |
625 | make="gmake" | |
1db68540 SS |
626 | strip="strip -d" |
627 | installstrip="" | |
4a908fbc | 628 | ;; |
90cee0c3 | 629 | Darwin) |
a43bd1d7 | 630 | cc="cc" |
9d2a0f1c MR |
631 | video4linux="no" |
632 | video4linux2="no" | |
90cee0c3 | 633 | audio_oss="no" |
8aa3ee32 | 634 | dv1394="no" |
a1309f8f | 635 | SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)" |
408382a4 | 636 | VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@' |
90cee0c3 | 637 | extralibs="" |
47930f09 | 638 | strip="strip -x" |
da186ae2 | 639 | installstrip="" |
e89b8b0a | 640 | FFLDFLAGS="-Wl,-dynamic,-search_paths_first" |
4e159595 | 641 | SLIBSUF=".dylib" |
f3b60109 DB |
642 | SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)' |
643 | SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)' | |
c536cb09 | 644 | FFSERVERLDFLAGS=-Wl,-bind_at_load |
d4596ae3 | 645 | LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"' |
90cee0c3 | 646 | ;; |
732d9245 | 647 | MINGW32*) |
951bf3e6 | 648 | # Note: the rest of the mingw32 config is done afterwards as mingw32 |
29799f8b | 649 | # can be forced on the command line for Linux cross compilation. |
732d9245 BE |
650 | mingw32="yes" |
651 | ;; | |
3f027ca7 | 652 | CYGWIN*) |
b2828252 | 653 | targetos=CYGWIN |
4581fdff | 654 | shlibdir='${PREFIX}/bin' |
9d2a0f1c MR |
655 | video4linux="no" |
656 | video4linux2="no" | |
3f027ca7 | 657 | audio_oss="yes" |
8aa3ee32 | 658 | dv1394="no" |
07a1b05e | 659 | VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil' |
fbb9d104 | 660 | VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)' |
3f027ca7 | 661 | extralibs="" |
487c2fad | 662 | EXESUF=".exe" |
4581fdff VP |
663 | SLIBPREF="cyg" |
664 | SLIBSUF=".dll" | |
665 | SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' | |
666 | SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)' | |
667 | SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a' | |
3f027ca7 | 668 | ;; |
b55e4ef4 | 669 | Linux) |
e240ee67 | 670 | LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS" |
b55e4ef4 | 671 | ;; |
99614dd4 | 672 | IRIX*) |
b2828252 | 673 | targetos=IRIX |
99614dd4 | 674 | ranlib="echo ignoring ranlib" |
9d2a0f1c MR |
675 | video4linux="no" |
676 | video4linux2="no" | |
99614dd4 MB |
677 | audio_oss="no" |
678 | make="gmake" | |
679 | ;; | |
f3ec2d46 SG |
680 | OS/2) |
681 | TMPE=$TMPE".exe" | |
3ca4b654 | 682 | ar="emxomfar -p128" |
69db4e10 SG |
683 | ranlib="echo ignoring ranlib" |
684 | strip="echo ignoring strip" | |
30a3e5d4 | 685 | add_cflags "-Zomf" |
e89b8b0a | 686 | FFLDFLAGS="-Zomf -Zstack 16384 -s" |
3ca4b654 | 687 | SHFLAGS="-Zdll -Zomf" |
c536cb09 | 688 | FFSERVERLDFLAGS="" |
f3ec2d46 SG |
689 | LIBPREF="" |
690 | LIBSUF=".lib" | |
691 | SLIBPREF="" | |
692 | SLIBSUF=".dll" | |
951bf3e6 | 693 | EXESUF=".exe" |
f3ec2d46 | 694 | extralibs="" |
c99dd233 | 695 | pkg_requires="" |
9d2a0f1c MR |
696 | video4linux="no" |
697 | video4linux2="no" | |
f3ec2d46 | 698 | audio_oss="no" |
8aa3ee32 | 699 | dv1394="no" |
f3ec2d46 | 700 | ffserver="no" |
3ca4b654 | 701 | vhook="no" |
f3ec2d46 | 702 | os2="yes" |
3ca4b654 | 703 | |
f3ec2d46 | 704 | ;; |
b2828252 DB |
705 | *) |
706 | targetos="${targetos}-UNKNOWN" | |
707 | ;; | |
ef0bc4c9 | 708 | esac |
de6d9b64 | 709 | |
0f3cb305 | 710 | # find source path |
997baf01 | 711 | source_path="`dirname \"$0\"`" |
0f3cb305 FB |
712 | source_path_used="yes" |
713 | if test -z "$source_path" -o "$source_path" = "." ; then | |
997baf01 | 714 | source_path="`pwd`" |
0f3cb305 | 715 | source_path_used="no" |
e7a4dafb MR |
716 | else |
717 | source_path="`cd \"$source_path\"; pwd`" | |
997baf01 MR |
718 | echo "$source_path" | grep -q '[[:blank:]]' && |
719 | die "Out of tree builds are impossible with whitespace in source path." | |
de6d9b64 FB |
720 | fi |
721 | ||
7d6ed4aa MR |
722 | if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
723 | show_help | |
724 | fi | |
725 | ||
f255e0ab MB |
726 | FFMPEG_CONFIGURATION=" " |
727 | for opt do | |
728 | FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt " | |
729 | done | |
730 | ||
13638ea9 SH |
731 | ENCODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_encoder)' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'` |
732 | DECODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_decoder)' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'` | |
733 | PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'` | |
734 | MUXER_LIST=`grep 'av_register_output_format(&[a-z]' "$source_path/libavformat/allformats.c" | sed 's/.*&\(.*\)).*/\1/'` | |
735 | DEMUXER_LIST=`grep 'av_register_input_format(&[a-z]' "$source_path/libavformat/allformats.c" | sed 's/.*&\(.*\)).*/\1/'` | |
009cf97d | 736 | |
a8d04fba MR |
737 | enable $ENCODER_LIST $DECODER_LIST $PARSER_LIST $MUXER_LIST $DEMUXER_LIST |
738 | ||
de6d9b64 | 739 | for opt do |
fce53524 | 740 | optval="${opt#*=}" |
de6d9b64 | 741 | case "$opt" in |
2ba042a7 MR |
742 | --log) |
743 | ;; | |
fce53524 | 744 | --log=*) logging="$optval" |
57bd82d4 | 745 | ;; |
2266e085 | 746 | --prefix=*) PREFIX="$optval"; force_prefix=yes |
de6d9b64 | 747 | ;; |
fce53524 | 748 | --libdir=*) libdir="$optval"; force_libdir=yes |
cc973ecb | 749 | ;; |
84c22efd DB |
750 | --shlibdir=*) shlibdir="$optval" |
751 | ;; | |
fce53524 | 752 | --incdir=*) incdir="$optval" |
1d67a1d4 | 753 | ;; |
fce53524 | 754 | --mandir=*) mandir="$optval" |
23a65308 | 755 | ;; |
fce53524 | 756 | --source-path=*) source_path="$optval" |
0f3cb305 | 757 | ;; |
fce53524 | 758 | --cross-prefix=*) cross_prefix="$optval" |
0f3cb305 | 759 | ;; |
fac252f9 MR |
760 | --cross-compile) cross_compile=yes |
761 | ;; | |
fce53524 | 762 | --cc=*) cc="$optval" |
de6d9b64 | 763 | ;; |
fce53524 | 764 | --make=*) make="$optval" |
4a908fbc | 765 | ;; |
30a3e5d4 | 766 | --extra-cflags=*) add_cflags "$optval" |
0f3cb305 | 767 | ;; |
28d8e661 | 768 | --extra-ldflags=*) add_ldflags "$optval" |
0f3cb305 | 769 | ;; |
28d8e661 | 770 | --extra-libs=*) add_extralibs "$optval" |
0f3cb305 | 771 | ;; |
fce53524 | 772 | --build-suffix=*) BUILDSUF="$optval" |
eb94aca9 | 773 | ;; |
cc6a90dd | 774 | --arch=*) arch="$optval" |
de6d9b64 | 775 | ;; |
38d0a8aa | 776 | --cpu=*) cpu="$optval" |
a4adb608 | 777 | ;; |
e45a2872 RD |
778 | --powerpc-perf-enable) powerpc_perf="yes" |
779 | ;; | |
de6d9b64 FB |
780 | --disable-mmx) mmx="no" |
781 | ;; | |
1839e854 SS |
782 | --disable-armv5te) armv5te="no" |
783 | ;; | |
eba9ae3c GB |
784 | --disable-iwmmxt) iwmmxt="no" |
785 | ;; | |
ab6c65f6 BF |
786 | --disable-altivec) altivec="no" |
787 | ;; | |
de6d9b64 FB |
788 | --enable-gprof) gprof="yes" |
789 | ;; | |
9d2a0f1c | 790 | --disable-v4l) video4linux="no" |
5cbcf02c | 791 | ;; |
9d2a0f1c | 792 | --disable-v4l2) video4linux2="no" |
0a7b514f | 793 | ;; |
6beefa40 MN |
794 | --disable-bktr) bktr="no" |
795 | ;; | |
5cbcf02c FB |
796 | --disable-audio-oss) audio_oss="no" |
797 | ;; | |
dfdfa47c FR |
798 | --disable-audio-beos) audio_beos="no" |
799 | ;; | |
8aa3ee32 MK |
800 | --disable-dv1394) dv1394="no" |
801 | ;; | |
ffc0ef96 | 802 | --disable-network) network="no"; ffserver="no" |
5cbcf02c | 803 | ;; |
0c7bb0e5 LB |
804 | --disable-ipv6) ipv6="no"; |
805 | ;; | |
0147f198 FR |
806 | --disable-zlib) zlib="no" |
807 | ;; | |
ba9261e5 | 808 | --enable-a52) a52="yes" |
6ed7422a | 809 | ;; |
bfd2edeb | 810 | --enable-a52bin) a52bin="yes" |
57514323 | 811 | ;; |
c99dd233 | 812 | --enable-dts) dts="yes" |
23c99253 | 813 | ;; |
ba9261e5 | 814 | --enable-pp) pp="yes" |
bba9b16c | 815 | ;; |
bb4c2140 MN |
816 | --enable-libgsm) libgsm="yes" |
817 | ;; | |
c99dd233 | 818 | --enable-mp3lame) mp3lame="yes" |
a6741398 | 819 | ;; |
f956e129 OS |
820 | --enable-libnut) libnut="yes" |
821 | ;; | |
9146ca37 | 822 | --enable-libogg) libogg="yes" |
c99dd233 | 823 | pkg_requires="$pkg_requires ogg >= 1.1" |
5c5dea3f | 824 | ;; |
be74741c | 825 | --enable-vorbis) libvorbis="yes" |
c99dd233 | 826 | pkg_requires="$pkg_requires vorbis vorbisenc" |
81e0d0b4 | 827 | ;; |
445ad18d ZK |
828 | --enable-faad) faad="yes" |
829 | ;; | |
830 | --enable-faadbin) faadbin="yes" | |
831 | ;; | |
c99dd233 | 832 | --enable-faac) faac="yes" |
29d48296 | 833 | ;; |
1ddadfa9 AT |
834 | --enable-xvid) xvid="yes" |
835 | ;; | |
c99dd233 | 836 | --enable-x264) x264="yes" |
6662ec29 | 837 | ;; |
8ac17293 SH |
838 | --enable-avisynth) avisynth="yes"; |
839 | ;; | |
f02be79d | 840 | --enable-dc1394) dc1394="yes" |
c99dd233 | 841 | pkg_requires="$pkg_requires libraw1394" |
f02be79d | 842 | ;; |
68892110 PG |
843 | --disable-vhook) vhook="no" |
844 | ;; | |
732d9245 BE |
845 | --enable-mingw32) mingw32="yes" |
846 | ;; | |
ac44871c GB |
847 | --enable-mingwce) mingwce="yes" |
848 | ;; | |
320d060a DB |
849 | --enable-static) lstatic="yes" |
850 | ;; | |
851 | --disable-static) lstatic="no" | |
852 | ;; | |
83286d2a | 853 | --enable-shared) lshared="yes" |
0319c531 | 854 | ;; |
320d060a DB |
855 | --disable-shared) lshared="no" |
856 | ;; | |
cddf3f45 GM |
857 | --disable-debug) debug="no" |
858 | ;; | |
859 | --disable-opts) optimize="no" | |
860 | ;; | |
78fcba8f MR |
861 | --enable-extra-warnings) extrawarnings="yes" |
862 | ;; | |
1eb2212e FB |
863 | --disable-mpegaudio-hp) mpegaudio_hp="no" |
864 | ;; | |
04f46ced GB |
865 | --disable-protocols) protocols="no"; network="no"; ffserver="no" |
866 | ;; | |
786b30af DB |
867 | --disable-ffmpeg) ffmpeg="no" |
868 | ;; | |
8154d2e0 FB |
869 | --disable-ffserver) ffserver="no" |
870 | ;; | |
a86b921c FB |
871 | --disable-ffplay) ffplay="no" |
872 | ;; | |
cddf3f45 | 873 | --enable-small) optimize="small" |
553a6284 | 874 | ;; |
60827a1a | 875 | --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no" |
891f64b3 | 876 | ;; |
60827a1a | 877 | --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no" |
bc634f6f | 878 | ;; |
60827a1a | 879 | --enable-amr_wb) amr="yes"; amr_wb="yes" |
115329f1 | 880 | ;; |
60827a1a | 881 | --enable-amr_if2) amr="yes"; amr_if2="yes" |
2a515c08 | 882 | ;; |
bde24d6e | 883 | --enable-sunmlib) mlib="yes" |
f80f7964 | 884 | ;; |
9c3d33d6 MN |
885 | --enable-pthreads) pthreads="yes" |
886 | ;; | |
790c9ca7 LA |
887 | --enable-swscaler) swscaler="yes" |
888 | ;; | |
b2e3c528 MN |
889 | --enable-gpl) gpl="yes" |
890 | ;; | |
9ddbcae6 | 891 | --enable-memalign-hack) memalign_hack="yes" |
da9b170c | 892 | ;; |
65d1bea2 MB |
893 | --disable-strip) dostrip="no" |
894 | ;; | |
a8d04fba | 895 | --enable-encoder=*) enable ${optval}_encoder |
009cf97d | 896 | ;; |
a8d04fba | 897 | --enable-decoder=*) enable ${optval}_decoder |
f593b273 | 898 | ;; |
a8d04fba | 899 | --disable-encoder=*) disable ${optval}_encoder |
f593b273 | 900 | ;; |
a8d04fba | 901 | --disable-decoder=*) disable ${optval}_decoder |
009cf97d | 902 | ;; |
a8d04fba | 903 | --disable-encoders) disable $ENCODER_LIST |
009cf97d | 904 | ;; |
a8d04fba | 905 | --disable-decoders) disable $DECODER_LIST |
b4cad537 | 906 | ;; |
a8d04fba | 907 | --enable-muxer=*) enable ${optval}_muxer |
a9e35095 | 908 | ;; |
a8d04fba | 909 | --disable-muxer=*) disable ${optval}_muxer |
ff70e601 | 910 | ;; |
a8d04fba | 911 | --disable-muxers) disable $MUXER_LIST; ffserver="no" |
ff70e601 | 912 | ;; |
a8d04fba | 913 | --enable-demuxer=*) enable ${optval}_demuxer |
ff70e601 | 914 | ;; |
a8d04fba | 915 | --disable-demuxer=*) disable ${optval}_demuxer |
ff70e601 | 916 | ;; |
a8d04fba | 917 | --disable-demuxers) disable $DEMUXER_LIST |
a9e35095 | 918 | ;; |
a8d04fba | 919 | --enable-parser=*) enable ${optval}_parser |
af9e7d18 | 920 | ;; |
a8d04fba | 921 | --disable-parser=*) disable ${optval}_parser |
af9e7d18 | 922 | ;; |
a8d04fba | 923 | --disable-parsers) disable $PARSER_LIST |
af9e7d18 | 924 | ;; |
74c53c2d MR |
925 | --help) show_help |
926 | ;; | |
b34c63f7 DB |
927 | *) |
928 | echo "Unknown option \"$opt\"." | |
929 | echo "See $0 --help for available options." | |
930 | exit 1 | |
931 | ;; | |
de6d9b64 FB |
932 | esac |
933 | done | |
934 | ||
720c69da MR |
935 | if test "$logging" != no; then |
936 | test "$logging" = yes || logfile="$logging" | |
57bd82d4 MR |
937 | echo "# $0 $@" >$logfile |
938 | set >>$logfile | |
2ba042a7 MR |
939 | else |
940 | logfile=/dev/null | |
57bd82d4 | 941 | fi |
e89b8b0a | 942 | |
e67bcdd9 DB |
943 | if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then |
944 | if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then | |
945 | cat <<EOF | |
946 | You can only build one library type at once on MinGW. | |
947 | Specify --disable-static --enable-shared to only build | |
948 | the shared libraries. To build only the static libraries | |
949 | you do not need to pass additional options. | |
950 | EOF | |
951 | exit 1 | |
952 | fi | |
9d2a0f1c MR |
953 | video4linux="no" |
954 | video4linux2="no" | |
e67bcdd9 DB |
955 | bktr="no" |
956 | audio_oss="no" | |
957 | dv1394="no" | |
958 | dc1394="no" | |
959 | ffserver="no" | |
960 | network="no" | |
961 | if test "$mingwce" = "yes"; then | |
962 | protocols="no" | |
963 | fi | |
e67bcdd9 DB |
964 | SLIBPREF="" |
965 | SLIBSUF=".dll" | |
966 | EXESUF=".exe" | |
d6a07a13 DB |
967 | SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' |
968 | SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)' | |
dfeb80a5 | 969 | SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)" |
b89c8f58 | 970 | SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a)" |
2266e085 | 971 | if test "$force_prefix" != yes; then PREFIX="$PROGRAMFILES/FFmpeg"; fi |
1066a995 DB |
972 | if test "$force_libdir" != yes; then bindir='${PREFIX}'; fi |
973 | shlibdir='${PREFIX}' | |
e67bcdd9 DB |
974 | fi |
975 | ||
28d8e661 DB |
976 | # Combine FFLDFLAGS and the LDFLAGS environment variable. |
977 | LDFLAGS="$FFLDFLAGS $LDFLAGS" | |
e89b8b0a | 978 | |
fac252f9 | 979 | test -n "$cross_prefix" && cross_compile=yes |
1ea46bed MR |
980 | cc="${cross_prefix}${cc}" |
981 | ar="${cross_prefix}${ar}" | |
982 | ranlib="${cross_prefix}${ranlib}" | |
983 | strip="${cross_prefix}${strip}" | |
984 | ||
320d060a DB |
985 | # we need to build at least one lib type |
986 | if test "$lstatic" = "no" && test "$lshared" = "no" ; then | |
987 | cat <<EOF | |
988 | At least one library type must be built. | |
989 | Specify --enable-static to build the static libraries or --enable-shared to | |
990 | build the shared libraries as well. To only build the shared libraries specify | |
991 | --disable-static in addition to --enable-shared. | |
992 | EOF | |
993 | exit 1; | |
994 | fi | |
995 | ||
be74741c | 996 | if test "$libvorbis" = "yes" ; then |
9146ca37 | 997 | if test "$libogg" = "no"; then |
29799f8b | 998 | echo "libogg must be enabled to enable Vorbis." |
5c5dea3f | 999 | fail="yes" |
5c5dea3f NB |
1000 | fi |
1001 | fi | |
1002 | ||
b2e3c528 | 1003 | if test "$gpl" != "yes"; then |
ba64106a | 1004 | if test "$pp" != "no"; then |
29799f8b | 1005 | echo "The Postprocessing code is under GPL and --enable-gpl is not specified." |
b2e3c528 MN |
1006 | fail="yes" |
1007 | fi | |
1008 | ||
1009 | if test "$a52" != "no" -o "$a52bin" != "no"; then | |
29799f8b | 1010 | echo "liba52 is under GPL and --enable-gpl is not specified." |
b2e3c528 MN |
1011 | fail="yes" |
1012 | fi | |
23c99253 | 1013 | |
1ddadfa9 | 1014 | if test "$xvid" != "no"; then |
29799f8b | 1015 | echo "libxvidcore is under GPL and --enable-gpl is not specified." |
1ddadfa9 AT |
1016 | fail="yes" |
1017 | fi | |
1018 | ||
6662ec29 | 1019 | if test "$x264" != "no"; then |
29799f8b | 1020 | echo "x264 is under GPL and --enable-gpl is not specified." |
6662ec29 MN |
1021 | fail="yes" |
1022 | fi | |
1023 | ||
23c99253 | 1024 | if test "$dts" != "no"; then |
29799f8b | 1025 | echo "libdts is under GPL and --enable-gpl is not specified." |
23c99253 MN |
1026 | fail="yes" |
1027 | fi | |
115329f1 | 1028 | |
b2e3c528 | 1029 | if test "$faad" != "no" -o "$faadbin" != "no"; then |
dcd479c0 MR |
1030 | if check_header faad.h; then |
1031 | check_cc << EOF | |
b2e3c528 MN |
1032 | #include <faad.h> |
1033 | #ifndef FAAD2_VERSION | |
1034 | ok faad1 | |
1035 | #endif | |
1036 | int main( void ) { return 0; } | |
1037 | EOF | |
dcd479c0 | 1038 | if test $? = 0 ; then |
29799f8b | 1039 | echo "FAAD2 is under GPL and --enable-gpl is not specified." |
b2e3c528 MN |
1040 | fail="yes" |
1041 | fi | |
1042 | else | |
1043 | faad="no" | |
1044 | faadbin="no" | |
29799f8b | 1045 | echo "FAAD test failed." |
b2e3c528 MN |
1046 | fi |
1047 | fi | |
115329f1 | 1048 | |
790c9ca7 LA |
1049 | if test "$swscaler" != "no"; then |
1050 | echo "The software scaler is under GPL and --enable-gpl is not specified." | |
1051 | fail="yes" | |
1052 | fi | |
ebb810d9 | 1053 | fi |
b2e3c528 | 1054 | |
ebb810d9 RP |
1055 | if test "$fail" = "yes"; then |
1056 | exit 1 | |
b2e3c528 MN |
1057 | fi |
1058 | ||
29799f8b | 1059 | # compute MMX state |
0f3cb305 | 1060 | if test $mmx = "default"; then |
419b8784 | 1061 | if test $arch = "x86_32" -o $arch = "x86_64"; then |
0f3cb305 FB |
1062 | mmx="yes" |
1063 | else | |
1064 | mmx="no" | |
1065 | fi | |
1066 | fi | |
1067 | ||
cf9d24ad | 1068 | #Darwin CC versions |
75388c74 | 1069 | needmdynamicnopic="no" |
cf9d24ad | 1070 | if test $targetos = Darwin; then |
b2924696 | 1071 | if test -n "`$cc -v 2>&1 | grep xlc`"; then |
30a3e5d4 | 1072 | add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto" |
cf9d24ad | 1073 | else |
bb270c08 DB |
1074 | gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`" |
1075 | case "$gcc_version" in | |
1076 | *2.95*) | |
30a3e5d4 | 1077 | add_cflags "-no-cpp-precomp -pipe" |
bb270c08 DB |
1078 | ;; |
1079 | *[34].*) | |
30a3e5d4 | 1080 | add_cflags "-no-cpp-precomp -pipe -force_cpusubtype_ALL -Wno-sign-compare" |
bb270c08 DB |
1081 | if test "$lshared" = no; then |
1082 | needmdynamicnopic="yes" | |
1083 | fi | |
1084 | ;; | |
1085 | *) | |
30a3e5d4 | 1086 | add_cflags "-no-cpp-precomp -pipe" |
bb270c08 DB |
1087 | if test "$lshared" = no; then |
1088 | needmdynamicnopic="yes" | |
1089 | fi | |
1090 | ;; | |
1091 | esac | |
cf9d24ad | 1092 | fi |
2a1a6b64 MN |
1093 | fi |
1094 | ||
1095 | if test $optimize != "no"; then | |
1096 | add_cflags "-fomit-frame-pointer" | |
cf9d24ad DC |
1097 | fi |
1098 | ||
ab6c65f6 BF |
1099 | # Can only do AltiVec on PowerPC |
1100 | if test $altivec = "default"; then | |
cc6a90dd | 1101 | if test $arch = "powerpc"; then |
ab6c65f6 BF |
1102 | altivec="yes" |
1103 | else | |
1104 | altivec="no" | |
1105 | fi | |
1106 | fi | |
1107 | ||
a4adb608 MN |
1108 | # Add processor-specific flags |
1109 | TUNECPU="generic" | |
9007f514 | 1110 | POWERPCMODE="32bits" |
38d0a8aa GP |
1111 | if test $cpu != "generic"; then |
1112 | case $cpu in | |
bb270c08 | 1113 | 601|ppc601|PowerPC601) |
1c5d830c | 1114 | add_cflags "-mcpu=601" |
bb270c08 DB |
1115 | if test $altivec = "yes"; then |
1116 | echo "WARNING: Tuning for PPC601 but AltiVec enabled!"; | |
1117 | fi | |
1118 | TUNECPU=ppc601 | |
1119 | ;; | |
1120 | 603*|ppc603*|PowerPC603*) | |
1c5d830c | 1121 | add_cflags "-mcpu=603" |
bb270c08 DB |
1122 | if test $altivec = "yes"; then |
1123 | echo "WARNING: Tuning for PPC603 but AltiVec enabled!"; | |
1124 | fi | |
1125 | TUNECPU=ppc603 | |
1126 | ;; | |
1127 | 604*|ppc604*|PowerPC604*) | |
1c5d830c | 1128 | add_cflags "-mcpu=604" |
bb270c08 DB |
1129 | if test $altivec = "yes"; then |
1130 | echo "WARNING: Tuning for PPC604 but AltiVec enabled!"; | |
1131 | fi | |
1132 | TUNECPU=ppc604 | |
1133 | ;; | |
1134 | G3|g3|75*|ppc75*|PowerPC75*) | |
1c5d830c | 1135 | add_cflags "-mcpu=750 -mpowerpc-gfxopt" |
bb270c08 DB |
1136 | if test $altivec = "yes"; then |
1137 | echo "WARNING: Tuning for PPC75x but AltiVec enabled!"; | |
1138 | fi | |
1139 | TUNECPU=ppc750 | |
1140 | ;; | |
1141 | G4|g4|745*|ppc745*|PowerPC745*) | |
1c5d830c | 1142 | add_cflags "-mcpu=7450 -mpowerpc-gfxopt" |
bb270c08 DB |
1143 | if test $altivec = "no"; then |
1144 | echo "WARNING: Tuning for PPC745x but AltiVec disabled!"; | |
1145 | fi | |
1146 | TUNECPU=ppc7450 | |
1147 | ;; | |
1148 | 74*|ppc74*|PowerPC74*) | |
1c5d830c | 1149 | add_cflags "-mcpu=7400 -mpowerpc-gfxopt" |
bb270c08 DB |
1150 | if test $altivec = "no"; then |
1151 | echo "WARNING: Tuning for PPC74xx but AltiVec disabled!"; | |
1152 | fi | |
1153 | TUNECPU=ppc7400 | |
1154 | ;; | |
1155 | G5|g5|970|ppc970|PowerPC970|power4*|Power4*) | |
1c5d830c | 1156 | add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" |
bb270c08 DB |
1157 | if test $altivec = "no"; then |
1158 | echo "WARNING: Tuning for PPC970 but AltiVec disabled!"; | |
1159 | fi | |
1160 | TUNECPU=ppc970 | |
9007f514 | 1161 | POWERPCMODE="64bits" |
bb270c08 | 1162 | ;; |
e7768fc5 GP |
1163 | # targets that do NOT support conditional mov (cmov) |
1164 | i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) | |
38d0a8aa | 1165 | add_cflags "-march=$cpu" |
e7768fc5 GP |
1166 | cmov="no" |
1167 | ;; | |
1168 | # targets that do support conditional mov (cmov) | |
94e4c3a3 | 1169 | i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx) |
e7768fc5 | 1170 | add_cflags "-march=$cpu" |
4c8d81fa | 1171 | cmov="yes" |
94e4c3a3 GP |
1172 | cmov_is_fast="yes" |
1173 | ;; | |
1174 | # targets that do support conditional mov but on which it's slow | |
1175 | pentium4|prescott|nocona) | |
1176 | add_cflags "-march=$cpu" | |
1177 | cmov="yes" | |
1178 | cmov_is_fast="no" | |
bb270c08 | 1179 | ;; |
d7b34d08 | 1180 | sparc64) |
1c5d830c | 1181 | add_cflags "-mcpu=v9" |
d7b34d08 | 1182 | ;; |
bb270c08 | 1183 | *) |
38d0a8aa | 1184 | echo "WARNING: Unknown CPU \"$cpu\", ignored." |
bb270c08 | 1185 | ;; |
a4adb608 MN |
1186 | esac |
1187 | fi | |
1188 | ||
be0d52ab MR |
1189 | # make sure we can execute files in $TMPDIR |
1190 | cat >$TMPE 2>>$logfile <<EOF | |
1191 | #! /bin/sh | |
1192 | EOF | |
1193 | chmod +x $TMPE >>$logfile 2>&1 | |
1194 | if ! $TMPE >>$logfile 2>&1; then | |
1195 | cat <<EOF | |
1196 | Unable to create and execute files in $TMPDIR1. Set the TMPDIR environment | |
68300911 DB |
1197 | variable to another directory and make sure that $TMPDIR1 is not mounted |
1198 | noexec. | |
be0d52ab MR |
1199 | EOF |
1200 | die "Sanity test failed." | |
1201 | fi | |
0244f743 | 1202 | rm $TMPE |
be0d52ab | 1203 | |
1a268acc MR |
1204 | # compiler sanity check |
1205 | check_exec <<EOF | |
1206 | int main(){ | |
1207 | return 0; | |
1208 | } | |
1209 | EOF | |
1210 | if test "$?" != 0; then | |
1211 | echo "$cc is unable to create an executable file." | |
1212 | if test -z "$cross_prefix" -a "$cross_compile" = no; then | |
1213 | echo "If $cc is a cross-compiler, use the --cross-compile option." | |
c7ae6345 | 1214 | echo "Only do this if you know what cross compiling means." |
1a268acc MR |
1215 | fi |
1216 | die "C compiler test failed." | |
1217 | fi | |
1218 | ||
87ea51e0 LB |
1219 | # check for assembler specific support |
1220 | ||
cc6a90dd | 1221 | if test $arch = "powerpc"; then |
87ea51e0 LB |
1222 | check_cc <<EOF && dcbzl=yes |
1223 | int main(void) { | |
1224 | register long zero = 0; | |
1225 | char data[1024]; | |
1226 | asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero)); | |
1227 | return 0; | |
1228 | } | |
1229 | EOF | |
1230 | fi | |
1231 | ||
57bd82d4 MR |
1232 | # check for SIMD availability |
1233 | ||
115329f1 | 1234 | # AltiVec flags: The FSF version of GCC differs from the Apple version |
cc6a90dd | 1235 | if test $arch = "powerpc"; then |
b6e52719 | 1236 | if test $altivec = "yes"; then |
b2924696 | 1237 | if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then |
30a3e5d4 | 1238 | add_cflags "-faltivec" |
b6e52719 | 1239 | else |
30a3e5d4 | 1240 | add_cflags "-maltivec -mabi=altivec" |
b6e52719 MD |
1241 | fi |
1242 | fi | |
1243 | fi | |
1244 | ||
6e7a01e4 | 1245 | check_header altivec.h && altivec_h=yes || altivec_h=no |
a9a07762 | 1246 | |
29799f8b | 1247 | # check if our compiler supports Motorola AltiVec C API |
ab6c65f6 | 1248 | if test $altivec = "yes"; then |
6e7a01e4 | 1249 | if test $altivec_h = "yes"; then |
f25fc9b1 MR |
1250 | inc_altivec_h="#include <altivec.h>" |
1251 | else | |
1252 | inc_altivec_h= | |
1253 | fi | |
1254 | check_cc <<EOF || altivec=no | |
dcd479c0 | 1255 | $inc_altivec_h |
a9a07762 MN |
1256 | int main(void) { |
1257 | vector signed int v1, v2, v3; | |
1258 | v1 = vec_add(v2,v3); | |
1259 | return 0; | |
1260 | } | |
1261 | EOF | |
1262 | fi | |
ab6c65f6 | 1263 | |
854fdb51 | 1264 | # check armv5te instructions support |
cc6a90dd | 1265 | if test $armv5te = "default" -a $arch = "armv4l"; then |
854fdb51 MR |
1266 | armv5te=no |
1267 | check_cc <<EOF && armv5te=yes | |
1268 | int main(void) { | |
1269 | __asm__ __volatile__ ("qadd r0, r0, r0"); | |
1270 | } | |
1271 | EOF | |
1272 | fi | |
1273 | ||
1274 | # check iwmmxt support | |
cc6a90dd | 1275 | if test $iwmmxt = "default" -a $arch = "armv4l"; then |
854fdb51 MR |
1276 | iwmmxt=no |
1277 | check_cc <<EOF && iwmmxt=yes | |
1278 | int main(void) { | |
1279 | __asm__ __volatile__ ("wunpckelub wr6, wr4"); | |
1280 | } | |
1281 | EOF | |
1282 | fi | |
1283 | ||
29799f8b | 1284 | # mmi only available on mips |
d46aba26 | 1285 | if test $mmi = "default"; then |
cc6a90dd | 1286 | if test $arch = "mips"; then |
d46aba26 LS |
1287 | mmi="yes" |
1288 | else | |
1289 | mmi="no" | |
1290 | fi | |
1291 | fi | |
1292 | ||
29799f8b | 1293 | # check if our compiler supports mmi |
57bd82d4 | 1294 | enabled mmi && check_cc <<EOF || mmi="no" |
d46aba26 LS |
1295 | int main(void) { |
1296 | __asm__ ("lq \$2, 0(\$2)"); | |
1297 | return 0; | |
1298 | } | |
1299 | EOF | |
57bd82d4 | 1300 | |
57bd82d4 MR |
1301 | # --- |
1302 | # big/little-endian test | |
fac252f9 | 1303 | if test "$cross_compile" = "no"; then |
57bd82d4 | 1304 | check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes" |
a3999908 MN |
1305 | #include <inttypes.h> |
1306 | int main(int argc, char ** argv){ | |
bb270c08 DB |
1307 | volatile uint32_t i=0x01234567; |
1308 | return (*((uint8_t*)(&i))) == 0x67; | |
a3999908 MN |
1309 | } |
1310 | EOF | |
487a54d7 | 1311 | else |
f25fc9b1 | 1312 | # programs cannot be launched if cross compiling, so make a static guess |
cc6a90dd | 1313 | if test "$arch" = "powerpc" -o "$arch" = "mips" ; then |
f25fc9b1 MR |
1314 | bigendian="yes" |
1315 | fi | |
487a54d7 FB |
1316 | fi |
1317 | ||
a3999908 | 1318 | # --- |
7f965c1c | 1319 | # *inttypes.h* test |
dcd479c0 | 1320 | check_header inttypes.h || inttypes=no |
7f965c1c CF |
1321 | |
1322 | # --- | |
b5c950c4 | 1323 | # *int_fast* test |
dcd479c0 | 1324 | check_cc <<EOF || emu_fast_int=yes |
b5c950c4 MN |
1325 | #include <inttypes.h> |
1326 | int main(int argc, char ** argv){ | |
bb270c08 DB |
1327 | volatile uint_fast64_t i=0x01234567; |
1328 | return 0; | |
b5c950c4 MN |
1329 | } |
1330 | EOF | |
1331 | ||
b5c950c4 | 1332 | # --- |
3d204385 NK |
1333 | # check availability of some header files |
1334 | ||
1981aafc | 1335 | memalign=no |
6194731a | 1336 | malloc_h=no |
dcd479c0 | 1337 | if check_header malloc.h; then |
6194731a | 1338 | malloc_h=yes |
1981aafc MR |
1339 | memalign=yes |
1340 | check_func memalign || memalign="no" | |
3d204385 NK |
1341 | fi |
1342 | ||
1981aafc | 1343 | if test "$memalign" = "no" -a "$mmx" = "yes" -a \ |
9ddbcae6 | 1344 | "$memalign_hack" != "yes" -a "$targetos" != "Darwin" -a \ |
a9907393 | 1345 | "$targetos" != "FreeBSD" ; then |
57bd82d4 | 1346 | die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack." |
8bf5d58f MN |
1347 | fi |
1348 | ||
47d23bbf MR |
1349 | check_header byteswap.h && byteswap_h=yes || byteswap_h=no |
1350 | ||
dcd479c0 | 1351 | check_func localtime_r && localtime_r=yes || localtime_r=no |
57bd82d4 | 1352 | enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no" |
57bd82d4 MR |
1353 | |
1354 | # check for some common methods of building with pthread support | |
1355 | # do this before the optional library checks as some of them require pthreads | |
1356 | if enabled pthreads; then | |
1357 | { check_cflags -pthread && check_ldflags -pthread; } || | |
1358 | { check_cflags -pthreads && check_ldflags -pthreads; } || | |
1359 | check_lib pthread.h pthread_create -lpthread || | |
1360 | check_func pthread_create || | |
1361 | die "ERROR: can't find pthreads library" | |
1362 | fi | |
1363 | ||
1364 | # these are off by default, so fail if requested and not available | |
4cbed916 | 1365 | enabled dts && require libdts dts.h dts_init -ldts -lm |
57bd82d4 | 1366 | enabled libgsm && require libgsm gsm.h gsm_create -lgsm |
4cbed916 | 1367 | enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm |
be74741c | 1368 | enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc -logg |
aedf11f8 | 1369 | enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg |
f956e129 | 1370 | enabled libnut && require libnut nut.h nut_demuxer_init -lnut |
57bd82d4 MR |
1371 | enabled xvid && require XviD xvid.h xvid_global -lxvidcore |
1372 | enabled x264 && require x264 x264.h x264_encoder_open -lx264 | |
1373 | enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 | |
bde24d6e | 1374 | enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib |
e0f80bd7 | 1375 | |
3b9bee88 MR |
1376 | # Ugh, faac uses stdcall calling convention on win32 so we can't use |
1377 | # the generic test functions | |
1378 | if enabled faac; then | |
1379 | save_flags | |
1380 | temp_extralibs -lfaac | |
1381 | check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found" | |
1382 | #include <stdint.h> | |
1383 | #include <faac.h> | |
1384 | int main(){ | |
1385 | char *id, *cpr; | |
1386 | faacEncGetVersion(&id, &cpr); | |
1387 | return 0; | |
1388 | } | |
1389 | EOF | |
1390 | restore_flags | |
1391 | fi | |
1392 | ||
87f1c97e MR |
1393 | # Ugh, recent faad2 versions have renamed all functions and #define the |
1394 | # old names in faad.h. Generic tests won't work. | |
1395 | if enabled faad; then | |
1396 | save_flags | |
1397 | temp_extralibs -lfaad | |
1398 | check_ld <<EOF && add_extralibs -lfaad || die "ERROR: libfaad not found" | |
1399 | #include <faad.h> | |
1400 | int main(){ | |
1401 | faacDecOpen(); | |
1402 | return 0; | |
1403 | } | |
1404 | EOF | |
1405 | restore_flags | |
1406 | fi | |
1407 | ||
8ac17293 SH |
1408 | # Ugh, avisynth uses WINAPI calls. Generic tests won't work. |
1409 | if enabled avisynth; then | |
1410 | save_flags | |
1411 | temp_extralibs -lvfw32 | |
1412 | check_ld <<EOF && add_extralibs -lvfw32 || die "ERROR: vfw32 not found" | |
1413 | #include <windows.h> | |
1414 | #include <vfw.h> | |
1415 | int main(){ | |
1416 | AVIFileInit(); | |
1417 | return 0; | |
1418 | } | |
1419 | EOF | |
1420 | restore_flags | |
1421 | fi | |
1422 | ||
1423 | ||
95e2ce4a | 1424 | # test for lrintf in math.h |
dcd479c0 | 1425 | check_exec <<EOF && have_lrintf=yes || have_lrintf=no |
95e2ce4a MN |
1426 | #define _ISOC9X_SOURCE 1 |
1427 | #include <math.h> | |
1428 | int main( void ) { return (lrintf(3.999f) > 0)?0:1; } | |
1429 | EOF | |
1430 | ||
c13e1abd FH |
1431 | _restrict= |
1432 | for restrict_keyword in restrict __restrict__ __restrict; do | |
57bd82d4 | 1433 | check_cc <<EOF && _restrict=$restrict_keyword && break |
dcd479c0 MR |
1434 | void foo(char * $restrict_keyword p); |
1435 | EOF | |
c13e1abd FH |
1436 | done |
1437 | ||
a8721c09 FB |
1438 | # dlopen/dlfcn.h probing |
1439 | ||
dcd479c0 | 1440 | check_header dlfcn.h && dlfcn=yes |
a8721c09 | 1441 | |
dcd479c0 MR |
1442 | temp_extralibs -ldl |
1443 | if check_func dlopen; then | |
1444 | dlopen=yes | |
1445 | ldl=-ldl | |
a8721c09 | 1446 | fi |
dcd479c0 | 1447 | restore_flags |
a8721c09 | 1448 | |
dcd479c0 MR |
1449 | if check_func dlopen; then |
1450 | dlopen=yes | |
1451 | ldl= | |
a8721c09 FB |
1452 | fi |
1453 | ||
f25fc9b1 MR |
1454 | if test "$vhook" = "default"; then |
1455 | vhook="$dlopen" | |
a8721c09 FB |
1456 | fi |
1457 | ||
bfd2edeb | 1458 | if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then |
57bd82d4 | 1459 | add_extralibs $ldl |
bfd2edeb MN |
1460 | fi |
1461 | ||
fbb9d104 VP |
1462 | if test "$targetos" = "CYGWIN" -a "$lstatic" = "yes" ; then |
1463 | vhook="no" | |
1464 | echo | |
1465 | echo "At the moment vhooks don't work on Cygwin static builds." | |
1466 | echo "Patches welcome." | |
1467 | echo | |
1468 | fi | |
1469 | ||
8d923001 MR |
1470 | if enabled vhook; then |
1471 | check_ldflags -rdynamic | |
1472 | check_ldflags -export-dynamic | |
1473 | fi | |
bfd2edeb | 1474 | |
a86b921c | 1475 | ########################################## |
29799f8b | 1476 | # imlib check |
a86b921c | 1477 | |
dcd479c0 MR |
1478 | temp_extralibs -lImlib2 |
1479 | check_ld <<EOF && imlib2=yes || imlib2=no | |
a8721c09 FB |
1480 | #include <X11/Xlib.h> |
1481 | #include <Imlib2.h> | |
1482 | int main( void ) { return (int) imlib_load_font("foo"); } | |
1483 | EOF | |
dcd479c0 | 1484 | restore_flags |
52b41d7f | 1485 | |
a86b921c | 1486 | ########################################## |
29799f8b | 1487 | # FreeType check |
a86b921c | 1488 | |
04511d53 | 1489 | freetype2=no |
e2a5fd20 | 1490 | if test "x$targetos" != "xBeOS"; then |
e2a3cd59 | 1491 | if (freetype-config --version) >/dev/null 2>&1 ; then |
dcd479c0 MR |
1492 | temp_cflags `freetype-config --cflags` |
1493 | temp_extralibs `freetype-config --libs` | |
1494 | check_ld <<EOF && freetype2=yes | |
1495 | #include <ft2build.h> | |
1496 | int main( void ) { return (int) FT_Init_FreeType(0); } | |
1497 | EOF | |
1498 | restore_flags | |
dee076fc | 1499 | fi |
04511d53 PG |
1500 | fi |
1501 | ||
a86b921c | 1502 | ########################################## |
29799f8b | 1503 | # SDL check |
a86b921c | 1504 | |
a86b921c FB |
1505 | sdl_too_old=no |
1506 | sdl=no | |
6a1a892f FD |
1507 | SDL_CONFIG="${cross_prefix}sdl-config" |
1508 | if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then | |
dcd479c0 MR |
1509 | temp_cflags `"${SDL_CONFIG}" --cflags` |
1510 | temp_extralibs `"${SDL_CONFIG}" --libs` | |
1511 | check_ld <<EOF | |
1512 | #include <SDL.h> | |
1513 | #undef main /* We don't want SDL to override our main() */ | |
1514 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
1515 | EOF | |
dcd479c0 MR |
1516 | if test $? = 0; then |
1517 | _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'` | |
29f3b38a | 1518 | if test "$_sdlversion" -lt 121 ; then |
dcd479c0 MR |
1519 | sdl_too_old=yes |
1520 | else | |
1521 | sdl=yes | |
29f3b38a MR |
1522 | check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no |
1523 | #include <SDL.h> | |
1524 | int main(void){ | |
1525 | const SDL_VideoInfo *vi = SDL_GetVideoInfo(); | |
1526 | int w = vi->current_w; | |
1527 | return 0; | |
1528 | } | |
1529 | EOF | |
dcd479c0 MR |
1530 | fi |
1531 | fi | |
29f3b38a | 1532 | restore_flags |
c3f6b472 | 1533 | fi |
a86b921c | 1534 | |
57bd82d4 MR |
1535 | enabled sdl || ffplay=no |
1536 | ||
146ea952 | 1537 | ########################################## |
29799f8b | 1538 | # texi2html check |
146ea952 NB |
1539 | |
1540 | texi2html=no | |
e2a3cd59 | 1541 | if (texi2html -version) >/dev/null 2>&1; then |
146ea952 NB |
1542 | texi2html=yes |
1543 | fi | |
1544 | ||
7a91333f | 1545 | ########################################## |
29799f8b | 1546 | # IPv6 check |
7a91333f | 1547 | |
0c7bb0e5 | 1548 | enabled network && enabled ipv6 && check_ld <<EOF && ipv6=yes || ipv6=no |
7a91333f HZ |
1549 | #include <sys/types.h> |
1550 | #include <sys/socket.h> | |
1551 | #include <netinet/in.h> | |
1552 | #include <netdb.h> | |
1553 | int main( void ) { | |
1554 | struct sockaddr_storage saddr; | |
1555 | struct ipv6_mreq mreq6; | |
1556 | getaddrinfo(0,0,0,0); | |
1557 | getnameinfo(0,0,0,0,0,0,0); | |
12fe88b4 | 1558 | IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0); |
7a91333f HZ |
1559 | } |
1560 | EOF | |
1561 | ||
47f38850 | 1562 | # check for video4linux2 --- V4L2_PIX_FMT_YUV420 |
9d2a0f1c | 1563 | enabled video4linux2 && check_cc <<EOF || video4linux2="no" |
84fe9963 | 1564 | #include <sys/time.h> |
f743a062 LA |
1565 | #include <asm/types.h> |
1566 | #include <linux/videodev2.h> | |
47f38850 | 1567 | int dummy = V4L2_PIX_FMT_YUV420; |
490c189b | 1568 | struct v4l2_buffer dummy1; |
47f38850 | 1569 | EOF |
47f38850 | 1570 | |
57bd82d4 MR |
1571 | enabled debug && add_cflags -g |
1572 | ||
1573 | # add some useful compiler flags if supported | |
1574 | check_cflags -Wdeclaration-after-statement | |
dcd479c0 MR |
1575 | check_cflags -Wall |
1576 | check_cflags -Wno-switch | |
c07bd6a9 MN |
1577 | check_cflags -Wdisabled-optimization |
1578 | check_cflags -Wpointer-arith | |
1579 | check_cflags -Wredundant-decls | |
78fcba8f | 1580 | enabled extrawarnings && check_cflags -Winline |
cf9d24ad | 1581 | |
57bd82d4 | 1582 | # add some linker flags |
e240ee67 | 1583 | check_ldflags $LDLATEFLAGS |
94a3401e | 1584 | |
57bd82d4 MR |
1585 | # not all compilers support -Os |
1586 | test "$optimize" = "small" && check_cflags -Os | |
cddf3f45 | 1587 | |
57bd82d4 | 1588 | if enabled optimize; then |
b2924696 | 1589 | if test -n "`$cc -v 2>&1 | grep xlc`"; then |
30a3e5d4 NP |
1590 | add_cflags "-O5" |
1591 | add_ldflags "-O5" | |
cf9d24ad | 1592 | else |
30a3e5d4 | 1593 | add_cflags "-O3" |
cf9d24ad | 1594 | fi |
cddf3f45 GM |
1595 | fi |
1596 | ||
80581e98 MN |
1597 | # PIC flags for shared library objects where they are needed |
1598 | if test "$lshared" = "yes" ; then | |
f25fc9b1 MR |
1599 | # LIBOBJFLAGS may have already been set in the OS configuration |
1600 | if test -z "$LIBOBJFLAGS" ; then | |
cc6a90dd | 1601 | case "$arch" in |
813457e5 MR |
1602 | x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;; |
1603 | esac | |
80581e98 | 1604 | fi |
80581e98 MN |
1605 | fi |
1606 | ||
1db54e20 | 1607 | if test "$gprof" = "yes" ; then |
30a3e5d4 NP |
1608 | add_cflags "-p" |
1609 | add_ldflags "-p" | |
1db54e20 DB |
1610 | fi |
1611 | ||
4454dc1b JD |
1612 | # find if .align arg is power-of-two or not |
1613 | if test $asmalign_pot = "unknown"; then | |
1614 | asmalign_pot="no" | |
1615 | echo 'asm (".align 3");' | check_cc && asmalign_pot="yes" | |
1616 | fi | |
1617 | ||
2266e085 | 1618 | echo "install prefix $PREFIX" |
29799f8b | 1619 | echo "source path $source_path" |
de6d9b64 | 1620 | echo "C compiler $cc" |
4a908fbc | 1621 | echo "make $make" |
38d0a8aa | 1622 | echo "ARCH $arch ($cpu)" |
eb94aca9 | 1623 | if test "$BUILDSUF" != ""; then |
f25fc9b1 | 1624 | echo "build suffix $BUILDSUF" |
eb94aca9 | 1625 | fi |
29799f8b | 1626 | echo "big-endian $bigendian" |
7f965c1c | 1627 | echo "inttypes.h $inttypes" |
b5c950c4 | 1628 | echo "broken inttypes.h $emu_fast_int" |
419b8784 | 1629 | if test $arch = "x86_32" -o $arch = "x86_64"; then |
f25fc9b1 | 1630 | echo "MMX enabled $mmx" |
e7768fc5 | 1631 | echo "CMOV enabled $cmov" |
94e4c3a3 | 1632 | echo "CMOV is fast $cmov_is_fast" |
e41e8342 | 1633 | fi |
cc6a90dd | 1634 | if test $arch = "armv4l"; then |
1839e854 | 1635 | echo "ARMv5TE enabled $armv5te" |
f25fc9b1 | 1636 | echo "IWMMXT enabled $iwmmxt" |
eba9ae3c | 1637 | fi |
cc6a90dd | 1638 | if test $arch = "mips"; then |
f25fc9b1 | 1639 | echo "MMI enabled $mmi" |
e41e8342 | 1640 | fi |
cc6a90dd | 1641 | if test $arch = "powerpc"; then |
f25fc9b1 | 1642 | echo "AltiVec enabled $altivec" |
87ea51e0 | 1643 | echo "dcbzl available $dcbzl" |
e41e8342 | 1644 | fi |
de6d9b64 | 1645 | echo "gprof enabled $gprof" |
0147f198 | 1646 | echo "zlib enabled $zlib" |
bb4c2140 | 1647 | echo "libgsm enabled $libgsm" |
a6741398 | 1648 | echo "mp3lame enabled $mp3lame" |
f956e129 | 1649 | echo "libnut enabled $libnut" |
9146ca37 | 1650 | echo "libogg enabled $libogg" |
be74741c | 1651 | echo "Vorbis enabled $libvorbis" |
29799f8b | 1652 | echo "FAAD enabled $faad" |
445ad18d | 1653 | echo "faadbin enabled $faadbin" |
29799f8b DB |
1654 | echo "FAAC enabled $faac" |
1655 | echo "XviD enabled $xvid" | |
6662ec29 | 1656 | echo "x264 enabled $x264" |
5cbcf02c | 1657 | echo "a52 support $a52" |
57514323 | 1658 | echo "a52 dlopened $a52bin" |
29799f8b | 1659 | echo "DTS support $dts" |
bba9b16c | 1660 | echo "pp support $pp" |
790c9ca7 | 1661 | echo "Software Scaler enabled $swscaler" |
8ac17293 | 1662 | echo "AVISynth enabled $avisynth" |
cddf3f45 | 1663 | echo "debug symbols $debug" |
65d1bea2 | 1664 | echo "strip symbols $dostrip" |
cddf3f45 | 1665 | echo "optimize $optimize" |
320d060a | 1666 | echo "static $lstatic" |
1ddf5ba1 | 1667 | echo "shared $lshared" |
29799f8b | 1668 | echo "video hooking $vhook" |
a86b921c FB |
1669 | echo "SDL support $sdl" |
1670 | if test $sdl_too_old = "yes"; then | |
f25fc9b1 | 1671 | echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support." |
a86b921c | 1672 | fi |
68892110 | 1673 | |
f25fc9b1 MR |
1674 | if test "$vhook" = "yes"; then |
1675 | echo "Imlib2 support $imlib2" | |
1676 | echo "FreeType support $freetype2" | |
68892110 | 1677 | fi |
bde24d6e | 1678 | echo "Sun medialib support" $mlib |
9c3d33d6 | 1679 | echo "pthreads support" $pthreads |
bc634f6f ZK |
1680 | echo "AMR-NB float support" $amr_nb |
1681 | echo "AMR-NB fixed support" $amr_nb_fixed | |
d663a1fd | 1682 | echo "AMR-WB float support" $amr_wb |
2a515c08 | 1683 | echo "AMR-WB IF2 support" $amr_if2 |
7a91333f HZ |
1684 | echo "network support $network" |
1685 | if test "$network" = "yes" ; then | |
f25fc9b1 | 1686 | echo "IPv6 support $ipv6" |
7a91333f | 1687 | fi |
4454dc1b | 1688 | echo ".align is power-of-two" $asmalign_pot |
b2e3c528 | 1689 | if test "$gpl" = "no" ; then |
f25fc9b1 | 1690 | echo "License: LGPL" |
b2e3c528 | 1691 | else |
f25fc9b1 | 1692 | echo "License: GPL" |
b2e3c528 | 1693 | fi |
de6d9b64 | 1694 | |
29799f8b | 1695 | echo "Creating config.mak and config.h..." |
de6d9b64 | 1696 | |
f255e0ab MB |
1697 | date >> config.log |
1698 | echo " $0 $FFMPEG_CONFIGURATION" >> config.log | |
29799f8b DB |
1699 | echo "# Automatically generated by configure - do not modify!" > config.mak |
1700 | echo "/* Automatically generated by configure - do not modify! */" > $TMPH | |
f255e0ab | 1701 | echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH |
de6d9b64 | 1702 | |
2266e085 DB |
1703 | echo "PREFIX=$PREFIX" >> config.mak |
1704 | echo "prefix=\$(DESTDIR)\${PREFIX}" >> config.mak | |
9a695e98 | 1705 | echo "libdir=\$(DESTDIR)$libdir" >> config.mak |
84c22efd | 1706 | echo "shlibdir=\$(DESTDIR)$shlibdir" >> config.mak |
1d67a1d4 | 1707 | echo "incdir=\$(DESTDIR)$incdir" >> config.mak |
9a695e98 DB |
1708 | echo "bindir=\$(DESTDIR)$bindir" >> config.mak |
1709 | echo "mandir=\$(DESTDIR)$mandir" >> config.mak | |
4a908fbc | 1710 | echo "MAKE=$make" >> config.mak |
980fc7b8 FB |
1711 | echo "CC=$cc" >> config.mak |
1712 | echo "AR=$ar" >> config.mak | |
be7109c1 | 1713 | echo "RANLIB=$ranlib" >> config.mak |
65d1bea2 | 1714 | if test "$dostrip" = "yes" ; then |
f25fc9b1 MR |
1715 | echo "STRIP=$strip" >> config.mak |
1716 | echo "INSTALLSTRIP=$installstrip" >> config.mak | |
65d1bea2 | 1717 | else |
f25fc9b1 MR |
1718 | echo "STRIP=echo ignoring strip" >> config.mak |
1719 | echo "INSTALLSTRIP=" >> config.mak | |
65d1bea2 | 1720 | fi |
75388c74 | 1721 | |
408382a4 | 1722 | VHOOKCFLAGS="-fPIC $CFLAGS" |
57bd82d4 | 1723 | test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic |
75388c74 | 1724 | |
a9b3f630 | 1725 | echo "OPTFLAGS=$CFLAGS" >> config.mak |
408382a4 | 1726 | echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak |
0f3cb305 | 1727 | echo "LDFLAGS=$LDFLAGS" >> config.mak |
f39e56a8 | 1728 | echo "LDCONFIG=$LDCONFIG" >> config.mak |
c536cb09 | 1729 | echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak |
e1707f52 | 1730 | echo "SHFLAGS=$SHFLAGS" >> config.mak |
408382a4 | 1731 | echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak |
fbb9d104 | 1732 | echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak |
80581e98 | 1733 | echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak |
b12f8273 | 1734 | echo "BUILD_STATIC=$lstatic" >> config.mak |
eb94aca9 | 1735 | echo "BUILDSUF=$BUILDSUF" >> config.mak |
f3ec2d46 | 1736 | echo "LIBPREF=$LIBPREF" >> config.mak |
eb94aca9 | 1737 | echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak |
320d060a DB |
1738 | if test "$lstatic" = "yes" ; then |
1739 | echo "LIB=$LIB" >> config.mak | |
1a44a8b6 AS |
1740 | else # Some Make complain if this variable does not exist. |
1741 | echo "LIB=" >> config.mak | |
320d060a | 1742 | fi |
f3ec2d46 | 1743 | echo "SLIBPREF=$SLIBPREF" >> config.mak |
eb94aca9 CY |
1744 | echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak |
1745 | echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak | |
b2828252 | 1746 | echo "TARGET_OS=$targetos" >> config.mak |
419b8784 | 1747 | if test "$arch" = "x86_32" -o "$arch" = "x86_64" ; then |
980fc7b8 | 1748 | echo "TARGET_ARCH_X86=yes" >> config.mak |
045ed63f | 1749 | echo "#define ARCH_X86 1" >> $TMPH |
419b8784 DB |
1750 | fi |
1751 | if test "$arch" = "x86_32" ; then | |
1752 | echo "TARGET_ARCH_X86_32=yes" >> config.mak | |
1753 | echo "#define ARCH_X86_32 1" >> $TMPH | |
cc6a90dd | 1754 | elif test "$arch" = "x86_64" ; then |
053dea12 AJ |
1755 | echo "TARGET_ARCH_X86_64=yes" >> config.mak |
1756 | echo "#define ARCH_X86_64 1" >> $TMPH | |
cc6a90dd | 1757 | elif test "$arch" = "armv4l" ; then |
6ed7422a | 1758 | echo "TARGET_ARCH_ARMV4L=yes" >> config.mak |
045ed63f | 1759 | echo "#define ARCH_ARMV4L 1" >> $TMPH |
cc6a90dd | 1760 | elif test "$arch" = "alpha" ; then |
91d1f1a4 | 1761 | echo "TARGET_ARCH_ALPHA=yes" >> config.mak |
045ed63f | 1762 | echo "#define ARCH_ALPHA 1" >> $TMPH |
cc6a90dd | 1763 | elif test "$arch" = "sparc64" ; then |
35fedfc3 PG |
1764 | echo "TARGET_ARCH_SPARC64=yes" >> config.mak |
1765 | echo "#define ARCH_SPARC64 1" >> $TMPH | |
bb476ff3 JM |
1766 | echo "TARGET_ARCH_SPARC=yes" >> config.mak |
1767 | echo "#define ARCH_SPARC 1" >> $TMPH | |
cc6a90dd | 1768 | elif test "$arch" = "sparc" ; then |
bb476ff3 JM |
1769 | echo "TARGET_ARCH_SPARC=yes" >> config.mak |
1770 | echo "#define ARCH_SPARC 1" >> $TMPH | |
cc6a90dd | 1771 | elif test "$arch" = "powerpc" ; then |
0f3cb305 FB |
1772 | echo "TARGET_ARCH_POWERPC=yes" >> config.mak |
1773 | echo "#define ARCH_POWERPC 1" >> $TMPH | |
9007f514 RD |
1774 | if test $POWERPCMODE = "32bits"; then |
1775 | echo "#define POWERPC_MODE_32BITS 1" >> $TMPH | |
1776 | else | |
1777 | echo "#define POWERPC_MODE_64BITS 1" >> $TMPH | |
1778 | fi | |
e45a2872 RD |
1779 | if test "$powerpc_perf" = "yes"; then |
1780 | echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH | |
1781 | fi | |
cc6a90dd | 1782 | elif test "$arch" = "mips" ; then |
d46aba26 LS |
1783 | echo "TARGET_ARCH_MIPS=yes" >> config.mak |
1784 | echo "#define ARCH_MIPS 1" >> $TMPH | |
cc6a90dd | 1785 | elif test "$arch" = "sh4" ; then |
bdb2e37c AB |
1786 | echo "TARGET_ARCH_SH4=yes" >> config.mak |
1787 | echo "#define ARCH_SH4 1" >> $TMPH | |
cc6a90dd | 1788 | elif test "$arch" = "parisc" ; then |
67860b26 SH |
1789 | echo "TARGET_ARCH_PARISC=yes" >> config.mak |
1790 | echo "#define ARCH_PARISC 1" >> $TMPH | |
cc6a90dd | 1791 | elif test "$arch" = "s390" ; then |
67860b26 SH |
1792 | echo "TARGET_ARCH_S390=yes" >> config.mak |
1793 | echo "#define ARCH_S390 1" >> $TMPH | |
cc6a90dd | 1794 | elif test "$arch" = "m68k" ; then |
67860b26 SH |
1795 | echo "TARGET_ARCH_M68K=yes" >> config.mak |
1796 | echo "#define ARCH_M68K 1" >> $TMPH | |
cc6a90dd | 1797 | elif test "$arch" = "ia64" ; then |
67860b26 SH |
1798 | echo "TARGET_ARCH_IA64=yes" >> config.mak |
1799 | echo "#define ARCH_IA64 1" >> $TMPH | |
cc6a90dd | 1800 | elif test "$arch" = "bfin" ; then |
81a9b052 MB |
1801 | echo "TARGET_ARCH_BFIN=yes" >> config.mak |
1802 | echo "#define ARCH_BFIN 1" >> $TMPH | |
bdb2e37c | 1803 | fi |
a4adb608 | 1804 | echo "#define TUNECPU $TUNECPU" >> $TMPH |
0f3cb305 FB |
1805 | if test "$bigendian" = "yes" ; then |
1806 | echo "WORDS_BIGENDIAN=yes" >> config.mak | |
1807 | echo "#define WORDS_BIGENDIAN 1" >> $TMPH | |
91d1f1a4 | 1808 | fi |
d2a9bddd MN |
1809 | if test "$inttypes" != "yes" ; then |
1810 | echo "#define EMULATE_INTTYPES 1" >> $TMPH | |
7f965c1c | 1811 | fi |
b5c950c4 | 1812 | if test "$emu_fast_int" = "yes" ; then |
19d053c5 | 1813 | echo "#define EMULATE_FAST_INT 1" >> $TMPH |
b5c950c4 | 1814 | fi |
57514323 | 1815 | if test "$mmx" = "yes" ; then |
980fc7b8 | 1816 | echo "TARGET_MMX=yes" >> config.mak |
045ed63f | 1817 | echo "#define HAVE_MMX 1" >> $TMPH |
e82c5a8c | 1818 | echo "#define __CPU__ 586" >> $TMPH |
de6d9b64 | 1819 | fi |
e7768fc5 GP |
1820 | if test "$cmov" = "yes" ; then |
1821 | echo "TARGET_CMOV=yes" >> config.mak | |
1822 | echo "#define HAVE_CMOV 1" >> $TMPH | |
1823 | fi | |
94e4c3a3 GP |
1824 | if test "$cmov_is_fast" = "yes" ; then |
1825 | echo "TARGET_CMOV_IS_FAST=yes" >> config.mak | |
1826 | echo "#define CMOV_IS_FAST 1" >> $TMPH | |
1827 | fi | |
1839e854 SS |
1828 | if test "$armv5te" = "yes" ; then |
1829 | echo "TARGET_ARMV5TE=yes" >> config.mak | |
1830 | echo "#define HAVE_ARMV5TE 1" >> $TMPH | |
1831 | fi | |
eba9ae3c GB |
1832 | if test "$iwmmxt" = "yes" ; then |
1833 | echo "TARGET_IWMMXT=yes" >> config.mak | |
1834 | echo "#define HAVE_IWMMXT 1" >> $TMPH | |
1835 | fi | |
d46aba26 LS |
1836 | if test "$mmi" = "yes" ; then |
1837 | echo "TARGET_MMI=yes" >> config.mak | |
1838 | echo "#define HAVE_MMI 1" >> $TMPH | |
1839 | fi | |
87ea51e0 | 1840 | |
ab6c65f6 BF |
1841 | if test "$altivec" = "yes" ; then |
1842 | echo "TARGET_ALTIVEC=yes" >> config.mak | |
1843 | echo "#define HAVE_ALTIVEC 1" >> $TMPH | |
f80f7964 | 1844 | fi |
44161118 | 1845 | |
9c3d33d6 MN |
1846 | if test "$pthreads" = "yes" ; then |
1847 | echo "HAVE_PTHREADS=yes" >> config.mak | |
1848 | echo "#define HAVE_PTHREADS 1" >> $TMPH | |
2450cff2 | 1849 | echo "#define HAVE_THREADS 1" >> $TMPH |
9c3d33d6 | 1850 | fi |
a86b921c | 1851 | if test "$sdl" = "yes" ; then |
6a1a892f FD |
1852 | echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak |
1853 | echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak | |
a86b921c | 1854 | fi |
146ea952 NB |
1855 | if test "$texi2html" = "yes"; then |
1856 | echo "BUILD_DOC=yes" >> config.mak | |
1857 | fi | |
5a872801 | 1858 | |
790c9ca7 | 1859 | sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'` |
6d9a2421 | 1860 | pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'` |
5a872801 LB |
1861 | lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'` |
1862 | lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'` | |
1863 | lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'` | |
1864 | ||
1865 | ||
1866 | ||
57514323 | 1867 | if test "$lshared" = "yes" ; then |
320d060a | 1868 | echo "#define BUILD_SHARED_AV 1" >> $TMPH |
0319c531 | 1869 | echo "BUILD_SHARED=yes" >> config.mak |
97006039 | 1870 | echo "PIC=-fPIC -DPIC" >> config.mak |
39503a27 | 1871 | echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak |
5a872801 | 1872 | echo "SPPVERSION=$lavc_version" >> config.mak |
39503a27 | 1873 | echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak |
5a872801 | 1874 | echo "LAVCVERSION=$lavc_version" >> config.mak |
39503a27 | 1875 | echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak |
5a872801 | 1876 | echo "LAVFVERSION=$lavf_version" >> config.mak |
39503a27 | 1877 | echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak |
5a872801 | 1878 | echo "LAVUVERSION=$lavu_version" >> config.mak |
790c9ca7 LA |
1879 | echo "SWSMAJOR=${sws_version%%.*}" >> config.mak |
1880 | echo "SWSVERSION=$sws_version" >> config.mak | |
4bdd05e7 | 1881 | echo "SLIBNAME=${SLIBNAME}" >> config.mak |
f3b60109 DB |
1882 | echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak |
1883 | echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak | |
5cb854e1 | 1884 | echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak |
0319c531 | 1885 | fi |
d7e27559 | 1886 | echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak |
ef0bc4c9 | 1887 | echo "EXTRALIBS=$extralibs" >> config.mak |
d2845d68 | 1888 | |
44161118 MR |
1889 | enabled_any $ENCODER_LIST && enable encoders |
1890 | enabled_any $DECODER_LIST && enable decoders | |
1891 | enabled_any $MUXER_LIST && enable muxers | |
1892 | enabled_any $DEMUXER_LIST && enable demuxers | |
f956e129 | 1893 | |
44161118 MR |
1894 | print_config HAVE_ $TMPH config.mak $HAVE_LIST |
1895 | print_config CONFIG_ $TMPH config.mak $CONFIG_LIST | |
8ac17293 | 1896 | |
732d9245 | 1897 | if test "$mingw32" = "yes" ; then |
2f30a81d | 1898 | echo "CONFIG_MINGW=yes" >> config.mak |
16806499 MN |
1899 | echo "HAVE_W32THREADS=yes" >> config.mak |
1900 | echo "#define HAVE_W32THREADS 1" >> $TMPH | |
2450cff2 | 1901 | echo "#define HAVE_THREADS 1" >> $TMPH |
7eea5766 | 1902 | echo "#ifndef __MINGW32__" >> $TMPH |
732d9245 | 1903 | echo "#define __MINGW32__ 1" >> $TMPH |
7eea5766 | 1904 | echo "#endif" >> $TMPH |
3f027ca7 FB |
1905 | fi |
1906 | ||
ac44871c | 1907 | if test "$mingwce" = "yes" ; then |
2f30a81d | 1908 | echo "CONFIG_MINGW=yes" >> config.mak |
ac44871c GB |
1909 | echo "#define CONFIG_WINCE 1" >> $TMPH |
1910 | echo "CONFIG_WINCE=yes" >> config.mak | |
1911 | echo "#ifndef __MINGW32__" >> $TMPH | |
1912 | echo "#define __MINGW32__ 1" >> $TMPH | |
1913 | echo "#endif" >> $TMPH | |
1914 | fi | |
1915 | ||
f3ec2d46 SG |
1916 | if test "$os2" = "yes" ; then |
1917 | echo "#define CONFIG_OS2 1" >> $TMPH | |
1918 | echo "CONFIG_OS2=yes" >> config.mak | |
e2a5fd20 MN |
1919 | echo "HAVE_OS2THREADS=yes" >> config.mak |
1920 | echo "#define HAVE_OS2THREADS 1" >> $TMPH | |
1921 | echo "#define HAVE_THREADS 1" >> $TMPH | |
f3ec2d46 SG |
1922 | fi |
1923 | ||
b2828252 | 1924 | if test "$targetos" = "SunOS" ; then |
6e023978 RS |
1925 | echo "#define CONFIG_SUNOS 1" >> $TMPH |
1926 | fi | |
1927 | ||
b2828252 | 1928 | if test "$targetos" = "BeOS" ; then |
2450cff2 FR |
1929 | echo "HAVE_BEOSTHREADS=yes" >> config.mak |
1930 | echo "#define HAVE_BEOSTHREADS 1" >> $TMPH | |
1931 | echo "#define HAVE_THREADS 1" >> $TMPH | |
1932 | fi | |
1933 | ||
b2828252 | 1934 | if test "$targetos" = "Darwin"; then |
90cee0c3 MN |
1935 | echo "#define CONFIG_DARWIN 1" >> $TMPH |
1936 | echo "CONFIG_DARWIN=yes" >> config.mak | |
1937 | fi | |
1938 | ||
4baca069 PG |
1939 | if test "$need_inet_aton" = "yes" ; then |
1940 | echo "NEED_INET_ATON=yes" >> config.mak | |
1941 | fi | |
1942 | ||
c13e1abd FH |
1943 | echo "#define restrict $_restrict" >> $TMPH |
1944 | ||
bb801c97 MN |
1945 | if test "$optimize" = "small"; then |
1946 | echo "#define always_inline" >> $TMPH | |
e5f28e8f | 1947 | echo "#define CONFIG_SMALL 1" >> $TMPH |
bb801c97 MN |
1948 | fi |
1949 | ||
0f3cb305 FB |
1950 | # build tree in object directory if source path is different from current one |
1951 | if test "$source_path_used" = "yes" ; then | |
2a4e872b AS |
1952 | DIRS="\ |
1953 | doc \ | |
1954 | libavformat \ | |
1955 | libavcodec \ | |
1956 | libavcodec/alpha \ | |
1957 | libavcodec/armv4l \ | |
c4e96cee | 1958 | libavcodec/bfin \ |
2a4e872b AS |
1959 | libavcodec/i386 \ |
1960 | libavcodec/sparc \ | |
1961 | libavcodec/mlib \ | |
1962 | libavcodec/ppc \ | |
1963 | libavcodec/liba52 \ | |
6d9a2421 | 1964 | libpostproc \ |
2a4e872b | 1965 | libavutil \ |
790c9ca7 | 1966 | libswscale \ |
2a4e872b AS |
1967 | tests \ |
1968 | vhook \ | |
1969 | " | |
1970 | FILES="\ | |
1971 | Makefile \ | |
997baf01 | 1972 | common.mak \ |
2a4e872b AS |
1973 | libavformat/Makefile \ |
1974 | libavcodec/Makefile \ | |
6d9a2421 | 1975 | libpostproc/Makefile \ |
2a4e872b | 1976 | libavutil/Makefile \ |
790c9ca7 | 1977 | libswscale/Makefile \ |
2a4e872b AS |
1978 | tests/Makefile \ |
1979 | vhook/Makefile \ | |
1980 | doc/Makefile \ | |
1981 | doc/texi2pod.pl \ | |
1982 | " | |
0f3cb305 FB |
1983 | for dir in $DIRS ; do |
1984 | mkdir -p $dir | |
1985 | done | |
1986 | for f in $FILES ; do | |
281a74da | 1987 | ln -sf "$source_path/$f" $f |
0f3cb305 FB |
1988 | done |
1989 | fi | |
997baf01 MR |
1990 | echo "SRC_PATH=\"$source_path\"" >> config.mak |
1991 | echo "SRC_PATH_BARE=$source_path" >> config.mak | |
1992 | echo "BUILD_ROOT=\"$PWD\"" >> config.mak | |
0f3cb305 | 1993 | |
d663a1fd | 1994 | if test "$amr_wb" = "yes" ; then |
d663a1fd MN |
1995 | echo |
1996 | echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204" | |
1997 | echo "V5.1.0 from " | |
1998 | echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip" | |
1999 | echo "and extracted the source to libavcodec/amrwb_float" | |
d663a1fd MN |
2000 | fi |
2001 | ||
891f64b3 | 2002 | if test "$amr_nb" = "yes" ; then |
891f64b3 | 2003 | echo |
6eb07e73 DB |
2004 | echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104" |
2005 | echo "REL-5 V5.1.0 from " | |
c51c4fa0 | 2006 | echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip" |
6eb07e73 DB |
2007 | echo "and extracted the source to libavcodec/amr_float" |
2008 | echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h" | |
2009 | fi | |
2010 | ||
bc634f6f | 2011 | if test "$amr_nb_fixed" = "yes" ; then |
b9ca6d47 | 2012 | echo |
bc634f6f ZK |
2013 | echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 " |
2014 | echo "REL-5 version 5.1.0 from " | |
c51c4fa0 | 2015 | echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip" |
891f64b3 | 2016 | echo "and extracted src to libavcodec/amr" |
bc634f6f ZK |
2017 | echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile." |
2018 | echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO" | |
891f64b3 | 2019 | fi |
2020 | ||
2a515c08 TM |
2021 | if test "$amr_if2" = "yes" ; then |
2022 | echo "AMR_CFLAGS=-DIF2=1" >> config.mak | |
2023 | fi | |
2024 | ||
8156056e | 2025 | # Apparently it's not possible to portably echo a backslash. |
4454dc1b | 2026 | if test "$asmalign_pot" = "yes" ; then |
8156056e | 2027 | printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH |
4454dc1b | 2028 | else |
8156056e | 2029 | printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH |
4454dc1b JD |
2030 | fi |
2031 | ||
bc634f6f | 2032 | |
fe84b3f0 | 2033 | # "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z" |
55006fc0 | 2034 | for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do |
44161118 | 2035 | ucname="`toupper $codec`" |
a8d04fba MR |
2036 | config_name="CONFIG_$ucname" |
2037 | enabled_name="ENABLE_$ucname" | |
2038 | if enabled $codec; then | |
2039 | echo "#define $config_name 1" >> $TMPH | |
2040 | echo "#define $enabled_name 1" >> $TMPH | |
2041 | echo "$config_name=yes" >> config.mak | |
2042 | else | |
2043 | echo "#define $enabled_name 0" >> $TMPH | |
2044 | fi | |
009cf97d MN |
2045 | done |
2046 | ||
9cb2cf10 DB |
2047 | # Do not overwrite config.h if unchanged to avoid superfluous rebuilds. |
2048 | diff $TMPH config.h >/dev/null 2>&1 | |
214c5f26 | 2049 | if test "$?" != "0" ; then |
9cb2cf10 DB |
2050 | mv -f $TMPH config.h |
2051 | else | |
2052 | echo "config.h is unchanged" | |
2053 | fi | |
3d204385 | 2054 | |
f3ec2d46 | 2055 | rm -f $TMPO $TMPC $TMPE $TMPS $TMPH |
def4272a AJ |
2056 | |
2057 | ||
29799f8b | 2058 | # build pkg-config files libav*.pc and libpostproc.pc |
31abdc45 | 2059 | # libavutil.pc |
2060 | cat <<EOF >libavutil.pc | |
2266e085 | 2061 | prefix=$PREFIX |
a94e666c | 2062 | exec_prefix=\${prefix} |
31abdc45 | 2063 | libdir=\${exec_prefix}/lib |
a94e666c | 2064 | includedir=\${prefix}/include |
31abdc45 | 2065 | |
2066 | Name: libavutil | |
2067 | Description: FFmpeg utility library | |
2068 | Version: $lavu_version | |
115329f1 | 2069 | Requires: |
31abdc45 | 2070 | Conflicts: |
2071 | Libs: -L\${libdir} -lavutil | |
2072 | Cflags: -I\${includedir} -I\${includedir}/ffmpeg | |
2073 | EOF | |
2074 | ||
2075 | cat <<EOF >libavutil-uninstalled.pc | |
2076 | prefix= | |
2077 | exec_prefix= | |
2078 | libdir=\${pcfiledir}/libavutil | |
2079 | includedir=\${pcfiledir}/libavutil | |
2080 | ||
2081 | Name: libavutil | |
2082 | Description: FFmpeg utility library | |
2083 | Version: $lavu_version | |
115329f1 | 2084 | Requires: |
31abdc45 | 2085 | Conflicts: |
2086 | Libs: \${libdir}/${LIBPREF}avutil${LIBSUF} | |
2087 | Cflags: -I\${includedir} | |
2088 | EOF | |
def4272a AJ |
2089 | |
2090 | # libavcodec.pc | |
2091 | cat <<EOF >libavcodec.pc | |
2266e085 | 2092 | prefix=$PREFIX |
a94e666c | 2093 | exec_prefix=\${prefix} |
def4272a | 2094 | libdir=\${exec_prefix}/lib |
a94e666c | 2095 | includedir=\${prefix}/include |
def4272a AJ |
2096 | |
2097 | Name: libavcodec | |
2098 | Description: FFmpeg codec library | |
31abdc45 | 2099 | Version: $lavc_version |
c99dd233 | 2100 | Requires: $pkg_requires libavutil = $lavu_version |
def4272a AJ |
2101 | Conflicts: |
2102 | Libs: -L\${libdir} -lavcodec $extralibs | |
2103 | Cflags: -I\${includedir} -I\${includedir}/ffmpeg | |
2104 | EOF | |
2105 | ||
2106 | cat <<EOF >libavcodec-uninstalled.pc | |
2107 | prefix= | |
2108 | exec_prefix= | |
2109 | libdir=\${pcfiledir}/libavcodec | |
2110 | includedir=\${pcfiledir}/libavcodec | |
2111 | ||
2112 | Name: libavcodec | |
2113 | Description: FFmpeg codec library | |
31abdc45 | 2114 | Version: $lavc_version |
c99dd233 | 2115 | Requires: $pkg_requires libavutil = $lavu_version |
def4272a AJ |
2116 | Conflicts: |
2117 | Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs | |
2118 | Cflags: -I\${includedir} | |
2119 | EOF | |
2120 | ||
2121 | # libavformat.pc | |
2122 | cat <<EOF >libavformat.pc | |
2266e085 | 2123 | prefix=$PREFIX |
a94e666c | 2124 | exec_prefix=\${prefix} |
def4272a | 2125 | libdir=\${exec_prefix}/lib |
a94e666c | 2126 | includedir=\${prefix}/include |
def4272a AJ |
2127 | |
2128 | Name: libavformat | |
2129 | Description: FFmpeg container format library | |
31abdc45 | 2130 | Version: $lavf_version |
c99dd233 | 2131 | Requires: $pkg_requires libavcodec = $lavc_version |
def4272a AJ |
2132 | Conflicts: |
2133 | Libs: -L\${libdir} -lavformat $extralibs | |
2134 | Cflags: -I\${includedir} -I\${includedir}/ffmpeg | |
2135 | EOF | |
2136 | ||
2137 | cat <<EOF >libavformat-uninstalled.pc | |
2138 | prefix= | |
2139 | exec_prefix= | |
2140 | libdir=\${pcfiledir}/libavformat | |
2141 | includedir=\${pcfiledir}/libavformat | |
2142 | ||
2143 | Name: libavformat | |
2144 | Description: FFmpeg container format library | |
31abdc45 | 2145 | Version: $lavf_version |
c99dd233 | 2146 | Requires: $pkg_requires libavcodec = $lavc_version |
def4272a AJ |
2147 | Conflicts: |
2148 | Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs | |
2149 | Cflags: -I\${includedir} | |
2150 | EOF | |
2151 | ||
2152 | ||
2153 | # libpostproc.pc | |
2154 | cat <<EOF >libpostproc.pc | |
2266e085 | 2155 | prefix=$PREFIX |
a94e666c | 2156 | exec_prefix=\${prefix} |
def4272a | 2157 | libdir=\${exec_prefix}/lib |
a94e666c | 2158 | includedir=\${prefix}/include |
def4272a AJ |
2159 | |
2160 | Name: libpostproc | |
2161 | Description: FFmpeg post processing library | |
31abdc45 | 2162 | Version: $lavc_version |
115329f1 | 2163 | Requires: |
def4272a AJ |
2164 | Conflicts: |
2165 | Libs: -L\${libdir} -lpostproc | |
2166 | Cflags: -I\${includedir} -I\${includedir}/postproc | |
2167 | EOF | |
2168 | ||
2169 | cat <<EOF >libpostproc-uninstalled.pc | |
2170 | prefix= | |
2171 | exec_prefix= | |
6d9a2421 DB |
2172 | libdir=\${pcfiledir}/libpostproc |
2173 | includedir=\${pcfiledir}/libpostproc | |
def4272a AJ |
2174 | |
2175 | Name: libpostproc | |
2176 | Description: FFmpeg post processing library | |
31abdc45 | 2177 | Version: $lavc_version |
115329f1 | 2178 | Requires: |
def4272a AJ |
2179 | Conflicts: |
2180 | Libs: \${libdir}/${LIBPREF}postproc${LIBSUF} | |
2181 | Cflags: -I\${includedir} | |
2182 | EOF | |
790c9ca7 | 2183 | |
6c0d0413 | 2184 | if test "$swscaler" != "no"; then |
2185 | sws_pc_libs="-L\${libdir} -lswscale" | |
2186 | sws_pc_uninstalled_libs="\${libdir}/${LIBPREF}swscale${LIBSUF}" | |
2187 | sws_pc_requires="$pkg_requires libavutil = $lavu_version" | |
2188 | else | |
2189 | sws_pc_libs="" | |
2190 | sws_pc_uninstalled_libs="" | |
2191 | sws_pc_requires="$pkg_requires libavcodec = $lavc_version" | |
2192 | fi | |
790c9ca7 LA |
2193 | # libswscale.pc |
2194 | cat <<EOF >libswscale.pc | |
2195 | prefix=$PREFIX | |
2196 | exec_prefix=\${prefix} | |
2197 | libdir=\${exec_prefix}/lib | |
2198 | includedir=\${prefix}/include | |
2199 | ||
2200 | Name: libswscale | |
2201 | Description: FFmpeg image rescaling library | |
2202 | Version: $sws_version | |
6c0d0413 | 2203 | Requires: $sws_pc_requires |
790c9ca7 | 2204 | Conflicts: |
6c0d0413 | 2205 | Libs: $sws_pc_libs |
790c9ca7 LA |
2206 | Cflags: -I\${includedir} -I\${includedir}/swscale |
2207 | EOF | |
2208 | ||
2209 | cat <<EOF >libswscale-uninstalled.pc | |
2210 | prefix= | |
2211 | exec_prefix= | |
2212 | libdir=\${pcfiledir}/libswscale | |
2213 | includedir=\${pcfiledir}/libswscale | |
2214 | ||
2215 | Name: libswscale | |
2216 | Description: FFmpeg image rescaling library | |
2217 | Version: $sws_version | |
6c0d0413 | 2218 | Requires: $sws_pc_requires |
790c9ca7 | 2219 | Conflicts: |
6c0d0413 | 2220 | Libs: $sws_pc_uninstalled_libs |
790c9ca7 LA |
2221 | Cflags: -I\${includedir} |
2222 | EOF |