a1c32a3e052d973aa5c18d671fad8e9c7b356fdf
[libav.git] / configure
1 #!/bin/sh
2 #
3 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
4 #
5
6 show_help(){
7 echo "Usage: configure [options]"
8 echo "Options: [defaults in brackets after descriptions]"
9 echo
10 echo "Standard options:"
11 echo " --help print this message"
12 echo " --prefix=PREFIX install in PREFIX [$prefix]"
13 echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
14 echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]"
15 echo " --mandir=DIR install man page in DIR [PREFIX/man]"
16 echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]"
17 echo " --enable-libogg enable Ogg support via libogg [default=no]"
18 echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]"
19 echo " --enable-theora enable Theora support via libtheora [default=no]"
20 echo " --enable-faad enable FAAD support via libfaad [default=no]"
21 echo " --enable-faadbin build FAAD support with runtime linking [default=no]"
22 echo " --enable-faac enable FAAC support via libfaac [default=no]"
23 echo " --enable-libgsm enable GSM support via libgsm [default=no]"
24 echo " --enable-xvid enable XviD support via xvidcore [default=no]"
25 echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
26 echo " --enable-mingw32 enable MinGW native/cross Windows compile"
27 echo " --enable-mingwce enable MinGW native/cross WinCE compile"
28 echo " --enable-a52 enable GPLed A52 support [default=no]"
29 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
30 echo " --enable-dts enable GPLed DTS support [default=no]"
31 echo " --enable-pp enable GPLed postprocessing support [default=no]"
32 echo " --enable-static build static libraries [default=yes]"
33 echo " --disable-static do not build static libraries [default=no]"
34 echo " --enable-shared build shared libraries [default=no]"
35 echo " --disable-shared do not build shared libraries [default=yes]"
36 echo " --enable-amr_nb enable amr_nb float audio codec"
37 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
38 echo " --enable-amr_wb enable amr_wb float audio codec"
39 echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
40 echo " --enable-sunmlib use Sun medialib [default=no]"
41 echo " --enable-pthreads use pthreads [default=no]"
42 echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
43 echo " and libraw1394 [default=no]"
44 echo " --enable-gpl allow use of GPL code, the resulting libav*"
45 echo " and ffmpeg will be under GPL [default=no]"
46 echo ""
47 echo "Advanced options (experts only):"
48 echo " --source-path=PATH path to source code [$source_path]"
49 echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
50 echo " --cc=CC use C compiler CC [$cc]"
51 echo " --make=MAKE use specified make [$make]"
52 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
53 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
54 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
55 echo " --build-suffix=SUFFIX suffix for application specific build []"
56 echo " --cpu=CPU force cpu to CPU [$cpu]"
57 echo " --tune=CPU tune code for a particular CPU"
58 echo " (may fail or perform badly on other CPUs)"
59 echo " --powerpc-perf-enable enable performance report on PPC"
60 echo " (requires enabling PMC)"
61 echo " --disable-mmx disable MMX usage"
62 echo " --disable-iwmmxt disable iwmmxt usage"
63 echo " --disable-altivec disable AltiVec usage"
64 echo " --disable-audio-oss disable OSS audio support [default=no]"
65 echo " --disable-audio-beos disable BeOS audio support [default=no]"
66 echo " --disable-v4l disable video4linux grabbing [default=no]"
67 echo " --disable-v4l2 disable video4linux2 grabbing [default=no]"
68 echo " --disable-bktr disable bktr video grabbing [default=no]"
69 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
70 echo " --disable-network disable network support [default=no]"
71 echo " --disable-zlib disable zlib [default=no]"
72 echo " --disable-lzo disable lzo [default=no]"
73 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
74 echo " --disable-vhook disable video hooking support"
75 echo " --enable-gprof enable profiling with gprof [$gprof]"
76 echo " --disable-debug disable debugging symbols"
77 echo " --disable-opts disable compiler optimizations"
78 echo " --disable-mpegaudio-hp faster (but less accurate)"
79 echo " MPEG audio decoding [default=no]"
80 echo " --disable-protocols disable I/O protocols support [default=no]"
81 echo " --disable-ffserver disable ffserver build"
82 echo " --disable-ffplay disable ffplay build"
83 echo " --enable-small optimize for size instead of speed"
84 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
85 echo " --disable-strip disable stripping of executables and shared libraries"
86 echo " --disable-encoder=NAME disables encoder NAME"
87 echo " --enable-encoder=NAME enables encoder NAME"
88 echo " --disable-decoder=NAME disables decoder NAME"
89 echo " --enable-decoder=NAME enables decoder NAME"
90 echo " --disable-encoders disables all encoders"
91 echo " --disable-decoders disables all decoders"
92 echo " --disable-muxers disables all muxers"
93 echo " --disable-demuxers disables all demuxers"
94 echo ""
95 echo "NOTE: Object files are built at the place where configure is launched."
96 exit 1
97 }
98
99 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
100 show_help
101 fi
102
103 # set temporary file name
104 if test ! -z "$TMPDIR" ; then
105 TMPDIR1="${TMPDIR}"
106 elif test ! -z "$TEMPDIR" ; then
107 TMPDIR1="${TEMPDIR}"
108 else
109 TMPDIR1="/tmp"
110 fi
111
112 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
113 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
114 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
115 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
116 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
117
118 # default parameters
119 prefix="/usr/local"
120 libdir=""
121 incdir=""
122 mandir=""
123 bindir=""
124 cross_prefix=""
125 cc="gcc"
126 ar="ar"
127 ranlib="ranlib"
128 make="make"
129 strip="strip"
130 cpu=`uname -m`
131 tune="generic"
132 powerpc_perf="no"
133 mmx="default"
134 iwmmxt="default"
135 altivec="default"
136 mmi="default"
137 case "$cpu" in
138 i386|i486|i586|i686|i86pc|BePC)
139 cpu="x86"
140 ;;
141 x86_64|amd64)
142 cpu="x86"
143 canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
144 if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
145 if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
146 cpu="x86_64"
147 fi
148 fi
149 ;;
150 # armv4l is a subset of armv5tel
151 armv4l|armv5tel)
152 cpu="armv4l"
153 ;;
154 alpha)
155 cpu="alpha"
156 ;;
157 "Power Macintosh"|ppc|powerpc)
158 cpu="powerpc"
159 ;;
160 mips|mipsel)
161 cpu="mips"
162 ;;
163 sun4u|sparc64)
164 cpu="sparc64"
165 ;;
166 sparc)
167 cpu="sparc"
168 ;;
169 sh4)
170 cpu="sh4"
171 ;;
172 parisc|parisc64)
173 cpu="parisc"
174 ;;
175 s390|s390x)
176 cpu="s390"
177 ;;
178 m68k)
179 cpu="m68k"
180 ;;
181 ia64)
182 cpu="ia64"
183 ;;
184 *)
185 cpu="unknown"
186 ;;
187 esac
188 gprof="no"
189 v4l="yes"
190 v4l2="yes"
191 bktr="no"
192 audio_oss="yes"
193 audio_beos="no"
194 dv1394="yes"
195 dc1394="no"
196 network="yes"
197 zlib="yes"
198 lzo="yes"
199 libgsm="no"
200 mp3lame="no"
201 libogg="no"
202 vorbis="no"
203 theora="no"
204 faad="no"
205 faadbin="no"
206 faac="no"
207 xvid="no"
208 x264="no"
209 a52="no"
210 a52bin="no"
211 dts="no"
212 pp="no"
213 mingw32="no"
214 mingwce="no"
215 cygwin="no"
216 os2="no"
217 lstatic="yes"
218 lshared="no"
219 optimize="yes"
220 debug="yes"
221 dostrip="yes"
222 installstrip="-s"
223 extralibs="-lm"
224 simpleidct="yes"
225 bigendian="no"
226 inttypes="yes"
227 emu_fast_int="no"
228 vhook="default"
229 dlfcn="no"
230 dlopen="no"
231 mpegaudio_hp="yes"
232 SHFLAGS='-shared -Wl,-soname,$@'
233 netserver="no"
234 need_inet_aton="no"
235 protocols="yes"
236 ffserver="yes"
237 ffplay="yes"
238 LIBOBJFLAGS=""
239 FFLDFLAGS=-Wl,--warn-common
240 FFSLDFLAGS=-Wl,-E
241 LDCONFIG="ldconfig"
242 LIBPREF="lib"
243 LIBSUF=".a"
244 LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
245 SLIBPREF="lib"
246 SLIBSUF=".so"
247 SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
248 SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
249 SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
250 EXESUF=""
251 BUILDSUF=""
252 amr_nb="no"
253 amr_wb="no"
254 amr_nb_fixed="no"
255 amr_if2="no"
256 sunmlib="no"
257 pthreads="no"
258 gpl="no"
259 memalignhack="no"
260 muxers="yes"
261 demuxers="yes"
262
263 # OS specific
264 targetos=`uname -s`
265 case $targetos in
266 BeOS)
267 prefix="/boot/home/config"
268 # helps building libavcodec
269 CFLAGS="$CFLAGS -DPIC -fomit-frame-pointer"
270 # 3 gcc releases known for BeOS, each with ugly bugs
271 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
272 case "$gcc_version" in
273 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
274 mmx="no"
275 ;;
276 *20010315*) echo "BeBits gcc"
277 CFLAGS="$CFLAGS -fno-expensive-optimizations"
278 ;;
279 esac
280 SHFLAGS=-nostart
281 # disable Linux things
282 audio_oss="no"
283 v4l="no"
284 v4l2="no"
285 dv1394="no"
286 # enable BeOS things
287 audio_beos="yes"
288 # no need for libm, but the inet stuff
289 # Check for BONE
290 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
291 extralibs="-lbind -lsocket"
292 else
293 netserver="yes"
294 need_inet_aton="yes"
295 extralibs="-lnet"
296 fi ;;
297 SunOS)
298 v4l="no"
299 v4l2="no"
300 audio_oss="no"
301 dv1394="no"
302 make="gmake"
303 FFLDFLAGS=""
304 FFSLDFLAGS=""
305 need_inet_aton="yes"
306 extralibs="$extralibs -lsocket -lnsl"
307 ;;
308 NetBSD)
309 v4l="no"
310 v4l2="no"
311 bktr="yes"
312 audio_oss="yes"
313 dv1394="no"
314 make="gmake"
315 FFLDFLAGS="$FFLDFLAGS -export-dynamic"
316 extralibs="$extralibs -lossaudio"
317 ;;
318 OpenBSD)
319 v4l="no"
320 v4l2="no"
321 bktr="yes"
322 audio_oss="yes"
323 dv1394="no"
324 make="gmake"
325 LIBOBJFLAGS="\$(PIC)"
326 FFLDFLAGS="$FFLDFLAGS -export-dynamic -pthread"
327 LDCONFIG="ldconfig -m \$(libdir)"
328 extralibs="$extralibs -lossaudio"
329 ;;
330 FreeBSD)
331 v4l="no"
332 v4l2="no"
333 bktr="yes"
334 audio_oss="yes"
335 dv1394="no"
336 make="gmake"
337 CFLAGS="$CFLAGS -pthread"
338 FFLDFLAGS="$FFLDFLAGS -export-dynamic -pthread"
339 ;;
340 BSD/OS)
341 v4l="no"
342 v4l2="no"
343 bktr="yes"
344 audio_oss="yes"
345 dv1394="no"
346 extralibs="-lpoll -lgnugetopt -lm"
347 make="gmake"
348 strip="strip -d"
349 installstrip=""
350 ;;
351 Darwin)
352 cc="cc"
353 v4l="no"
354 v4l2="no"
355 audio_oss="no"
356 dv1394="no"
357 SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
358 extralibs=""
359 darwin="yes"
360 strip="strip -x"
361 installstrip=""
362 FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
363 SLIBSUF=".dylib"
364 SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
365 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
366 FFSLDFLAGS=-Wl,-bind_at_load
367 ;;
368 MINGW32*)
369 # Note: the rest of the mingw32 config is done afterwards as mingw32
370 # can be forced on the command line for Linux cross compilation.
371 mingw32="yes"
372 ;;
373 CYGWIN*)
374 v4l="no"
375 v4l2="no"
376 audio_oss="yes"
377 dv1394="no"
378 vhook="no"
379 extralibs=""
380 cygwin="yes"
381 EXESUF=".exe"
382 ;;
383 Linux)
384 FFLDFLAGS="$FFLDFLAGS -rdynamic -Wl,--as-needed -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil"
385 ;;
386 IRIX*)
387 ranlib="echo ignoring ranlib"
388 v4l="no"
389 v4l2="no"
390 audio_oss="no"
391 make="gmake"
392 ;;
393 OS/2)
394 TMPE=$TMPE".exe"
395 ar="emxomfar -p128"
396 ranlib="echo ignoring ranlib"
397 strip="echo ignoring strip"
398 CFLAGS="$CFLAGS -Zomf"
399 FFLDFLAGS="-Zomf -Zstack 16384 -s"
400 SHFLAGS="-Zdll -Zomf"
401 FFSLDFLAGS=""
402 LIBPREF=""
403 LIBSUF=".lib"
404 SLIBPREF=""
405 SLIBSUF=".dll"
406 EXESUF=".exe"
407 extralibs=""
408 pkg_requires=""
409 v4l="no"
410 v4l2="no"
411 audio_oss="no"
412 dv1394="no"
413 ffserver="no"
414 vhook="no"
415 os2="yes"
416
417 ;;
418 *) ;;
419 esac
420
421 # From MPlayer configure. We need TARGET_OS available
422 # to the Makefile, so it can distinguish between flavors
423 # of AltiVec on PowerPC.
424 TARGET_OS=`( uname -s ) 2>&1`
425 case "$TARGET_OS" in
426 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS)
427 ;;
428 IRIX*)
429 TARGET_OS=IRIX
430 ;;
431 HP-UX*)
432 TARGET_OS=HP-UX
433 ;;
434 [cC][yY][gG][wW][iI][nN]*)
435 TARGET_OS=CYGWIN
436 ;;
437 *)
438 TARGET_OS="$TARGET_OS-UNKNOWN"
439 ;;
440 esac
441
442 # find source path
443 source_path="`dirname $0`"
444 source_path_used="yes"
445 if test -z "$source_path" -o "$source_path" = "." ; then
446 source_path=`pwd`
447 source_path_used="no"
448 else
449 source_path="`cd \"$source_path\"; pwd`"
450 fi
451
452 FFMPEG_CONFIGURATION=" "
453 for opt do
454 FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
455 done
456
457 CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
458
459 for opt do
460 case "$opt" in
461 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
462 ;;
463 --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
464 ;;
465 --incdir=*) incdir=`echo $opt | cut -d '=' -f 2`;
466 ;;
467 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
468 ;;
469 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
470 ;;
471 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
472 ;;
473 --cc=*) cc=`echo $opt | cut -d '=' -f 2-`
474 ;;
475 --make=*) make=`echo $opt | cut -d '=' -f 2`
476 ;;
477 --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
478 ;;
479 --extra-ldflags=*) FFLDFLAGS="$FFLDFLAGS ${opt#--extra-ldflags=}"
480 ;;
481 --extra-libs=*) extralibs=${opt#--extra-libs=}
482 ;;
483 --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
484 ;;
485 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
486 ;;
487 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
488 ;;
489 --powerpc-perf-enable) powerpc_perf="yes"
490 ;;
491 --disable-mmx) mmx="no"
492 ;;
493 --disable-iwmmxt) iwmmxt="no"
494 ;;
495 --disable-altivec) altivec="no"
496 ;;
497 --enable-gprof) gprof="yes"
498 ;;
499 --disable-v4l) v4l="no"
500 ;;
501 --disable-v4l2) v4l2="no"
502 ;;
503 --disable-bktr) bktr="no"
504 ;;
505 --disable-audio-oss) audio_oss="no"
506 ;;
507 --disable-audio-beos) audio_beos="no"
508 ;;
509 --disable-dv1394) dv1394="no"
510 ;;
511 --disable-network) network="no"; ffserver="no"
512 ;;
513 --disable-zlib) zlib="no"
514 ;;
515 --disable-lzo) lzo="no"
516 ;;
517 --enable-a52) a52="yes"
518 ;;
519 --enable-a52bin) a52bin="yes"
520 ;;
521 --enable-dts) dts="yes"
522 extralibs="$extralibs -ldts"
523 ;;
524 --enable-pp) pp="yes"
525 ;;
526 --enable-libgsm) libgsm="yes"
527 extralibs="$extralibs -lgsm"
528 ;;
529 --enable-mp3lame) mp3lame="yes"
530 extralibs="$extralibs -lmp3lame"
531 ;;
532 --enable-libogg) libogg="yes"
533 extralibs="$extralibs -logg"
534 pkg_requires="$pkg_requires ogg >= 1.1"
535 ;;
536 --enable-vorbis) vorbis="yes"
537 extralibs="$extralibs -lvorbis -lvorbisenc"
538 pkg_requires="$pkg_requires vorbis vorbisenc"
539 ;;
540 --enable-theora) theora="yes"
541 extralibs="$extralibs -ltheora"
542 pkg_requires="$pkg_requires theora"
543 ;;
544 --enable-faad) faad="yes"
545 extralibs="$extralibs -lfaad"
546 ;;
547 --enable-faadbin) faadbin="yes"
548 ;;
549 --enable-faac) faac="yes"
550 extralibs="$extralibs -lfaac"
551 ;;
552 --enable-xvid) xvid="yes"
553 extralibs="$extralibs -lxvidcore"
554 ;;
555 --enable-x264) x264="yes"
556 extralibs="$extralibs -lx264"
557 ;;
558 --enable-dc1394) dc1394="yes"
559 extralibs="$extralibs -ldc1394_control -lraw1394"
560 pkg_requires="$pkg_requires libraw1394"
561 ;;
562 --disable-vhook) vhook="no"
563 ;;
564 --disable-simple_idct) simpleidct="no"
565 ;;
566 --enable-mingw32) mingw32="yes"
567 ;;
568 --enable-mingwce) mingwce="yes"
569 ;;
570 --enable-static) lstatic="yes"
571 ;;
572 --disable-static) lstatic="no"
573 ;;
574 --enable-shared) lshared="yes"
575 ;;
576 --disable-shared) lshared="no"
577 ;;
578 --disable-debug) debug="no"
579 ;;
580 --disable-opts) optimize="no"
581 ;;
582 --disable-mpegaudio-hp) mpegaudio_hp="no"
583 ;;
584 --disable-protocols) protocols="no"; network="no"; ffserver="no"
585 ;;
586 --disable-ffserver) ffserver="no"
587 ;;
588 --disable-ffplay) ffplay="no"
589 ;;
590 --enable-small) optimize="small"
591 ;;
592 --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
593 ;;
594 --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
595 ;;
596 --enable-amr_wb) amr="yes"; amr_wb="yes"
597 ;;
598 --enable-amr_if2) amr="yes"; amr_if2="yes"
599 ;;
600 --enable-sunmlib) sunmlib="yes"
601 ;;
602 --enable-pthreads) pthreads="yes"
603 ;;
604 --enable-gpl) gpl="yes"
605 ;;
606 --enable-memalign-hack) memalignhack="yes"
607 ;;
608 --disable-strip) dostrip="no"
609 ;;
610 --enable-encoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-encoder=}_encoder"
611 ;;
612 --enable-decoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-decoder=}_decoder"
613 ;;
614 --disable-encoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-encoder=}_encoder##\"`"
615 ;;
616 --disable-decoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-decoder=}_decoder##\"`"
617 ;;
618 --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
619 ;;
620 --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`"
621 ;;
622 --disable-muxers) muxers="no"; ffserver="no"
623 ;;
624 --disable-demuxers) demuxers="no"
625 ;;
626 --help) show_help
627 ;;
628 *)
629 echo "Unknown option \"$opt\"."
630 echo "See $0 --help for available options."
631 exit 1
632 ;;
633 esac
634 done
635
636
637 # Combine FFLDFLAGS and the LDFLAGS environment variable
638 LDFLAGS="$FFLDFLAGS $LDFLAGS"
639
640 # we need to build at least one lib type
641 if test "$lstatic" = "no" && test "$lshared" = "no" ; then
642 cat <<EOF
643 At least one library type must be built.
644 Specify --enable-static to build the static libraries or --enable-shared to
645 build the shared libraries as well. To only build the shared libraries specify
646 --disable-static in addition to --enable-shared.
647 EOF
648 exit 1;
649 fi
650
651 if test "$theora" = "yes" ; then
652 if test "$libogg" = "no"; then
653 echo "libogg must be enabled to enable Theora."
654 fail="yes"
655 theora="no"
656 fi
657 fi
658
659 if test "$vorbis" = "yes" ; then
660 if test "$libogg" = "no"; then
661 echo "libogg must be enabled to enable Vorbis."
662 fail="yes"
663 vorbis="no"
664 fi
665 fi
666
667 if test "$gpl" != "yes"; then
668 if test "$pp" != "no"; then
669 echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
670 fail="yes"
671 fi
672
673 if test "$a52" != "no" -o "$a52bin" != "no"; then
674 echo "liba52 is under GPL and --enable-gpl is not specified."
675 fail="yes"
676 fi
677
678 if test "$xvid" != "no"; then
679 echo "libxvidcore is under GPL and --enable-gpl is not specified."
680 fail="yes"
681 fi
682
683 if test "$x264" != "no"; then
684 echo "x264 is under GPL and --enable-gpl is not specified."
685 fail="yes"
686 fi
687
688 if test "$dts" != "no"; then
689 echo "libdts is under GPL and --enable-gpl is not specified."
690 fail="yes"
691 fi
692
693 if test "$faad" != "no" -o "$faadbin" != "no"; then
694 cat > $TMPC << EOF
695 #include <faad.h>
696 int main( void ) { return 0; }
697 EOF
698
699 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
700 cat > $TMPC << EOF
701 #include <faad.h>
702 #ifndef FAAD2_VERSION
703 ok faad1
704 #endif
705 int main( void ) { return 0; }
706 EOF
707 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
708 echo "FAAD2 is under GPL and --enable-gpl is not specified."
709 fail="yes"
710 fi
711 else
712 faad="no"
713 faadbin="no"
714 echo "FAAD test failed."
715 fi
716 fi
717
718
719 if test "$fail" = "yes"; then
720 exit 1
721 fi
722 fi
723
724 # compute MMX state
725 if test $mmx = "default"; then
726 if test $cpu = "x86" -o $cpu = "x86_64"; then
727 mmx="yes"
728 else
729 mmx="no"
730 fi
731 fi
732
733 # check iwmmxt support
734 if test $iwmmxt = "default" -a $cpu = "armv4l"; then
735 cat > $TMPC << EOF
736 int main(void) {
737 __asm__ __volatile__ ("wunpckelub wr6, wr4");
738 }
739 EOF
740
741 iwmmxt=no
742 if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
743 iwmmxt=yes
744 fi
745 fi
746
747 #Darwin CC versions
748 needmdynamicnopic="no"
749 if test $targetos = Darwin; then
750 if test -n "`$cc -v 2>&1 | grep xlc`"; then
751 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
752 else
753 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
754 case "$gcc_version" in
755 *2.95*)
756 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
757 ;;
758 *[34].*)
759 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
760 if test "$lshared" = no; then
761 needmdynamicnopic="yes"
762 fi
763 ;;
764 *)
765 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
766 if test "$lshared" = no; then
767 needmdynamicnopic="yes"
768 fi
769 ;;
770 esac
771 fi
772 fi
773
774 # Can only do AltiVec on PowerPC
775 if test $altivec = "default"; then
776 if test $cpu = "powerpc"; then
777 altivec="yes"
778 else
779 altivec="no"
780 fi
781 fi
782
783 # Add processor-specific flags
784 TUNECPU="generic"
785 POWERPCMODE="32bits"
786 if test $tune != "generic"; then
787 case $tune in
788 601|ppc601|PowerPC601)
789 CFLAGS="$CFLAGS -mcpu=601"
790 if test $altivec = "yes"; then
791 echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
792 fi
793 TUNECPU=ppc601
794 ;;
795 603*|ppc603*|PowerPC603*)
796 CFLAGS="$CFLAGS -mcpu=603"
797 if test $altivec = "yes"; then
798 echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
799 fi
800 TUNECPU=ppc603
801 ;;
802 604*|ppc604*|PowerPC604*)
803 CFLAGS="$CFLAGS -mcpu=604"
804 if test $altivec = "yes"; then
805 echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
806 fi
807 TUNECPU=ppc604
808 ;;
809 G3|g3|75*|ppc75*|PowerPC75*)
810 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
811 if test $altivec = "yes"; then
812 echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
813 fi
814 TUNECPU=ppc750
815 ;;
816 G4|g4|745*|ppc745*|PowerPC745*)
817 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
818 if test $altivec = "no"; then
819 echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
820 fi
821 TUNECPU=ppc7450
822 ;;
823 74*|ppc74*|PowerPC74*)
824 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
825 if test $altivec = "no"; then
826 echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
827 fi
828 TUNECPU=ppc7400
829 ;;
830 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
831 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
832 if test $altivec = "no"; then
833 echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
834 fi
835 TUNECPU=ppc970
836 POWERPCMODE="64bits"
837 ;;
838 i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
839 CFLAGS="$CFLAGS -march=$tune"
840 ;;
841 *)
842 echo "WARNING: Unknown CPU \"$tune\", ignored."
843 ;;
844 esac
845 fi
846
847 # AltiVec flags: The FSF version of GCC differs from the Apple version
848 if test $cpu = "powerpc"; then
849 if test $altivec = "yes"; then
850 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
851 CFLAGS="$CFLAGS -faltivec"
852 else
853 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
854 fi
855 fi
856 fi
857
858 # check if we have <altivec.h>
859 cat > $TMPC << EOF
860 #include <altivec.h>
861 int main( void ) { return 0; }
862 EOF
863
864 _altivec_h="no"
865 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
866 _altivec_h="yes"
867 fi
868
869 # check if our compiler supports Motorola AltiVec C API
870 if test $altivec = "yes"; then
871 if test $_altivec_h = "yes"; then
872 cat > $TMPC << EOF
873 #include <altivec.h>
874 int main(void) {
875 vector signed int v1, v2, v3;
876 v1 = vec_add(v2,v3);
877 return 0;
878 }
879 EOF
880 else
881 cat > $TMPC << EOF
882 int main(void) {
883 vector signed int v1, v2, v3;
884 v1 = vec_add(v2,v3);
885 return 0;
886 }
887 EOF
888 fi
889 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
890 fi
891
892 # mmi only available on mips
893 if test $mmi = "default"; then
894 if test $cpu = "mips"; then
895 mmi="yes"
896 else
897 mmi="no"
898 fi
899 fi
900
901 # check if our compiler supports mmi
902 if test $mmi = "yes"; then
903 cat > $TMPC << EOF
904 int main(void) {
905 __asm__ ("lq \$2, 0(\$2)");
906 return 0;
907 }
908 EOF
909 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
910 fi
911
912 if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
913 if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
914 cat <<EOF
915 You can only build one library type at once on MinGW.
916 Specify --disable-static --enable-shared to only build
917 the shared libraries. To build only the static libraries
918 you do not need to pass additional options.
919 EOF
920 exit 1
921 fi
922 v4l="no"
923 v4l2="no"
924 bktr="no"
925 audio_oss="no"
926 dv1394="no"
927 dc1394="no"
928 ffserver="no"
929 network="no"
930 if test "$mingwce" = "yes"; then
931 protocols="no"
932 fi
933 SLIBPREF=""
934 SLIBSUF=".dll"
935 EXESUF=".exe"
936 if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
937 if test "$force_libdir" != yes; then bindir="$prefix"; fi
938 fi
939
940 cc="${cross_prefix}${cc}"
941 ar="${cross_prefix}${ar}"
942 ranlib="${cross_prefix}${ranlib}"
943 strip="${cross_prefix}${strip}"
944
945 if test -z "$cross_prefix" ; then
946
947 # ---
948 # big/little-endian test
949 cat > $TMPC << EOF
950 #include <inttypes.h>
951 int main(int argc, char ** argv){
952 volatile uint32_t i=0x01234567;
953 return (*((uint8_t*)(&i))) == 0x67;
954 }
955 EOF
956
957 if $cc -o $TMPE $TMPC 2>/dev/null ; then
958 $TMPE && bigendian="yes"
959 else
960 echo big/little test failed
961 fi
962
963 else
964
965 # programs cannot be launched if cross compiling, so make a static guess
966 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
967 bigendian="yes"
968 fi
969
970 fi
971
972 # ---
973 # *inttypes.h* test
974 cat > $TMPC << EOF
975 #include <inttypes.h>
976 int main(int argc, char ** argv){
977 return 0;
978 }
979 EOF
980
981 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
982
983 # ---
984 # *int_fast* test
985 cat > $TMPC << EOF
986 #include <inttypes.h>
987 int main(int argc, char ** argv){
988 volatile uint_fast64_t i=0x01234567;
989 return 0;
990 }
991 EOF
992
993 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
994
995 # ---
996 # check availability of some header files
997
998 cat > $TMPC << EOF
999 #include <malloc.h>
1000 int main( void ) { return 0; }
1001 EOF
1002
1003 _memalign=no
1004 _malloc_h=no
1005 if $cc -o $TMPE $TMPC 2> /dev/null ; then
1006 _malloc_h=yes
1007 _memalign=yes
1008 # check for memalign - atmos
1009 cat > $TMPC << EOF
1010 #include <stdio.h>
1011 #include <malloc.h>
1012 int main ( void ) {
1013 char *string = NULL;
1014 string = memalign(64, sizeof(char));
1015 return 0;
1016 }
1017 EOF
1018 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
1019 fi
1020
1021 if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
1022 echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
1023 exit 1
1024 fi
1025
1026 cat > $TMPC << EOF
1027 #include <time.h>
1028 int main( void ) { localtime_r(NULL, NULL); }
1029 EOF
1030
1031 localtime_r=no
1032 if $cc -o $TMPE $TMPC 2> /dev/null ; then
1033 localtime_r=yes
1034 fi
1035
1036 if test "$zlib" = "yes"; then
1037 # check for zlib - mmu_man
1038 cat > $TMPC << EOF
1039 #include <zlib.h>
1040 int main ( void ) {
1041 if (zlibVersion() != ZLIB_VERSION)
1042 puts("zlib version differs !!!");
1043 return 1;
1044 return 0;
1045 }
1046 EOF
1047 $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
1048 # $TMPE 2> /dev/null > /dev/null || zlib="no"
1049 # XXX: more tests needed - runtime test
1050 fi
1051 if test "$zlib" = "yes"; then
1052 extralibs="$extralibs -lz"
1053 fi
1054
1055 if test "$lzo" = "yes" -a "$gpl" = "yes"; then
1056 # check for liblzo
1057 cat > $TMPC << EOF
1058 #include <lzo1x.h>
1059 int main ( void ) {
1060 lzo_init();
1061 return 0;
1062 }
1063 EOF
1064 $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -llzo 2> /dev/null || lzo="no"
1065 else
1066 lzo="no"
1067 fi
1068 if test "$lzo" = "yes"; then
1069 extralibs="$extralibs -llzo"
1070 fi
1071
1072 # test for lrintf in math.h
1073 cat > $TMPC << EOF
1074 #define _ISOC9X_SOURCE 1
1075 #include <math.h>
1076 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1077 EOF
1078
1079 have_lrintf="no"
1080 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC $extralibs 2> /dev/null ; then
1081 have_lrintf="yes"
1082 # allanc@chickenandporn.com: cannot execute cross-compiled
1083 # code on the host. Only execute if not cross-compiling.
1084 if test -z "$cross_prefix" ; then
1085 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
1086 fi
1087 fi
1088
1089 _restrict=
1090 for restrict_keyword in restrict __restrict__ __restrict; do
1091 echo "void foo(char * $restrict_keyword p);" > $TMPC
1092 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
1093 _restrict=$restrict_keyword
1094 break;
1095 fi
1096 done
1097
1098 # test gcc version to see if vector builtins can be used
1099 # currently only used on i386 for MMX builtins
1100 cat > $TMPC << EOF
1101 #include <xmmintrin.h>
1102 int main(void) {
1103 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
1104 return 0;
1105 #else
1106 #error no vector builtins
1107 #endif
1108 }
1109 EOF
1110
1111 builtin_vector=no
1112 if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
1113 builtin_vector=yes
1114 fi
1115
1116 # test for mm3dnow.h
1117 cat > $TMPC << EOF
1118 #include <mm3dnow.h>
1119 int main(void) {
1120 __m64 b1;
1121 b1 = _m_pswapd(b1);
1122 _m_femms();
1123 return 0;
1124 }
1125 EOF
1126
1127 mm3dnow=no
1128 march=athlon
1129 if test "$cpu" = "x86_64"; then
1130 march=k8
1131 fi
1132 if $cc -march=$march -o $TMPO $TMPC 2> /dev/null ; then
1133 mm3dnow=yes
1134 fi
1135
1136 # Probe for -Wdeclaration-after-statement
1137 if test "$cc" = "gcc"; then
1138 cat > $TMPC << EOF
1139 int main( void ) { return 0; }
1140 EOF
1141
1142 if $cc -Wdeclaration-after-statement -Werror -o $TMPE $TMPC 2> /dev/null ; then
1143 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
1144 fi
1145 fi
1146
1147 # dlopen/dlfcn.h probing
1148
1149 cat > $TMPC << EOF
1150 #include <dlfcn.h>
1151 int main( void ) { return (int) dlopen("foo", 0); }
1152 EOF
1153
1154 ldl=-ldl
1155
1156 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1157 dlfcn=yes
1158 dlopen=yes
1159 fi
1160
1161 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
1162 dlfcn=yes
1163 dlopen=yes
1164 ldl=""
1165 fi
1166
1167 cat > $TMPC << EOF
1168 int main( void ) { return (int) dlopen("foo", 0); }
1169 EOF
1170
1171 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1172 dlopen=yes
1173 fi
1174
1175 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
1176 dlopen=yes
1177 ldl=""
1178 fi
1179
1180 if test "$vhook" = "default" ; then
1181 vhook="$dlopen"
1182 fi
1183
1184 if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1185 extralibs="$extralibs $ldl"
1186 fi
1187
1188
1189 ##########################################
1190 # imlib check
1191
1192 cat > $TMPC << EOF
1193 #include <X11/Xlib.h>
1194 #include <Imlib2.h>
1195 int main( void ) { return (int) imlib_load_font("foo"); }
1196 EOF
1197
1198 imlib2=no
1199 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
1200 imlib2=yes
1201 fi
1202
1203 ##########################################
1204 # FreeType check
1205
1206 cat > $TMPC << EOF
1207 #include <ft2build.h>
1208 int main( void ) { return (int) FT_Init_FreeType(0); }
1209 EOF
1210
1211 freetype2=no
1212 if test "x$targetos" != "xBeOS"; then
1213 if (freetype-config --version) >/dev/null 2>&1 ; then
1214 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
1215 freetype2=yes
1216 fi
1217 fi
1218 fi
1219
1220 ##########################################
1221 # SDL check
1222
1223 cat > $TMPC << EOF
1224 #include <SDL.h>
1225 #undef main /* We don't want SDL to override our main() */
1226 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1227 EOF
1228
1229 sdl_too_old=no
1230 sdl=no
1231 SDL_CONFIG="${cross_prefix}sdl-config"
1232 if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
1233 if $cc -o $TMPE `"${SDL_CONFIG}" --cflags` $TMPC `"${SDL_CONFIG}" --libs` > /dev/null 2>&1 ; then
1234 _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
1235 if test "$_sdlversion" -lt 121 ; then
1236 sdl_too_old=yes
1237 else
1238 sdl=yes
1239 fi
1240 fi
1241 fi
1242
1243 ##########################################
1244 # texi2html check
1245
1246 texi2html=no
1247 if (texi2html -version) >/dev/null 2>&1; then
1248 texi2html=yes
1249 fi
1250
1251 if test "$network" = "yes" ; then
1252 ##########################################
1253 # IPv6 check
1254
1255 cat > $TMPC << EOF
1256 #include <sys/types.h>
1257 #include <sys/socket.h>
1258 #include <netinet/in.h>
1259 #include <netdb.h>
1260 int main( void ) {
1261 struct sockaddr_storage saddr;
1262 struct ipv6_mreq mreq6;
1263 getaddrinfo(0,0,0,0);
1264 getnameinfo(0,0,0,0,0,0,0);
1265 IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
1266 }
1267 EOF
1268
1269 ipv6=no
1270 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
1271 ipv6=yes
1272 fi
1273 fi
1274
1275 if test "$v4l2" = "yes"; then
1276 # check for video4linux2 --- V4L2_PIX_FMT_YUV420
1277 cat > $TMPC << EOF
1278 #include <sys/time.h>
1279 #include <asm/types.h>
1280 #include <linux/videodev2.h>
1281 int dummy = V4L2_PIX_FMT_YUV420;
1282 struct v4l2_buffer dummy1;
1283 EOF
1284 $cc -c -o $TMPE $TMPC 2> /dev/null || v4l2="no"
1285 fi
1286
1287 case "`$cc -v 2>&1 | grep version`" in
1288 *gcc*)
1289 CFLAGS="-Wall -Wno-switch $CFLAGS"
1290 ;;
1291 *)
1292 ;;
1293 esac
1294
1295 if test "$sdl" = "no" ; then
1296 ffplay=no
1297 fi
1298
1299 if test "$debug" = "yes"; then
1300 CFLAGS="-g $CFLAGS"
1301 fi
1302
1303 if test "$optimize" = "small"; then
1304 # CFLAGS=${CFLAGS//-O3/-Os}
1305 CFLAGS="$CFLAGS -Os"
1306 fi
1307
1308 if test "$optimize" = "yes"; then
1309 if test -n "`$cc -v 2>&1 | grep xlc`"; then
1310 CFLAGS="$CFLAGS -O5"
1311 LDFLAGS="$LDFLAGS -O5"
1312 else
1313 CFLAGS="-O3 $CFLAGS"
1314 fi
1315 fi
1316
1317 # PIC flags for shared library objects where they are needed
1318 if test "$lshared" = "yes" ; then
1319 # LIBOBJFLAGS may have already been set in the OS configuration
1320 if test -z "$LIBOBJFLAGS" ; then
1321 if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
1322 LIBOBJFLAGS="\$(PIC)"
1323 fi
1324 fi
1325 fi
1326
1327 if test x"$bindir" = x""; then
1328 bindir="${prefix}/bin"
1329 fi
1330
1331 if test x"$libdir" = x""; then
1332 libdir="${prefix}/lib"
1333 fi
1334
1335 if test x"$incdir" = x""; then
1336 incdir="${prefix}/include/ffmpeg"
1337 fi
1338
1339 if test x"$mandir" = x""; then
1340 mandir="${prefix}/man"
1341 fi
1342
1343 echo "install prefix $prefix"
1344 echo "source path $source_path"
1345 echo "C compiler $cc"
1346 echo "make $make"
1347 echo "CPU $cpu ($tune)"
1348 if test "$BUILDSUF" != ""; then
1349 echo "build suffix $BUILDSUF"
1350 fi
1351 echo "big-endian $bigendian"
1352 echo "inttypes.h $inttypes"
1353 echo "broken inttypes.h $emu_fast_int"
1354 if test $cpu = "x86" -o $cpu = "x86_64"; then
1355 echo "MMX enabled $mmx"
1356 echo "Vector Builtins $builtin_vector"
1357 echo "3DNow! Builtins $mm3dnow"
1358 fi
1359 if test $cpu = "armv4l"; then
1360 echo "IWMMXT enabled $iwmmxt"
1361 fi
1362 if test $cpu = "mips"; then
1363 echo "MMI enabled $mmi"
1364 fi
1365 if test $cpu = "powerpc"; then
1366 echo "AltiVec enabled $altivec"
1367 fi
1368 echo "gprof enabled $gprof"
1369 echo "zlib enabled $zlib"
1370 echo "lzo enabled $lzo"
1371 echo "libgsm enabled $libgsm"
1372 echo "mp3lame enabled $mp3lame"
1373 echo "libogg enabled $libogg"
1374 echo "Vorbis enabled $vorbis"
1375 echo "Theora enabled $theora"
1376 echo "FAAD enabled $faad"
1377 echo "faadbin enabled $faadbin"
1378 echo "FAAC enabled $faac"
1379 echo "XviD enabled $xvid"
1380 echo "x264 enabled $x264"
1381 echo "a52 support $a52"
1382 echo "a52 dlopened $a52bin"
1383 echo "DTS support $dts"
1384 echo "pp support $pp"
1385 echo "debug symbols $debug"
1386 echo "strip symbols $dostrip"
1387 echo "optimize $optimize"
1388 echo "static $lstatic"
1389 echo "shared $lshared"
1390 echo "video hooking $vhook"
1391 echo "SDL support $sdl"
1392 if test $sdl_too_old = "yes"; then
1393 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
1394 fi
1395
1396 if test "$vhook" = "yes" ; then
1397 echo "Imlib2 support $imlib2"
1398 echo "FreeType support $freetype2"
1399 fi
1400 echo "Sun medialib support" $sunmlib
1401 echo "pthreads support" $pthreads
1402 echo "AMR-NB float support" $amr_nb
1403 echo "AMR-NB fixed support" $amr_nb_fixed
1404 echo "AMR-WB float support" $amr_wb
1405 echo "AMR-WB IF2 support" $amr_if2
1406 echo "network support $network"
1407 if test "$network" = "yes" ; then
1408 echo "IPv6 support $ipv6"
1409 fi
1410 if test "$gpl" = "no" ; then
1411 echo "License: LGPL"
1412 else
1413 echo "License: GPL"
1414 fi
1415
1416 echo "Creating config.mak and config.h..."
1417
1418 date >> config.log
1419 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1420 echo "# Automatically generated by configure - do not modify!" > config.mak
1421 echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1422 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1423
1424 echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1425 echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1426 echo "incdir=\$(DESTDIR)$incdir" >> config.mak
1427 echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1428 echo "mandir=\$(DESTDIR)$mandir" >> config.mak
1429 echo "MAKE=$make" >> config.mak
1430 echo "CC=$cc" >> config.mak
1431 echo "AR=$ar" >> config.mak
1432 echo "RANLIB=$ranlib" >> config.mak
1433 if test "$dostrip" = "yes" ; then
1434 echo "STRIP=$strip" >> config.mak
1435 echo "INSTALLSTRIP=$installstrip" >> config.mak
1436 else
1437 echo "STRIP=echo ignoring strip" >> config.mak
1438 echo "INSTALLSTRIP=" >> config.mak
1439 fi
1440
1441 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
1442 # shared modules on OS/X (vhook/Makefile).
1443 SHCFLAGS=$CFLAGS
1444 if test "$needmdynamicnopic" = yes; then
1445 CFLAGS="$CFLAGS -mdynamic-no-pic"
1446 fi
1447
1448 echo "OPTFLAGS=$CFLAGS" >> config.mak
1449 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1450 echo "LDFLAGS=$LDFLAGS" >> config.mak
1451 echo "LDCONFIG=$LDCONFIG" >> config.mak
1452 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1453 echo "SHFLAGS=$SHFLAGS" >> config.mak
1454 echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
1455 echo "BUILD_STATIC=$lstatic" >> config.mak
1456 echo "BUILDSUF=$BUILDSUF" >> config.mak
1457 echo "LIBPREF=$LIBPREF" >> config.mak
1458 echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1459 if test "$lstatic" = "yes" ; then
1460 echo "LIB=$LIB" >> config.mak
1461 else # Some Make complain if this variable does not exist.
1462 echo "LIB=" >> config.mak
1463 fi
1464 echo "SLIBPREF=$SLIBPREF" >> config.mak
1465 echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1466 echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1467 echo "TARGET_OS=$TARGET_OS" >> config.mak
1468 if test "$cpu" = "x86" ; then
1469 echo "TARGET_ARCH_X86=yes" >> config.mak
1470 echo "#define ARCH_X86 1" >> $TMPH
1471 elif test "$cpu" = "x86_64" ; then
1472 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1473 echo "#define ARCH_X86_64 1" >> $TMPH
1474 elif test "$cpu" = "armv4l" ; then
1475 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1476 echo "#define ARCH_ARMV4L 1" >> $TMPH
1477 elif test "$cpu" = "alpha" ; then
1478 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1479 echo "#define ARCH_ALPHA 1" >> $TMPH
1480 elif test "$cpu" = "sparc64" ; then
1481 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1482 echo "#define ARCH_SPARC64 1" >> $TMPH
1483 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1484 echo "#define ARCH_SPARC 1" >> $TMPH
1485 elif test "$cpu" = "sparc" ; then
1486 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1487 echo "#define ARCH_SPARC 1" >> $TMPH
1488 elif test "$cpu" = "powerpc" ; then
1489 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1490 echo "#define ARCH_POWERPC 1" >> $TMPH
1491 if test $POWERPCMODE = "32bits"; then
1492 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1493 else
1494 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1495 fi
1496 if test "$powerpc_perf" = "yes"; then
1497 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1498 fi
1499 elif test "$cpu" = "mips" ; then
1500 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1501 echo "#define ARCH_MIPS 1" >> $TMPH
1502 elif test "$cpu" = "sh4" ; then
1503 echo "TARGET_ARCH_SH4=yes" >> config.mak
1504 echo "#define ARCH_SH4 1" >> $TMPH
1505 elif test "$cpu" = "parisc" ; then
1506 echo "TARGET_ARCH_PARISC=yes" >> config.mak
1507 echo "#define ARCH_PARISC 1" >> $TMPH
1508 elif test "$cpu" = "s390" ; then
1509 echo "TARGET_ARCH_S390=yes" >> config.mak
1510 echo "#define ARCH_S390 1" >> $TMPH
1511 elif test "$cpu" = "m68k" ; then
1512 echo "TARGET_ARCH_M68K=yes" >> config.mak
1513 echo "#define ARCH_M68K 1" >> $TMPH
1514 elif test "$cpu" = "ia64" ; then
1515 echo "TARGET_ARCH_IA64=yes" >> config.mak
1516 echo "#define ARCH_IA64 1" >> $TMPH
1517 fi
1518 echo "#define TUNECPU $TUNECPU" >> $TMPH
1519 if test "$bigendian" = "yes" ; then
1520 echo "WORDS_BIGENDIAN=yes" >> config.mak
1521 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1522 fi
1523 if test "$inttypes" != "yes" ; then
1524 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1525 fi
1526 if test "$emu_fast_int" = "yes" ; then
1527 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1528 fi
1529 if test "$mmx" = "yes" ; then
1530 echo "TARGET_MMX=yes" >> config.mak
1531 echo "#define HAVE_MMX 1" >> $TMPH
1532 echo "#define __CPU__ 586" >> $TMPH
1533 fi
1534 if test "$builtin_vector" = "yes" ; then
1535 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1536 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1537 fi
1538 if test "$mm3dnow" = "yes" ; then
1539 echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak
1540 echo "#define HAVE_MM3DNOW 1" >> $TMPH
1541 fi
1542 if test "$iwmmxt" = "yes" ; then
1543 echo "TARGET_IWMMXT=yes" >> config.mak
1544 echo "#define HAVE_IWMMXT 1" >> $TMPH
1545 fi
1546 if test "$mmi" = "yes" ; then
1547 echo "TARGET_MMI=yes" >> config.mak
1548 echo "#define HAVE_MMI 1" >> $TMPH
1549 fi
1550 if test "$altivec" = "yes" ; then
1551 echo "TARGET_ALTIVEC=yes" >> config.mak
1552 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1553 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1554 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1555 if test "$_altivec_h" = "yes" ; then
1556 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1557 else
1558 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1559 fi
1560 fi
1561 if test "$gprof" = "yes" ; then
1562 echo "TARGET_GPROF=yes" >> config.mak
1563 echo "#define HAVE_GPROF 1" >> $TMPH
1564 fi
1565 if test "$localtime_r" = "yes" ; then
1566 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1567 fi
1568 if test "$imlib2" = "yes" ; then
1569 echo "HAVE_IMLIB2=yes" >> config.mak
1570 fi
1571 if test "$freetype2" = "yes" ; then
1572 echo "HAVE_FREETYPE2=yes" >> config.mak
1573 fi
1574 if test "$sunmlib" = "yes" ; then
1575 echo "HAVE_MLIB=yes" >> config.mak
1576 echo "#define HAVE_MLIB 1" >> $TMPH
1577 extralibs="$extralibs -lmlib"
1578 fi
1579 if test "$pthreads" = "yes" ; then
1580 echo "HAVE_PTHREADS=yes" >> config.mak
1581 echo "#define HAVE_PTHREADS 1" >> $TMPH
1582 echo "#define HAVE_THREADS 1" >> $TMPH
1583 if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
1584 extralibs="$extralibs -lpthread"
1585 fi
1586 fi
1587 if test "$sdl" = "yes" ; then
1588 echo "CONFIG_SDL=yes" >> config.mak
1589 echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
1590 echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
1591 fi
1592 if test "$texi2html" = "yes"; then
1593 echo "BUILD_DOC=yes" >> config.mak
1594 fi
1595 if test "$have_lrintf" = "yes" ; then
1596 echo "#define HAVE_LRINTF 1" >> $TMPH
1597 fi
1598 if test "$vhook" = "yes" ; then
1599 echo "BUILD_VHOOK=yes" >> config.mak
1600 echo "#define HAVE_VHOOK 1" >> $TMPH
1601 fi
1602
1603 pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libavcodec/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
1604 lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1605 lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1606 lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1607
1608
1609
1610 if test "$lshared" = "yes" ; then
1611 echo "#define BUILD_SHARED_AV 1" >> $TMPH
1612 echo "BUILD_SHARED=yes" >> config.mak
1613 echo "PIC=-fPIC -DPIC" >> config.mak
1614 echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
1615 echo "SPPVERSION=$lavc_version" >> config.mak
1616 echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
1617 echo "LAVCVERSION=$lavc_version" >> config.mak
1618 echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
1619 echo "LAVFVERSION=$lavf_version" >> config.mak
1620 echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
1621 echo "LAVUVERSION=$lavu_version" >> config.mak
1622 echo "SLIBNAME=${SLIBNAME}" >> config.mak
1623 echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1624 echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
1625 fi
1626 echo "EXTRALIBS=$extralibs" >> config.mak
1627 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1628 cut -d '"' -f 2`
1629 echo "VERSION=$version" >>config.mak
1630 # If you do not want to use encoders, disable them.
1631 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1632 echo "CONFIG_ENCODERS=yes" >> config.mak
1633
1634 # If you do not want to use decoders, disable them.
1635 echo "#define CONFIG_DECODERS 1" >> $TMPH
1636 echo "CONFIG_DECODERS=yes" >> config.mak
1637
1638 # muxers
1639 if test "$muxers" = "yes" ; then
1640 echo "#define CONFIG_MUXERS 1" >> $TMPH
1641 echo "CONFIG_MUXERS=yes" >> config.mak
1642 fi
1643
1644 # demuxers
1645 if test "$demuxers" = "yes" ; then
1646 echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1647 echo "CONFIG_DEMUXERS=yes" >> config.mak
1648 fi
1649
1650 # AC3
1651 if test "$a52" = "yes" ; then
1652 echo "#define CONFIG_AC3 1" >> $TMPH
1653 echo "CONFIG_AC3=yes" >> config.mak
1654
1655 if test "$a52bin" = "yes" ; then
1656 echo "#define CONFIG_A52BIN 1" >> $TMPH
1657 echo "CONFIG_A52BIN=yes" >> config.mak
1658 fi
1659 fi
1660
1661 # DTS
1662 if test "$dts" = "yes" ; then
1663 echo "#define CONFIG_DTS 1" >> $TMPH
1664 echo "CONFIG_DTS=yes" >> config.mak
1665 fi
1666
1667 # PP
1668 if test "$pp" = "yes" ; then
1669 echo "#define CONFIG_PP 1" >> $TMPH
1670 echo "CONFIG_PP=yes" >> config.mak
1671 fi
1672
1673 # MPEG audio high precision mode
1674 if test "$mpegaudio_hp" = "yes" ; then
1675 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1676 fi
1677
1678 if test "$v4l" = "yes" ; then
1679 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1680 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1681 fi
1682
1683 if test "$v4l2" = "yes" ; then
1684 echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
1685 echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
1686 fi
1687
1688 if test "$bktr" = "yes" ; then
1689 echo "#define CONFIG_BKTR 1" >> $TMPH
1690 echo "CONFIG_BKTR=yes" >> config.mak
1691 fi
1692
1693 if test "$dv1394" = "yes" ; then
1694 echo "#define CONFIG_DV1394 1" >> $TMPH
1695 echo "CONFIG_DV1394=yes" >> config.mak
1696 fi
1697
1698 if test "$dc1394" = "yes" ; then
1699 echo "#define CONFIG_DC1394 1" >> $TMPH
1700 echo "CONFIG_DC1394=yes" >> config.mak
1701 fi
1702
1703 if test "$dlopen" = "yes" ; then
1704 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1705 fi
1706
1707 if test "$dlfcn" = "yes" ; then
1708 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1709 fi
1710
1711 if test "$audio_oss" = "yes" ; then
1712 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1713 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1714 fi
1715
1716 if test "$audio_beos" = "yes" ; then
1717 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1718 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1719 fi
1720
1721 if test "$network" = "yes" ; then
1722 echo "#define CONFIG_NETWORK 1" >> $TMPH
1723 echo "CONFIG_NETWORK=yes" >> config.mak
1724 fi
1725
1726 if test "$ipv6" = "yes" ; then
1727 echo "#define CONFIG_IPV6 1" >> $TMPH
1728 fi
1729
1730 if test "$zlib" = "yes" ; then
1731 echo "#define CONFIG_ZLIB 1" >> $TMPH
1732 echo "CONFIG_ZLIB=yes" >> config.mak
1733 fi
1734
1735 if test "$lzo" = "yes" ; then
1736 echo "#define CONFIG_LZO 1" >> $TMPH
1737 echo "CONFIG_LZO=yes" >> config.mak
1738 fi
1739
1740 if test "$libgsm" = "yes" ; then
1741 echo "#define CONFIG_LIBGSM 1" >> $TMPH
1742 echo "CONFIG_LIBGSM=yes" >> config.mak
1743 fi
1744
1745 if test "$mp3lame" = "yes" ; then
1746 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1747 echo "CONFIG_MP3LAME=yes" >> config.mak
1748 fi
1749
1750 if test "$libogg" = "yes" ; then
1751 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1752 echo "CONFIG_LIBOGG=yes" >> config.mak
1753 fi
1754
1755 if test "$vorbis" = "yes" ; then
1756 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1757 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1758 fi
1759
1760 if test "$theora" = "yes" ; then
1761 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1762 echo "CONFIG_LIBTHEORA=yes" >> config.mak
1763 fi
1764
1765 if test "$faad" = "yes" ; then
1766 echo "#define CONFIG_FAAD 1" >> $TMPH
1767 echo "CONFIG_FAAD=yes" >> config.mak
1768 fi
1769
1770 if test "$faadbin" = "yes" ; then
1771 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1772 echo "CONFIG_FAADBIN=yes" >> config.mak
1773 fi
1774
1775 if test "$faac" = "yes" ; then
1776 echo "#define CONFIG_FAAC 1" >> $TMPH
1777 echo "CONFIG_FAAC=yes" >> config.mak
1778 fi
1779
1780 if test "$xvid" = "yes" ; then
1781 echo "#define CONFIG_XVID 1" >> $TMPH
1782 echo "CONFIG_XVID=yes" >> config.mak
1783 fi
1784
1785 if test "$x264" = "yes" ; then
1786 echo "#define CONFIG_X264 1" >> $TMPH
1787 echo "CONFIG_X264=yes" >> config.mak
1788 fi
1789
1790 if test "$mingw32" = "yes" ; then
1791 echo "#define CONFIG_WIN32 1" >> $TMPH
1792 echo "CONFIG_WIN32=yes" >> config.mak
1793 echo "HAVE_W32THREADS=yes" >> config.mak
1794 echo "#define HAVE_W32THREADS 1" >> $TMPH
1795 echo "#define HAVE_THREADS 1" >> $TMPH
1796 echo "#ifndef __MINGW32__" >> $TMPH
1797 echo "#define __MINGW32__ 1" >> $TMPH
1798 echo "#endif" >> $TMPH
1799 fi
1800
1801 if test "$mingwce" = "yes" ; then
1802 echo "#define CONFIG_WIN32 1" >> $TMPH
1803 echo "CONFIG_WIN32=yes" >> config.mak
1804 echo "#define CONFIG_WINCE 1" >> $TMPH
1805 echo "CONFIG_WINCE=yes" >> config.mak
1806 echo "#ifndef __MINGW32__" >> $TMPH
1807 echo "#define __MINGW32__ 1" >> $TMPH
1808 echo "#endif" >> $TMPH
1809 fi
1810
1811 if test "$os2" = "yes" ; then
1812 echo "#define CONFIG_OS2 1" >> $TMPH
1813 echo "CONFIG_OS2=yes" >> config.mak
1814 echo "HAVE_OS2THREADS=yes" >> config.mak
1815 echo "#define HAVE_OS2THREADS 1" >> $TMPH
1816 echo "#define HAVE_THREADS 1" >> $TMPH
1817 fi
1818
1819 if test "$TARGET_OS" = "SunOS" ; then
1820 echo "#define CONFIG_SUNOS 1" >> $TMPH
1821 fi
1822
1823 if test "$TARGET_OS" = "BeOS" ; then
1824 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1825 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1826 echo "#define HAVE_THREADS 1" >> $TMPH
1827 fi
1828
1829 if test "$darwin" = "yes"; then
1830 echo "#define CONFIG_DARWIN 1" >> $TMPH
1831 echo "CONFIG_DARWIN=yes" >> config.mak
1832 fi
1833
1834 if test "$_malloc_h" = "yes" ; then
1835 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1836 else
1837 echo "#undef HAVE_MALLOC_H" >> $TMPH
1838 fi
1839
1840 if test "$_memalign" = "yes" ; then
1841 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1842 else
1843 echo "#undef HAVE_MEMALIGN" >> $TMPH
1844 fi
1845
1846 if test "$memalignhack" = "yes" ; then
1847 echo "#define MEMALIGN_HACK 1" >> $TMPH
1848 fi
1849
1850
1851 if test "$netserver" = "yes" ; then
1852 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1853 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1854 fi
1855
1856 if test "$need_inet_aton" = "yes" ; then
1857 echo "NEED_INET_ATON=yes" >> config.mak
1858 fi
1859
1860 if test "$simpleidct" = "yes" ; then
1861 echo "#define SIMPLE_IDCT 1" >> $TMPH
1862 fi
1863
1864 if test "$protocols" = "yes" ; then
1865 echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
1866 echo "CONFIG_PROTOCOLS=yes" >> config.mak
1867 fi
1868
1869 if test "$ffserver" = "yes" ; then
1870 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1871 echo "CONFIG_FFSERVER=yes" >> config.mak
1872 fi
1873
1874 if test "$ffplay" = "yes" ; then
1875 echo "CONFIG_FFPLAY=yes" >> config.mak
1876 fi
1877
1878 if test "$gpl" = "yes" ; then
1879 echo "#define CONFIG_GPL 1" >> $TMPH
1880 echo "CONFIG_GPL=yes" >> config.mak
1881 fi
1882
1883 echo "#define restrict $_restrict" >> $TMPH
1884
1885 if test "$optimize" = "small"; then
1886 echo "#define always_inline" >> $TMPH
1887 fi
1888
1889 # build tree in object directory if source path is different from current one
1890 if test "$source_path_used" = "yes" ; then
1891 DIRS="\
1892 doc \
1893 libavformat \
1894 libavcodec \
1895 libavcodec/alpha \
1896 libavcodec/armv4l \
1897 libavcodec/i386 \
1898 libavcodec/sparc \
1899 libavcodec/mlib \
1900 libavcodec/ppc \
1901 libavcodec/liba52 \
1902 libavcodec/libpostproc \
1903 libavutil \
1904 tests \
1905 vhook \
1906 "
1907 FILES="\
1908 Makefile \
1909 libavformat/Makefile \
1910 libavcodec/Makefile \
1911 libavcodec/libpostproc/Makefile \
1912 libavutil/Makefile \
1913 tests/Makefile \
1914 vhook/Makefile \
1915 doc/Makefile \
1916 doc/texi2pod.pl \
1917 "
1918 for dir in $DIRS ; do
1919 mkdir -p $dir
1920 done
1921 for f in $FILES ; do
1922 ln -sf "$source_path/$f" $f
1923 done
1924 fi
1925 echo "SRC_PATH=$source_path" >> config.mak
1926 echo "BUILD_ROOT=$PWD" >> config.mak
1927
1928 if test "$amr" = "yes" ; then
1929 echo "#define AMR 1" >> $TMPH
1930 echo "AMR=yes" >> config.mak
1931 fi
1932
1933 if test "$amr_wb" = "yes" ; then
1934 echo "#define AMR_WB 1" >> $TMPH
1935 echo "AMR_WB=yes" >> config.mak
1936 echo
1937 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1938 echo "V5.1.0 from "
1939 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1940 echo "and extracted the source to libavcodec/amrwb_float"
1941 fi
1942
1943 if test "$amr_nb" = "yes" ; then
1944 echo "#define AMR_NB 1" >> $TMPH
1945 echo "AMR_NB=yes" >> config.mak
1946 echo
1947 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1948 echo "REL-5 V5.1.0 from "
1949 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip"
1950 echo "and extracted the source to libavcodec/amr_float"
1951 echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
1952 fi
1953
1954 if test "$amr_nb_fixed" = "yes" ; then
1955 echo "#define AMR_NB_FIXED 1" >> $TMPH
1956 echo "AMR_NB_FIXED=yes" >> config.mak
1957 echo
1958 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1959 echo "REL-5 version 5.1.0 from "
1960 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip"
1961 echo "and extracted src to libavcodec/amr"
1962 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1963 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1964 fi
1965
1966 if test "$amr_if2" = "yes" ; then
1967 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1968 fi
1969
1970
1971 for codec in $CODEC_LIST ; do
1972 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1973 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1974 done
1975
1976 # Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
1977 diff $TMPH config.h >/dev/null 2>&1
1978 if test "$?" != "0" ; then
1979 mv -f $TMPH config.h
1980 else
1981 echo "config.h is unchanged"
1982 fi
1983
1984 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1985
1986
1987 # build pkg-config files libav*.pc and libpostproc.pc
1988 # libavutil.pc
1989 cat <<EOF >libavutil.pc
1990 prefix=$prefix
1991 exec_prefix=\${prefix}
1992 libdir=\${exec_prefix}/lib
1993 includedir=\${prefix}/include
1994
1995 Name: libavutil
1996 Description: FFmpeg utility library
1997 Version: $lavu_version
1998 Requires:
1999 Conflicts:
2000 Libs: -L\${libdir} -lavutil
2001 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2002 EOF
2003
2004 cat <<EOF >libavutil-uninstalled.pc
2005 prefix=
2006 exec_prefix=
2007 libdir=\${pcfiledir}/libavutil
2008 includedir=\${pcfiledir}/libavutil
2009
2010 Name: libavutil
2011 Description: FFmpeg utility library
2012 Version: $lavu_version
2013 Requires:
2014 Conflicts:
2015 Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
2016 Cflags: -I\${includedir}
2017 EOF
2018
2019 # libavcodec.pc
2020 cat <<EOF >libavcodec.pc
2021 prefix=$prefix
2022 exec_prefix=\${prefix}
2023 libdir=\${exec_prefix}/lib
2024 includedir=\${prefix}/include
2025
2026 Name: libavcodec
2027 Description: FFmpeg codec library
2028 Version: $lavc_version
2029 Requires: $pkg_requires libavutil = $lavu_version
2030 Conflicts:
2031 Libs: -L\${libdir} -lavcodec $extralibs
2032 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2033 EOF
2034
2035 cat <<EOF >libavcodec-uninstalled.pc
2036 prefix=
2037 exec_prefix=
2038 libdir=\${pcfiledir}/libavcodec
2039 includedir=\${pcfiledir}/libavcodec
2040
2041 Name: libavcodec
2042 Description: FFmpeg codec library
2043 Version: $lavc_version
2044 Requires: $pkg_requires libavutil = $lavu_version
2045 Conflicts:
2046 Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
2047 Cflags: -I\${includedir}
2048 EOF
2049
2050 # libavformat.pc
2051 cat <<EOF >libavformat.pc
2052 prefix=$prefix
2053 exec_prefix=\${prefix}
2054 libdir=\${exec_prefix}/lib
2055 includedir=\${prefix}/include
2056
2057 Name: libavformat
2058 Description: FFmpeg container format library
2059 Version: $lavf_version
2060 Requires: $pkg_requires libavcodec = $lavc_version
2061 Conflicts:
2062 Libs: -L\${libdir} -lavformat $extralibs
2063 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2064 EOF
2065
2066 cat <<EOF >libavformat-uninstalled.pc
2067 prefix=
2068 exec_prefix=
2069 libdir=\${pcfiledir}/libavformat
2070 includedir=\${pcfiledir}/libavformat
2071
2072 Name: libavformat
2073 Description: FFmpeg container format library
2074 Version: $lavf_version
2075 Requires: $pkg_requires libavcodec = $lavc_version
2076 Conflicts:
2077 Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
2078 Cflags: -I\${includedir}
2079 EOF
2080
2081
2082 # libpostproc.pc
2083 cat <<EOF >libpostproc.pc
2084 prefix=$prefix
2085 exec_prefix=\${prefix}
2086 libdir=\${exec_prefix}/lib
2087 includedir=\${prefix}/include
2088
2089 Name: libpostproc
2090 Description: FFmpeg post processing library
2091 Version: $lavc_version
2092 Requires:
2093 Conflicts:
2094 Libs: -L\${libdir} -lpostproc
2095 Cflags: -I\${includedir} -I\${includedir}/postproc
2096 EOF
2097
2098 cat <<EOF >libpostproc-uninstalled.pc
2099 prefix=
2100 exec_prefix=
2101 libdir=\${pcfiledir}/libavcodec/libpostproc
2102 includedir=\${pcfiledir}/libavcodec/libpostproc
2103
2104 Name: libpostproc
2105 Description: FFmpeg post processing library
2106 Version: $lavc_version
2107 Requires:
2108 Conflicts:
2109 Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
2110 Cflags: -I\${includedir}
2111 EOF