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