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