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