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