Statistics
| Branch: | Revision:

ffmpeg / configure @ 320d060a

History | View | Annotate | Download (51.8 KB)

1
#!/bin/sh
2
#
3
# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
4
#
5

    
6
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
7
cat << EOF
8

    
9
Usage: configure [options]
10
Options: [defaults in brackets after descriptions]
11

    
12
EOF
13
echo "Standard options:"
14
echo "  --help                   print this message"
15
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
16
echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
17
echo "  --mandir=DIR             install man page in DIR [PREFIX/man]"
18
echo "  --enable-mp3lame         enable MP3 encoding via libmp3lame [default=no]"
19
echo "  --enable-libogg          enable Ogg support via libogg [default=no]"
20
echo "  --enable-vorbis          enable Vorbis support via libvorbis [default=no]"
21
echo "  --enable-theora          enable Theora support via libtheora [default=no]"
22
echo "  --enable-faad            enable FAAD support via libfaad [default=no]"
23
echo "  --enable-faadbin         build FAAD support with runtime linking [default=no]"
24
echo "  --enable-faac            enable FAAC support via libfaac [default=no]"
25
echo "  --enable-libgsm          enable GSM support via libgsm [default=no]"
26
echo "  --enable-xvid            enable XviD support via xvidcore [default=no]"
27
echo "  --enable-x264            enable H.264 encoding via x264 [default=no]"
28
echo "  --enable-mingw32         enable MinGW native/cross Windows compile"
29
echo "  --enable-mingwce         enable MinGW native/cross WinCE compile"
30
echo "  --enable-a52             enable GPLed A52 support [default=no]"
31
echo "  --enable-a52bin          open liba52.so.0 at runtime [default=no]"
32
echo "  --enable-dts             enable GPLed DTS support [default=no]"
33
echo "  --enable-pp              enable GPLed postprocessing support [default=no]"
34
echo "  --enable-static          build static libraries [default=yes]"
35
echo "  --disable-static         do not build static libraries [default=no]"
36
echo "  --enable-shared          build shared libraries [default=no]"
37
echo "  --disable-shared         do not build shared libraries [default=yes]"
38
echo "  --enable-amr_nb          enable amr_nb float audio codec"
39
echo "  --enable-amr_nb-fixed    use fixed point for amr-nb codec"
40
echo "  --enable-amr_wb          enable amr_wb float audio codec"
41
echo "  --enable-amr_if2         enable amr_wb IF2 audio codec"
42
echo "  --enable-sunmlib         use Sun medialib [default=no]"
43
echo "  --enable-pthreads        use pthreads [default=no]"
44
echo "  --enable-dc1394          enable IIDC-1394 grabbing using libdc1394"
45
echo "                           and libraw1394 [default=no]"
46
echo "  --enable-gpl             allow use of GPL code, the resulting libav*"
47
echo "                           and ffmpeg will be under GPL [default=no]"
48
echo ""
49
echo "Advanced options (experts only):"
50
echo "  --source-path=PATH       path to source code [$source_path]"
51
echo "  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]"
52
echo "  --cc=CC                  use C compiler CC [$cc]"
53
echo "  --make=MAKE              use specified make [$make]"
54
echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
55
echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
56
echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
57
echo "  --build-suffix=SUFFIX    suffix for application specific build []"
58
echo "  --cpu=CPU                force cpu to CPU  [$cpu]"
59
echo "  --tune=CPU               tune code for a particular CPU"
60
echo "                           (may fail or perform badly on other CPUs)"
61
echo "  --powerpc-perf-enable    enable performance report on PPC"
62
echo "                           (requires enabling PMC)"
63
echo "  --disable-mmx            disable MMX usage"
64
echo "  --disable-iwmmxt         disable iwmmxt usage"
65
echo "  --disable-altivec        disable AltiVec usage"
66
echo "  --disable-audio-oss      disable OSS audio support [default=no]"
67
echo "  --disable-audio-beos     disable BeOS audio support [default=no]"
68
echo "  --disable-v4l            disable video4linux grabbing [default=no]"
69
echo "  --disable-bktr           disable bktr video grabbing [default=no]"
70
echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
71
echo "  --disable-network        disable network support [default=no]"
72
echo "  --disable-zlib           disable zlib [default=no]"
73
echo "  --disable-lzo            disable lzo [default=no]"
74
echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
75
echo "  --disable-vhook          disable video hooking support"
76
echo "  --enable-gprof           enable profiling with gprof [$gprof]"
77
echo "  --disable-debug          disable debugging symbols"
78
echo "  --disable-opts           disable compiler optimizations"
79
echo "  --disable-mpegaudio-hp   faster (but less accurate)"
80
echo "                           MPEG audio decoding [default=no]"
81
echo "  --disable-protocols      disable I/O protocols support [default=no]"
82
echo "  --disable-ffserver       disable ffserver build"
83
echo "  --disable-ffplay         disable ffplay build"
84
echo "  --enable-small           optimize for size instead of speed"
85
echo "  --enable-memalign-hack   emulate memalign, interferes with memory debuggers"
86
echo "  --disable-strip          disable stripping of executables and shared libraries"
87
echo "  --disable-encoder=NAME   disables encoder NAME"
88
echo "  --enable-encoder=NAME    enables encoder NAME"
89
echo "  --disable-decoder=NAME   disables decoder NAME"
90
echo "  --enable-decoder=NAME    enables decoder NAME"
91
echo "  --disable-encoders       disables all encoders"
92
echo "  --disable-decoders       disables all decoders"
93
echo "  --disable-muxers         disables all muxers"
94
echo "  --disable-demuxers       disables all demuxers"
95
echo ""
96
echo "NOTE: Object files are built at the place where configure is launched."
97
exit 1
98
fi
99

    
100
# set temporary file name
101
if test ! -z "$TMPDIR" ; then
102
    TMPDIR1="${TMPDIR}"
103
elif test ! -z "$TEMPDIR" ; then
104
    TMPDIR1="${TEMPDIR}"
105
else
106
    TMPDIR1="/tmp"
107
fi
108

    
109
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
110
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
111
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
112
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
113
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
114

    
115
# default parameters
116
prefix="/usr/local"
117
libdir=""
118
mandir=""
119
bindir=""
120
cross_prefix=""
121
cc="gcc"
122
ar="ar"
123
ranlib="ranlib"
124
make="make"
125
strip="strip"
126
cpu=`uname -m`
127
tune="generic"
128
powerpc_perf="no"
129
mmx="default"
130
iwmmxt="default"
131
altivec="default"
132
mmi="default"
133
case "$cpu" in
134
  i386|i486|i586|i686|i86pc|BePC)
135
    cpu="x86"
136
  ;;
137
  x86_64|amd64)
138
    cpu="x86"
139
    canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
140
    if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
141
      if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
142
        cpu="x86_64"
143
      fi
144
    fi
145
  ;;
146
  # armv4l is a subset of armv5tel
147
  armv4l|armv5tel)
148
    cpu="armv4l"
149
  ;;
150
  alpha)
151
    cpu="alpha"
152
  ;;
153
  "Power Macintosh"|ppc|powerpc)
154
    cpu="powerpc"
155
  ;;
156
  mips|mipsel)
157
    cpu="mips"
158
  ;;
159
  sun4u|sparc64)
160
    cpu="sparc64"
161
  ;;
162
  sparc)
163
    cpu="sparc"
164
  ;;
165
  sh4)
166
    cpu="sh4"
167
  ;;
168
  parisc|parisc64)
169
    cpu="parisc"
170
  ;;
171
  s390|s390x)
172
    cpu="s390"
173
  ;;
174
  m68k)
175
    cpu="m68k"
176
  ;;
177
  ia64)
178
    cpu="ia64"
179
  ;;
180
  *)
181
    cpu="unknown"
182
  ;;
183
esac
184
gprof="no"
185
v4l="yes"
186
bktr="no"
187
audio_oss="yes"
188
audio_beos="no"
189
dv1394="yes"
190
dc1394="no"
191
network="yes"
192
zlib="yes"
193
lzo="yes"
194
libgsm="no"
195
mp3lame="no"
196
libogg="no"
197
vorbis="no"
198
theora="no"
199
faad="no"
200
faadbin="no"
201
faac="no"
202
xvid="no"
203
x264="no"
204
a52="no"
205
a52bin="no"
206
dts="no"
207
pp="no"
208
mingw32="no"
209
mingwce="no"
210
cygwin="no"
211
os2="no"
212
lstatic="yes"
213
lshared="no"
214
optimize="yes"
215
debug="yes"
216
dostrip="yes"
217
installstrip="-s"
218
extralibs="-lm"
219
simpleidct="yes"
220
bigendian="no"
221
inttypes="yes"
222
emu_fast_int="no"
223
vhook="default"
224
dlfcn="no"
225
dlopen="no"
226
mpegaudio_hp="yes"
227
SHFLAGS='-shared -Wl,-soname,$@.$(LIBMAJOR)'
228
netserver="no"
229
need_inet_aton="no"
230
protocols="yes"
231
ffserver="yes"
232
ffplay="yes"
233
LIBOBJFLAGS=""
234
LDFLAGS=-Wl,--warn-common
235
FFSLDFLAGS=-Wl,-E
236
LDCONFIG="ldconfig"
237
LIBPREF="lib"
238
LIBSUF=".a"
239
LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
240
SLIBPREF="lib"
241
SLIBSUF=".so"
242
SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
243
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBVERSION)'
244
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBMAJOR)'
245
EXESUF=""
246
BUILDSUF=""
247
amr_nb="no"
248
amr_wb="no"
249
amr_nb_fixed="no"
250
amr_if2="no"
251
sunmlib="no"
252
pthreads="no"
253
gpl="no"
254
memalignhack="no"
255
muxers="yes"
256
demuxers="yes"
257

    
258
# OS specific
259
targetos=`uname -s`
260
case $targetos in
261
BeOS)
262
prefix="/boot/home/config"
263
# helps building libavcodec
264
CFLAGS="-DPIC -fomit-frame-pointer"
265
# 3 gcc releases known for BeOS, each with ugly bugs
266
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
267
case "$gcc_version" in
268
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
269
mmx="no"
270
;;
271
*20010315*) echo "BeBits gcc"
272
CFLAGS="$CFLAGS -fno-expensive-optimizations"
273
;;
274
esac
275
SHFLAGS=-nostart
276
# disable Linux things
277
audio_oss="no"
278
v4l="no"
279
dv1394="no"
280
# enable BeOS things
281
audio_beos="yes"
282
# no need for libm, but the inet stuff
283
# Check for BONE
284
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
285
extralibs="-lbind -lsocket"
286
else
287
netserver="yes"
288
need_inet_aton="yes"
289
extralibs="-lnet"
290
fi ;;
291
SunOS)
292
v4l="no"
293
audio_oss="no"
294
dv1394="no"
295
make="gmake"
296
LDFLAGS=""
297
FFSLDFLAGS=""
298
need_inet_aton="yes"
299
extralibs="$extralibs -lsocket -lnsl"
300
;;
301
NetBSD)
302
v4l="no"
303
bktr="yes"
304
audio_oss="yes"
305
dv1394="no"
306
make="gmake"
307
LDFLAGS="$LDFLAGS -export-dynamic"
308
case `uname -r` in
309
2.*) extralibs="$extralibs -lossaudio"
310
;;
311
esac
312
;;
313
OpenBSD)
314
v4l="no"
315
bktr="yes"
316
audio_oss="yes"
317
dv1394="no"
318
make="gmake"
319
LIBOBJFLAGS="\$(PIC)"
320
LDFLAGS="$LDFLAGS -export-dynamic -pthread"
321
LDCONFIG="ldconfig -m \$(libdir)"
322
extralibs="$extralibs -lossaudio"
323
;;
324
FreeBSD)
325
v4l="no"
326
bktr="yes"
327
audio_oss="yes"
328
dv1394="no"
329
make="gmake"
330
CFLAGS="-pthread"
331
LDFLAGS="$LDFLAGS -export-dynamic -pthread"
332
;;
333
BSD/OS)
334
v4l="no"
335
bktr="yes"
336
audio_oss="yes"
337
dv1394="no"
338
extralibs="-lpoll -lgnugetopt -lm"
339
make="gmake"
340
strip="strip -d"
341
installstrip=""
342
;;
343
Darwin)
344
cc="cc"
345
v4l="no"
346
audio_oss="no"
347
dv1394="no"
348
ffserver="no"
349
SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
350
extralibs=""
351
darwin="yes"
352
strip="strip -x"
353
installstrip=""
354
LDFLAGS="-Wl,-dynamic,-search_paths_first"
355
SLIBSUF=".dylib"
356
SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
357
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
358
FFSLDFLAGS=-Wl,-bind_at_load
359
;;
360
MINGW32*)
361
# Note: the rest of the mingw32 config is done afterwards as mingw32
362
# can be forced on the command line for Linux cross compilation.
363
mingw32="yes"
364
;;
365
CYGWIN*)
366
v4l="no"
367
audio_oss="yes"
368
dv1394="no"
369
vhook="no"
370
extralibs=""
371
cygwin="yes"
372
EXESUF=".exe"
373
;;
374
Linux)
375
LDFLAGS="$LDFLAGS -rdynamic"
376
;;
377
IRIX*)
378
ranlib="echo ignoring ranlib"
379
v4l="no"
380
audio_oss="no"
381
make="gmake"
382
;;
383
OS/2)
384
TMPE=$TMPE".exe"
385
ar="emxomfar -p128"
386
ranlib="echo ignoring ranlib"
387
strip="echo ignoring strip"
388
CFLAGS="-Zomf"
389
LDFLAGS="-Zomf -Zstack 16384 -s"
390
SHFLAGS="-Zdll -Zomf"
391
FFSLDFLAGS=""
392
LIBPREF=""
393
LIBSUF=".lib"
394
SLIBPREF=""
395
SLIBSUF=".dll"
396
EXESUF=".exe"
397
extralibs=""
398
pkg_requires=""
399
v4l="no"
400
audio_oss="no"
401
dv1394="no"
402
network="no"
403
ffserver="no"
404
vhook="no"
405
os2="yes"
406

    
407
;;
408
*) ;;
409
esac
410

    
411
# From MPlayer configure. We need TARGET_OS available
412
# to the Makefile, so it can distinguish between flavors
413
# of AltiVec on PowerPC.
414
TARGET_OS=`( uname -s ) 2>&1`
415
  case "$TARGET_OS" in
416
  Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS)
417
    ;;
418
  IRIX*)
419
    TARGET_OS=IRIX
420
    ;;
421
  HP-UX*)
422
    TARGET_OS=HP-UX
423
    ;;
424
  [cC][yY][gG][wW][iI][nN]*)
425
    TARGET_OS=CYGWIN
426
    ;;
427
  *)
428
    TARGET_OS="$TARGET_OS-UNKNOWN"
429
    ;;
430
  esac
431

    
432
# find source path
433
source_path="`dirname $0`"
434
source_path_used="yes"
435
if test -z "$source_path" -o "$source_path" = "." ; then
436
    source_path=`pwd`
437
    source_path_used="no"
438
else
439
    source_path="`cd \"$source_path\"; pwd`"
440
fi
441

    
442
FFMPEG_CONFIGURATION=" "
443
for opt do
444
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
445
done
446

    
447
CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c  | sed 's/.*&\(.*\)).*/\1/'`
448

    
449
for opt do
450
  case "$opt" in
451
  --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
452
  ;;
453
  --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
454
  ;;
455
  --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
456
  ;;
457
  --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
458
  ;;
459
  --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
460
  ;;
461
  --cc=*) cc=`echo $opt | cut -d '=' -f 2-`
462
  ;;
463
  --make=*) make=`echo $opt | cut -d '=' -f 2`
464
  ;;
465
  --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
466
  ;;
467
  --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
468
  ;;
469
  --extra-libs=*) extralibs=${opt#--extra-libs=}
470
  ;;
471
  --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
472
  ;;
473
  --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
474
  ;;
475
  --tune=*) tune=`echo $opt | cut -d '=' -f 2`
476
  ;;
477
  --powerpc-perf-enable) powerpc_perf="yes"
478
  ;;
479
  --disable-mmx) mmx="no"
480
  ;;
481
  --disable-iwmmxt) iwmmxt="no"
482
  ;;
483
  --disable-altivec) altivec="no"
484
  ;;
485
  --enable-gprof) gprof="yes"
486
  ;;
487
  --disable-v4l) v4l="no"
488
  ;;
489
  --disable-bktr) bktr="no"
490
  ;;
491
  --disable-audio-oss) audio_oss="no"
492
  ;;
493
  --disable-audio-beos) audio_beos="no"
494
  ;;
495
  --disable-dv1394) dv1394="no"
496
  ;;
497
  --disable-network) network="no"; ffserver="no"
498
  ;;
499
  --disable-zlib) zlib="no"
500
  ;;
501
  --disable-lzo) lzo="no"
502
  ;;
503
  --enable-a52) a52="yes"
504
  ;;
505
  --enable-a52bin) a52bin="yes"
506
  ;;
507
  --enable-dts) dts="yes"
508
    extralibs="$extralibs -ldts"
509
  ;;
510
  --enable-pp) pp="yes"
511
  ;;
512
  --enable-libgsm) libgsm="yes"
513
    extralibs="$extralibs -lgsm"
514
  ;;
515
  --enable-mp3lame) mp3lame="yes"
516
    extralibs="$extralibs -lmp3lame"
517
  ;;
518
  --enable-libogg) libogg="yes"
519
    extralibs="$extralibs -logg"
520
    pkg_requires="$pkg_requires ogg >= 1.1"
521
  ;;
522
  --enable-vorbis) vorbis="yes"
523
    extralibs="$extralibs -lvorbis -lvorbisenc"
524
    pkg_requires="$pkg_requires vorbis vorbisenc"
525
  ;;
526
  --enable-theora) theora="yes"
527
    extralibs="$extralibs -ltheora"
528
    pkg_requires="$pkg_requires theora"
529
  ;;
530
  --enable-faad) faad="yes"
531
    extralibs="$extralibs -lfaad"
532
  ;;
533
  --enable-faadbin) faadbin="yes"
534
  ;;
535
  --enable-faac) faac="yes"
536
    extralibs="$extralibs -lfaac"
537
  ;;
538
  --enable-xvid) xvid="yes"
539
    extralibs="$extralibs -lxvidcore"
540
  ;;
541
  --enable-x264) x264="yes"
542
    extralibs="$extralibs -lx264"
543
  ;;
544
  --enable-dc1394) dc1394="yes"
545
    extralibs="$extralibs -ldc1394_control -lraw1394"
546
    pkg_requires="$pkg_requires libraw1394"
547
  ;;
548
  --disable-vhook) vhook="no"
549
  ;;
550
  --disable-simple_idct) simpleidct="no"
551
  ;;
552
  --enable-mingw32) mingw32="yes"
553
  ;;
554
  --enable-mingwce) mingwce="yes"
555
  ;;
556
  --enable-static) lstatic="yes"
557
  ;;
558
  --disable-static) lstatic="no"
559
  ;;
560
  --enable-shared) lshared="yes"
561
  ;;
562
  --disable-shared) lshared="no"
563
  ;;
564
  --disable-debug) debug="no"
565
  ;;
566
  --disable-opts) optimize="no"
567
  ;;
568
  --disable-mpegaudio-hp) mpegaudio_hp="no"
569
  ;;
570
  --disable-protocols) protocols="no"; network="no"; ffserver="no"
571
  ;;
572
  --disable-ffserver) ffserver="no"
573
  ;;
574
  --disable-ffplay) ffplay="no"
575
  ;;
576
  --enable-small) optimize="small"
577
  ;;
578
  --enable-amr_nb) amr_nb="yes"
579
  ;;
580
  --enable-amr_nb-fixed) amr_nb_fixed="yes"
581
  ;;
582
  --enable-amr_wb) amr_wb="yes"
583
  ;;
584
  --enable-amr_if2) amr_if2="yes"
585
  ;;
586
  --enable-sunmlib) sunmlib="yes"
587
  ;;
588
  --enable-pthreads) pthreads="yes"
589
  ;;
590
  --enable-gpl) gpl="yes"
591
  ;;
592
  --enable-memalign-hack) memalignhack="yes"
593
  ;;
594
  --disable-strip) dostrip="no"
595
  ;;
596
  --enable-encoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-encoder=}_encoder"
597
  ;;
598
  --enable-decoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-decoder=}_decoder"
599
  ;;
600
  --disable-encoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-encoder=}_encoder##\"`"
601
  ;;
602
  --disable-decoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-decoder=}_decoder##\"`"
603
  ;;
604
  --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
605
  ;;
606
  --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`"
607
  ;;
608
  --disable-muxers) muxers="no"; ffserver="no"
609
  ;;
610
  --disable-demuxers) demuxers="no"
611
  ;;
612
  *)
613
  echo "Unknown option \"$opt\"."
614
  echo "See $0 --help for available options."
615
  exit 1
616
  ;;
617
  esac
618
done
619

    
620
# we need to build at least one lib type
621
if test "$lstatic" = "no" && test "$lshared" = "no" ; then
622
    cat <<EOF
623
At least one library type must be built.
624
Specify --enable-static to build the static libraries or --enable-shared to
625
build the shared libraries as well. To only build the shared libraries specify
626
--disable-static in addition to --enable-shared.
627
EOF
628
    exit 1;
629
fi
630

    
631
if test "$theora" = "yes" ; then
632
    if test "$libogg" = "no"; then
633
        echo "libogg must be enabled to enable Theora."
634
        fail="yes"
635
        theora="no"
636
    fi
637
fi
638

    
639
if test "$vorbis" = "yes" ; then
640
    if test "$libogg" = "no"; then
641
        echo "libogg must be enabled to enable Vorbis."
642
        fail="yes"
643
        vorbis="no"
644
    fi
645
fi
646

    
647
if test "$gpl" != "yes"; then
648
    if test "$pp" != "no"; then
649
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
650
        fail="yes"
651
    fi
652

    
653
    if test "$a52" != "no" -o "$a52bin" != "no"; then
654
        echo "liba52 is under GPL and --enable-gpl is not specified."
655
        fail="yes"
656
    fi
657

    
658
    if test "$xvid" != "no"; then
659
        echo "libxvidcore is under GPL and --enable-gpl is not specified."
660
        fail="yes"
661
    fi
662

    
663
    if test "$x264" != "no"; then
664
        echo "x264 is under GPL and --enable-gpl is not specified."
665
        fail="yes"
666
    fi
667

    
668
    if test "$dts" != "no"; then
669
        echo "libdts is under GPL and --enable-gpl is not specified."
670
        fail="yes"
671
    fi
672

    
673
    if test "$faad" != "no" -o "$faadbin" != "no"; then
674
        cat > $TMPC << EOF
675
            #include <faad.h>
676
            int main( void ) { return 0; }
677
EOF
678

    
679
        if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
680
            cat > $TMPC << EOF
681
                #include <faad.h>
682
                #ifndef FAAD2_VERSION
683
                ok faad1
684
                #endif
685
                int main( void ) { return 0; }
686
EOF
687
            if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
688
                echo "FAAD2 is under GPL and --enable-gpl is not specified."
689
                fail="yes"
690
            fi
691
        else
692
            faad="no"
693
            faadbin="no"
694
            echo "FAAD test failed."
695
        fi
696
    fi
697

    
698

    
699
    if test "$fail" = "yes"; then
700
        exit 1
701
    fi
702
fi
703

    
704
# compute MMX state
705
if test $mmx = "default"; then
706
    if test $cpu = "x86" -o $cpu = "x86_64"; then
707
        mmx="yes"
708
    else
709
        mmx="no"
710
    fi
711
fi
712

    
713
# check iwmmxt support
714
if test $iwmmxt = "default" -a $cpu = "armv4l"; then
715
    cat > $TMPC << EOF
716
        int main(void) {
717
        __asm__ __volatile__ ("wunpckelub wr6, wr4");
718
        }
719
EOF
720

    
721
    iwmmxt=no
722
    if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
723
        iwmmxt=yes
724
    fi
725
fi
726

    
727
#Darwin CC versions
728
needmdynamicnopic="no"
729
if test $targetos = Darwin; then
730
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
731
        CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
732
    else
733
        gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
734
        case "$gcc_version" in
735
            *2.95*)
736
                CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
737
                ;;
738
            *[34].*)
739
                CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
740
                if test "$lshared" = no; then
741
                   needmdynamicnopic="yes"
742
                fi
743
                ;;
744
            *)
745
                CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
746
                if test "$lshared" = no; then
747
                   needmdynamicnopic="yes"
748
                fi
749
                ;;
750
        esac
751
    fi
752
fi
753

    
754
# Can only do AltiVec on PowerPC
755
if test $altivec = "default"; then
756
    if test $cpu = "powerpc"; then
757
        altivec="yes"
758
    else
759
        altivec="no"
760
    fi
761
fi
762

    
763
# Add processor-specific flags
764
TUNECPU="generic"
765
POWERPCMODE="32bits"
766
if test $tune != "generic"; then
767
    case $tune in
768
        601|ppc601|PowerPC601)
769
            CFLAGS="$CFLAGS -mcpu=601"
770
            if test $altivec = "yes"; then
771
                echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
772
            fi
773
            TUNECPU=ppc601
774
        ;;
775
        603*|ppc603*|PowerPC603*)
776
            CFLAGS="$CFLAGS -mcpu=603"
777
            if test $altivec = "yes"; then
778
                echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
779
            fi
780
            TUNECPU=ppc603
781
        ;;
782
        604*|ppc604*|PowerPC604*)
783
            CFLAGS="$CFLAGS -mcpu=604"
784
            if test $altivec = "yes"; then
785
                echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
786
            fi
787
            TUNECPU=ppc604
788
        ;;
789
        G3|g3|75*|ppc75*|PowerPC75*)
790
            CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
791
            if test $altivec = "yes"; then
792
                echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
793
            fi
794
            TUNECPU=ppc750
795
        ;;
796
        G4|g4|745*|ppc745*|PowerPC745*)
797
            CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
798
            if test $altivec = "no"; then
799
                echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
800
            fi
801
            TUNECPU=ppc7450
802
        ;;
803
        74*|ppc74*|PowerPC74*)
804
            CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
805
            if test $altivec = "no"; then
806
                echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
807
            fi
808
            TUNECPU=ppc7400
809
        ;;
810
        G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
811
            CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
812
            if test $altivec = "no"; then
813
                echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
814
            fi
815
            TUNECPU=ppc970
816
            POWERPCMODE="64bits"
817
        ;;
818
        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)
819
            CFLAGS="$CFLAGS -march=$tune"
820
        ;;
821
        *)
822
        echo "WARNING: Unknown CPU \"$tune\", ignored."
823
        ;;
824
    esac
825
fi
826

    
827
# AltiVec flags: The FSF version of GCC differs from the Apple version
828
if test $cpu = "powerpc"; then
829
    if test $altivec = "yes"; then
830
        if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
831
            CFLAGS="$CFLAGS -faltivec"
832
        else
833
            CFLAGS="$CFLAGS -maltivec -mabi=altivec"
834
        fi
835
    fi
836
fi
837

    
838
# check if we have <altivec.h>
839
cat > $TMPC << EOF
840
#include <altivec.h>
841
int main( void ) { return 0; }
842
EOF
843

    
844
_altivec_h="no"
845
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
846
_altivec_h="yes"
847
fi
848

    
849
# check if our compiler supports Motorola AltiVec C API
850
if test $altivec = "yes"; then
851
if test $_altivec_h = "yes"; then
852
cat > $TMPC << EOF
853
#include <altivec.h>
854
int main(void) {
855
    vector signed int v1, v2, v3;
856
    v1 = vec_add(v2,v3);
857
    return 0;
858
}
859
EOF
860
else
861
cat > $TMPC << EOF
862
int main(void) {
863
    vector signed int v1, v2, v3;
864
    v1 = vec_add(v2,v3);
865
    return 0;
866
}
867
EOF
868
fi
869
$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
870
fi
871

    
872
# mmi only available on mips
873
if test $mmi = "default"; then
874
    if test $cpu = "mips"; then
875
        mmi="yes"
876
    else
877
        mmi="no"
878
    fi
879
fi
880

    
881
# check if our compiler supports mmi
882
if test $mmi = "yes"; then
883
cat > $TMPC << EOF
884
int main(void) {
885
    __asm__ ("lq \$2, 0(\$2)");
886
    return 0;
887
}
888
EOF
889
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
890
fi
891

    
892
if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
893
    if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
894
        cat <<EOF
895
You can only build one library type at once on MinGW.
896
Specify --disable-static --enable-shared to only build
897
the shared libraries. To build only the static libraries
898
you don't need to pass additional options.
899
EOF
900
        exit 1
901
    fi
902
    v4l="no"
903
    bktr="no"
904
    audio_oss="no"
905
    dv1394="no"
906
    dc1394="no"
907
    ffserver="no"
908
    network="no"
909
if test "$mingwce" = "yes"; then
910
    protocols="no"
911
fi
912
    SLIBPREF=""
913
    SLIBSUF=".dll"
914
    EXESUF=".exe"
915
    if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
916
    if test "$force_libdir" != yes; then bindir="$prefix"; fi
917
fi
918

    
919
cc="${cross_prefix}${cc}"
920
ar="${cross_prefix}${ar}"
921
ranlib="${cross_prefix}${ranlib}"
922
strip="${cross_prefix}${strip}"
923

    
924
if test -z "$cross_prefix" ; then
925

    
926
# ---
927
# big/little-endian test
928
cat > $TMPC << EOF
929
#include <inttypes.h>
930
int main(int argc, char ** argv){
931
        volatile uint32_t i=0x01234567;
932
        return (*((uint8_t*)(&i))) == 0x67;
933
}
934
EOF
935

    
936
if $cc -o $TMPE $TMPC 2>/dev/null ; then
937
$TMPE && bigendian="yes"
938
else
939
echo big/little test failed
940
fi
941

    
942
else
943

    
944
# programs cannot be launched if cross compiling, so make a static guess
945
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
946
    bigendian="yes"
947
fi
948

    
949
fi
950

    
951
# ---
952
# *inttypes.h* test
953
cat > $TMPC << EOF
954
#include <inttypes.h>
955
int main(int argc, char ** argv){
956
    return 0;
957
}
958
EOF
959

    
960
$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
961

    
962
# ---
963
# *int_fast* test
964
cat > $TMPC << EOF
965
#include <inttypes.h>
966
int main(int argc, char ** argv){
967
        volatile uint_fast64_t i=0x01234567;
968
        return 0;
969
}
970
EOF
971

    
972
$cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
973

    
974
# ---
975
# check availability of some header files
976

    
977
cat > $TMPC << EOF
978
#include <malloc.h>
979
int main( void ) { return 0; }
980
EOF
981

    
982
_memalign=no
983
_malloc_h=no
984
if $cc -o $TMPE $TMPC 2> /dev/null ; then
985
_malloc_h=yes
986
_memalign=yes
987
# check for memalign - atmos
988
cat > $TMPC << EOF
989
#include <stdio.h>
990
#include <malloc.h>
991
int main ( void ) {
992
char *string = NULL;
993
string = memalign(64, sizeof(char));
994
return 0;
995
}
996
EOF
997
$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
998
fi
999

    
1000
if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
1001
    echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
1002
    exit 1
1003
fi
1004

    
1005
cat > $TMPC << EOF
1006
#include <time.h>
1007
int main( void ) { localtime_r(NULL, NULL); }
1008
EOF
1009

    
1010
localtime_r=no
1011
if $cc -o $TMPE $TMPC 2> /dev/null ; then
1012
  localtime_r=yes
1013
fi
1014

    
1015
if test "$zlib" = "yes"; then
1016
# check for zlib - mmu_man
1017
cat > $TMPC << EOF
1018
#include <zlib.h>
1019
int main ( void ) {
1020
if (zlibVersion() != ZLIB_VERSION)
1021
   puts("zlib version differs !!!");
1022
   return 1;
1023
return 0;
1024
}
1025
EOF
1026
$cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
1027
# $TMPE 2> /dev/null > /dev/null || zlib="no"
1028
# XXX: more tests needed - runtime test
1029
fi
1030
if test "$zlib" = "yes"; then
1031
extralibs="$extralibs -lz"
1032
fi
1033

    
1034
if test "$lzo" = "yes" -a "$gpl" = "yes"; then
1035
# check for liblzo
1036
cat > $TMPC << EOF
1037
#include <lzo1x.h>
1038
int main ( void ) {
1039
lzo_init();
1040
return 0;
1041
}
1042
EOF
1043
$cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -llzo 2> /dev/null || lzo="no"
1044
else
1045
lzo="no"
1046
fi
1047
if test "$lzo" = "yes"; then
1048
extralibs="$extralibs -llzo"
1049
fi
1050

    
1051
# test for lrintf in math.h
1052
cat > $TMPC << EOF
1053
#define _ISOC9X_SOURCE  1
1054
#include <math.h>
1055
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1056
EOF
1057

    
1058
have_lrintf="no"
1059
if $cc $CFLAGS $LDFLAGS $extralibs -o $TMPE $TMPC 2> /dev/null ; then
1060
  have_lrintf="yes"
1061
  # allanc@chickenandporn.com: cannot execute cross-compiled
1062
  # code on the host.  Only execute if not cross-compiling.
1063
  if test -z "$cross_prefix" ; then
1064
    $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
1065
  fi
1066
fi
1067

    
1068
_restrict=
1069
for restrict_keyword in restrict __restrict__ __restrict; do
1070
  echo "void foo(char * $restrict_keyword p);" > $TMPC
1071
  if $cc -c -o $TMPO $TMPC 2> /dev/null; then
1072
    _restrict=$restrict_keyword
1073
    break;
1074
  fi
1075
done
1076

    
1077
# test gcc version to see if vector builtins can be used
1078
# currently only used on i386 for MMX builtins
1079
cat > $TMPC << EOF
1080
#include <xmmintrin.h>
1081
int main(void) {
1082
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
1083
return 0;
1084
#else
1085
#error no vector builtins
1086
#endif
1087
}
1088
EOF
1089

    
1090
builtin_vector=no
1091
if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
1092
  builtin_vector=yes
1093
fi
1094

    
1095
# Probe for -Wdeclaration-after-statement
1096
if test "$cc" = "gcc"; then
1097
  cat > $TMPC << EOF
1098
  int main( void ) { return 0; }
1099
EOF
1100

    
1101
  if $cc -Wdeclaration-after-statement -Werror -o $TMPE $TMPC 2> /dev/null ; then
1102
    CFLAGS="$CFLAGS -Wdeclaration-after-statement"
1103
  fi
1104
fi
1105

    
1106
# dlopen/dlfcn.h probing
1107

    
1108
cat > $TMPC << EOF
1109
#include <dlfcn.h>
1110
int main( void ) { return (int) dlopen("foo", 0); }
1111
EOF
1112

    
1113
ldl=-ldl
1114

    
1115
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1116
dlfcn=yes
1117
dlopen=yes
1118
fi
1119

    
1120
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
1121
dlfcn=yes
1122
dlopen=yes
1123
ldl=""
1124
fi
1125

    
1126
cat > $TMPC << EOF
1127
int main( void ) { return (int) dlopen("foo", 0); }
1128
EOF
1129

    
1130
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1  ; then
1131
dlopen=yes
1132
fi
1133

    
1134
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1  ; then
1135
dlopen=yes
1136
ldl=""
1137
fi
1138

    
1139
if test "$vhook" = "default" ; then
1140
  vhook="$dlopen"
1141
fi
1142

    
1143
if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1144
  extralibs="$extralibs $ldl"
1145
fi
1146

    
1147

    
1148
##########################################
1149
# imlib check
1150

    
1151
cat > $TMPC << EOF
1152
#include <X11/Xlib.h>
1153
#include <Imlib2.h>
1154
int main( void ) { return (int) imlib_load_font("foo"); }
1155
EOF
1156

    
1157
imlib2=no
1158
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1  ; then
1159
imlib2=yes
1160
fi
1161

    
1162
##########################################
1163
# FreeType check
1164

    
1165
cat > $TMPC << EOF
1166
#include <ft2build.h>
1167
int main( void ) { return (int) FT_Init_FreeType(0); }
1168
EOF
1169

    
1170
freetype2=no
1171
if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
1172
  if (freetype-config --version) >/dev/null 2>&1 ; then
1173
    if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
1174
      freetype2=yes
1175
    fi
1176
  fi
1177
fi
1178

    
1179
##########################################
1180
# SDL check
1181

    
1182
cat > $TMPC << EOF
1183
#include <SDL.h>
1184
#undef main /* We don't want SDL to override our main() */
1185
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1186
EOF
1187

    
1188
sdl_too_old=no
1189
sdl=no
1190
if (sdl-config --version) >/dev/null 2>&1 ; then
1191
if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  > /dev/null 2>&1  ; then
1192
_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1193
if test "$_sdlversion" -lt 121 ; then
1194
sdl_too_old=yes
1195
else
1196
sdl=yes
1197
fi
1198
fi
1199
fi
1200

    
1201
##########################################
1202
# texi2html check
1203

    
1204
texi2html=no
1205
if (texi2html -version) >/dev/null 2>&1; then
1206
texi2html=yes
1207
fi
1208

    
1209
if test "$network" = "yes" ; then
1210
##########################################
1211
# IPv6 check
1212

    
1213
cat > $TMPC << EOF
1214
#include <sys/types.h>
1215
#include <sys/socket.h>
1216
#include <netinet/in.h>
1217
#include <netdb.h>
1218
int main( void ) {
1219
  struct sockaddr_storage saddr;
1220
  struct ipv6_mreq mreq6;
1221
  getaddrinfo(0,0,0,0);
1222
  getnameinfo(0,0,0,0,0,0,0);
1223
  IN6_IS_ADDR_MULTICAST(0);
1224
}
1225
EOF
1226

    
1227
ipv6=no
1228
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
1229
ipv6=yes
1230
fi
1231
fi
1232

    
1233
case "`$cc -v 2>&1 | grep version`" in
1234
    *gcc*)
1235
        CFLAGS="-Wall -Wno-switch $CFLAGS"
1236
        ;;
1237
    *)
1238
        ;;
1239
esac
1240

    
1241
if test "$sdl" = "no" ; then
1242
   ffplay=no
1243
fi
1244

    
1245
if test "$debug" = "yes"; then
1246
        CFLAGS="-g $CFLAGS"
1247
fi
1248

    
1249
if test "$optimize" = "small"; then
1250
#  CFLAGS=${CFLAGS//-O3/-Os}
1251
  CFLAGS="$CFLAGS -Os"
1252
fi
1253

    
1254
if test "$optimize" = "yes"; then
1255
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1256
        CFLAGS="$CFLAGS -O5"
1257
        LDFLAGS="$LDFLAGS -O5"
1258
    else
1259
        CFLAGS="-O3 $CFLAGS"
1260
    fi
1261
fi
1262

    
1263
# PIC flags for shared library objects where they are needed
1264
if test "$lshared" = "yes" ; then
1265
  # LIBOBJFLAGS may have already been set in the OS configuration
1266
  if test -z "$LIBOBJFLAGS" ; then
1267
    if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
1268
      LIBOBJFLAGS="\$(PIC)"
1269
    fi
1270
  fi
1271
fi
1272

    
1273
if test x"$bindir" = x""; then
1274
bindir="${prefix}/bin"
1275
fi
1276

    
1277
if test x"$libdir" = x""; then
1278
libdir="${prefix}/lib"
1279
fi
1280

    
1281
if test x"$mandir" = x""; then
1282
mandir="${prefix}/man"
1283
fi
1284

    
1285
echo "install prefix   $prefix"
1286
echo "source path      $source_path"
1287
echo "C compiler       $cc"
1288
echo "make             $make"
1289
echo "CPU              $cpu ($tune)"
1290
if test "$BUILDSUF" != ""; then
1291
echo "build suffix     $BUILDSUF"
1292
fi
1293
echo "big-endian       $bigendian"
1294
echo "inttypes.h       $inttypes"
1295
echo "broken inttypes.h $emu_fast_int"
1296
if test $cpu = "x86" -o $cpu = "x86_64"; then
1297
echo "MMX enabled      $mmx"
1298
echo "Vector Builtins  $builtin_vector"
1299
fi
1300
if test $cpu = "armv4l"; then
1301
echo "IWMMXT enabled   $iwmmxt"
1302
fi
1303
if test $cpu = "mips"; then
1304
echo "MMI enabled      $mmi"
1305
fi
1306
if test $cpu = "powerpc"; then
1307
echo "AltiVec enabled  $altivec"
1308
fi
1309
echo "gprof enabled    $gprof"
1310
echo "zlib enabled     $zlib"
1311
echo "lzo enabled      $lzo"
1312
echo "libgsm enabled   $libgsm"
1313
echo "mp3lame enabled  $mp3lame"
1314
echo "libogg enabled   $libogg"
1315
echo "Vorbis enabled   $vorbis"
1316
echo "Theora enabled   $theora"
1317
echo "FAAD enabled     $faad"
1318
echo "faadbin enabled  $faadbin"
1319
echo "FAAC enabled     $faac"
1320
echo "XviD enabled     $xvid"
1321
echo "x264 enabled     $x264"
1322
echo "a52 support      $a52"
1323
echo "a52 dlopened     $a52bin"
1324
echo "DTS support      $dts"
1325
echo "pp support       $pp"
1326
echo "debug symbols    $debug"
1327
echo "strip symbols    $dostrip"
1328
echo "optimize         $optimize"
1329
echo "static           $lstatic"
1330
echo "shared           $lshared"
1331
echo "video hooking    $vhook"
1332
echo "SDL support      $sdl"
1333
if test $sdl_too_old = "yes"; then
1334
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
1335
fi
1336

    
1337
if test "$vhook" = "yes" ; then
1338
echo "Imlib2 support   $imlib2"
1339
echo "FreeType support $freetype2"
1340
fi
1341
echo "Sun medialib support"  $sunmlib
1342
echo "pthreads support"      $pthreads
1343
echo "AMR-NB float support"  $amr_nb
1344
echo "AMR-NB fixed support"  $amr_nb_fixed
1345
echo "AMR-WB float support"  $amr_wb
1346
echo "AMR-WB IF2 support"    $amr_if2
1347
echo "network support      $network"
1348
if test "$network" = "yes" ; then
1349
echo "IPv6 support         $ipv6"
1350
fi
1351
if test "$gpl" = "no" ; then
1352
echo "License: LGPL"
1353
else
1354
echo "License: GPL"
1355
fi
1356

    
1357
echo "Creating config.mak and config.h..."
1358

    
1359
date >> config.log
1360
echo "   $0 $FFMPEG_CONFIGURATION" >> config.log
1361
echo "# Automatically generated by configure - do not modify!" > config.mak
1362
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1363
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1364

    
1365
echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1366
echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1367
echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1368
echo "mandir=\$(DESTDIR)$mandir" >> config.mak
1369
echo "MAKE=$make" >> config.mak
1370
echo "CC=$cc" >> config.mak
1371
echo "AR=$ar" >> config.mak
1372
echo "RANLIB=$ranlib" >> config.mak
1373
if test "$dostrip" = "yes" ; then
1374
echo "STRIP=$strip" >> config.mak
1375
echo "INSTALLSTRIP=$installstrip" >> config.mak
1376
else
1377
echo "STRIP=echo ignoring strip" >> config.mak
1378
echo "INSTALLSTRIP=" >> config.mak
1379
fi
1380

    
1381
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
1382
# shared modules on OS/X (vhook/Makefile).
1383
SHCFLAGS=$CFLAGS
1384
if test "$needmdynamicnopic" = yes; then
1385
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1386
fi
1387

    
1388
echo "OPTFLAGS=$CFLAGS" >> config.mak
1389
echo "SHCFLAGS=$SHCFLAGS">>config.mak
1390
echo "LDFLAGS=$LDFLAGS" >> config.mak
1391
echo "LDCONFIG=$LDCONFIG" >> config.mak
1392
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1393
echo "SHFLAGS=$SHFLAGS" >> config.mak
1394
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
1395
echo "BUILDSUF=$BUILDSUF" >> config.mak
1396
echo "LIBPREF=$LIBPREF" >> config.mak
1397
echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1398
if test "$lstatic" = "yes" ; then
1399
  echo "LIB=$LIB" >> config.mak
1400
fi
1401
echo "SLIBPREF=$SLIBPREF" >> config.mak
1402
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1403
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1404
echo "TARGET_OS=$TARGET_OS" >> config.mak
1405
if test "$cpu" = "x86" ; then
1406
  echo "TARGET_ARCH_X86=yes" >> config.mak
1407
  echo "#define ARCH_X86 1" >> $TMPH
1408
elif test "$cpu" = "x86_64" ; then
1409
  echo "TARGET_ARCH_X86_64=yes" >> config.mak
1410
  echo "#define ARCH_X86_64 1" >> $TMPH
1411
elif test "$cpu" = "armv4l" ; then
1412
  echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1413
  echo "#define ARCH_ARMV4L 1" >> $TMPH
1414
elif test "$cpu" = "alpha" ; then
1415
  echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1416
  echo "#define ARCH_ALPHA 1" >> $TMPH
1417
elif test "$cpu" = "sparc64" ; then
1418
  echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1419
  echo "#define ARCH_SPARC64 1" >> $TMPH
1420
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1421
  echo "#define ARCH_SPARC 1" >> $TMPH
1422
elif test "$cpu" = "sparc" ; then
1423
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1424
  echo "#define ARCH_SPARC 1" >> $TMPH
1425
elif test "$cpu" = "powerpc" ; then
1426
  echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1427
  echo "#define ARCH_POWERPC 1" >> $TMPH
1428
  if test $POWERPCMODE = "32bits"; then
1429
    echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1430
  else
1431
    echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1432
  fi
1433
  if test "$powerpc_perf" = "yes"; then
1434
    echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1435
  fi
1436
elif test "$cpu" = "mips" ; then
1437
  echo "TARGET_ARCH_MIPS=yes" >> config.mak
1438
  echo "#define ARCH_MIPS 1" >> $TMPH
1439
elif test "$cpu" = "sh4" ; then
1440
  echo "TARGET_ARCH_SH4=yes" >> config.mak
1441
  echo "#define ARCH_SH4 1" >> $TMPH
1442
elif test "$cpu" = "parisc" ; then
1443
  echo "TARGET_ARCH_PARISC=yes" >> config.mak
1444
  echo "#define ARCH_PARISC 1" >> $TMPH
1445
elif test "$cpu" = "s390" ; then
1446
  echo "TARGET_ARCH_S390=yes" >> config.mak
1447
  echo "#define ARCH_S390 1" >> $TMPH
1448
elif test "$cpu" = "m68k" ; then
1449
  echo "TARGET_ARCH_M68K=yes" >> config.mak
1450
  echo "#define ARCH_M68K 1" >> $TMPH
1451
elif test "$cpu" = "ia64" ; then
1452
  echo "TARGET_ARCH_IA64=yes" >> config.mak
1453
  echo "#define ARCH_IA64 1" >> $TMPH
1454
fi
1455
echo "#define TUNECPU $TUNECPU" >> $TMPH
1456
if test "$bigendian" = "yes" ; then
1457
  echo "WORDS_BIGENDIAN=yes" >> config.mak
1458
  echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1459
fi
1460
if test "$inttypes" != "yes" ; then
1461
  echo "#define EMULATE_INTTYPES 1" >> $TMPH
1462
fi
1463
if test "$emu_fast_int" = "yes" ; then
1464
  echo "#define EMULATE_FAST_INT 1" >> $TMPH
1465
fi
1466
if test "$mmx" = "yes" ; then
1467
  echo "TARGET_MMX=yes" >> config.mak
1468
  echo "#define HAVE_MMX 1" >> $TMPH
1469
  echo "#define __CPU__ 586" >> $TMPH
1470
fi
1471
if test "$builtin_vector" = "yes" ; then
1472
  echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1473
  echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1474
fi
1475
if test "$iwmmxt" = "yes" ; then
1476
  echo "TARGET_IWMMXT=yes" >> config.mak
1477
  echo "#define HAVE_IWMMXT 1" >> $TMPH
1478
fi
1479
if test "$mmi" = "yes" ; then
1480
  echo "TARGET_MMI=yes" >> config.mak
1481
  echo "#define HAVE_MMI 1" >> $TMPH
1482
fi
1483
if test "$altivec" = "yes" ; then
1484
  echo "TARGET_ALTIVEC=yes" >> config.mak
1485
  echo "#define HAVE_ALTIVEC 1" >> $TMPH
1486
  echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1487
  echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1488
  if test "$_altivec_h" = "yes" ; then
1489
    echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1490
  else
1491
    echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1492
  fi
1493
fi
1494
if test "$gprof" = "yes" ; then
1495
  echo "TARGET_GPROF=yes" >> config.mak
1496
  echo "#define HAVE_GPROF 1" >> $TMPH
1497
fi
1498
if test "$localtime_r" = "yes" ; then
1499
  echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1500
fi
1501
if test "$imlib2" = "yes" ; then
1502
  echo "HAVE_IMLIB2=yes" >> config.mak
1503
fi
1504
if test "$freetype2" = "yes" ; then
1505
  echo "HAVE_FREETYPE2=yes" >> config.mak
1506
fi
1507
if test "$sunmlib" = "yes" ; then
1508
  echo "HAVE_MLIB=yes" >> config.mak
1509
  echo "#define HAVE_MLIB 1" >> $TMPH
1510
  extralibs="$extralibs -lmlib"
1511
fi
1512
if test "$pthreads" = "yes" ; then
1513
  echo "HAVE_PTHREADS=yes" >> config.mak
1514
  echo "#define HAVE_PTHREADS 1" >> $TMPH
1515
  echo "#define HAVE_THREADS 1" >> $TMPH
1516
  if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
1517
     extralibs="$extralibs -lpthread"
1518
  fi
1519
fi
1520
if test "$sdl" = "yes" ; then
1521
  echo "CONFIG_SDL=yes" >> config.mak
1522
  echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1523
  echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1524
fi
1525
if test "$texi2html" = "yes"; then
1526
  echo "BUILD_DOC=yes" >> config.mak
1527
fi
1528
if test "$have_lrintf" = "yes" ; then
1529
  echo "#define HAVE_LRINTF 1" >> $TMPH
1530
fi
1531
if test "$vhook" = "yes" ; then
1532
  echo "BUILD_VHOOK=yes" >> config.mak
1533
  echo "#define HAVE_VHOOK 1" >> $TMPH
1534
fi
1535

    
1536
pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libavcodec/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
1537
lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1538
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1539
lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1540

    
1541

    
1542

    
1543
if test "$lshared" = "yes" ; then
1544
  echo "#define BUILD_SHARED_AV 1" >> $TMPH
1545
  echo "BUILD_SHARED=yes" >> config.mak
1546
  echo "PIC=-fPIC -DPIC" >> config.mak
1547
  echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
1548
  echo "SPPVERSION=$lavc_version" >> config.mak
1549
  echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
1550
  echo "LAVCVERSION=$lavc_version" >> config.mak
1551
  echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
1552
  echo "LAVFVERSION=$lavf_version" >> config.mak
1553
  echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
1554
  echo "LAVUVERSION=$lavu_version" >> config.mak
1555
  echo "SLIBNAME=${SLIBNAME}" >> config.mak
1556
  echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1557
  echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
1558
fi
1559
echo "EXTRALIBS=$extralibs" >> config.mak
1560
version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1561
 cut -d '"' -f 2`
1562
echo "VERSION=$version" >>config.mak
1563
# If you do not want to use encoders, disable them.
1564
echo "#define CONFIG_ENCODERS 1" >> $TMPH
1565
echo "CONFIG_ENCODERS=yes" >> config.mak
1566

    
1567
# If you do not want to use decoders, disable them.
1568
echo "#define CONFIG_DECODERS 1" >> $TMPH
1569
echo "CONFIG_DECODERS=yes" >> config.mak
1570

    
1571
# muxers
1572
if test "$muxers" = "yes" ; then
1573
  echo "#define CONFIG_MUXERS 1" >> $TMPH
1574
  echo "CONFIG_MUXERS=yes" >> config.mak
1575
fi
1576

    
1577
# demuxers
1578
if test "$demuxers" = "yes" ; then
1579
  echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1580
  echo "CONFIG_DEMUXERS=yes" >> config.mak
1581
fi
1582

    
1583
# AC3
1584
if test "$a52" = "yes" ; then
1585
  echo "#define CONFIG_AC3 1" >> $TMPH
1586
  echo "CONFIG_AC3=yes" >> config.mak
1587

    
1588
  if test "$a52bin" = "yes" ; then
1589
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1590
    echo "CONFIG_A52BIN=yes" >> config.mak
1591
  fi
1592
fi
1593

    
1594
# DTS
1595
if test "$dts" = "yes" ; then
1596
  echo "#define CONFIG_DTS 1" >> $TMPH
1597
  echo "CONFIG_DTS=yes" >> config.mak
1598
fi
1599

    
1600
# PP
1601
if test "$pp" = "yes" ; then
1602
  echo "#define CONFIG_PP 1" >> $TMPH
1603
  echo "CONFIG_PP=yes" >> config.mak
1604
fi
1605

    
1606
# MPEG audio high precision mode
1607
if test "$mpegaudio_hp" = "yes" ; then
1608
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1609
fi
1610

    
1611
if test "$v4l" = "yes" ; then
1612
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1613
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1614
fi
1615

    
1616
if test "$bktr" = "yes" ; then
1617
  echo "#define CONFIG_BKTR 1" >> $TMPH
1618
  echo "CONFIG_BKTR=yes" >> config.mak
1619
fi
1620

    
1621
if test "$dv1394" = "yes" ; then
1622
  echo "#define CONFIG_DV1394 1" >> $TMPH
1623
  echo "CONFIG_DV1394=yes" >> config.mak
1624
fi
1625

    
1626
if test "$dc1394" = "yes" ; then
1627
  echo "#define CONFIG_DC1394 1" >> $TMPH
1628
  echo "CONFIG_DC1394=yes" >> config.mak
1629
fi
1630

    
1631
if test "$dlopen" = "yes" ; then
1632
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1633
fi
1634

    
1635
if test "$dlfcn" = "yes" ; then
1636
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1637
fi
1638

    
1639
if test "$audio_oss" = "yes" ; then
1640
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1641
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1642
fi
1643

    
1644
if test "$audio_beos" = "yes" ; then
1645
  echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1646
  echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1647
fi
1648

    
1649
if test "$network" = "yes" ; then
1650
  echo "#define CONFIG_NETWORK 1" >> $TMPH
1651
  echo "CONFIG_NETWORK=yes" >> config.mak
1652
fi
1653

    
1654
if test "$ipv6" = "yes" ; then
1655
  echo "#define CONFIG_IPV6 1" >> $TMPH
1656
fi
1657

    
1658
if test "$zlib" = "yes" ; then
1659
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1660
  echo "CONFIG_ZLIB=yes" >> config.mak
1661
fi
1662

    
1663
if test "$lzo" = "yes" ; then
1664
  echo "#define CONFIG_LZO 1" >> $TMPH
1665
  echo "CONFIG_LZO=yes" >> config.mak
1666
fi
1667

    
1668
if test "$libgsm" = "yes" ; then
1669
  echo "#define CONFIG_LIBGSM 1" >> $TMPH
1670
  echo "CONFIG_LIBGSM=yes" >> config.mak
1671
fi
1672

    
1673
if test "$mp3lame" = "yes" ; then
1674
  echo "#define CONFIG_MP3LAME 1" >> $TMPH
1675
  echo "CONFIG_MP3LAME=yes" >> config.mak
1676
fi
1677

    
1678
if test "$libogg" = "yes" ; then
1679
  echo "#define CONFIG_LIBOGG 1" >> $TMPH
1680
  echo "CONFIG_LIBOGG=yes" >> config.mak
1681
fi
1682

    
1683
if test "$vorbis" = "yes" ; then
1684
  echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1685
  echo "CONFIG_LIBVORBIS=yes" >> config.mak
1686
fi
1687

    
1688
if test "$theora" = "yes" ; then
1689
  echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1690
  echo "CONFIG_LIBTHEORA=yes" >> config.mak
1691
fi
1692

    
1693
if test "$faad" = "yes" ; then
1694
  echo "#define CONFIG_FAAD 1" >> $TMPH
1695
  echo "CONFIG_FAAD=yes" >> config.mak
1696
fi
1697

    
1698
if test "$faadbin" = "yes" ; then
1699
  echo "#define CONFIG_FAADBIN 1" >> $TMPH
1700
  echo "CONFIG_FAADBIN=yes" >> config.mak
1701
fi
1702

    
1703
if test "$faac" = "yes" ; then
1704
  echo "#define CONFIG_FAAC 1" >> $TMPH
1705
  echo "CONFIG_FAAC=yes" >> config.mak
1706
fi
1707

    
1708
if test "$xvid" = "yes" ; then
1709
  echo "#define CONFIG_XVID 1" >> $TMPH
1710
  echo "CONFIG_XVID=yes" >> config.mak
1711
fi
1712

    
1713
if test "$x264" = "yes" ; then
1714
  echo "#define CONFIG_X264 1" >> $TMPH
1715
  echo "CONFIG_X264=yes" >> config.mak
1716
fi
1717

    
1718
if test "$mingw32" = "yes" ; then
1719
  echo "#define CONFIG_WIN32 1" >> $TMPH
1720
  echo "CONFIG_WIN32=yes" >> config.mak
1721
  echo "HAVE_W32THREADS=yes" >> config.mak
1722
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1723
  echo "#define HAVE_THREADS 1" >> $TMPH
1724
  echo "#ifndef __MINGW32__" >> $TMPH
1725
  echo "#define __MINGW32__ 1" >> $TMPH
1726
  echo "#endif" >> $TMPH
1727
fi
1728

    
1729
if test "$mingwce" = "yes" ; then
1730
  echo "#define CONFIG_WIN32 1" >> $TMPH
1731
  echo "CONFIG_WIN32=yes" >> config.mak
1732
  echo "#define CONFIG_WINCE 1" >> $TMPH
1733
  echo "CONFIG_WINCE=yes" >> config.mak
1734
  echo "#ifndef __MINGW32__" >> $TMPH
1735
  echo "#define __MINGW32__ 1" >> $TMPH
1736
  echo "#endif" >> $TMPH
1737
fi
1738

    
1739
if test "$os2" = "yes" ; then
1740
  echo "#define CONFIG_OS2 1" >> $TMPH
1741
  echo "CONFIG_OS2=yes" >> config.mak
1742
fi
1743

    
1744
if test "$TARGET_OS" = "SunOS" ; then
1745
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1746
fi
1747

    
1748
if test "$TARGET_OS" = "BeOS" ; then
1749
  echo "HAVE_BEOSTHREADS=yes" >> config.mak
1750
  echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1751
  echo "#define HAVE_THREADS 1" >> $TMPH
1752
fi
1753

    
1754
if test "$darwin" = "yes"; then
1755
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1756
  echo "CONFIG_DARWIN=yes" >> config.mak
1757
fi
1758

    
1759
if test "$_malloc_h" = "yes" ; then
1760
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1761
else
1762
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1763
fi
1764

    
1765
if test "$_memalign" = "yes" ; then
1766
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1767
else
1768
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1769
fi
1770

    
1771
if test "$memalignhack" = "yes" ; then
1772
  echo "#define MEMALIGN_HACK 1" >> $TMPH
1773
fi
1774

    
1775

    
1776
if test "$netserver" = "yes" ; then
1777
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1778
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1779
fi
1780

    
1781
if test "$need_inet_aton" = "yes" ; then
1782
  echo "NEED_INET_ATON=yes" >> config.mak
1783
fi
1784

    
1785
if test "$simpleidct" = "yes" ; then
1786
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1787
fi
1788

    
1789
if test "$protocols" = "yes" ; then
1790
  echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
1791
  echo "CONFIG_PROTOCOLS=yes" >> config.mak
1792
fi
1793

    
1794
if test "$ffserver" = "yes" ; then
1795
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1796
  echo "CONFIG_FFSERVER=yes" >> config.mak
1797
fi
1798

    
1799
if test "$ffplay" = "yes" ; then
1800
  echo "CONFIG_FFPLAY=yes" >> config.mak
1801
fi
1802

    
1803
if test "$gpl" = "yes" ; then
1804
  echo "#define CONFIG_GPL 1" >> $TMPH
1805
  echo "CONFIG_GPL=yes" >> config.mak
1806
fi
1807

    
1808
echo "#define restrict $_restrict" >> $TMPH
1809

    
1810
if test "$optimize" = "small"; then
1811
  echo "#define always_inline"  >> $TMPH
1812
fi
1813

    
1814
# build tree in object directory if source path is different from current one
1815
if test "$source_path_used" = "yes" ; then
1816
    DIRS="\
1817
         doc \
1818
         libavformat \
1819
         libavcodec \
1820
         libavcodec/alpha \
1821
         libavcodec/armv4l \
1822
         libavcodec/i386 \
1823
         libavcodec/sparc \
1824
         libavcodec/mlib \
1825
         libavcodec/ppc \
1826
         libavcodec/liba52 \
1827
         libavcodec/libpostproc \
1828
         libavutil \
1829
         tests \
1830
         vhook \
1831
         "
1832
    FILES="\
1833
          Makefile \
1834
          libavformat/Makefile \
1835
          libavcodec/Makefile \
1836
          libavcodec/libpostproc/Makefile \
1837
          libavutil/Makefile \
1838
          tests/Makefile \
1839
          vhook/Makefile \
1840
          doc/Makefile \
1841
          doc/texi2pod.pl \
1842
          "
1843
    for dir in $DIRS ; do
1844
            mkdir -p $dir
1845
    done
1846
    for f in $FILES ; do
1847
        ln -sf "$source_path/$f" $f
1848
    done
1849
    echo "SRC_PATH=$source_path" >> config.mak
1850
else
1851
    echo "SRC_PATH='$source_path'" >> config.mak
1852
fi
1853

    
1854
if test "$amr_wb" = "yes" ; then
1855
  echo "#define AMR_WB 1" >> $TMPH
1856
  echo "AMR_WB=yes" >> config.mak
1857
  echo
1858
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1859
  echo "V5.1.0 from "
1860
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1861
  echo "and extracted the source to libavcodec/amrwb_float"
1862
  echo
1863
fi
1864

    
1865
if test "$amr_nb" = "yes" ; then
1866
  echo "#define AMR_NB 1" >> $TMPH
1867
  echo "AMR_NB=yes" >> config.mak
1868
  echo
1869
if test "$amr_nb_fixed" = "yes" ; then
1870
  echo "AMR_NB_FIXED=yes" >> config.mak
1871
  echo "#define AMR_NB_FIXED 1" >> $TMPH
1872
  echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1873
  echo "REL-5 version 5.1.0 from "
1874
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1875
  echo "and extracted src to libavcodec/amr"
1876
  echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1877
  echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1878
  echo
1879
else
1880
  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1881
  echo "REL-5 V5.1.0 from "
1882
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1883
  echo "and extracted the source to libavcodec/amr_float"
1884
  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1885
  echo
1886
fi
1887

    
1888
if test "$amr_if2" = "yes" ; then
1889
  echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1890
fi
1891

    
1892
fi
1893

    
1894
for codec in $CODEC_LIST ; do
1895
    echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1896
    echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1897
done
1898

    
1899
diff $TMPH config.h >/dev/null 2>&1
1900
if test $? -ne 0 ; then
1901
        mv -f $TMPH config.h
1902
else
1903
        echo "config.h is unchanged"
1904
fi
1905

    
1906
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1907

    
1908

    
1909
# build pkg-config files libav*.pc and libpostproc.pc
1910
# libavutil.pc
1911
cat <<EOF >libavutil.pc
1912
prefix=$prefix
1913
exec_prefix=\${prefix}
1914
libdir=\${exec_prefix}/lib
1915
includedir=\${prefix}/include
1916

    
1917
Name: libavutil
1918
Description: FFmpeg utility library
1919
Version: $lavu_version
1920
Requires:
1921
Conflicts:
1922
Libs: -L\${libdir} -lavutil
1923
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1924
EOF
1925

    
1926
cat <<EOF >libavutil-uninstalled.pc
1927
prefix=
1928
exec_prefix=
1929
libdir=\${pcfiledir}/libavutil
1930
includedir=\${pcfiledir}/libavutil
1931

    
1932
Name: libavutil
1933
Description: FFmpeg utility library
1934
Version: $lavu_version
1935
Requires:
1936
Conflicts:
1937
Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1938
Cflags: -I\${includedir}
1939
EOF
1940

    
1941
# libavcodec.pc
1942
cat <<EOF >libavcodec.pc
1943
prefix=$prefix
1944
exec_prefix=\${prefix}
1945
libdir=\${exec_prefix}/lib
1946
includedir=\${prefix}/include
1947

    
1948
Name: libavcodec
1949
Description: FFmpeg codec library
1950
Version: $lavc_version
1951
Requires: $pkg_requires libavutil = $lavu_version
1952
Conflicts:
1953
Libs: -L\${libdir} -lavcodec $extralibs
1954
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1955
EOF
1956

    
1957
cat <<EOF >libavcodec-uninstalled.pc
1958
prefix=
1959
exec_prefix=
1960
libdir=\${pcfiledir}/libavcodec
1961
includedir=\${pcfiledir}/libavcodec
1962

    
1963
Name: libavcodec
1964
Description: FFmpeg codec library
1965
Version: $lavc_version
1966
Requires: $pkg_requires libavutil = $lavu_version
1967
Conflicts:
1968
Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1969
Cflags: -I\${includedir}
1970
EOF
1971

    
1972
# libavformat.pc
1973
cat <<EOF >libavformat.pc
1974
prefix=$prefix
1975
exec_prefix=\${prefix}
1976
libdir=\${exec_prefix}/lib
1977
includedir=\${prefix}/include
1978

    
1979
Name: libavformat
1980
Description: FFmpeg container format library
1981
Version: $lavf_version
1982
Requires: $pkg_requires libavcodec = $lavc_version
1983
Conflicts:
1984
Libs: -L\${libdir} -lavformat $extralibs
1985
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1986
EOF
1987

    
1988
cat <<EOF >libavformat-uninstalled.pc
1989
prefix=
1990
exec_prefix=
1991
libdir=\${pcfiledir}/libavformat
1992
includedir=\${pcfiledir}/libavformat
1993

    
1994
Name: libavformat
1995
Description: FFmpeg container format library
1996
Version: $lavf_version
1997
Requires: $pkg_requires libavcodec = $lavc_version
1998
Conflicts:
1999
Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
2000
Cflags: -I\${includedir}
2001
EOF
2002

    
2003

    
2004
# libpostproc.pc
2005
cat <<EOF >libpostproc.pc
2006
prefix=$prefix
2007
exec_prefix=\${prefix}
2008
libdir=\${exec_prefix}/lib
2009
includedir=\${prefix}/include
2010

    
2011
Name: libpostproc
2012
Description: FFmpeg post processing library
2013
Version: $lavc_version
2014
Requires:
2015
Conflicts:
2016
Libs: -L\${libdir} -lpostproc
2017
Cflags: -I\${includedir} -I\${includedir}/postproc
2018
EOF
2019

    
2020
cat <<EOF >libpostproc-uninstalled.pc
2021
prefix=
2022
exec_prefix=
2023
libdir=\${pcfiledir}/libavcodec/libpostproc
2024
includedir=\${pcfiledir}/libavcodec/libpostproc
2025

    
2026
Name: libpostproc
2027
Description: FFmpeg post processing library
2028
Version: $lavc_version
2029
Requires:
2030
Conflicts:
2031
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
2032
Cflags: -I\${includedir}
2033
EOF