Statistics
| Branch: | Revision:

ffmpeg / configure @ 04f46ced

History | View | Annotate | Download (50.1 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-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-protocols      disable I/O protocols support [default=no]"
78
echo "  --disable-ffserver       disable ffserver build"
79
echo "  --disable-ffplay         disable ffplay build"
80
echo "  --enable-small           optimize for size instead of speed"
81
echo "  --enable-memalign-hack   emulate memalign, interferes with memory debuggers"
82
echo "  --disable-strip          disable stripping of executables and shared libraries"
83
echo "  --disable-encoder=NAME   disables encoder NAME"
84
echo "  --enable-encoder=NAME    enables encoder NAME"
85
echo "  --disable-decoder=NAME   disables decoder NAME"
86
echo "  --enable-decoder=NAME    enables decoder NAME"
87
echo "  --disable-encoders       disables all encoders"
88
echo "  --disable-decoders       disables all decoders"
89
echo "  --disable-muxers         disables all muxers"
90
echo "  --disable-demuxers       disables all demuxers"
91
echo ""
92
echo "NOTE: Object files are built at the place where configure is launched."
93
exit 1
94
fi
95

    
96
# set temporary file name
97
if test ! -z "$TMPDIR" ; then
98
    TMPDIR1="${TMPDIR}"
99
elif test ! -z "$TEMPDIR" ; then
100
    TMPDIR1="${TEMPDIR}"
101
else
102
    TMPDIR1="/tmp"
103
fi
104

    
105
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
106
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
107
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
108
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
109
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
110

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

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

    
401
;;
402
*) ;;
403
esac
404

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

    
426
# find source path
427
source_path="`dirname $0`"
428
source_path_used="yes"
429
if test -z "$source_path" -o "$source_path" = "." ; then
430
    source_path=`pwd`
431
    source_path_used="no"
432
else
433
    source_path="`cd \"$source_path\"; pwd`"
434
fi
435

    
436
FFMPEG_CONFIGURATION=" "
437
for opt do
438
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
439
done
440

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

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

    
606
if test "$theora" = "yes" ; then
607
    if test "$libogg" = "no"; then
608
        echo "libogg must be enabled to enable Theora."
609
        fail="yes"
610
        theora="no"
611
    fi
612
fi
613

    
614
if test "$vorbis" = "yes" ; then
615
    if test "$libogg" = "no"; then
616
        echo "libogg must be enabled to enable Vorbis."
617
        fail="yes"
618
        vorbis="no"
619
    fi
620
fi
621

    
622
if test "$gpl" != "yes"; then
623
    if test "$pp" != "no"; then
624
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
625
        fail="yes"
626
    fi
627

    
628
    if test "$a52" != "no" -o "$a52bin" != "no"; then
629
        echo "liba52 is under GPL and --enable-gpl is not specified."
630
        fail="yes"
631
    fi
632

    
633
    if test "$xvid" != "no"; then
634
        echo "libxvidcore is under GPL and --enable-gpl is not specified."
635
        fail="yes"
636
    fi
637

    
638
    if test "$x264" != "no"; then
639
        echo "x264 is under GPL and --enable-gpl is not specified."
640
        fail="yes"
641
    fi
642

    
643
    if test "$dts" != "no"; then
644
        echo "libdts is under GPL and --enable-gpl is not specified."
645
        fail="yes"
646
    fi
647

    
648
    if test "$faad" != "no" -o "$faadbin" != "no"; then
649
        cat > $TMPC << EOF
650
            #include <faad.h>
651
            int main( void ) { return 0; }
652
EOF
653

    
654
        if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
655
            cat > $TMPC << EOF
656
                #include <faad.h>
657
                #ifndef FAAD2_VERSION
658
                ok faad1
659
                #endif
660
                int main( void ) { return 0; }
661
EOF
662
            if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
663
                echo "FAAD2 is under GPL and --enable-gpl is not specified."
664
                fail="yes"
665
            fi
666
        else
667
            faad="no"
668
            faadbin="no"
669
            echo "FAAD test failed."
670
        fi
671
    fi
672

    
673

    
674
    if test "$fail" = "yes"; then
675
        exit 1
676
    fi
677
fi
678

    
679
# compute MMX state
680
if test $mmx = "default"; then
681
    if test $cpu = "x86" -o $cpu = "x86_64"; then
682
        mmx="yes"
683
    else
684
        mmx="no"
685
    fi
686
fi
687

    
688
# check iwmmxt support
689
if test $iwmmxt = "default" -a $cpu = "armv4l"; then
690
    cat > $TMPC << EOF
691
        int main(void) {
692
        __asm__ __volatile__ ("wunpckelub wr6, wr4");
693
        }
694
EOF
695

    
696
    iwmmxt=no
697
    if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
698
        iwmmxt=yes
699
    fi
700
fi
701

    
702
#Darwin CC versions
703
needmdynamicnopic="no"
704
if test $targetos = Darwin; then
705
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
706
        CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
707
    else
708
        gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
709
        case "$gcc_version" in
710
            *2.95*)
711
                CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
712
                ;;
713
            *[34].*)
714
                CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
715
                if test "$lshared" = no; then
716
                   needmdynamicnopic="yes"
717
                fi
718
                ;;
719
            *)
720
                CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
721
                if test "$lshared" = no; then
722
                   needmdynamicnopic="yes"
723
                fi
724
                ;;
725
        esac
726
    fi
727
fi
728

    
729
# Can only do AltiVec on PowerPC
730
if test $altivec = "default"; then
731
    if test $cpu = "powerpc"; then
732
        altivec="yes"
733
    else
734
        altivec="no"
735
    fi
736
fi
737

    
738
# Add processor-specific flags
739
TUNECPU="generic"
740
POWERPCMODE="32bits"
741
if test $tune != "generic"; then
742
    case $tune in
743
        601|ppc601|PowerPC601)
744
            CFLAGS="$CFLAGS -mcpu=601"
745
            if test $altivec = "yes"; then
746
                echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
747
            fi
748
            TUNECPU=ppc601
749
        ;;
750
        603*|ppc603*|PowerPC603*)
751
            CFLAGS="$CFLAGS -mcpu=603"
752
            if test $altivec = "yes"; then
753
                echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
754
            fi
755
            TUNECPU=ppc603
756
        ;;
757
        604*|ppc604*|PowerPC604*)
758
            CFLAGS="$CFLAGS -mcpu=604"
759
            if test $altivec = "yes"; then
760
                echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
761
            fi
762
            TUNECPU=ppc604
763
        ;;
764
        G3|g3|75*|ppc75*|PowerPC75*)
765
            CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
766
            if test $altivec = "yes"; then
767
                echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
768
            fi
769
            TUNECPU=ppc750
770
        ;;
771
        G4|g4|745*|ppc745*|PowerPC745*)
772
            CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
773
            if test $altivec = "no"; then
774
                echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
775
            fi
776
            TUNECPU=ppc7450
777
        ;;
778
        74*|ppc74*|PowerPC74*)
779
            CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
780
            if test $altivec = "no"; then
781
                echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
782
            fi
783
            TUNECPU=ppc7400
784
        ;;
785
        G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
786
            CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
787
            if test $altivec = "no"; then
788
                echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
789
            fi
790
            TUNECPU=ppc970
791
            POWERPCMODE="64bits"
792
        ;;
793
        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)
794
            CFLAGS="$CFLAGS -march=$tune"
795
        ;;
796
        *)
797
        echo "WARNING: Unknown CPU \"$tune\", ignored."
798
        ;;
799
    esac
800
fi
801

    
802
# AltiVec flags: The FSF version of GCC differs from the Apple version
803
if test $cpu = "powerpc"; then
804
    if test $altivec = "yes"; then
805
        if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
806
            CFLAGS="$CFLAGS -faltivec"
807
        else
808
            CFLAGS="$CFLAGS -maltivec -mabi=altivec"
809
        fi
810
    fi
811
fi
812

    
813
# check if we have <altivec.h>
814
cat > $TMPC << EOF
815
#include <altivec.h>
816
int main( void ) { return 0; }
817
EOF
818

    
819
_altivec_h="no"
820
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
821
_altivec_h="yes"
822
fi
823

    
824
# check if our compiler supports Motorola AltiVec C API
825
if test $altivec = "yes"; then
826
if test $_altivec_h = "yes"; then
827
cat > $TMPC << EOF
828
#include <altivec.h>
829
int main(void) {
830
    vector signed int v1, v2, v3;
831
    v1 = vec_add(v2,v3);
832
    return 0;
833
}
834
EOF
835
else
836
cat > $TMPC << EOF
837
int main(void) {
838
    vector signed int v1, v2, v3;
839
    v1 = vec_add(v2,v3);
840
    return 0;
841
}
842
EOF
843
fi
844
$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
845
fi
846

    
847
# mmi only available on mips
848
if test $mmi = "default"; then
849
    if test $cpu = "mips"; then
850
        mmi="yes"
851
    else
852
        mmi="no"
853
    fi
854
fi
855

    
856
# check if our compiler supports mmi
857
if test $mmi = "yes"; then
858
cat > $TMPC << EOF
859
int main(void) {
860
    __asm__ ("lq \$2, 0(\$2)");
861
    return 0;
862
}
863
EOF
864
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
865
fi
866

    
867
if test "$mingw32" = "yes" ; then
868
    v4l="no"
869
    bktr="no"
870
    audio_oss="no"
871
    dv1394="no"
872
    dc1394="no"
873
    ffserver="no"
874
    network="no"
875
    SLIBPREF=""
876
    SLIBSUF=".dll"
877
    EXESUF=".exe"
878
    if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
879
    if test "$force_libdir" != yes; then bindir="$prefix"; fi
880
fi
881

    
882
cc="${cross_prefix}${cc}"
883
ar="${cross_prefix}${ar}"
884
ranlib="${cross_prefix}${ranlib}"
885
strip="${cross_prefix}${strip}"
886

    
887
if test -z "$cross_prefix" ; then
888

    
889
# ---
890
# big/little-endian test
891
cat > $TMPC << EOF
892
#include <inttypes.h>
893
int main(int argc, char ** argv){
894
        volatile uint32_t i=0x01234567;
895
        return (*((uint8_t*)(&i))) == 0x67;
896
}
897
EOF
898

    
899
if $cc -o $TMPE $TMPC 2>/dev/null ; then
900
$TMPE && bigendian="yes"
901
else
902
echo big/little test failed
903
fi
904

    
905
else
906

    
907
# programs cannot be launched if cross compiling, so make a static guess
908
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
909
    bigendian="yes"
910
fi
911

    
912
fi
913

    
914
# ---
915
# *inttypes.h* test
916
cat > $TMPC << EOF
917
#include <inttypes.h>
918
int main(int argc, char ** argv){
919
    return 0;
920
}
921
EOF
922

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

    
925
# ---
926
# *int_fast* test
927
cat > $TMPC << EOF
928
#include <inttypes.h>
929
int main(int argc, char ** argv){
930
        volatile uint_fast64_t i=0x01234567;
931
        return 0;
932
}
933
EOF
934

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

    
937
# ---
938
# check availability of some header files
939

    
940
cat > $TMPC << EOF
941
#include <malloc.h>
942
int main( void ) { return 0; }
943
EOF
944

    
945
_memalign=no
946
_malloc_h=no
947
if $cc -o $TMPE $TMPC 2> /dev/null ; then
948
_malloc_h=yes
949
_memalign=yes
950
# check for memalign - atmos
951
cat > $TMPC << EOF
952
#include <stdio.h>
953
#include <malloc.h>
954
int main ( void ) {
955
char *string = NULL;
956
string = memalign(64, sizeof(char));
957
return 0;
958
}
959
EOF
960
$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
961
fi
962

    
963
if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
964
    echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
965
    exit 1
966
fi
967

    
968
cat > $TMPC << EOF
969
#include <time.h>
970
int main( void ) { localtime_r(NULL, NULL); }
971
EOF
972

    
973
localtime_r=no
974
if $cc -o $TMPE $TMPC 2> /dev/null ; then
975
  localtime_r=yes
976
fi
977

    
978
if test "$zlib" = "yes"; then
979
# check for zlib - mmu_man
980
cat > $TMPC << EOF
981
#include <zlib.h>
982
int main ( void ) {
983
if (zlibVersion() != ZLIB_VERSION)
984
   puts("zlib version differs !!!");
985
   return 1;
986
return 0;
987
}
988
EOF
989
$cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
990
# $TMPE 2> /dev/null > /dev/null || zlib="no"
991
# XXX: more tests needed - runtime test
992
fi
993
if test "$zlib" = "yes"; then
994
extralibs="$extralibs -lz"
995
fi
996

    
997
if test "$lzo" = "yes" -a "$gpl" = "yes"; then
998
# check for liblzo
999
cat > $TMPC << EOF
1000
#include <lzo1x.h>
1001
int main ( void ) {
1002
lzo_init();
1003
return 0;
1004
}
1005
EOF
1006
$cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -llzo 2> /dev/null || lzo="no"
1007
else
1008
lzo="no"
1009
fi
1010
if test "$lzo" = "yes"; then
1011
extralibs="$extralibs -llzo"
1012
fi
1013

    
1014
# test for lrintf in math.h
1015
cat > $TMPC << EOF
1016
#define _ISOC9X_SOURCE  1
1017
#include <math.h>
1018
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1019
EOF
1020

    
1021
have_lrintf="no"
1022
if $cc $CFLAGS $LDFLAGS $extralibs -o $TMPE $TMPC 2> /dev/null ; then
1023
  have_lrintf="yes"
1024
  # allanc@chickenandporn.com: cannot execute cross-compiled
1025
  # code on the host.  Only execute if not cross-compiling.
1026
  if test -z "$cross_prefix" ; then
1027
    $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
1028
  fi
1029
fi
1030

    
1031
_restrict=
1032
for restrict_keyword in restrict __restrict__ __restrict; do
1033
  echo "void foo(char * $restrict_keyword p);" > $TMPC
1034
  if $cc -c -o $TMPO $TMPC 2> /dev/null; then
1035
    _restrict=$restrict_keyword
1036
    break;
1037
  fi
1038
done
1039

    
1040
# test gcc version to see if vector builtins can be used
1041
# currently only used on i386 for MMX builtins
1042
cat > $TMPC << EOF
1043
#include <xmmintrin.h>
1044
int main(void) {
1045
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
1046
return 0;
1047
#else
1048
#error no vector builtins
1049
#endif
1050
}
1051
EOF
1052

    
1053
builtin_vector=no
1054
if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
1055
  builtin_vector=yes
1056
fi
1057

    
1058
# Probe for -Wdeclaration-after-statement
1059
if test "$cc" = "gcc"; then
1060
  cat > $TMPC << EOF
1061
  int main( void ) { return 0; }
1062
EOF
1063

    
1064
  if $cc -Wdeclaration-after-statement -Werror -o $TMPE $TMPC 2> /dev/null ; then
1065
    CFLAGS="$CFLAGS -Wdeclaration-after-statement"
1066
  fi
1067
fi
1068

    
1069
# dlopen/dlfcn.h probing
1070

    
1071
cat > $TMPC << EOF
1072
#include <dlfcn.h>
1073
int main( void ) { return (int) dlopen("foo", 0); }
1074
EOF
1075

    
1076
ldl=-ldl
1077

    
1078
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1079
dlfcn=yes
1080
dlopen=yes
1081
fi
1082

    
1083
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
1084
dlfcn=yes
1085
dlopen=yes
1086
ldl=""
1087
fi
1088

    
1089
cat > $TMPC << EOF
1090
int main( void ) { return (int) dlopen("foo", 0); }
1091
EOF
1092

    
1093
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1  ; then
1094
dlopen=yes
1095
fi
1096

    
1097
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1  ; then
1098
dlopen=yes
1099
ldl=""
1100
fi
1101

    
1102
if test "$vhook" = "default" ; then
1103
  vhook="$dlopen"
1104
fi
1105

    
1106
if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1107
  extralibs="$extralibs $ldl"
1108
fi
1109

    
1110

    
1111
##########################################
1112
# imlib check
1113

    
1114
cat > $TMPC << EOF
1115
#include <X11/Xlib.h>
1116
#include <Imlib2.h>
1117
int main( void ) { return (int) imlib_load_font("foo"); }
1118
EOF
1119

    
1120
imlib2=no
1121
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1  ; then
1122
imlib2=yes
1123
fi
1124

    
1125
##########################################
1126
# FreeType check
1127

    
1128
cat > $TMPC << EOF
1129
#include <ft2build.h>
1130
int main( void ) { return (int) FT_Init_FreeType(0); }
1131
EOF
1132

    
1133
freetype2=no
1134
if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
1135
  if (freetype-config --version) >/dev/null 2>&1 ; then
1136
    if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
1137
      freetype2=yes
1138
    fi
1139
  fi
1140
fi
1141

    
1142
##########################################
1143
# SDL check
1144

    
1145
cat > $TMPC << EOF
1146
#include <SDL.h>
1147
#undef main /* We don't want SDL to override our main() */
1148
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1149
EOF
1150

    
1151
sdl_too_old=no
1152
sdl=no
1153
if (sdl-config --version) >/dev/null 2>&1 ; then
1154
if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  > /dev/null 2>&1  ; then
1155
_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1156
if test "$_sdlversion" -lt 121 ; then
1157
sdl_too_old=yes
1158
else
1159
sdl=yes
1160
fi
1161
fi
1162
fi
1163

    
1164
##########################################
1165
# texi2html check
1166

    
1167
texi2html=no
1168
if (texi2html -version) >/dev/null 2>&1; then
1169
texi2html=yes
1170
fi
1171

    
1172
if test "$network" = "yes" ; then
1173
##########################################
1174
# IPv6 check
1175

    
1176
cat > $TMPC << EOF
1177
#include <sys/types.h>
1178
#include <sys/socket.h>
1179
#include <netinet/in.h>
1180
#include <netdb.h>
1181
int main( void ) {
1182
  struct sockaddr_storage saddr;
1183
  struct ipv6_mreq mreq6;
1184
  getaddrinfo(0,0,0,0);
1185
  getnameinfo(0,0,0,0,0,0,0);
1186
  IN6_IS_ADDR_MULTICAST(0);
1187
}
1188
EOF
1189

    
1190
ipv6=no
1191
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
1192
ipv6=yes
1193
fi
1194
fi
1195

    
1196
case "`$cc -v 2>&1 | grep version`" in
1197
    *gcc*)
1198
        CFLAGS="-Wall -Wno-switch $CFLAGS"
1199
        ;;
1200
    *)
1201
        ;;
1202
esac
1203

    
1204
if test "$sdl" = "no" ; then
1205
   ffplay=no
1206
fi
1207

    
1208
if test "$debug" = "yes"; then
1209
        CFLAGS="-g $CFLAGS"
1210
fi
1211

    
1212
if test "$optimize" = "small"; then
1213
#  CFLAGS=${CFLAGS//-O3/-Os}
1214
  CFLAGS="$CFLAGS -Os"
1215
fi
1216

    
1217
if test "$optimize" = "yes"; then
1218
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1219
        CFLAGS="$CFLAGS -O5"
1220
        LDFLAGS="$LDFLAGS -O5"
1221
    else
1222
        CFLAGS="-O3 $CFLAGS"
1223
    fi
1224
fi
1225

    
1226
# PIC flags for shared library objects where they are needed
1227
if test "$lshared" = "yes" ; then
1228
  # LIBOBJFLAGS may have already been set in the OS configuration
1229
  if test -z "$LIBOBJFLAGS" ; then
1230
    if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
1231
      LIBOBJFLAGS="\$(PIC)"
1232
    fi
1233
  fi
1234
fi
1235

    
1236
if test x"$bindir" = x""; then
1237
bindir="${prefix}/bin"
1238
fi
1239

    
1240
if test x"$libdir" = x""; then
1241
libdir="${prefix}/lib"
1242
fi
1243

    
1244
if test x"$mandir" = x""; then
1245
mandir="${prefix}/man"
1246
fi
1247

    
1248
echo "install prefix   $prefix"
1249
echo "source path      $source_path"
1250
echo "C compiler       $cc"
1251
echo "make             $make"
1252
echo "CPU              $cpu ($tune)"
1253
if test "$BUILDSUF" != ""; then
1254
echo "build suffix     $BUILDSUF"
1255
fi
1256
echo "big-endian       $bigendian"
1257
echo "inttypes.h       $inttypes"
1258
echo "broken inttypes.h $emu_fast_int"
1259
if test $cpu = "x86" -o $cpu = "x86_64"; then
1260
echo "MMX enabled      $mmx"
1261
echo "Vector Builtins  $builtin_vector"
1262
fi
1263
if test $cpu = "armv4l"; then
1264
echo "IWMMXT enabled   $iwmmxt"
1265
fi
1266
if test $cpu = "mips"; then
1267
echo "MMI enabled      $mmi"
1268
fi
1269
if test $cpu = "powerpc"; then
1270
echo "AltiVec enabled  $altivec"
1271
fi
1272
echo "gprof enabled    $gprof"
1273
echo "zlib enabled     $zlib"
1274
echo "lzo enabled      $lzo"
1275
echo "libgsm enabled   $libgsm"
1276
echo "mp3lame enabled  $mp3lame"
1277
echo "libogg enabled   $libogg"
1278
echo "Vorbis enabled   $vorbis"
1279
echo "Theora enabled   $theora"
1280
echo "FAAD enabled     $faad"
1281
echo "faadbin enabled  $faadbin"
1282
echo "FAAC enabled     $faac"
1283
echo "XviD enabled     $xvid"
1284
echo "x264 enabled     $x264"
1285
echo "a52 support      $a52"
1286
echo "a52 dlopened     $a52bin"
1287
echo "DTS support      $dts"
1288
echo "pp support       $pp"
1289
echo "debug symbols    $debug"
1290
echo "strip symbols    $dostrip"
1291
echo "optimize         $optimize"
1292
echo "shared           $lshared"
1293
echo "video hooking    $vhook"
1294
echo "SDL support      $sdl"
1295
if test $sdl_too_old = "yes"; then
1296
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
1297
fi
1298

    
1299
if test "$vhook" = "yes" ; then
1300
echo "Imlib2 support   $imlib2"
1301
echo "FreeType support $freetype2"
1302
fi
1303
echo "Sun medialib support"  $sunmlib
1304
echo "pthreads support"      $pthreads
1305
echo "AMR-NB float support"  $amr_nb
1306
echo "AMR-NB fixed support"  $amr_nb_fixed
1307
echo "AMR-WB float support"  $amr_wb
1308
echo "AMR-WB IF2 support"    $amr_if2
1309
echo "network support      $network"
1310
if test "$network" = "yes" ; then
1311
echo "IPv6 support         $ipv6"
1312
fi
1313
if test "$gpl" = "no" ; then
1314
echo "License: LGPL"
1315
else
1316
echo "License: GPL"
1317
fi
1318

    
1319
echo "Creating config.mak and config.h..."
1320

    
1321
date >> config.log
1322
echo "   $0 $FFMPEG_CONFIGURATION" >> config.log
1323
echo "# Automatically generated by configure - do not modify!" > config.mak
1324
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1325
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1326

    
1327
echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1328
echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1329
echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1330
echo "mandir=\$(DESTDIR)$mandir" >> config.mak
1331
echo "MAKE=$make" >> config.mak
1332
echo "CC=$cc" >> config.mak
1333
echo "AR=$ar" >> config.mak
1334
echo "RANLIB=$ranlib" >> config.mak
1335
if test "$dostrip" = "yes" ; then
1336
echo "STRIP=$strip" >> config.mak
1337
echo "INSTALLSTRIP=$installstrip" >> config.mak
1338
else
1339
echo "STRIP=echo ignoring strip" >> config.mak
1340
echo "INSTALLSTRIP=" >> config.mak
1341
fi
1342

    
1343
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
1344
# shared modules on OS/X (vhook/Makefile).
1345
SHCFLAGS=$CFLAGS
1346
if test "$needmdynamicnopic" = yes; then
1347
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1348
fi
1349

    
1350
echo "OPTFLAGS=$CFLAGS" >> config.mak
1351
echo "SHCFLAGS=$SHCFLAGS">>config.mak
1352
echo "LDFLAGS=$LDFLAGS" >> config.mak
1353
echo "LDCONFIG=$LDCONFIG" >> config.mak
1354
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1355
echo "SHFLAGS=$SHFLAGS" >> config.mak
1356
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
1357
echo "BUILDSUF=$BUILDSUF" >> config.mak
1358
echo "LIBPREF=$LIBPREF" >> config.mak
1359
echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1360
echo "LIB=$LIB" >> config.mak
1361
echo "SLIBPREF=$SLIBPREF" >> config.mak
1362
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1363
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1364
echo "TARGET_OS=$TARGET_OS" >> config.mak
1365
if test "$cpu" = "x86" ; then
1366
  echo "TARGET_ARCH_X86=yes" >> config.mak
1367
  echo "#define ARCH_X86 1" >> $TMPH
1368
elif test "$cpu" = "x86_64" ; then
1369
  echo "TARGET_ARCH_X86_64=yes" >> config.mak
1370
  echo "#define ARCH_X86_64 1" >> $TMPH
1371
elif test "$cpu" = "armv4l" ; then
1372
  echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1373
  echo "#define ARCH_ARMV4L 1" >> $TMPH
1374
elif test "$cpu" = "alpha" ; then
1375
  echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1376
  echo "#define ARCH_ALPHA 1" >> $TMPH
1377
elif test "$cpu" = "sparc64" ; then
1378
  echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1379
  echo "#define ARCH_SPARC64 1" >> $TMPH
1380
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1381
  echo "#define ARCH_SPARC 1" >> $TMPH
1382
elif test "$cpu" = "sparc" ; then
1383
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1384
  echo "#define ARCH_SPARC 1" >> $TMPH
1385
elif test "$cpu" = "powerpc" ; then
1386
  echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1387
  echo "#define ARCH_POWERPC 1" >> $TMPH
1388
  if test $POWERPCMODE = "32bits"; then
1389
    echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1390
  else
1391
    echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1392
  fi
1393
  if test "$powerpc_perf" = "yes"; then
1394
    echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1395
  fi
1396
elif test "$cpu" = "mips" ; then
1397
  echo "TARGET_ARCH_MIPS=yes" >> config.mak
1398
  echo "#define ARCH_MIPS 1" >> $TMPH
1399
elif test "$cpu" = "sh4" ; then
1400
  echo "TARGET_ARCH_SH4=yes" >> config.mak
1401
  echo "#define ARCH_SH4 1" >> $TMPH
1402
elif test "$cpu" = "parisc" ; then
1403
  echo "TARGET_ARCH_PARISC=yes" >> config.mak
1404
  echo "#define ARCH_PARISC 1" >> $TMPH
1405
elif test "$cpu" = "s390" ; then
1406
  echo "TARGET_ARCH_S390=yes" >> config.mak
1407
  echo "#define ARCH_S390 1" >> $TMPH
1408
elif test "$cpu" = "m68k" ; then
1409
  echo "TARGET_ARCH_M68K=yes" >> config.mak
1410
  echo "#define ARCH_M68K 1" >> $TMPH
1411
elif test "$cpu" = "ia64" ; then
1412
  echo "TARGET_ARCH_IA64=yes" >> config.mak
1413
  echo "#define ARCH_IA64 1" >> $TMPH
1414
fi
1415
echo "#define TUNECPU $TUNECPU" >> $TMPH
1416
if test "$bigendian" = "yes" ; then
1417
  echo "WORDS_BIGENDIAN=yes" >> config.mak
1418
  echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1419
fi
1420
if test "$inttypes" != "yes" ; then
1421
  echo "#define EMULATE_INTTYPES 1" >> $TMPH
1422
fi
1423
if test "$emu_fast_int" = "yes" ; then
1424
  echo "#define EMULATE_FAST_INT 1" >> $TMPH
1425
fi
1426
if test "$mmx" = "yes" ; then
1427
  echo "TARGET_MMX=yes" >> config.mak
1428
  echo "#define HAVE_MMX 1" >> $TMPH
1429
  echo "#define __CPU__ 586" >> $TMPH
1430
fi
1431
if test "$builtin_vector" = "yes" ; then
1432
  echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1433
  echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1434
fi
1435
if test "$iwmmxt" = "yes" ; then
1436
  echo "TARGET_IWMMXT=yes" >> config.mak
1437
  echo "#define HAVE_IWMMXT 1" >> $TMPH
1438
fi
1439
if test "$mmi" = "yes" ; then
1440
  echo "TARGET_MMI=yes" >> config.mak
1441
  echo "#define HAVE_MMI 1" >> $TMPH
1442
fi
1443
if test "$altivec" = "yes" ; then
1444
  echo "TARGET_ALTIVEC=yes" >> config.mak
1445
  echo "#define HAVE_ALTIVEC 1" >> $TMPH
1446
  echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1447
  echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1448
  if test "$_altivec_h" = "yes" ; then
1449
    echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1450
  else
1451
    echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1452
  fi
1453
fi
1454
if test "$gprof" = "yes" ; then
1455
  echo "TARGET_GPROF=yes" >> config.mak
1456
  echo "#define HAVE_GPROF 1" >> $TMPH
1457
fi
1458
if test "$localtime_r" = "yes" ; then
1459
  echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1460
fi
1461
if test "$imlib2" = "yes" ; then
1462
  echo "HAVE_IMLIB2=yes" >> config.mak
1463
fi
1464
if test "$freetype2" = "yes" ; then
1465
  echo "HAVE_FREETYPE2=yes" >> config.mak
1466
fi
1467
if test "$sunmlib" = "yes" ; then
1468
  echo "HAVE_MLIB=yes" >> config.mak
1469
  echo "#define HAVE_MLIB 1" >> $TMPH
1470
  extralibs="$extralibs -lmlib"
1471
fi
1472
if test "$pthreads" = "yes" ; then
1473
  echo "HAVE_PTHREADS=yes" >> config.mak
1474
  echo "#define HAVE_PTHREADS 1" >> $TMPH
1475
  echo "#define HAVE_THREADS 1" >> $TMPH
1476
  if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
1477
     extralibs="$extralibs -lpthread"
1478
  fi
1479
fi
1480
if test "$sdl" = "yes" ; then
1481
  echo "CONFIG_SDL=yes" >> config.mak
1482
  echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1483
  echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1484
fi
1485
if test "$texi2html" = "yes"; then
1486
  echo "BUILD_DOC=yes" >> config.mak
1487
fi
1488
if test "$have_lrintf" = "yes" ; then
1489
  echo "#define HAVE_LRINTF 1" >> $TMPH
1490
fi
1491
if test "$vhook" = "yes" ; then
1492
  echo "BUILD_VHOOK=yes" >> config.mak
1493
  echo "#define HAVE_VHOOK 1" >> $TMPH
1494
fi
1495

    
1496
pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libavcodec/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
1497
lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1498
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1499
lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1500

    
1501

    
1502

    
1503
if test "$lshared" = "yes" ; then
1504
  echo "BUILD_SHARED=yes" >> config.mak
1505
  echo "PIC=-fPIC -DPIC" >> config.mak
1506
  echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
1507
  echo "SPPVERSION=$lavc_version" >> config.mak
1508
  echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
1509
  echo "LAVCVERSION=$lavc_version" >> config.mak
1510
  echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
1511
  echo "LAVFVERSION=$lavf_version" >> config.mak
1512
  echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
1513
  echo "LAVUVERSION=$lavu_version" >> config.mak
1514
  echo "SLIBNAME=${SLIBNAME}" >> config.mak
1515
  echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1516
  echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
1517
fi
1518
echo "EXTRALIBS=$extralibs" >> config.mak
1519
version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1520
 cut -d '"' -f 2`
1521
echo "VERSION=$version" >>config.mak
1522
# If you do not want to use encoders, disable them.
1523
echo "#define CONFIG_ENCODERS 1" >> $TMPH
1524
echo "CONFIG_ENCODERS=yes" >> config.mak
1525

    
1526
# If you do not want to use decoders, disable them.
1527
echo "#define CONFIG_DECODERS 1" >> $TMPH
1528
echo "CONFIG_DECODERS=yes" >> config.mak
1529

    
1530
# muxers
1531
if test "$muxers" = "yes" ; then
1532
  echo "#define CONFIG_MUXERS 1" >> $TMPH
1533
  echo "CONFIG_MUXERS=yes" >> config.mak
1534
fi
1535

    
1536
# demuxers
1537
if test "$demuxers" = "yes" ; then
1538
  echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1539
  echo "CONFIG_DEMUXERS=yes" >> config.mak
1540
fi
1541

    
1542
# AC3
1543
if test "$a52" = "yes" ; then
1544
  echo "#define CONFIG_AC3 1" >> $TMPH
1545
  echo "CONFIG_AC3=yes" >> config.mak
1546

    
1547
  if test "$a52bin" = "yes" ; then
1548
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1549
    echo "CONFIG_A52BIN=yes" >> config.mak
1550
  fi
1551
fi
1552

    
1553
# DTS
1554
if test "$dts" = "yes" ; then
1555
  echo "#define CONFIG_DTS 1" >> $TMPH
1556
  echo "CONFIG_DTS=yes" >> config.mak
1557
fi
1558

    
1559
# PP
1560
if test "$pp" = "yes" ; then
1561
  echo "#define CONFIG_PP 1" >> $TMPH
1562
  echo "CONFIG_PP=yes" >> config.mak
1563
fi
1564

    
1565
# MPEG audio high precision mode
1566
if test "$mpegaudio_hp" = "yes" ; then
1567
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1568
fi
1569

    
1570
if test "$v4l" = "yes" ; then
1571
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1572
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1573
fi
1574

    
1575
if test "$bktr" = "yes" ; then
1576
  echo "#define CONFIG_BKTR 1" >> $TMPH
1577
  echo "CONFIG_BKTR=yes" >> config.mak
1578
fi
1579

    
1580
if test "$dv1394" = "yes" ; then
1581
  echo "#define CONFIG_DV1394 1" >> $TMPH
1582
  echo "CONFIG_DV1394=yes" >> config.mak
1583
fi
1584

    
1585
if test "$dc1394" = "yes" ; then
1586
  echo "#define CONFIG_DC1394 1" >> $TMPH
1587
  echo "CONFIG_DC1394=yes" >> config.mak
1588
fi
1589

    
1590
if test "$dlopen" = "yes" ; then
1591
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1592
fi
1593

    
1594
if test "$dlfcn" = "yes" ; then
1595
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1596
fi
1597

    
1598
if test "$audio_oss" = "yes" ; then
1599
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1600
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1601
fi
1602

    
1603
if test "$audio_beos" = "yes" ; then
1604
  echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1605
  echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1606
fi
1607

    
1608
if test "$network" = "yes" ; then
1609
  echo "#define CONFIG_NETWORK 1" >> $TMPH
1610
  echo "CONFIG_NETWORK=yes" >> config.mak
1611
fi
1612

    
1613
if test "$ipv6" = "yes" ; then
1614
  echo "#define CONFIG_IPV6 1" >> $TMPH
1615
fi
1616

    
1617
if test "$zlib" = "yes" ; then
1618
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1619
  echo "CONFIG_ZLIB=yes" >> config.mak
1620
fi
1621

    
1622
if test "$lzo" = "yes" ; then
1623
  echo "#define CONFIG_LZO 1" >> $TMPH
1624
  echo "CONFIG_LZO=yes" >> config.mak
1625
fi
1626

    
1627
if test "$libgsm" = "yes" ; then
1628
  echo "#define CONFIG_LIBGSM 1" >> $TMPH
1629
  echo "CONFIG_LIBGSM=yes" >> config.mak
1630
fi
1631

    
1632
if test "$mp3lame" = "yes" ; then
1633
  echo "#define CONFIG_MP3LAME 1" >> $TMPH
1634
  echo "CONFIG_MP3LAME=yes" >> config.mak
1635
fi
1636

    
1637
if test "$libogg" = "yes" ; then
1638
  echo "#define CONFIG_LIBOGG 1" >> $TMPH
1639
  echo "CONFIG_LIBOGG=yes" >> config.mak
1640
fi
1641

    
1642
if test "$vorbis" = "yes" ; then
1643
  echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1644
  echo "CONFIG_LIBVORBIS=yes" >> config.mak
1645
fi
1646

    
1647
if test "$theora" = "yes" ; then
1648
  echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1649
  echo "CONFIG_LIBTHEORA=yes" >> config.mak
1650
fi
1651

    
1652
if test "$faad" = "yes" ; then
1653
  echo "#define CONFIG_FAAD 1" >> $TMPH
1654
  echo "CONFIG_FAAD=yes" >> config.mak
1655
fi
1656

    
1657
if test "$faadbin" = "yes" ; then
1658
  echo "#define CONFIG_FAADBIN 1" >> $TMPH
1659
  echo "CONFIG_FAADBIN=yes" >> config.mak
1660
fi
1661

    
1662
if test "$faac" = "yes" ; then
1663
  echo "#define CONFIG_FAAC 1" >> $TMPH
1664
  echo "CONFIG_FAAC=yes" >> config.mak
1665
fi
1666

    
1667
if test "$xvid" = "yes" ; then
1668
  echo "#define CONFIG_XVID 1" >> $TMPH
1669
  echo "CONFIG_XVID=yes" >> config.mak
1670
fi
1671

    
1672
if test "$x264" = "yes" ; then
1673
  echo "#define CONFIG_X264 1" >> $TMPH
1674
  echo "CONFIG_X264=yes" >> config.mak
1675
fi
1676

    
1677
if test "$mingw32" = "yes" ; then
1678
  echo "#define CONFIG_WIN32 1" >> $TMPH
1679
  echo "CONFIG_WIN32=yes" >> config.mak
1680
  echo "HAVE_W32THREADS=yes" >> config.mak
1681
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1682
  echo "#define HAVE_THREADS 1" >> $TMPH
1683
  echo "#ifndef __MINGW32__" >> $TMPH
1684
  echo "#define __MINGW32__ 1" >> $TMPH
1685
  echo "#endif" >> $TMPH
1686
fi
1687

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

    
1693
if test "$TARGET_OS" = "SunOS" ; then
1694
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1695
fi
1696

    
1697
if test "$TARGET_OS" = "BeOS" ; then
1698
  echo "HAVE_BEOSTHREADS=yes" >> config.mak
1699
  echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1700
  echo "#define HAVE_THREADS 1" >> $TMPH
1701
fi
1702

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

    
1708
if test "$_malloc_h" = "yes" ; then
1709
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1710
else
1711
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1712
fi
1713

    
1714
if test "$_memalign" = "yes" ; then
1715
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1716
else
1717
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1718
fi
1719

    
1720
if test "$memalignhack" = "yes" ; then
1721
  echo "#define MEMALIGN_HACK 1" >> $TMPH
1722
fi
1723

    
1724

    
1725
if test "$netserver" = "yes" ; then
1726
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1727
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1728
fi
1729

    
1730
if test "$need_inet_aton" = "yes" ; then
1731
  echo "NEED_INET_ATON=yes" >> config.mak
1732
fi
1733

    
1734
if test "$simpleidct" = "yes" ; then
1735
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1736
fi
1737

    
1738
if test "$protocols" = "yes" ; then
1739
  echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
1740
  echo "CONFIG_PROTOCOLS=yes" >> config.mak
1741
fi
1742

    
1743
if test "$ffserver" = "yes" ; then
1744
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1745
  echo "CONFIG_FFSERVER=yes" >> config.mak
1746
fi
1747

    
1748
if test "$ffplay" = "yes" ; then
1749
  echo "CONFIG_FFPLAY=yes" >> config.mak
1750
fi
1751

    
1752
if test "$gpl" = "yes" ; then
1753
  echo "#define CONFIG_GPL 1" >> $TMPH
1754
  echo "CONFIG_GPL=yes" >> config.mak
1755
fi
1756

    
1757
echo "#define restrict $_restrict" >> $TMPH
1758

    
1759
if test "$optimize" = "small"; then
1760
  echo "#define always_inline"  >> $TMPH
1761
fi
1762

    
1763
# build tree in object directory if source path is different from current one
1764
if test "$source_path_used" = "yes" ; then
1765
    DIRS="\
1766
         doc \
1767
         libavformat \
1768
         libavcodec \
1769
         libavcodec/alpha \
1770
         libavcodec/armv4l \
1771
         libavcodec/i386 \
1772
         libavcodec/sparc \
1773
         libavcodec/mlib \
1774
         libavcodec/ppc \
1775
         libavcodec/liba52 \
1776
         libavcodec/libpostproc \
1777
         libavutil \
1778
         tests \
1779
         vhook \
1780
         "
1781
    FILES="\
1782
          Makefile \
1783
          libavformat/Makefile \
1784
          libavcodec/Makefile \
1785
          libavcodec/libpostproc/Makefile \
1786
          libavutil/Makefile \
1787
          tests/Makefile \
1788
          vhook/Makefile \
1789
          doc/Makefile \
1790
          doc/texi2pod.pl \
1791
          "
1792
    for dir in $DIRS ; do
1793
            mkdir -p $dir
1794
    done
1795
    for f in $FILES ; do
1796
        ln -sf "$source_path/$f" $f
1797
    done
1798
    echo "SRC_PATH=$source_path" >> config.mak
1799
else
1800
    echo "SRC_PATH='$source_path'" >> config.mak
1801
fi
1802

    
1803
if test "$amr_wb" = "yes" ; then
1804
  echo "#define AMR_WB 1" >> $TMPH
1805
  echo "AMR_WB=yes" >> config.mak
1806
  echo
1807
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1808
  echo "V5.1.0 from "
1809
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1810
  echo "and extracted the source to libavcodec/amrwb_float"
1811
  echo
1812
fi
1813

    
1814
if test "$amr_nb" = "yes" ; then
1815
  echo "#define AMR_NB 1" >> $TMPH
1816
  echo "AMR_NB=yes" >> config.mak
1817
  echo
1818
if test "$amr_nb_fixed" = "yes" ; then
1819
  echo "AMR_NB_FIXED=yes" >> config.mak
1820
  echo "#define AMR_NB_FIXED 1" >> $TMPH
1821
  echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1822
  echo "REL-5 version 5.1.0 from "
1823
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1824
  echo "and extracted src to libavcodec/amr"
1825
  echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1826
  echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1827
  echo
1828
else
1829
  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1830
  echo "REL-5 V5.1.0 from "
1831
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1832
  echo "and extracted the source to libavcodec/amr_float"
1833
  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1834
  echo
1835
fi
1836

    
1837
if test "$amr_if2" = "yes" ; then
1838
  echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1839
fi
1840

    
1841
fi
1842

    
1843
for codec in $CODEC_LIST ; do
1844
    echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1845
    echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1846
done
1847

    
1848
diff $TMPH config.h >/dev/null 2>&1
1849
if test $? -ne 0 ; then
1850
        mv -f $TMPH config.h
1851
else
1852
        echo "config.h is unchanged"
1853
fi
1854

    
1855
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1856

    
1857

    
1858
# build pkg-config files libav*.pc and libpostproc.pc
1859
# libavutil.pc
1860
cat <<EOF >libavutil.pc
1861
prefix=$prefix
1862
exec_prefix=\${prefix}
1863
libdir=\${exec_prefix}/lib
1864
includedir=\${prefix}/include
1865

    
1866
Name: libavutil
1867
Description: FFmpeg utility library
1868
Version: $lavu_version
1869
Requires:
1870
Conflicts:
1871
Libs: -L\${libdir} -lavutil
1872
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1873
EOF
1874

    
1875
cat <<EOF >libavutil-uninstalled.pc
1876
prefix=
1877
exec_prefix=
1878
libdir=\${pcfiledir}/libavutil
1879
includedir=\${pcfiledir}/libavutil
1880

    
1881
Name: libavutil
1882
Description: FFmpeg utility library
1883
Version: $lavu_version
1884
Requires:
1885
Conflicts:
1886
Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1887
Cflags: -I\${includedir}
1888
EOF
1889

    
1890
# libavcodec.pc
1891
cat <<EOF >libavcodec.pc
1892
prefix=$prefix
1893
exec_prefix=\${prefix}
1894
libdir=\${exec_prefix}/lib
1895
includedir=\${prefix}/include
1896

    
1897
Name: libavcodec
1898
Description: FFmpeg codec library
1899
Version: $lavc_version
1900
Requires: $pkg_requires libavutil = $lavu_version
1901
Conflicts:
1902
Libs: -L\${libdir} -lavcodec $extralibs
1903
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1904
EOF
1905

    
1906
cat <<EOF >libavcodec-uninstalled.pc
1907
prefix=
1908
exec_prefix=
1909
libdir=\${pcfiledir}/libavcodec
1910
includedir=\${pcfiledir}/libavcodec
1911

    
1912
Name: libavcodec
1913
Description: FFmpeg codec library
1914
Version: $lavc_version
1915
Requires: $pkg_requires libavutil = $lavu_version
1916
Conflicts:
1917
Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1918
Cflags: -I\${includedir}
1919
EOF
1920

    
1921
# libavformat.pc
1922
cat <<EOF >libavformat.pc
1923
prefix=$prefix
1924
exec_prefix=\${prefix}
1925
libdir=\${exec_prefix}/lib
1926
includedir=\${prefix}/include
1927

    
1928
Name: libavformat
1929
Description: FFmpeg container format library
1930
Version: $lavf_version
1931
Requires: $pkg_requires libavcodec = $lavc_version
1932
Conflicts:
1933
Libs: -L\${libdir} -lavformat $extralibs
1934
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1935
EOF
1936

    
1937
cat <<EOF >libavformat-uninstalled.pc
1938
prefix=
1939
exec_prefix=
1940
libdir=\${pcfiledir}/libavformat
1941
includedir=\${pcfiledir}/libavformat
1942

    
1943
Name: libavformat
1944
Description: FFmpeg container format library
1945
Version: $lavf_version
1946
Requires: $pkg_requires libavcodec = $lavc_version
1947
Conflicts:
1948
Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1949
Cflags: -I\${includedir}
1950
EOF
1951

    
1952

    
1953
# libpostproc.pc
1954
cat <<EOF >libpostproc.pc
1955
prefix=$prefix
1956
exec_prefix=\${prefix}
1957
libdir=\${exec_prefix}/lib
1958
includedir=\${prefix}/include
1959

    
1960
Name: libpostproc
1961
Description: FFmpeg post processing library
1962
Version: $lavc_version
1963
Requires:
1964
Conflicts:
1965
Libs: -L\${libdir} -lpostproc
1966
Cflags: -I\${includedir} -I\${includedir}/postproc
1967
EOF
1968

    
1969
cat <<EOF >libpostproc-uninstalled.pc
1970
prefix=
1971
exec_prefix=
1972
libdir=\${pcfiledir}/libavcodec/libpostproc
1973
includedir=\${pcfiledir}/libavcodec/libpostproc
1974

    
1975
Name: libpostproc
1976
Description: FFmpeg post processing library
1977
Version: $lavc_version
1978
Requires:
1979
Conflicts:
1980
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1981
Cflags: -I\${includedir}
1982
EOF