Statistics
| Branch: | Revision:

ffmpeg / configure @ e0f80bd7

History | View | Annotate | Download (49.4 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-pp       use libpostproc.so [default=no]"
34
echo "  --enable-shared          build shared libraries [default=no]"
35
echo "  --enable-amr_nb          enable amr_nb float audio codec"
36
echo "  --enable-amr_nb-fixed    use fixed point for amr-nb codec"
37
echo "  --enable-amr_wb          enable amr_wb float audio codec"
38
echo "  --enable-amr_if2         enable amr_wb IF2 audio codec"
39
echo "  --enable-sunmlib         use Sun medialib [default=no]"
40
echo "  --enable-pthreads        use pthreads [default=no]"
41
echo "  --enable-dc1394          enable IIDC-1394 grabbing using libdc1394"
42
echo "                           and libraw1394 [default=no]"
43
echo "  --enable-gpl             allow use of GPL code, the resulting libav*"
44
echo "                           and ffmpeg will be under GPL [default=no]"
45
echo ""
46
echo "Advanced options (experts only):"
47
echo "  --source-path=PATH       path to source code [$source_path]"
48
echo "  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]"
49
echo "  --cc=CC                  use C compiler CC [$cc]"
50
echo "  --make=MAKE              use specified make [$make]"
51
echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
52
echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
53
echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
54
echo "  --build-suffix=SUFFIX    suffix for application specific build []"
55
echo "  --cpu=CPU                force cpu to CPU  [$cpu]"
56
echo "  --tune=CPU               tune code for a particular CPU"
57
echo "                           (may fail or perform badly on other CPUs)"
58
echo "  --powerpc-perf-enable    enable performance report on PPC"
59
echo "                           (requires enabling PMC)"
60
echo "  --disable-mmx            disable MMX usage"
61
echo "  --disable-iwmmxt         disable iwmmxt usage"
62
echo "  --disable-altivec        disable AltiVec usage"
63
echo "  --disable-audio-oss      disable OSS audio support [default=no]"
64
echo "  --disable-audio-beos     disable BeOS audio support [default=no]"
65
echo "  --disable-v4l            disable video4linux grabbing [default=no]"
66
echo "  --disable-bktr           disable bktr video grabbing [default=no]"
67
echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
68
echo "  --disable-network        disable network support [default=no]"
69
echo "  --disable-zlib           disable zlib [default=no]"
70
echo "  --disable-lzo            disable lzo [default=no]"
71
echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
72
echo "  --disable-vhook          disable video hooking support"
73
echo "  --enable-gprof           enable profiling with gprof [$gprof]"
74
echo "  --disable-debug          disable debugging symbols"
75
echo "  --disable-opts           disable compiler optimizations"
76
echo "  --disable-mpegaudio-hp   faster (but less accurate)"
77
echo "                           MPEG audio decoding [default=no]"
78
echo "  --disable-ffserver       disable ffserver build"
79
echo "  --disable-ffplay         disable ffplay build"
80
echo "  --enable-small           optimize for size instead of speed"
81
echo "  --enable-memalign-hack   emulate memalign, interferes with memory debuggers"
82
echo "  --disable-strip          disable stripping of executables and shared libraries"
83
echo "  --disable-encoder=NAME   disables encoder NAME"
84
echo "  --enable-encoder=NAME    enables encoder NAME"
85
echo "  --disable-decoder=NAME   disables decoder NAME"
86
echo "  --enable-decoder=NAME    enables decoder NAME"
87
echo "  --disable-encoders       disables all encoders"
88
echo "  --disable-decoders       disables all decoders"
89
echo "  --disable-muxers         disables all muxers"
90
echo "  --disable-demuxers       disables all demuxers"
91
echo ""
92
echo "NOTE: Object files are built at the place where configure is launched."
93
exit 1
94
fi
95

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

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

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

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

    
395
;;
396
*) ;;
397
esac
398

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

    
420
# find source path
421
source_path="`dirname $0`"
422
source_path_used="yes"
423
if test -z "$source_path" -o "$source_path" = "." ; then
424
    source_path=`pwd`
425
    source_path_used="no"
426
else
427
    source_path="`cd \"$source_path\"; pwd`"
428
fi
429

    
430
FFMPEG_CONFIGURATION=" "
431
for opt do
432
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
433
done
434

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

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

    
601
if test "$theora" = "yes" ; then
602
    if test "$libogg" = "no"; then
603
        echo "libogg must be enabled to enable Theora."
604
        fail="yes"
605
        theora="no"
606
    fi
607
fi
608

    
609
if test "$vorbis" = "yes" ; then
610
    if test "$libogg" = "no"; then
611
        echo "libogg must be enabled to enable Vorbis."
612
        fail="yes"
613
        vorbis="no"
614
    fi
615
fi
616

    
617
if test "$gpl" != "yes"; then
618
    if test "$pp" != "no" -o "$shared_pp" != "no"; then
619
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
620
        fail="yes"
621
    fi
622

    
623
    if test "$a52" != "no" -o "$a52bin" != "no"; then
624
        echo "liba52 is under GPL and --enable-gpl is not specified."
625
        fail="yes"
626
    fi
627

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

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

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

    
643
    if test "$faad" != "no" -o "$faadbin" != "no"; then
644
        cat > $TMPC << EOF
645
            #include <faad.h>
646
            int main( void ) { return 0; }
647
EOF
648

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

    
668

    
669
    if test "$fail" = "yes"; then
670
        exit 1
671
    fi
672
fi
673

    
674
# compute MMX state
675
if test $mmx = "default"; then
676
    if test $cpu = "x86" -o $cpu = "x86_64"; then
677
        mmx="yes"
678
    else
679
        mmx="no"
680
    fi
681
fi
682

    
683
# check iwmmxt support
684
if test $iwmmxt = "default" -a $cpu = "armv4l"; then
685
    cat > $TMPC << EOF
686
        int main(void) {
687
        __asm__ __volatile__ ("wunpckelub wr6, wr4");
688
        }
689
EOF
690

    
691
    iwmmxt=no
692
    if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
693
        iwmmxt=yes
694
    fi
695
fi
696

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

    
724
# Can only do AltiVec on PowerPC
725
if test $altivec = "default"; then
726
    if test $cpu = "powerpc"; then
727
        altivec="yes"
728
    else
729
        altivec="no"
730
    fi
731
fi
732

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

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

    
808
# check if we have <altivec.h>
809
cat > $TMPC << EOF
810
#include <altivec.h>
811
int main( void ) { return 0; }
812
EOF
813

    
814
_altivec_h="no"
815
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
816
_altivec_h="yes"
817
fi
818

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

    
842
# mmi only available on mips
843
if test $mmi = "default"; then
844
    if test $cpu = "mips"; then
845
        mmi="yes"
846
    else
847
        mmi="no"
848
    fi
849
fi
850

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

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

    
877
cc="${cross_prefix}${cc}"
878
ar="${cross_prefix}${ar}"
879
ranlib="${cross_prefix}${ranlib}"
880
strip="${cross_prefix}${strip}"
881

    
882
if test -z "$cross_prefix" ; then
883

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

    
894
if $cc -o $TMPE $TMPC 2>/dev/null ; then
895
$TMPE && bigendian="yes"
896
else
897
echo big/little test failed
898
fi
899

    
900
else
901

    
902
# programs cannot be launched if cross compiling, so make a static guess
903
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
904
    bigendian="yes"
905
fi
906

    
907
fi
908

    
909
# ---
910
# *inttypes.h* test
911
cat > $TMPC << EOF
912
#include <inttypes.h>
913
int main(int argc, char ** argv){
914
    return 0;
915
}
916
EOF
917

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

    
920
# ---
921
# *int_fast* test
922
cat > $TMPC << EOF
923
#include <inttypes.h>
924
int main(int argc, char ** argv){
925
        volatile uint_fast64_t i=0x01234567;
926
        return 0;
927
}
928
EOF
929

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

    
932
# ---
933
# check availability of some header files
934

    
935
cat > $TMPC << EOF
936
#include <malloc.h>
937
int main( void ) { return 0; }
938
EOF
939

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

    
958
if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
959
    echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
960
    exit 1
961
fi
962

    
963
cat > $TMPC << EOF
964
#include <time.h>
965
int main( void ) { localtime_r(NULL, NULL); }
966
EOF
967

    
968
localtime_r=no
969
if $cc -o $TMPE $TMPC 2> /dev/null ; then
970
  localtime_r=yes
971
fi
972

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

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

    
1009
# test for lrintf in math.h
1010
cat > $TMPC << EOF
1011
#define _ISOC9X_SOURCE  1
1012
#include <math.h>
1013
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1014
EOF
1015

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

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

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

    
1048
builtin_vector=no
1049
if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
1050
  builtin_vector=yes
1051
fi
1052

    
1053
# Probe for -Wdeclaration-after-statement
1054
if test "$cc" = "gcc"; then
1055
  cat > $TMPC << EOF
1056
  int main( void ) { return 0; }
1057
EOF
1058

    
1059
  if $cc -Wdeclaration-after-statement -Werror -o $TMPE $TMPC 2> /dev/null ; then
1060
    CFLAGS="$CFLAGS -Wdeclaration-after-statement"
1061
  fi
1062
fi
1063

    
1064
# dlopen/dlfcn.h probing
1065

    
1066
cat > $TMPC << EOF
1067
#include <dlfcn.h>
1068
int main( void ) { return (int) dlopen("foo", 0); }
1069
EOF
1070

    
1071
ldl=-ldl
1072

    
1073
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1074
dlfcn=yes
1075
dlopen=yes
1076
fi
1077

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

    
1084
cat > $TMPC << EOF
1085
int main( void ) { return (int) dlopen("foo", 0); }
1086
EOF
1087

    
1088
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1  ; then
1089
dlopen=yes
1090
fi
1091

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

    
1097
if test "$vhook" = "default" ; then
1098
  vhook="$dlopen"
1099
fi
1100

    
1101
if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1102
  extralibs="$extralibs $ldl"
1103
fi
1104

    
1105

    
1106
##########################################
1107
# imlib check
1108

    
1109
cat > $TMPC << EOF
1110
#include <X11/Xlib.h>
1111
#include <Imlib2.h>
1112
int main( void ) { return (int) imlib_load_font("foo"); }
1113
EOF
1114

    
1115
imlib2=no
1116
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1  ; then
1117
imlib2=yes
1118
fi
1119

    
1120
##########################################
1121
# FreeType check
1122

    
1123
cat > $TMPC << EOF
1124
#include <ft2build.h>
1125
int main( void ) { return (int) FT_Init_FreeType(0); }
1126
EOF
1127

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

    
1137
##########################################
1138
# SDL check
1139

    
1140
cat > $TMPC << EOF
1141
#include <SDL.h>
1142
#undef main /* We don't want SDL to override our main() */
1143
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1144
EOF
1145

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

    
1159
##########################################
1160
# texi2html check
1161

    
1162
texi2html=no
1163
if (texi2html -version) >/dev/null 2>&1; then
1164
texi2html=yes
1165
fi
1166

    
1167
if test "$network" = "yes" ; then
1168
##########################################
1169
# IPv6 check
1170

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

    
1185
ipv6=no
1186
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
1187
ipv6=yes
1188
fi
1189
fi
1190

    
1191
case "`$cc -v 2>&1 | grep version`" in
1192
    *gcc*)
1193
        CFLAGS="-Wall -Wno-switch $CFLAGS"
1194
        ;;
1195
    *)
1196
        ;;
1197
esac
1198

    
1199
if test "$sdl" = "no" ; then
1200
   ffplay=no
1201
fi
1202

    
1203
if test "$debug" = "yes"; then
1204
        CFLAGS="-g $CFLAGS"
1205
fi
1206

    
1207
if test "$optimize" = "small"; then
1208
#  CFLAGS=${CFLAGS//-O3/-Os}
1209
  CFLAGS="$CFLAGS -Os"
1210
fi
1211

    
1212
if test "$optimize" = "yes"; then
1213
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1214
        CFLAGS="$CFLAGS -O5"
1215
        LDFLAGS="$LDFLAGS -O5"
1216
    else
1217
        CFLAGS="-O3 $CFLAGS"
1218
    fi
1219
fi
1220

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

    
1231
if test x"$bindir" = x""; then
1232
bindir="${prefix}/bin"
1233
fi
1234

    
1235
if test x"$libdir" = x""; then
1236
libdir="${prefix}/lib"
1237
fi
1238

    
1239
if test x"$mandir" = x""; then
1240
mandir="${prefix}/man"
1241
fi
1242

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

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

    
1314
echo "Creating config.mak and config.h..."
1315

    
1316
date >> config.log
1317
echo "   $0 $FFMPEG_CONFIGURATION" >> config.log
1318
echo "# Automatically generated by configure - do not modify!" > config.mak
1319
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1320
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1321

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

    
1338
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
1339
# shared modules on OS/X (vhook/Makefile).
1340
SHCFLAGS=$CFLAGS
1341
if test "$needmdynamicnopic" = yes; then
1342
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1343
fi
1344

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

    
1490
lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1491
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1492
lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1493

    
1494

    
1495

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

    
1516
# If you do not want to use decoders, disable them.
1517
echo "#define CONFIG_DECODERS 1" >> $TMPH
1518
echo "CONFIG_DECODERS=yes" >> config.mak
1519

    
1520
# muxers
1521
if test "$muxers" = "yes" ; then
1522
  echo "#define CONFIG_MUXERS 1" >> $TMPH
1523
  echo "CONFIG_MUXERS=yes" >> config.mak
1524
fi
1525

    
1526
# demuxers
1527
if test "$demuxers" = "yes" ; then
1528
  echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1529
  echo "CONFIG_DEMUXERS=yes" >> config.mak
1530
fi
1531

    
1532
# AC3
1533
if test "$a52" = "yes" ; then
1534
  echo "#define CONFIG_AC3 1" >> $TMPH
1535
  echo "CONFIG_AC3=yes" >> config.mak
1536

    
1537
  if test "$a52bin" = "yes" ; then
1538
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1539
    echo "CONFIG_A52BIN=yes" >> config.mak
1540
  fi
1541
fi
1542

    
1543
# DTS
1544
if test "$dts" = "yes" ; then
1545
  echo "#define CONFIG_DTS 1" >> $TMPH
1546
  echo "CONFIG_DTS=yes" >> config.mak
1547
fi
1548

    
1549
# PP
1550
if test "$pp" = "yes" ; then
1551
  echo "#define CONFIG_PP 1" >> $TMPH
1552
  echo "CONFIG_PP=yes" >> config.mak
1553

    
1554
  if test "$shared_pp" = "yes" ; then
1555
    echo "#define SHARED_PP 1" >> $TMPH
1556
    echo "SHARED_PP=yes" >> config.mak
1557
  fi
1558
fi
1559

    
1560
# MPEG audio high precision mode
1561
if test "$mpegaudio_hp" = "yes" ; then
1562
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1563
fi
1564

    
1565
if test "$v4l" = "yes" ; then
1566
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1567
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1568
fi
1569

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

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

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

    
1585
if test "$dlopen" = "yes" ; then
1586
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1587
fi
1588

    
1589
if test "$dlfcn" = "yes" ; then
1590
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1591
fi
1592

    
1593
if test "$audio_oss" = "yes" ; then
1594
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1595
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1596
fi
1597

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

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

    
1608
if test "$ipv6" = "yes" ; then
1609
  echo "#define CONFIG_IPV6 1" >> $TMPH
1610
fi
1611

    
1612
if test "$zlib" = "yes" ; then
1613
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1614
  echo "CONFIG_ZLIB=yes" >> config.mak
1615
fi
1616

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

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

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

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

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

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

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

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

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

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

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

    
1672
if test "$mingw32" = "yes" ; then
1673
  echo "#define CONFIG_WIN32 1" >> $TMPH
1674
  echo "CONFIG_WIN32=yes" >> config.mak
1675
  echo "HAVE_W32THREADS=yes" >> config.mak
1676
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1677
  echo "#define HAVE_THREADS 1" >> $TMPH
1678
  echo "#ifndef __MINGW32__" >> $TMPH
1679
  echo "#define __MINGW32__ 1" >> $TMPH
1680
  echo "#endif" >> $TMPH
1681
fi
1682

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

    
1688
if test "$TARGET_OS" = "SunOS" ; then
1689
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1690
fi
1691

    
1692
if test "$TARGET_OS" = "BeOS" ; then
1693
  echo "HAVE_BEOSTHREADS=yes" >> config.mak
1694
  echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1695
  echo "#define HAVE_THREADS 1" >> $TMPH
1696
fi
1697

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

    
1703
if test "$_malloc_h" = "yes" ; then
1704
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1705
else
1706
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1707
fi
1708

    
1709
if test "$_memalign" = "yes" ; then
1710
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1711
else
1712
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1713
fi
1714

    
1715
if test "$memalignhack" = "yes" ; then
1716
  echo "#define MEMALIGN_HACK 1" >> $TMPH
1717
fi
1718

    
1719

    
1720
if test "$netserver" = "yes" ; then
1721
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1722
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1723
fi
1724

    
1725
if test "$need_inet_aton" = "yes" ; then
1726
  echo "NEED_INET_ATON=yes" >> config.mak
1727
fi
1728

    
1729
if test "$simpleidct" = "yes" ; then
1730
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1731
fi
1732

    
1733
if test "$ffserver" = "yes" ; then
1734
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1735
  echo "CONFIG_FFSERVER=yes" >> config.mak
1736
fi
1737

    
1738
if test "$ffplay" = "yes" ; then
1739
  echo "CONFIG_FFPLAY=yes" >> config.mak
1740
fi
1741

    
1742
if test "$gpl" = "yes" ; then
1743
  echo "#define CONFIG_GPL 1" >> $TMPH
1744
  echo "CONFIG_GPL=yes" >> config.mak
1745
fi
1746

    
1747
echo "#define restrict $_restrict" >> $TMPH
1748

    
1749
if test "$optimize" = "small"; then
1750
  echo "#define always_inline"  >> $TMPH
1751
fi
1752

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

    
1793
if test "$amr_wb" = "yes" ; then
1794
  echo "#define AMR_WB 1" >> $TMPH
1795
  echo "AMR_WB=yes" >> config.mak
1796
  echo
1797
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1798
  echo "V5.1.0 from "
1799
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1800
  echo "and extracted the source to libavcodec/amrwb_float"
1801
  echo
1802
fi
1803

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

    
1827
if test "$amr_if2" = "yes" ; then
1828
  echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1829
fi
1830

    
1831
fi
1832

    
1833
for codec in $CODEC_LIST ; do
1834
    echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1835
    echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1836
done
1837

    
1838
diff $TMPH config.h >/dev/null 2>&1
1839
if test $? -ne 0 ; then
1840
        mv -f $TMPH config.h
1841
else
1842
        echo "config.h is unchanged"
1843
fi
1844

    
1845
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1846

    
1847

    
1848
# build pkg-config files libav*.pc and libpostproc.pc
1849
# libavutil.pc
1850
cat <<EOF >libavutil.pc
1851
prefix=$prefix
1852
exec_prefix=\${prefix}
1853
libdir=\${exec_prefix}/lib
1854
includedir=\${prefix}/include
1855

    
1856
Name: libavutil
1857
Description: FFmpeg utility library
1858
Version: $lavu_version
1859
Requires:
1860
Conflicts:
1861
Libs: -L\${libdir} -lavutil
1862
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1863
EOF
1864

    
1865
cat <<EOF >libavutil-uninstalled.pc
1866
prefix=
1867
exec_prefix=
1868
libdir=\${pcfiledir}/libavutil
1869
includedir=\${pcfiledir}/libavutil
1870

    
1871
Name: libavutil
1872
Description: FFmpeg utility library
1873
Version: $lavu_version
1874
Requires:
1875
Conflicts:
1876
Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1877
Cflags: -I\${includedir}
1878
EOF
1879

    
1880
# libavcodec.pc
1881
cat <<EOF >libavcodec.pc
1882
prefix=$prefix
1883
exec_prefix=\${prefix}
1884
libdir=\${exec_prefix}/lib
1885
includedir=\${prefix}/include
1886

    
1887
Name: libavcodec
1888
Description: FFmpeg codec library
1889
Version: $lavc_version
1890
Requires: $pkg_requires libavutil = $lavu_version
1891
Conflicts:
1892
Libs: -L\${libdir} -lavcodec $extralibs
1893
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1894
EOF
1895

    
1896
cat <<EOF >libavcodec-uninstalled.pc
1897
prefix=
1898
exec_prefix=
1899
libdir=\${pcfiledir}/libavcodec
1900
includedir=\${pcfiledir}/libavcodec
1901

    
1902
Name: libavcodec
1903
Description: FFmpeg codec library
1904
Version: $lavc_version
1905
Requires: $pkg_requires libavutil = $lavu_version
1906
Conflicts:
1907
Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1908
Cflags: -I\${includedir}
1909
EOF
1910

    
1911
# libavformat.pc
1912
cat <<EOF >libavformat.pc
1913
prefix=$prefix
1914
exec_prefix=\${prefix}
1915
libdir=\${exec_prefix}/lib
1916
includedir=\${prefix}/include
1917

    
1918
Name: libavformat
1919
Description: FFmpeg container format library
1920
Version: $lavf_version
1921
Requires: $pkg_requires libavcodec = $lavc_version
1922
Conflicts:
1923
Libs: -L\${libdir} -lavformat $extralibs
1924
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1925
EOF
1926

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

    
1933
Name: libavformat
1934
Description: FFmpeg container format library
1935
Version: $lavf_version
1936
Requires: $pkg_requires libavcodec = $lavc_version
1937
Conflicts:
1938
Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1939
Cflags: -I\${includedir}
1940
EOF
1941

    
1942

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

    
1950
Name: libpostproc
1951
Description: FFmpeg post processing library
1952
Version: $lavc_version
1953
Requires:
1954
Conflicts:
1955
Libs: -L\${libdir} -lpostproc
1956
Cflags: -I\${includedir} -I\${includedir}/postproc
1957
EOF
1958

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

    
1965
Name: libpostproc
1966
Description: FFmpeg post processing library
1967
Version: $lavc_version
1968
Requires:
1969
Conflicts:
1970
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1971
Cflags: -I\${includedir}
1972
EOF