r1009: Move the dependencies to newer package names
[cinelerra_cv/mob.git] / quicktime / ffmpeg / configure
blobfadfd5675dd7b0ddf22fbf5bfddd94edf5ad3737
1 #!/bin/sh
3 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
6 # This configure script has been hacked for cinelerra's own purposes!
7 # search for the 'cinelerra' strings to observe these hacks.
9 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
10 cat << EOF
12 Usage: configure [options]
13 Options: [defaults in brackets after descriptions]
15 EOF
16 echo "Standard options:"
17 echo " --help print this message"
18 echo " --prefix=PREFIX install in PREFIX [$prefix]"
19 echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
20 echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
21 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
22 echo " --enable-libogg enable ogg support via libogg [default=no]"
23 echo " --enable-vorbis enable vorbis support via libvorbis [default=no]"
24 echo " --enable-theora enable theora support via libtheora [default=no]"
25 echo " --enable-faad enable faad support via libfaad [default=no]"
26 echo " --enable-faadbin build faad support with runtime linking [default=no]"
27 echo " --enable-faac enable faac support via libfaac [default=no]"
28 echo " --enable-libgsm enable gsm support via libgsm [default=no]"
29 echo " --enable-xvid enable xvid support via xvidcore [default=no]"
30 echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
31 echo " --enable-mingw32 enable mingw32 native/cross windows compile"
32 echo " --enable-a52 enable GPL'ed A52 support [default=no]"
33 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
34 echo " --enable-dts enable GPL'ed DTS support [default=no]"
35 echo " --enable-pp enable GPL'ed post processing support [default=no]"
36 echo " --enable-shared-pp use libpostproc.so [default=no]"
37 echo " --enable-shared build shared libraries [default=no]"
38 echo " --enable-amr_nb enable amr_nb float audio codec"
39 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
40 echo " --enable-amr_wb enable amr_wb float audio codec"
41 echo " --enable-sunmlib use Sun medialib [default=no]"
42 echo " --enable-pthreads use pthreads [default=no]"
43 echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [default=no]"
44 echo " --enable-gpl allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
45 echo ""
46 echo "Advanced options (experts only):"
47 echo " --source-path=PATH path of source code [$source_path]"
48 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
49 echo " --cc=CC use C compiler CC [$cc]"
50 echo " --make=MAKE use specified make [$make]"
51 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
52 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
53 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
54 echo " --build-suffix=SUFFIX suffix for application specific build []"
55 echo " --cpu=CPU force cpu to CPU [$cpu]"
56 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
57 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
58 echo " --disable-mmx disable mmx usage"
59 echo " --disable-iwmmxt disable iwmmxt usage"
60 echo " --disable-altivec disable AltiVec usage"
61 echo " --disable-audio-oss disable OSS audio support [default=no]"
62 echo " --disable-audio-beos disable BeOS audio support [default=no]"
63 echo " --disable-v4l disable video4linux grabbing [default=no]"
64 echo " --disable-bktr disable bktr video grabbing [default=no]"
65 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
66 echo " --disable-network disable network support [default=no]"
67 echo " --disable-zlib disable zlib [default=no]"
68 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
69 echo " --disable-vhook disable video hooking support"
70 echo " --enable-gprof enable profiling with gprof [$gprof]"
71 echo " --disable-debug disable debugging symbols"
72 echo " --disable-opts disable compiler optimizations"
73 echo " --disable-mpegaudio-hp faster (but less accurate)"
74 echo " mpegaudio decoding [default=no]"
75 echo " --disable-ffserver disable ffserver build"
76 echo " --disable-ffplay disable ffplay build"
77 echo " --enable-small optimize for size instead of speed"
78 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
79 echo " --disable-strip disable stripping of executables and shared libraries"
80 echo " --enable-codec=codec enables codec"
81 echo " --disable-codec=codec disables codec"
82 echo " --disable-encoders disables all encoders"
83 echo " --disable-decoders disables all decoders"
84 echo ""
85 echo "NOTE: The object files are build at the place where configure is launched"
86 exit 1
89 # set temporary file name
90 if test ! -z "$TMPDIR" ; then
91 TMPDIR1="${TMPDIR}"
92 elif test ! -z "$TEMPDIR" ; then
93 TMPDIR1="${TEMPDIR}"
94 else
95 TMPDIR1="/tmp"
98 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
99 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
100 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
101 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
102 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
104 # default parameters
105 prefix="/usr/local"
106 libdir=""
107 mandir=""
108 bindir=""
109 cross_prefix=""
110 cc="gcc"
111 ar="ar"
112 ranlib="ranlib"
113 make="make"
114 strip="strip"
115 cpu=`uname -m`
116 tune="generic"
117 powerpc_perf="no"
118 mmx="default"
119 iwmmxt="default"
120 altivec="default"
121 mmi="default"
122 case "$cpu" in
123 i386|i486|i586|i686|i86pc|BePC)
124 cpu="x86"
126 x86_64|amd64)
127 cpu="x86"
128 canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
129 if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
130 if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
131 cpu="x86_64"
135 # armv4l is a subset of armv5tel
136 armv4l|armv5tel)
137 cpu="armv4l"
139 alpha)
140 cpu="alpha"
142 "Power Macintosh"|ppc)
143 cpu="powerpc"
145 mips)
146 cpu="mips"
148 sun4u|sparc64)
149 cpu="sparc64"
151 sparc)
152 cpu="sparc"
154 sh4)
155 cpu="sh4"
158 cpu="unknown"
160 esac
161 gprof="no"
162 v4l="yes"
163 bktr="no"
164 audio_oss="yes"
165 audio_beos="no"
166 dv1394="yes"
167 dc1394="no"
168 network="yes"
169 zlib="yes"
170 libgsm="no"
171 mp3lame="no"
172 libogg="no"
173 vorbis="no"
174 theora="no"
175 faad="no"
176 faadbin="no"
177 faac="no"
178 xvid="no"
179 x264="no"
180 a52="no"
181 a52bin="no"
182 dts="no"
183 pp="no"
184 shared_pp="no"
185 mingw32="no"
186 cygwin="no"
187 os2="no"
188 lshared="no"
189 optimize="yes"
190 debug="yes"
191 dostrip="yes"
192 extralibs="-lm"
193 simpleidct="yes"
194 bigendian="no"
195 inttypes="yes"
196 emu_fast_int="no"
197 vhook="default"
198 dlfcn="no"
199 dlopen="no"
200 mpegaudio_hp="yes"
201 SHFLAGS=-shared
202 netserver="no"
203 need_inet_aton="no"
204 ffserver="yes"
205 ffplay="yes"
206 LIBOBJFLAGS=""
207 LDFLAGS=-Wl,--warn-common
208 FFSLDFLAGS=-Wl,-E
209 LDCONFIG="ldconfig"
210 LIBPREF="lib"
211 LIBSUF=".a"
212 SLIBPREF="lib"
213 SLIBSUF=".so"
214 EXESUF=""
215 BUILDSUF=""
216 amr_nb="no"
217 amr_wb="no"
218 amr_nb_fixed="no"
219 amr_if2="no"
220 sunmlib="no"
221 pthreads="no"
222 gpl="no"
223 memalignhack="no"
225 # OS specific
226 targetos=`uname -s`
227 case $targetos in
228 BeOS)
229 prefix="/boot/home/config"
230 # helps building libavcodec
231 CFLAGS="-DPIC -fomit-frame-pointer"
232 # 3 gcc releases known for BeOS, each with ugly bugs
233 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
234 case "$gcc_version" in
235 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
236 mmx="no"
238 *20010315*) echo "BeBits gcc"
239 CFLAGS="$CFLAGS -fno-expensive-optimizations"
241 esac
242 SHFLAGS=-nostart
243 # disable linux things
244 audio_oss="no"
245 v4l="no"
246 dv1394="no"
247 # enable beos things
248 audio_beos="yes"
249 # no need for libm, but the inet stuff
250 # Check for BONE
251 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
252 extralibs="-lbind -lsocket"
253 else
254 netserver="yes"
255 need_inet_aton="yes"
256 extralibs="-lnet"
257 fi ;;
258 SunOS)
259 v4l="no"
260 audio_oss="no"
261 dv1394="no"
262 make="gmake"
263 LDFLAGS=""
264 FFSLDFLAGS=""
265 need_inet_aton="yes"
266 extralibs="$extralibs -lsocket -lnsl"
268 NetBSD)
269 v4l="no"
270 bktr="yes"
271 audio_oss="yes"
272 dv1394="no"
273 make="gmake"
274 LDFLAGS="$LDFLAGS -export-dynamic"
275 case `uname -r` in
276 2.*) extralibs="-lossaudio"
278 esac
280 OpenBSD)
281 v4l="no"
282 bktr="yes"
283 audio_oss="yes"
284 dv1394="no"
285 make="gmake"
286 LIBOBJFLAGS="\$(PIC)"
287 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
288 LDCONFIG="ldconfig -m \$(libdir)"
289 extralibs="$extralibs -lossaudio"
291 FreeBSD)
292 v4l="no"
293 bktr="yes"
294 audio_oss="yes"
295 dv1394="no"
296 make="gmake"
297 CFLAGS="-pthread"
298 LDFLAGS="$LDFLAGS -export-dynamic -pthread"
300 BSD/OS)
301 v4l="no"
302 bktr="yes"
303 audio_oss="yes"
304 dv1394="no"
305 extralibs="-lpoll -lgnugetopt -lm"
306 make="gmake"
308 Darwin)
309 cc="cc"
310 v4l="no"
311 audio_oss="no"
312 dv1394="no"
313 ffserver="no"
314 SHFLAGS="-dynamiclib"
315 extralibs=""
316 darwin="yes"
317 strip="strip -x"
318 LDFLAGS="-Wl,-d,-search_paths_first"
319 FFSLDFLAGS=-Wl,-bind_at_load
321 MINGW32*)
322 # Note: the rest of the mingw32 config is done afterwards as mingw32
323 # can be forced on command line for linux cross compilation
324 mingw32="yes"
326 CYGWIN*)
327 v4l="no"
328 audio_oss="yes"
329 dv1394="no"
330 ffserver="no"
331 extralibs=""
332 cygwin="yes"
333 EXESUF=".exe"
335 Linux)
336 LDFLAGS="$LDFLAGS -rdynamic"
338 IRIX*)
339 ranlib="echo ignoring ranlib"
340 v4l="no"
341 audio_oss="no"
342 make="gmake"
344 OS/2)
345 TMPE=$TMPE".exe"
346 ar="emxomfar -p128"
347 ranlib="echo ignoring ranlib"
348 strip="echo ignoring strip"
349 CFLAGS="-Zomf"
350 LDFLAGS="-Zomf -Zstack 16384 -s"
351 SHFLAGS="-Zdll -Zomf"
352 FFSLDFLAGS=""
353 LIBPREF=""
354 LIBSUF=".lib"
355 SLIBPREF=""
356 SLIBSUF=".dll"
357 EXESUF=".exe"
358 extralibs=""
359 v4l="no"
360 audio_oss="no"
361 dv1394="no"
362 network="no"
363 ffserver="no"
364 vhook="no"
365 os2="yes"
368 *) ;;
369 esac
371 # From mplayer configure. We need TARGET_OS available
372 # to the Makefile, so it can distinguish between flavors
373 # of AltiVec on PowerPC
374 TARGET_OS=`( uname -s ) 2>&1`
375 case "$TARGET_OS" in
376 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
378 IRIX*)
379 TARGET_OS=IRIX
381 HP-UX*)
382 TARGET_OS=HP-UX
384 [cC][yY][gG][wW][iI][nN]*)
385 TARGET_OS=CYGWIN
388 TARGET_OS="$TARGET_OS-UNKNOWN"
390 esac
392 # find source path
393 source_path="`echo $0 | sed -e 's#/configure##'`"
394 source_path_used="yes"
395 if test -z "$source_path" -o "$source_path" = "." ; then
396 source_path=`pwd`
397 source_path_used="no"
398 else
399 source_path="`cd \"$source_path\"; pwd`"
402 FFMPEG_CONFIGURATION=" "
403 for opt do
404 FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
405 done
407 CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
409 for opt do
410 case "$opt" in
411 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
413 --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
415 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
417 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
419 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
421 --cc=*) cc=`echo $opt | cut -d '=' -f 2-`
423 --make=*) make=`echo $opt | cut -d '=' -f 2`
425 --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
427 --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
429 --extra-libs=*) extralibs=${opt#--extra-libs=}
431 --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
433 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
435 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
437 --powerpc-perf-enable) powerpc_perf="yes"
439 --disable-mmx) mmx="no"
441 --disable-iwmmxt) iwmmxt="no"
443 --disable-altivec) altivec="no"
445 --enable-gprof) gprof="yes"
447 --disable-v4l) v4l="no"
449 --disable-bktr) bktr="no"
451 --disable-audio-oss) audio_oss="no"
453 --disable-audio-beos) audio_beos="no"
455 --disable-dv1394) dv1394="no"
457 --disable-network) network="no"; ffserver="no"
459 --disable-zlib) zlib="no"
461 --enable-a52) a52="yes"
463 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
465 --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
467 --enable-pp) pp="yes"
469 --enable-shared-pp) shared_pp="yes"
471 --enable-libgsm) libgsm="yes"
473 --enable-mp3lame) mp3lame="yes"
475 --enable-libogg) libogg="yes"
477 --enable-vorbis) vorbis="yes"
479 --enable-theora) theora="yes"
481 --enable-faad) faad="yes"
483 --enable-faadbin) faadbin="yes"
485 --enable-faac) faac="yes"
487 --enable-xvid) xvid="yes"
489 --enable-x264) x264="yes"; extralibs="$extralibs -lx264"
491 --enable-dc1394) dc1394="yes"
493 --disable-vhook) vhook="no"
495 --disable-simple_idct) simpleidct="no"
497 --enable-mingw32) mingw32="yes"
499 --enable-shared) lshared="yes"
501 --disable-debug) debug="no"
503 --disable-opts) optimize="no"
505 --disable-mpegaudio-hp) mpegaudio_hp="no"
507 --disable-ffserver) ffserver="no"
509 --disable-ffplay) ffplay="no"
511 --enable-small) optimize="small"
513 --enable-amr_nb) amr_nb="yes"
515 --enable-amr_nb-fixed) amr_nb_fixed="yes"
517 --enable-amr_wb) amr_wb="yes"
519 --enable-amr_if2) amr_if2="yes"
521 --enable-sunmlib) sunmlib="yes"
523 --enable-pthreads) pthreads="yes"
525 --enable-gpl) gpl="yes"
527 --enable-memalign-hack) memalignhack="yes"
529 --disable-strip) dostrip="no"
531 --enable-codec=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-codec=}"
533 --disable-codec=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-codec=}##\"`"
535 --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
537 --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`"
539 esac
540 done
542 if test "$theora" = "yes" ; then
543 if test "$libogg" = "no"; then
544 echo "libogg must be enabled to enable Theora"
545 fail="yes"
546 theora="no"
550 if test "$vorbis" = "yes" ; then
551 if test "$libogg" = "no"; then
552 echo "libogg must be enabled to enable Vorbis"
553 fail="yes"
554 vorbis="no"
558 if test "$gpl" != "yes"; then
559 if test "$pp" != "no" -o "$shared_pp" != "no"; then
560 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
561 fail="yes"
564 if test "$a52" != "no" -o "$a52bin" != "no"; then
565 echo "liba52 is under GPL and --enable-gpl is not specified"
566 fail="yes"
569 if test "$xvid" != "no"; then
570 echo "libxvidcore is under GPL and --enable-gpl is not specified"
571 fail="yes"
574 if test "$x264" != "no"; then
575 echo "x264 is under GPL and --enable-gpl is not specified"
576 fail="yes"
579 if test "$dts" != "no"; then
580 echo "libdts is under GPL and --enable-gpl is not specified"
581 fail="yes"
584 if test "$faad" != "no" -o "$faadbin" != "no"; then
585 cat > $TMPC << EOF
586 #include <faad.h>
587 int main( void ) { return 0; }
590 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
591 cat > $TMPC << EOF
592 #include <faad.h>
593 #ifndef FAAD2_VERSION
594 ok faad1
595 #endif
596 int main( void ) { return 0; }
598 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
599 echo "faad2 is under GPL and --enable-gpl is not specified"
600 fail="yes"
602 else
603 faad="no"
604 faadbin="no"
605 echo "faad test failed"
610 if test "$fail" = "yes"; then
611 exit 1
615 # compute mmx state
616 if test $mmx = "default"; then
617 if test $cpu = "x86" -o $cpu = "x86_64"; then
618 mmx="yes"
619 else
620 mmx="no"
624 # check iwmmxt support
625 if test $iwmmxt = "default" -a $cpu = "armv4l"; then
626 cat > $TMPC << EOF
627 int main(void) {
628 __asm__ __volatile__ ("wunpckelub wr6, wr4");
632 iwmmxt=no
633 if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
634 iwmmxt=yes
638 #Darwin CC versions
639 needmdynamicnopic="no"
640 if test $targetos = Darwin; then
641 if test -n "`$cc -v 2>&1 | grep xlc`"; then
642 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
643 else
644 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
645 case "$gcc_version" in
646 *2.95*)
647 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
649 *[34].*)
650 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
651 if test "$lshared" = no; then
652 needmdynamicnopic="yes"
656 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
657 if test "$lshared" = no; then
658 needmdynamicnopic="yes"
661 esac
665 # Can only do AltiVec on PowerPC
666 if test $altivec = "default"; then
667 if test $cpu = "powerpc"; then
668 altivec="yes"
669 else
670 altivec="no"
674 # Add processor-specific flags
675 TUNECPU="generic"
676 POWERPCMODE="32bits"
677 if test $tune != "generic"; then
678 case $tune in
679 601|ppc601|PowerPC601)
680 CFLAGS="$CFLAGS -mcpu=601"
681 if test $altivec = "yes"; then
682 echo "WARNING: tuning for PPC601 but altivec enabled !";
684 TUNECPU=ppc601
686 603*|ppc603*|PowerPC603*)
687 CFLAGS="$CFLAGS -mcpu=603"
688 if test $altivec = "yes"; then
689 echo "WARNING: tuning for PPC603 but altivec enabled !";
691 TUNECPU=ppc603
693 604*|ppc604*|PowerPC604*)
694 CFLAGS="$CFLAGS -mcpu=604"
695 if test $altivec = "yes"; then
696 echo "WARNING: tuning for PPC604 but altivec enabled !";
698 TUNECPU=ppc604
700 G3|g3|75*|ppc75*|PowerPC75*)
701 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
702 if test $altivec = "yes"; then
703 echo "WARNING: tuning for PPC75x but altivec enabled !";
705 TUNECPU=ppc750
707 G4|g4|745*|ppc745*|PowerPC745*)
708 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
709 if test $altivec = "no"; then
710 echo "WARNING: tuning for PPC745x but altivec disabled !";
712 TUNECPU=ppc7450
714 74*|ppc74*|PowerPC74*)
715 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
716 if test $altivec = "no"; then
717 echo "WARNING: tuning for PPC74xx but altivec disabled !";
719 TUNECPU=ppc7400
721 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
722 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
723 if test $altivec = "no"; then
724 echo "WARNING: tuning for PPC970 but altivec disabled !";
726 TUNECPU=ppc970
727 POWERPCMODE="64bits"
729 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)
730 CFLAGS="$CFLAGS -march=$tune"
733 echo "WARNING: unknown CPU \"$tune\", ignored"
735 esac
738 # AltiVec flags: The FSF version of GCC differs from the Apple version
739 if test $cpu = "powerpc"; then
740 if test $altivec = "yes"; then
741 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
742 CFLAGS="$CFLAGS -faltivec"
743 else
744 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
749 # See if we have <altivec.h>
750 cat > $TMPC << EOF
751 #include <altivec.h>
752 int main( void ) { return 0; }
755 _altivec_h="no"
756 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
757 _altivec_h="yes"
760 # See does our compiler support Motorola AltiVec C API
761 if test $altivec = "yes"; then
762 if test $_altivec_h = "yes"; then
763 cat > $TMPC << EOF
764 #include <altivec.h>
765 int main(void) {
766 vector signed int v1, v2, v3;
767 v1 = vec_add(v2,v3);
768 return 0;
771 else
772 cat > $TMPC << EOF
773 int main(void) {
774 vector signed int v1, v2, v3;
775 v1 = vec_add(v2,v3);
776 return 0;
780 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
783 # Can only do mmi on mips
784 if test $mmi = "default"; then
785 if test $cpu = "mips"; then
786 mmi="yes"
787 else
788 mmi="no"
792 # See does our compiler support mmi
793 if test $mmi = "yes"; then
794 cat > $TMPC << EOF
795 int main(void) {
796 __asm__ ("lq \$2, 0(\$2)");
797 return 0;
800 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
803 if test "$mingw32" = "yes" ; then
804 v4l="no"
805 bktr="no"
806 audio_oss="no"
807 dv1394="no"
808 dc1394="no"
809 ffserver="no"
810 network="no"
811 LIBPREF=""
812 LIBSUF=".lib"
813 SLIBPREF=""
814 SLIBSUF=".dll"
815 EXESUF=".exe"
816 if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
817 if test "$force_libdir" != yes; then bindir="$prefix"; fi
820 cc="${cross_prefix}${cc}"
821 ar="${cross_prefix}${ar}"
822 ranlib="${cross_prefix}${ranlib}"
823 strip="${cross_prefix}${strip}"
825 if test -z "$cross_prefix" ; then
827 # ---
828 # big/little endian test
829 cat > $TMPC << EOF
830 #include <inttypes.h>
831 int main(int argc, char ** argv){
832 volatile uint32_t i=0x01234567;
833 return (*((uint8_t*)(&i))) == 0x67;
837 if $cc -o $TMPE $TMPC 2>/dev/null ; then
838 $TMPE && bigendian="yes"
839 else
840 echo big/little test failed
843 else
845 # if cross compiling, cannot launch a program, so make a static guess
846 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
847 bigendian="yes"
852 # ---
853 # *inttypes.h* test
854 cat > $TMPC << EOF
855 #include <inttypes.h>
856 int main(int argc, char ** argv){
857 return 0;
861 $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
863 # ---
864 # *int_fast* test
865 cat > $TMPC << EOF
866 #include <inttypes.h>
867 int main(int argc, char ** argv){
868 volatile uint_fast64_t i=0x01234567;
869 return 0;
873 $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
875 # ---
876 # check availability of some header files
878 cat > $TMPC << EOF
879 #include <malloc.h>
880 int main( void ) { return 0; }
883 _memalign=no
884 _malloc_h=no
885 if $cc -o $TMPE $TMPC 2> /dev/null ; then
886 _malloc_h=yes
887 _memalign=yes
888 # check for memalign - atmos
889 cat > $TMPC << EOF
890 #include <stdio.h>
891 #include <malloc.h>
892 int main ( void ) {
893 char *string = NULL;
894 string = memalign(64, sizeof(char));
895 return 0;
898 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
901 if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
902 echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
903 exit 1
906 cat > $TMPC << EOF
907 #include <time.h>
908 int main( void ) { localtime_r(NULL, NULL); }
911 localtime_r=no
912 if $cc -o $TMPE $TMPC 2> /dev/null ; then
913 localtime_r=yes
916 if test "$zlib" = "yes"; then
917 # check for zlib - mmu_man
918 cat > $TMPC << EOF
919 #include <zlib.h>
920 int main ( void ) {
921 if (zlibVersion() != ZLIB_VERSION)
922 puts("zlib version differs !!!");
923 return 1;
924 return 0;
927 $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
928 # $TMPE 2> /dev/null > /dev/null || zlib="no"
929 # XXX: more tests needed - runtime test
931 if test "$zlib" = "yes"; then
932 extralibs="$extralibs -lz"
935 # test for lrintf in math.h
936 cat > $TMPC << EOF
937 #define _ISOC9X_SOURCE 1
938 #include <math.h>
939 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
942 have_lrintf="no"
943 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
944 have_lrintf="yes"
945 # allanc@chickenandporn.com: cannot execute cross-compiled
946 # code on the host. Only execute if not cross-compiling.
947 if test -z "$cross_prefix" ; then
948 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
952 _restrict=
953 for restrict_keyword in restrict __restrict__ __restrict; do
954 echo "void foo(char * $restrict_keyword p);" > $TMPC
955 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
956 _restrict=$restrict_keyword
957 break;
959 done
961 # test gcc version to see if vector builtins can be used
962 # currently only used on i386 for MMX builtins
963 cat > $TMPC << EOF
964 #include <xmmintrin.h>
965 int main(void) {
966 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
967 return 0;
968 #else
969 #error no vector builtins
970 #endif
974 builtin_vector=no
975 if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
976 builtin_vector=yes
979 # dlopen/dlfcn.h probing
981 cat > $TMPC << EOF
982 #include <dlfcn.h>
983 int main( void ) { return (int) dlopen("foo", 0); }
986 ldl=-ldl
988 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
989 dlfcn=yes
990 dlopen=yes
993 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
994 dlfcn=yes
995 dlopen=yes
996 ldl=""
999 cat > $TMPC << EOF
1000 int main( void ) { return (int) dlopen("foo", 0); }
1003 if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1004 dlopen=yes
1007 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
1008 dlopen=yes
1009 ldl=""
1012 if test "$vhook" = "default" ; then
1013 vhook="$dlopen"
1016 ##########################################
1017 # imlib probe
1019 cat > $TMPC << EOF
1020 #include <X11/Xlib.h>
1021 #include <Imlib2.h>
1022 int main( void ) { return (int) imlib_load_font("foo"); }
1025 imlib2=no
1026 if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
1027 imlib2=yes
1030 ##########################################
1031 # freetype probe
1033 cat > $TMPC << EOF
1034 #include <ft2build.h>
1035 int main( void ) { return (int) FT_Init_FreeType(0); }
1038 freetype2=no
1039 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
1040 if (freetype-config --version) >/dev/null 2>&1 ; then
1041 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
1042 freetype2=yes
1047 ##########################################
1048 # SDL probe
1050 cat > $TMPC << EOF
1051 #include <SDL.h>
1052 #undef main /* We don't want SDL to override our main() */
1053 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1056 sdl_too_old=no
1057 sdl=no
1058 if (sdl-config --version) >/dev/null 2>&1 ; then
1059 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
1060 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1061 if test "$_sdlversion" -lt 121 ; then
1062 sdl_too_old=yes
1063 else
1064 sdl=yes
1069 ##########################################
1070 # texi2html probe
1072 texi2html=no
1073 if (texi2html -version) >/dev/null 2>&1; then
1074 texi2html=yes
1077 if test "$network" = "yes" ; then
1078 ##########################################
1079 # IPv6 probe
1081 cat > $TMPC << EOF
1082 #include <sys/types.h>
1083 #include <sys/socket.h>
1084 #include <netinet/in.h>
1085 #include <netdb.h>
1086 int main( void ) {
1087 struct sockaddr_storage saddr;
1088 struct ipv6_mreq mreq6;
1089 getaddrinfo(0,0,0,0);
1090 getnameinfo(0,0,0,0,0,0,0);
1091 IN6_IS_ADDR_MULTICAST(0);
1095 ipv6=no
1096 if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
1097 ipv6=yes
1101 case "`$cc -v 2>&1 | grep version`" in
1102 *gcc*)
1103 CFLAGS="-Wall -Wno-switch $CFLAGS"
1107 esac
1109 if test "$sdl" = "no" ; then
1110 ffplay=no
1113 if test "$debug" = "yes"; then
1114 CFLAGS="-g $CFLAGS"
1117 if test "$optimize" = "small"; then
1118 # CFLAGS=${CFLAGS//-O3/-Os}
1119 CFLAGS="$CFLAGS -Os"
1122 if test "$optimize" = "yes"; then
1123 if test -n "`$cc -v 2>&1 | grep xlc`"; then
1124 CFLAGS="$CFLAGS -O5"
1125 LDFLAGS="$LDFLAGS -O5"
1126 else
1127 CFLAGS="-O3 $CFLAGS"
1131 # PIC flags for shared library objects where they are needed
1132 if test "$lshared" = "yes" ; then
1133 # LIBOBJFLAGS may have already been set in the OS configuration
1134 if test -z "$LIBOBJFLAGS" ; then
1135 if test "$cpu" = "x86_64" ; then
1136 LIBOBJFLAGS="\$(PIC)"
1141 if test x"$bindir" = x""; then
1142 bindir="${prefix}/bin"
1145 if test x"$libdir" = x""; then
1146 libdir="${prefix}/lib"
1149 if test x"$mandir" = x""; then
1150 mandir="${prefix}/man"
1153 echo "Install prefix $prefix"
1154 echo "Source path $source_path"
1155 echo "C compiler $cc"
1156 echo "make $make"
1157 echo "CPU $cpu ($tune)"
1158 if test "$BUILDSUF" != ""; then
1159 echo "Build suffix $BUILDSUF"
1161 echo "Big Endian $bigendian"
1162 echo "inttypes.h $inttypes"
1163 echo "broken inttypes.h $emu_fast_int"
1164 if test $cpu = "x86" -o $cpu = "x86_64"; then
1165 echo "MMX enabled $mmx"
1166 echo "Vector Builtins $builtin_vector"
1168 if test $cpu = "armv4l"; then
1169 echo "IWMMXT enabled $iwmmxt"
1171 if test $cpu = "mips"; then
1172 echo "MMI enabled $mmi"
1174 if test $cpu = "powerpc"; then
1175 echo "AltiVec enabled $altivec"
1177 echo "gprof enabled $gprof"
1178 echo "zlib enabled $zlib"
1179 echo "libgsm enabled $libgsm"
1180 echo "mp3lame enabled $mp3lame"
1181 echo "libogg enabled $libogg"
1182 echo "vorbis enabled $vorbis"
1183 echo "theora enabled $theora"
1184 echo "faad enabled $faad"
1185 echo "faadbin enabled $faadbin"
1186 echo "faac enabled $faac"
1187 echo "xvid enabled $xvid"
1188 echo "x264 enabled $x264"
1189 echo "a52 support $a52"
1190 echo "a52 dlopened $a52bin"
1191 echo "dts support $dts"
1192 echo "pp support $pp"
1193 echo "debug symbols $debug"
1194 echo "strip symbols $dostrip"
1195 echo "optimize $optimize"
1196 echo "shared pp $shared_pp"
1197 echo "Video hooking $vhook"
1198 echo "SDL support $sdl"
1199 if test $sdl_too_old = "yes"; then
1200 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1203 if test "$vhook" = "yes" ; then
1204 echo "Imlib2 support $imlib2"
1205 echo "freetype support $freetype2"
1207 echo "Sun medialib support" $sunmlib
1208 echo "pthreads support" $pthreads
1209 echo "AMR-NB float support" $amr_nb
1210 echo "AMR-NB fixed support" $amr_nb_fixed
1211 echo "AMR-WB float support" $amr_wb
1212 echo "AMR-WB IF2 support" $amr_if2
1213 echo "network support $network"
1214 if test "$network" = "yes" ; then
1215 echo "IPv6 support $ipv6"
1217 if test "$gpl" = "no" ; then
1218 echo "License: LGPL"
1219 else
1220 echo "License: GPL"
1223 # CINELERRA - This script makes avconfig.h directly!
1224 echo "creating avconfig.mak and avconfig.h"
1226 date >> config.log
1227 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1228 echo "# Automatically generated by configure - do not modify" > config.mak
1229 echo "/* Automatically generated by configure - do not modify */" > $TMPH
1230 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1232 echo "prefix=$prefix" >> config.mak
1233 echo "libdir=$libdir" >> config.mak
1234 echo "bindir=$bindir" >> config.mak
1235 echo "mandir=$mandir" >> config.mak
1236 echo "MAKE=$make" >> config.mak
1237 echo "CC=$cc" >> config.mak
1238 echo "AR=$ar" >> config.mak
1239 echo "RANLIB=$ranlib" >> config.mak
1240 if test "$dostrip" = "yes" ; then
1241 echo "STRIP=$strip" >> config.mak
1242 echo "INSTALLSTRIP=-s" >> config.mak
1243 else
1244 echo "STRIP=echo ignoring strip" >> config.mak
1245 echo "INSTALLSTRIP=" >> config.mak
1248 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1249 # shared modules on OS/X (vhook/Makefile).
1250 SHCFLAGS=$CFLAGS
1251 if test "$needmdynamicnopic" = yes; then
1252 CFLAGS="$CFLAGS -mdynamic-no-pic"
1255 echo "OPTFLAGS=$CFLAGS" >> config.mak
1256 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1257 echo "LDFLAGS=$LDFLAGS" >> config.mak
1258 echo "LDCONFIG=$LDCONFIG" >> config.mak
1259 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1260 echo "SHFLAGS=$SHFLAGS" >> config.mak
1261 echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
1262 echo "BUILDSUF=$BUILDSUF" >> config.mak
1263 echo "LIBPREF=$LIBPREF" >> config.mak
1264 echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1265 echo "SLIBPREF=$SLIBPREF" >> config.mak
1266 echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1267 echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1268 echo "TARGET_OS=$TARGET_OS" >> config.mak
1269 if test "$cpu" = "x86" ; then
1270 echo "TARGET_ARCH_X86=yes" >> config.mak
1271 echo "#define ARCH_X86 1" >> $TMPH
1272 elif test "$cpu" = "x86_64" ; then
1273 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1274 echo "#define ARCH_X86_64 1" >> $TMPH
1275 elif test "$cpu" = "armv4l" ; then
1276 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1277 echo "#define ARCH_ARMV4L 1" >> $TMPH
1278 elif test "$cpu" = "alpha" ; then
1279 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1280 echo "#define ARCH_ALPHA 1" >> $TMPH
1281 elif test "$cpu" = "sparc64" ; then
1282 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1283 echo "#define ARCH_SPARC64 1" >> $TMPH
1284 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1285 echo "#define ARCH_SPARC 1" >> $TMPH
1286 elif test "$cpu" = "sparc" ; then
1287 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1288 echo "#define ARCH_SPARC 1" >> $TMPH
1289 elif test "$cpu" = "powerpc" ; then
1290 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1291 echo "#define ARCH_POWERPC 1" >> $TMPH
1292 if test $POWERPCMODE = "32bits"; then
1293 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1294 else
1295 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1297 if test "$powerpc_perf" = "yes"; then
1298 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1300 elif test "$cpu" = "mips" ; then
1301 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1302 echo "#define ARCH_MIPS 1" >> $TMPH
1303 elif test "$cpu" = "sh4" ; then
1304 echo "TARGET_ARCH_SH4=yes" >> config.mak
1305 echo "#define ARCH_SH4 1" >> $TMPH
1307 echo "#define TUNECPU $TUNECPU" >> $TMPH
1308 if test "$bigendian" = "yes" ; then
1309 echo "WORDS_BIGENDIAN=yes" >> config.mak
1310 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1312 if test "$inttypes" != "yes" ; then
1313 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1315 if test "$emu_fast_int" = "yes" ; then
1316 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1318 if test "$mmx" = "yes" ; then
1319 echo "TARGET_MMX=yes" >> config.mak
1320 echo "#define HAVE_MMX 1" >> $TMPH
1321 echo "#define __CPU__ 586" >> $TMPH
1323 if test "$builtin_vector" = "yes" ; then
1324 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1325 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1327 if test "$iwmmxt" = "yes" ; then
1328 echo "TARGET_IWMMXT=yes" >> config.mak
1329 echo "#define HAVE_IWMMXT 1" >> $TMPH
1331 if test "$mmi" = "yes" ; then
1332 echo "TARGET_MMI=yes" >> config.mak
1333 echo "#define HAVE_MMI 1" >> $TMPH
1335 if test "$altivec" = "yes" ; then
1336 echo "TARGET_ALTIVEC=yes" >> config.mak
1337 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1338 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1339 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1340 if test "$_altivec_h" = "yes" ; then
1341 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1342 else
1343 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1346 if test "$gprof" = "yes" ; then
1347 echo "TARGET_GPROF=yes" >> config.mak
1348 echo "#define HAVE_GPROF 1" >> $TMPH
1350 if test "$localtime_r" = "yes" ; then
1351 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1353 if test "$imlib2" = "yes" ; then
1354 echo "HAVE_IMLIB2=yes" >> config.mak
1356 if test "$freetype2" = "yes" ; then
1357 echo "HAVE_FREETYPE2=yes" >> config.mak
1359 if test "$sunmlib" = "yes" ; then
1360 echo "HAVE_MLIB=yes" >> config.mak
1361 echo "#define HAVE_MLIB 1" >> $TMPH
1362 extralibs="$extralibs -lmlib"
1364 if test "$pthreads" = "yes" ; then
1365 echo "HAVE_PTHREADS=yes" >> config.mak
1366 echo "#define HAVE_PTHREADS 1" >> $TMPH
1367 echo "#define HAVE_THREADS 1" >> $TMPH
1368 if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
1369 extralibs="$extralibs -lpthread"
1372 if test "$sdl" = "yes" ; then
1373 echo "CONFIG_SDL=yes" >> config.mak
1374 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1375 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1377 if test "$texi2html" = "yes"; then
1378 echo "BUILD_DOC=yes" >> config.mak
1380 if test "$have_lrintf" = "yes" ; then
1381 echo "#define HAVE_LRINTF 1" >> $TMPH
1383 if test "$vhook" = "yes" ; then
1384 echo "BUILD_VHOOK=yes" >> config.mak
1385 echo "#define HAVE_VHOOK 1" >> $TMPH
1386 extralibs="$extralibs $ldl"
1388 if test "$lshared" = "yes" ; then
1389 echo "BUILD_SHARED=yes" >> config.mak
1390 echo "PIC=-fPIC -DPIC" >> config.mak
1392 echo "EXTRALIBS=$extralibs" >> config.mak
1393 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1394 cut -d '"' -f 2`
1395 echo "VERSION=$version" >>config.mak
1396 # if you do not want to use encoders, disable that.
1397 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1398 echo "CONFIG_ENCODERS=yes" >> config.mak
1400 # if you do not want to use decoders, disable that.
1401 echo "#define CONFIG_DECODERS 1" >> $TMPH
1402 echo "CONFIG_DECODERS=yes" >> config.mak
1404 # AC3
1405 if test "$a52" = "yes" ; then
1406 echo "#define CONFIG_AC3 1" >> $TMPH
1407 echo "CONFIG_AC3=yes" >> config.mak
1409 if test "$a52bin" = "yes" ; then
1410 echo "#define CONFIG_A52BIN 1" >> $TMPH
1411 echo "CONFIG_A52BIN=yes" >> config.mak
1415 # DTS
1416 if test "$dts" = "yes" ; then
1417 echo "#define CONFIG_DTS 1" >> $TMPH
1418 echo "CONFIG_DTS=yes" >> config.mak
1421 # PP
1422 if test "$pp" = "yes" ; then
1423 echo "#define CONFIG_PP 1" >> $TMPH
1424 echo "CONFIG_PP=yes" >> config.mak
1426 if test "$shared_pp" = "yes" ; then
1427 echo "#define SHARED_PP 1" >> $TMPH
1428 echo "SHARED_PP=yes" >> config.mak
1432 # mpeg audio high precision mode
1433 if test "$mpegaudio_hp" = "yes" ; then
1434 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1437 if test "$v4l" = "yes" ; then
1438 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1439 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1442 if test "$bktr" = "yes" ; then
1443 echo "#define CONFIG_BKTR 1" >> $TMPH
1444 echo "CONFIG_BKTR=yes" >> config.mak
1447 if test "$dv1394" = "yes" ; then
1448 echo "#define CONFIG_DV1394 1" >> $TMPH
1449 echo "CONFIG_DV1394=yes" >> config.mak
1452 if test "$dc1394" = "yes" ; then
1453 echo "#define CONFIG_DC1394 1" >> $TMPH
1454 echo "CONFIG_DC1394=yes" >> config.mak
1457 if test "$dlopen" = "yes" ; then
1458 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1461 if test "$dlfcn" = "yes" ; then
1462 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1465 if test "$audio_oss" = "yes" ; then
1466 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1467 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1470 if test "$audio_beos" = "yes" ; then
1471 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1472 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1475 if test "$network" = "yes" ; then
1476 echo "#define CONFIG_NETWORK 1" >> $TMPH
1477 echo "CONFIG_NETWORK=yes" >> config.mak
1480 if test "$ipv6" = "yes" ; then
1481 echo "#define CONFIG_IPV6 1" >> $TMPH
1484 if test "$zlib" = "yes" ; then
1485 echo "#define CONFIG_ZLIB 1" >> $TMPH
1486 echo "CONFIG_ZLIB=yes" >> config.mak
1489 if test "$libgsm" = "yes" ; then
1490 echo "#define CONFIG_LIBGSM 1" >> $TMPH
1491 echo "CONFIG_LIBGSM=yes" >> config.mak
1494 if test "$mp3lame" = "yes" ; then
1495 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1496 echo "CONFIG_MP3LAME=yes" >> config.mak
1499 if test "$libogg" = "yes" ; then
1500 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1501 echo "CONFIG_LIBOGG=yes" >> config.mak
1504 if test "$vorbis" = "yes" ; then
1505 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1506 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1509 if test "$theora" = "yes" ; then
1510 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1511 echo "CONFIG_LIBTHEORA=yes" >> config.mak
1514 if test "$faad" = "yes" ; then
1515 echo "#define CONFIG_FAAD 1" >> $TMPH
1516 echo "CONFIG_FAAD=yes" >> config.mak
1519 if test "$faadbin" = "yes" ; then
1520 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1521 echo "CONFIG_FAADBIN=yes" >> config.mak
1524 if test "$faac" = "yes" ; then
1525 echo "#define CONFIG_FAAC 1" >> $TMPH
1526 echo "CONFIG_FAAC=yes" >> config.mak
1529 if test "$xvid" = "yes" ; then
1530 echo "#define CONFIG_XVID 1" >> $TMPH
1531 echo "CONFIG_XVID=yes" >> config.mak
1534 if test "$x264" = "yes" ; then
1535 echo "#define CONFIG_X264 1" >> $TMPH
1536 echo "CONFIG_X264=yes" >> config.mak
1539 if test "$mingw32" = "yes" ; then
1540 echo "#define CONFIG_WIN32 1" >> $TMPH
1541 echo "CONFIG_WIN32=yes" >> config.mak
1542 echo "HAVE_W32THREADS=yes" >> config.mak
1543 echo "#define HAVE_W32THREADS 1" >> $TMPH
1544 echo "#define HAVE_THREADS 1" >> $TMPH
1545 echo "#ifndef __MINGW32__" >> $TMPH
1546 echo "#define __MINGW32__ 1" >> $TMPH
1547 echo "#endif" >> $TMPH
1550 if test "$os2" = "yes" ; then
1551 echo "#define CONFIG_OS2 1" >> $TMPH
1552 echo "CONFIG_OS2=yes" >> config.mak
1555 if test "$TARGET_OS" = "SunOS" ; then
1556 echo "#define CONFIG_SUNOS 1" >> $TMPH
1559 if test "$TARGET_OS" = "BeOS" ; then
1560 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1561 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1562 echo "#define HAVE_THREADS 1" >> $TMPH
1565 if test "$darwin" = "yes"; then
1566 echo "#define CONFIG_DARWIN 1" >> $TMPH
1567 echo "CONFIG_DARWIN=yes" >> config.mak
1570 if test "$_malloc_h" = "yes" ; then
1571 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1572 else
1573 echo "#undef HAVE_MALLOC_H" >> $TMPH
1576 if test "$_memalign" = "yes" ; then
1577 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1578 else
1579 echo "#undef HAVE_MEMALIGN" >> $TMPH
1582 if test "$memalignhack" = "yes" ; then
1583 echo "#define MEMALIGN_HACK 1" >> $TMPH
1587 if test "$netserver" = "yes" ; then
1588 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1589 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1592 if test "$need_inet_aton" = "yes" ; then
1593 echo "NEED_INET_ATON=yes" >> config.mak
1596 if test "$simpleidct" = "yes" ; then
1597 echo "#define SIMPLE_IDCT 1" >> $TMPH
1600 if test "$ffserver" = "yes" ; then
1601 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1602 echo "CONFIG_FFSERVER=yes" >> config.mak
1605 if test "$ffplay" = "yes" ; then
1606 echo "CONFIG_FFPLAY=yes" >> config.mak
1609 if test "$gpl" = "yes" ; then
1610 echo "#define CONFIG_GPL 1" >> $TMPH
1611 echo "CONFIG_GPL=yes" >> config.mak
1614 echo "#define restrict $_restrict" >> $TMPH
1616 if test "$optimize" = "small"; then
1617 echo "#define always_inline" >> $TMPH
1620 # build tree in object directory if source path is different from current one
1621 if test "$source_path_used" = "yes" ; then
1622 DIRS="doc libavformat libavcodec libavcodec/alpha libavcodec/armv4l \
1623 libavcodec/i386 libavcodec/sparc libavcodec/mlib \
1624 libavcodec/ppc libavcodec/liba52 libavcodec/libpostproc tests vhook"
1625 FILES="Makefile libavformat/Makefile libavcodec/Makefile \
1626 libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile \
1627 doc/Makefile doc/texi2pod.pl"
1628 # CINELERRA - commented to avoid creating directories...
1629 # for dir in $DIRS ; do
1630 # mkdir -p $dir
1631 # done
1632 # for f in $FILES ; do
1633 # ln -sf "$source_path/$f" $f
1634 # done
1635 echo "SRC_PATH=$source_path" >> config.mak
1636 else
1637 echo "SRC_PATH='$source_path'" >> config.mak
1640 if test "$amr_wb" = "yes" ; then
1641 echo "#define AMR_WB 1" >> $TMPH
1642 echo "AMR_WB=yes" >> config.mak
1643 echo
1644 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1645 echo "V5.1.0 from "
1646 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1647 echo "and extracted the source to libavcodec/amrwb_float"
1648 echo
1651 if test "$amr_nb" = "yes" ; then
1652 echo "#define AMR_NB 1" >> $TMPH
1653 echo "AMR_NB=yes" >> config.mak
1654 echo
1655 if test "$amr_nb_fixed" = "yes" ; then
1656 echo "AMR_NB_FIXED=yes" >> config.mak
1657 echo "#define AMR_NB_FIXED 1" >> $TMPH
1658 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1659 echo "REL-5 version 5.1.0 from "
1660 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1661 echo "and extracted src to libavcodec/amr"
1662 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1663 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1664 echo
1665 else
1666 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1667 echo "REL-5 V5.1.0 from "
1668 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1669 echo "and extracted the source to libavcodec/amr_float"
1670 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1671 echo
1674 if test "$amr_if2" = "yes" ; then
1675 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1680 for codec in $CODEC_LIST ; do
1681 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1682 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1683 done
1685 # CINELERRA - This script makes avconfig.h directly!
1686 diff $TMPH avconfig.h >/dev/null 2>&1
1687 if test $? -ne 0 ; then
1688 mv -f $TMPH avconfig.h
1689 else
1690 echo "avconfig.h is unchanged"
1693 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1696 # build pkg-config files libavcodec.pc, libavformat.pc and libpostproc.pc
1698 lavc_build=`grep '#define LIBAVCODEC_BUILD' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9]//g'`
1699 # CINELERRA: libavformat directory not actually in the Cinelerra repo
1700 #lavf_build=`grep '#define LIBAVFORMAT_BUILD' "$source_path/libavformat/avformat.h" | sed 's/[^0-9]//g'`
1702 requires=
1703 test "$libogg" = "yes" && requires="$requires ogg >= 1.1"
1704 test "$vorbis" = "yes" && requires="$requires vorbis"
1705 test "$theora" = "yes" && requires="$requires theora"
1707 # CINELERRA:
1708 # BEGIN COMMENTING OUT THE .pc FILES
1709 if test 1 -eq 0 ; then
1711 # libavcodec.pc
1712 cat <<EOF >libavcodec.pc
1713 prefix=$prefix
1714 exec_prefix=\${prefix}
1715 libdir=\${exec_prefix}/lib
1716 includedir=\${prefix}/include
1718 Name: libavcodec
1719 Description: FFmpeg codec library
1720 Version: $version-$lavc_build
1721 Requires: $requires
1722 Conflicts:
1723 Libs: -L\${libdir} -lavcodec $extralibs
1724 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1727 cat <<EOF >libavcodec-uninstalled.pc
1728 prefix=
1729 exec_prefix=
1730 libdir=\${pcfiledir}/libavcodec
1731 includedir=\${pcfiledir}/libavcodec
1733 Name: libavcodec
1734 Description: FFmpeg codec library
1735 Version: $version-$lavc_build
1736 Requires: $requires
1737 Conflicts:
1738 Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1739 Cflags: -I\${includedir}
1742 # libavformat.pc
1743 cat <<EOF >libavformat.pc
1744 prefix=$prefix
1745 exec_prefix=\${prefix}
1746 libdir=\${exec_prefix}/lib
1747 includedir=\${prefix}/include
1749 Name: libavformat
1750 Description: FFmpeg container format library
1751 Version: $version-$lavf_build
1752 Requires: $requires libavcodec = $version-$lavc_build
1753 Conflicts:
1754 Libs: -L\${libdir} -lavformat $extralibs
1755 Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1758 cat <<EOF >libavformat-uninstalled.pc
1759 prefix=
1760 exec_prefix=
1761 libdir=\${pcfiledir}/libavformat
1762 includedir=\${pcfiledir}/libavformat
1764 Name: libavformat
1765 Description: FFmpeg container format library
1766 Version: $version-$lavf_build
1767 Requires: $requires libavcodec = $version-$lavc_build
1768 Conflicts:
1769 Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1770 Cflags: -I\${includedir}
1774 # libpostproc.pc
1775 cat <<EOF >libpostproc.pc
1776 prefix=$prefix
1777 exec_prefix=\${prefix}
1778 libdir=\${exec_prefix}/lib
1779 includedir=\${prefix}/include
1781 Name: libpostproc
1782 Description: FFmpeg post processing library
1783 Version: $version
1784 Requires:
1785 Conflicts:
1786 Libs: -L\${libdir} -lpostproc
1787 Cflags: -I\${includedir} -I\${includedir}/postproc
1790 cat <<EOF >libpostproc-uninstalled.pc
1791 prefix=
1792 exec_prefix=
1793 libdir=\${pcfiledir}/libavcodec/libpostproc
1794 includedir=\${pcfiledir}/libavcodec/libpostproc
1796 Name: libpostproc
1797 Description: FFmpeg post processing library
1798 Version: $version
1799 Requires:
1800 Conflicts:
1801 Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1802 Cflags: -I\${includedir}
1806 # END COMMENTING OUT THE .pc FILES