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