Statistics
| Branch: | Revision:

ffmpeg / configure @ 1db68540

History | View | Annotate | Download (47.2 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-simple_idct    disable simple IDCT routines [default=no]"
71
echo "  --disable-vhook          disable video hooking support"
72
echo "  --enable-gprof           enable profiling with gprof [$gprof]"
73
echo "  --disable-debug          disable debugging symbols"
74
echo "  --disable-opts           disable compiler optimizations"
75
echo "  --disable-mpegaudio-hp   faster (but less accurate)"
76
echo "                           MPEG audio decoding [default=no]"
77
echo "  --disable-ffserver       disable ffserver build"
78
echo "  --disable-ffplay         disable ffplay build"
79
echo "  --enable-small           optimize for size instead of speed"
80
echo "  --enable-memalign-hack   emulate memalign, interferes with memory debuggers"
81
echo "  --disable-strip          disable stripping of executables and shared libraries"
82
echo "  --enable-codec=CODEC     enables CODEC"
83
echo "  --disable-codec=CODEC    disables CODEC"
84
echo "  --disable-encoders       disables all encoders"
85
echo "  --disable-decoders       disables all decoders"
86
echo "  --disable-muxers         disables all muxers"
87
echo "  --disable-demuxers       disables all demuxers"
88
echo ""
89
echo "NOTE: Object files are built at the place where configure is launched."
90
exit 1
91
fi
92

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

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

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

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

    
391
;;
392
*) ;;
393
esac
394

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

    
416
# find source path
417
source_path="`echo $0 | sed -e 's#/configure##'`"
418
source_path_used="yes"
419
if test -z "$source_path" -o "$source_path" = "." ; then
420
    source_path=`pwd`
421
    source_path_used="no"
422
else
423
    source_path="`cd \"$source_path\"; pwd`"
424
fi
425

    
426
FFMPEG_CONFIGURATION=" "
427
for opt do
428
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
429
done
430

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

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

    
591
if test "$theora" = "yes" ; then
592
    if test "$libogg" = "no"; then
593
        echo "libogg must be enabled to enable Theora."
594
        fail="yes"
595
        theora="no"
596
    fi
597
fi
598

    
599
if test "$vorbis" = "yes" ; then
600
    if test "$libogg" = "no"; then
601
        echo "libogg must be enabled to enable Vorbis."
602
        fail="yes"
603
        vorbis="no"
604
    fi
605
fi
606

    
607
if test "$gpl" != "yes"; then
608
    if test "$pp" != "no" -o "$shared_pp" != "no"; then
609
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
610
        fail="yes"
611
    fi
612

    
613
    if test "$a52" != "no" -o "$a52bin" != "no"; then
614
        echo "liba52 is under GPL and --enable-gpl is not specified."
615
        fail="yes"
616
    fi
617

    
618
    if test "$xvid" != "no"; then
619
        echo "libxvidcore is under GPL and --enable-gpl is not specified."
620
        fail="yes"
621
    fi
622

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

    
628
    if test "$dts" != "no"; then
629
        echo "libdts is under GPL and --enable-gpl is not specified."
630
        fail="yes"
631
    fi
632
    
633
    if test "$faad" != "no" -o "$faadbin" != "no"; then
634
        cat > $TMPC << EOF
635
            #include <faad.h>
636
            int main( void ) { return 0; }
637
EOF
638
    
639
        if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
640
            cat > $TMPC << EOF
641
                #include <faad.h>
642
                #ifndef FAAD2_VERSION
643
                ok faad1
644
                #endif
645
                int main( void ) { return 0; }
646
EOF
647
            if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
648
                echo "FAAD2 is under GPL and --enable-gpl is not specified."
649
                fail="yes"
650
            fi
651
        else
652
            faad="no"
653
            faadbin="no"
654
            echo "FAAD test failed."
655
        fi
656
    fi
657
   
658

    
659
    if test "$fail" = "yes"; then
660
        exit 1
661
    fi
662
fi
663

    
664
# compute MMX state
665
if test $mmx = "default"; then
666
    if test $cpu = "x86" -o $cpu = "x86_64"; then
667
        mmx="yes"
668
    else
669
        mmx="no"
670
    fi
671
fi
672

    
673
# check iwmmxt support
674
if test $iwmmxt = "default" -a $cpu = "armv4l"; then
675
    cat > $TMPC << EOF
676
        int main(void) { 
677
        __asm__ __volatile__ ("wunpckelub wr6, wr4");
678
        }
679
EOF
680

    
681
    iwmmxt=no
682
    if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
683
        iwmmxt=yes
684
    fi
685
fi
686

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

    
714
# Can only do AltiVec on PowerPC
715
if test $altivec = "default"; then
716
    if test $cpu = "powerpc"; then
717
        altivec="yes"
718
    else
719
        altivec="no"
720
    fi
721
fi
722

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

    
787
# AltiVec flags: The FSF version of GCC differs from the Apple version 
788
if test $cpu = "powerpc"; then
789
    if test $altivec = "yes"; then
790
        if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
791
            CFLAGS="$CFLAGS -faltivec"
792
        else
793
            CFLAGS="$CFLAGS -maltivec -mabi=altivec"
794
        fi
795
    fi
796
fi
797

    
798
# check if we have <altivec.h>
799
cat > $TMPC << EOF
800
#include <altivec.h>
801
int main( void ) { return 0; }
802
EOF
803

    
804
_altivec_h="no"
805
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
806
_altivec_h="yes"
807
fi
808

    
809
# check if our compiler supports Motorola AltiVec C API
810
if test $altivec = "yes"; then
811
if test $_altivec_h = "yes"; then
812
cat > $TMPC << EOF
813
#include <altivec.h>
814
int main(void) {
815
    vector signed int v1, v2, v3;
816
    v1 = vec_add(v2,v3);
817
    return 0;
818
}
819
EOF
820
else
821
cat > $TMPC << EOF
822
int main(void) {
823
    vector signed int v1, v2, v3;
824
    v1 = vec_add(v2,v3);
825
    return 0;
826
}
827
EOF
828
fi
829
$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
830
fi
831

    
832
# mmi only available on mips
833
if test $mmi = "default"; then
834
    if test $cpu = "mips"; then
835
        mmi="yes"
836
    else
837
        mmi="no"
838
    fi
839
fi
840

    
841
# check if our compiler supports mmi
842
if test $mmi = "yes"; then
843
cat > $TMPC << EOF
844
int main(void) {
845
    __asm__ ("lq \$2, 0(\$2)");
846
    return 0;
847
}
848
EOF
849
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
850
fi
851

    
852
if test "$mingw32" = "yes" ; then
853
    v4l="no"
854
    bktr="no"
855
    audio_oss="no"
856
    dv1394="no"
857
    dc1394="no"
858
    ffserver="no"
859
    network="no"
860
    SLIBPREF=""
861
    SLIBSUF=".dll"
862
    EXESUF=".exe"
863
    if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
864
    if test "$force_libdir" != yes; then bindir="$prefix"; fi
865
fi
866

    
867
cc="${cross_prefix}${cc}"
868
ar="${cross_prefix}${ar}"
869
ranlib="${cross_prefix}${ranlib}"
870
strip="${cross_prefix}${strip}"
871

    
872
if test -z "$cross_prefix" ; then
873

    
874
# ---
875
# big/little-endian test
876
cat > $TMPC << EOF
877
#include <inttypes.h>
878
int main(int argc, char ** argv){
879
	volatile uint32_t i=0x01234567;
880
	return (*((uint8_t*)(&i))) == 0x67;
881
}
882
EOF
883

    
884
if $cc -o $TMPE $TMPC 2>/dev/null ; then
885
$TMPE && bigendian="yes"
886
else
887
echo big/little test failed
888
fi
889

    
890
else
891

    
892
# programs cannot be launched if cross compiling, so make a static guess
893
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
894
    bigendian="yes"
895
fi
896

    
897
fi
898

    
899
# ---
900
# *inttypes.h* test
901
cat > $TMPC << EOF
902
#include <inttypes.h>
903
int main(int argc, char ** argv){
904
    return 0;
905
}
906
EOF
907

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

    
910
# ---
911
# *int_fast* test
912
cat > $TMPC << EOF
913
#include <inttypes.h>
914
int main(int argc, char ** argv){
915
	volatile uint_fast64_t i=0x01234567;
916
	return 0;
917
}
918
EOF
919

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

    
922
# ---
923
# check availability of some header files
924

    
925
cat > $TMPC << EOF
926
#include <malloc.h>
927
int main( void ) { return 0; }
928
EOF
929

    
930
_memalign=no
931
_malloc_h=no
932
if $cc -o $TMPE $TMPC 2> /dev/null ; then
933
_malloc_h=yes
934
_memalign=yes
935
# check for memalign - atmos
936
cat > $TMPC << EOF
937
#include <stdio.h>
938
#include <malloc.h>
939
int main ( void ) {
940
char *string = NULL;
941
string = memalign(64, sizeof(char));
942
return 0;
943
}
944
EOF
945
$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
946
fi
947

    
948
if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
949
    echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
950
    exit 1
951
fi
952

    
953
cat > $TMPC << EOF
954
#include <time.h>
955
int main( void ) { localtime_r(NULL, NULL); }
956
EOF
957

    
958
localtime_r=no
959
if $cc -o $TMPE $TMPC 2> /dev/null ; then
960
  localtime_r=yes
961
fi
962

    
963
if test "$zlib" = "yes"; then
964
# check for zlib - mmu_man
965
cat > $TMPC << EOF
966
#include <zlib.h>
967
int main ( void ) {
968
if (zlibVersion() != ZLIB_VERSION)
969
   puts("zlib version differs !!!");
970
   return 1;
971
return 0;
972
}
973
EOF
974
$cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
975
# $TMPE 2> /dev/null > /dev/null || zlib="no"
976
# XXX: more tests needed - runtime test
977
fi
978
if test "$zlib" = "yes"; then
979
extralibs="$extralibs -lz"
980
fi
981

    
982
# test for lrintf in math.h
983
cat > $TMPC << EOF
984
#define _ISOC9X_SOURCE  1
985
#include <math.h>
986
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
987
EOF
988

    
989
have_lrintf="no"
990
if $cc $CFLAGS $LDFLAGS $extralibs -o $TMPE $TMPC 2> /dev/null ; then
991
  have_lrintf="yes"
992
  # allanc@chickenandporn.com: cannot execute cross-compiled
993
  # code on the host.  Only execute if not cross-compiling.
994
  if test -z "$cross_prefix" ; then
995
    $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
996
  fi
997
fi
998

    
999
_restrict=
1000
for restrict_keyword in restrict __restrict__ __restrict; do
1001
  echo "void foo(char * $restrict_keyword p);" > $TMPC
1002
  if $cc -c -o $TMPO $TMPC 2> /dev/null; then
1003
    _restrict=$restrict_keyword
1004
    break;
1005
  fi
1006
done
1007

    
1008
# test gcc version to see if vector builtins can be used
1009
# currently only used on i386 for MMX builtins
1010
cat > $TMPC << EOF
1011
#include <xmmintrin.h>
1012
int main(void) { 
1013
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
1014
return 0;
1015
#else
1016
#error no vector builtins
1017
#endif
1018
}
1019
EOF
1020

    
1021
builtin_vector=no
1022
if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
1023
  builtin_vector=yes
1024
fi
1025

    
1026
# dlopen/dlfcn.h probing
1027

    
1028
cat > $TMPC << EOF
1029
#include <dlfcn.h>
1030
int main( void ) { return (int) dlopen("foo", 0); }
1031
EOF
1032

    
1033
ldl=-ldl
1034

    
1035
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
1036
dlfcn=yes
1037
dlopen=yes
1038
fi
1039

    
1040
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
1041
dlfcn=yes
1042
dlopen=yes
1043
ldl=""
1044
fi
1045

    
1046
cat > $TMPC << EOF
1047
int main( void ) { return (int) dlopen("foo", 0); }
1048
EOF
1049

    
1050
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1  ; then
1051
dlopen=yes
1052
fi
1053

    
1054
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1  ; then
1055
dlopen=yes
1056
ldl=""
1057
fi
1058

    
1059
if test "$vhook" = "default" ; then
1060
  vhook="$dlopen"
1061
fi
1062

    
1063
if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1064
  extralibs="$extralibs $ldl"
1065
fi
1066

    
1067

    
1068
##########################################
1069
# imlib check
1070

    
1071
cat > $TMPC << EOF
1072
#include <X11/Xlib.h>
1073
#include <Imlib2.h>
1074
int main( void ) { return (int) imlib_load_font("foo"); }
1075
EOF
1076

    
1077
imlib2=no
1078
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1  ; then
1079
imlib2=yes
1080
fi
1081

    
1082
##########################################
1083
# FreeType check
1084

    
1085
cat > $TMPC << EOF
1086
#include <ft2build.h>
1087
int main( void ) { return (int) FT_Init_FreeType(0); }
1088
EOF
1089

    
1090
freetype2=no
1091
if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
1092
  if (freetype-config --version) >/dev/null 2>&1 ; then
1093
    if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
1094
      freetype2=yes
1095
    fi
1096
  fi
1097
fi
1098

    
1099
##########################################
1100
# SDL check
1101

    
1102
cat > $TMPC << EOF
1103
#include <SDL.h>
1104
#undef main /* We don't want SDL to override our main() */
1105
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1106
EOF
1107

    
1108
sdl_too_old=no
1109
sdl=no
1110
if (sdl-config --version) >/dev/null 2>&1 ; then
1111
if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  > /dev/null 2>&1  ; then
1112
_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
1113
if test "$_sdlversion" -lt 121 ; then
1114
sdl_too_old=yes
1115
else
1116
sdl=yes
1117
fi
1118
fi
1119
fi
1120

    
1121
##########################################
1122
# texi2html check
1123

    
1124
texi2html=no
1125
if (texi2html -version) >/dev/null 2>&1; then
1126
texi2html=yes
1127
fi
1128

    
1129
if test "$network" = "yes" ; then
1130
##########################################
1131
# IPv6 check
1132

    
1133
cat > $TMPC << EOF
1134
#include <sys/types.h>
1135
#include <sys/socket.h>
1136
#include <netinet/in.h>
1137
#include <netdb.h>
1138
int main( void ) {
1139
  struct sockaddr_storage saddr;
1140
  struct ipv6_mreq mreq6;
1141
  getaddrinfo(0,0,0,0);
1142
  getnameinfo(0,0,0,0,0,0,0);
1143
  IN6_IS_ADDR_MULTICAST(0);
1144
}
1145
EOF
1146

    
1147
ipv6=no
1148
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
1149
ipv6=yes
1150
fi
1151
fi
1152

    
1153
case "`$cc -v 2>&1 | grep version`" in
1154
    *gcc*)
1155
	CFLAGS="-Wall -Wno-switch $CFLAGS"
1156
	;;
1157
    *)
1158
	;;
1159
esac
1160

    
1161
if test "$sdl" = "no" ; then
1162
   ffplay=no
1163
fi
1164

    
1165
if test "$debug" = "yes"; then
1166
	CFLAGS="-g $CFLAGS"
1167
fi
1168

    
1169
if test "$optimize" = "small"; then
1170
#  CFLAGS=${CFLAGS//-O3/-Os}
1171
  CFLAGS="$CFLAGS -Os"
1172
fi
1173

    
1174
if test "$optimize" = "yes"; then
1175
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1176
	CFLAGS="$CFLAGS -O5"
1177
	LDFLAGS="$LDFLAGS -O5"
1178
    else
1179
	CFLAGS="-O3 $CFLAGS"
1180
    fi
1181
fi
1182

    
1183
# PIC flags for shared library objects where they are needed
1184
if test "$lshared" = "yes" ; then
1185
  # LIBOBJFLAGS may have already been set in the OS configuration
1186
  if test -z "$LIBOBJFLAGS" ; then
1187
    if test "$cpu" = "x86_64" -o "$cpu" = "ia64" ; then
1188
      LIBOBJFLAGS="\$(PIC)"
1189
    fi
1190
  fi
1191
fi
1192

    
1193
if test x"$bindir" = x""; then
1194
bindir="${prefix}/bin"
1195
fi
1196

    
1197
if test x"$libdir" = x""; then
1198
libdir="${prefix}/lib"
1199
fi
1200

    
1201
if test x"$mandir" = x""; then
1202
mandir="${prefix}/man"
1203
fi
1204

    
1205
echo "install prefix   $prefix"
1206
echo "source path      $source_path"
1207
echo "C compiler       $cc"
1208
echo "make             $make"
1209
echo "CPU              $cpu ($tune)"
1210
if test "$BUILDSUF" != ""; then
1211
echo "build suffix     $BUILDSUF"
1212
fi
1213
echo "big-endian       $bigendian"
1214
echo "inttypes.h       $inttypes"
1215
echo "broken inttypes.h $emu_fast_int"
1216
if test $cpu = "x86" -o $cpu = "x86_64"; then
1217
echo "MMX enabled      $mmx"
1218
echo "Vector Builtins  $builtin_vector"
1219
fi
1220
if test $cpu = "armv4l"; then
1221
echo "IWMMXT enabled   $iwmmxt"
1222
fi
1223
if test $cpu = "mips"; then
1224
echo "MMI enabled      $mmi"
1225
fi
1226
if test $cpu = "powerpc"; then
1227
echo "AltiVec enabled  $altivec"
1228
fi
1229
echo "gprof enabled    $gprof"
1230
echo "zlib enabled     $zlib"
1231
echo "libgsm enabled   $libgsm"
1232
echo "mp3lame enabled  $mp3lame"
1233
echo "libogg enabled   $libogg"
1234
echo "Vorbis enabled   $vorbis"
1235
echo "Theora enabled   $theora"
1236
echo "FAAD enabled     $faad"
1237
echo "faadbin enabled  $faadbin"
1238
echo "FAAC enabled     $faac"
1239
echo "XviD enabled     $xvid"
1240
echo "x264 enabled     $x264"
1241
echo "a52 support      $a52"
1242
echo "a52 dlopened     $a52bin"
1243
echo "DTS support      $dts"
1244
echo "pp support       $pp"
1245
echo "debug symbols    $debug"
1246
echo "strip symbols    $dostrip"
1247
echo "optimize         $optimize"
1248
echo "shared pp        $shared_pp"
1249
echo "video hooking    $vhook"
1250
echo "SDL support      $sdl"
1251
if test $sdl_too_old = "yes"; then
1252
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
1253
fi
1254

    
1255
if test "$vhook" = "yes" ; then
1256
echo "Imlib2 support   $imlib2"
1257
echo "FreeType support $freetype2"
1258
fi
1259
echo "Sun medialib support"  $sunmlib
1260
echo "pthreads support"      $pthreads
1261
echo "AMR-NB float support"  $amr_nb
1262
echo "AMR-NB fixed support"  $amr_nb_fixed
1263
echo "AMR-WB float support"  $amr_wb
1264
echo "AMR-WB IF2 support"    $amr_if2
1265
echo "network support      $network"
1266
if test "$network" = "yes" ; then
1267
echo "IPv6 support         $ipv6"
1268
fi
1269
if test "$gpl" = "no" ; then
1270
echo "License: LGPL"
1271
else
1272
echo "License: GPL"
1273
fi
1274

    
1275
echo "Creating config.mak and config.h..."
1276

    
1277
date >> config.log
1278
echo "   $0 $FFMPEG_CONFIGURATION" >> config.log
1279
echo "# Automatically generated by configure - do not modify!" > config.mak
1280
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1281
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1282

    
1283
echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1284
echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1285
echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1286
echo "mandir=\$(DESTDIR)$mandir" >> config.mak
1287
echo "MAKE=$make" >> config.mak
1288
echo "CC=$cc" >> config.mak
1289
echo "AR=$ar" >> config.mak
1290
echo "RANLIB=$ranlib" >> config.mak
1291
if test "$dostrip" = "yes" ; then
1292
echo "STRIP=$strip" >> config.mak
1293
echo "INSTALLSTRIP=$installstrip" >> config.mak
1294
else
1295
echo "STRIP=echo ignoring strip" >> config.mak
1296
echo "INSTALLSTRIP=" >> config.mak
1297
fi
1298

    
1299
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
1300
# shared modules on OS/X (vhook/Makefile).
1301
SHCFLAGS=$CFLAGS
1302
if test "$needmdynamicnopic" = yes; then
1303
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1304
fi
1305

    
1306
echo "OPTFLAGS=$CFLAGS" >> config.mak
1307
echo "SHCFLAGS=$SHCFLAGS">>config.mak
1308
echo "LDFLAGS=$LDFLAGS" >> config.mak
1309
echo "LDCONFIG=$LDCONFIG" >> config.mak
1310
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1311
echo "SHFLAGS=$SHFLAGS" >> config.mak
1312
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
1313
echo "BUILDSUF=$BUILDSUF" >> config.mak
1314
echo "LIBPREF=$LIBPREF" >> config.mak
1315
echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1316
echo "SLIBPREF=$SLIBPREF" >> config.mak
1317
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1318
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1319
echo "TARGET_OS=$TARGET_OS" >> config.mak
1320
if test "$cpu" = "x86" ; then
1321
  echo "TARGET_ARCH_X86=yes" >> config.mak
1322
  echo "#define ARCH_X86 1" >> $TMPH
1323
elif test "$cpu" = "x86_64" ; then
1324
  echo "TARGET_ARCH_X86_64=yes" >> config.mak
1325
  echo "#define ARCH_X86_64 1" >> $TMPH
1326
elif test "$cpu" = "armv4l" ; then
1327
  echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1328
  echo "#define ARCH_ARMV4L 1" >> $TMPH
1329
elif test "$cpu" = "alpha" ; then
1330
  echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1331
  echo "#define ARCH_ALPHA 1" >> $TMPH
1332
elif test "$cpu" = "sparc64" ; then
1333
  echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1334
  echo "#define ARCH_SPARC64 1" >> $TMPH
1335
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1336
  echo "#define ARCH_SPARC 1" >> $TMPH
1337
elif test "$cpu" = "sparc" ; then
1338
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1339
  echo "#define ARCH_SPARC 1" >> $TMPH
1340
elif test "$cpu" = "powerpc" ; then
1341
  echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1342
  echo "#define ARCH_POWERPC 1" >> $TMPH
1343
  if test $POWERPCMODE = "32bits"; then
1344
    echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1345
  else
1346
    echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1347
  fi
1348
  if test "$powerpc_perf" = "yes"; then
1349
    echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1350
  fi
1351
elif test "$cpu" = "mips" ; then
1352
  echo "TARGET_ARCH_MIPS=yes" >> config.mak
1353
  echo "#define ARCH_MIPS 1" >> $TMPH
1354
elif test "$cpu" = "sh4" ; then
1355
  echo "TARGET_ARCH_SH4=yes" >> config.mak
1356
  echo "#define ARCH_SH4 1" >> $TMPH
1357
elif test "$cpu" = "parisc" ; then
1358
  echo "TARGET_ARCH_PARISC=yes" >> config.mak
1359
  echo "#define ARCH_PARISC 1" >> $TMPH
1360
elif test "$cpu" = "s390" ; then
1361
  echo "TARGET_ARCH_S390=yes" >> config.mak
1362
  echo "#define ARCH_S390 1" >> $TMPH
1363
elif test "$cpu" = "m68k" ; then
1364
  echo "TARGET_ARCH_M68K=yes" >> config.mak
1365
  echo "#define ARCH_M68K 1" >> $TMPH
1366
elif test "$cpu" = "ia64" ; then
1367
  echo "TARGET_ARCH_IA64=yes" >> config.mak
1368
  echo "#define ARCH_IA64 1" >> $TMPH
1369
fi
1370
echo "#define TUNECPU $TUNECPU" >> $TMPH
1371
if test "$bigendian" = "yes" ; then
1372
  echo "WORDS_BIGENDIAN=yes" >> config.mak
1373
  echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1374
fi
1375
if test "$inttypes" != "yes" ; then
1376
  echo "#define EMULATE_INTTYPES 1" >> $TMPH
1377
fi
1378
if test "$emu_fast_int" = "yes" ; then
1379
  echo "#define EMULATE_FAST_INT 1" >> $TMPH
1380
fi
1381
if test "$mmx" = "yes" ; then
1382
  echo "TARGET_MMX=yes" >> config.mak
1383
  echo "#define HAVE_MMX 1" >> $TMPH
1384
  echo "#define __CPU__ 586" >> $TMPH
1385
fi
1386
if test "$builtin_vector" = "yes" ; then
1387
  echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1388
  echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1389
fi
1390
if test "$iwmmxt" = "yes" ; then
1391
  echo "TARGET_IWMMXT=yes" >> config.mak
1392
  echo "#define HAVE_IWMMXT 1" >> $TMPH
1393
fi
1394
if test "$mmi" = "yes" ; then
1395
  echo "TARGET_MMI=yes" >> config.mak
1396
  echo "#define HAVE_MMI 1" >> $TMPH
1397
fi
1398
if test "$altivec" = "yes" ; then
1399
  echo "TARGET_ALTIVEC=yes" >> config.mak
1400
  echo "#define HAVE_ALTIVEC 1" >> $TMPH
1401
  echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1402
  echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1403
  if test "$_altivec_h" = "yes" ; then
1404
    echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1405
  else
1406
    echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1407
  fi
1408
fi
1409
if test "$gprof" = "yes" ; then
1410
  echo "TARGET_GPROF=yes" >> config.mak
1411
  echo "#define HAVE_GPROF 1" >> $TMPH
1412
fi
1413
if test "$localtime_r" = "yes" ; then
1414
  echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1415
fi
1416
if test "$imlib2" = "yes" ; then
1417
  echo "HAVE_IMLIB2=yes" >> config.mak
1418
fi
1419
if test "$freetype2" = "yes" ; then
1420
  echo "HAVE_FREETYPE2=yes" >> config.mak
1421
fi
1422
if test "$sunmlib" = "yes" ; then
1423
  echo "HAVE_MLIB=yes" >> config.mak
1424
  echo "#define HAVE_MLIB 1" >> $TMPH
1425
  extralibs="$extralibs -lmlib"
1426
fi
1427
if test "$pthreads" = "yes" ; then
1428
  echo "HAVE_PTHREADS=yes" >> config.mak
1429
  echo "#define HAVE_PTHREADS 1" >> $TMPH
1430
  echo "#define HAVE_THREADS 1" >> $TMPH
1431
  if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
1432
     extralibs="$extralibs -lpthread"
1433
  fi
1434
fi
1435
if test "$sdl" = "yes" ; then
1436
  echo "CONFIG_SDL=yes" >> config.mak
1437
  echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1438
  echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1439
fi
1440
if test "$texi2html" = "yes"; then
1441
  echo "BUILD_DOC=yes" >> config.mak
1442
fi
1443
if test "$have_lrintf" = "yes" ; then
1444
  echo "#define HAVE_LRINTF 1" >> $TMPH
1445
fi
1446
if test "$vhook" = "yes" ; then
1447
  echo "BUILD_VHOOK=yes" >> config.mak
1448
  echo "#define HAVE_VHOOK 1" >> $TMPH
1449
fi
1450
if test "$lshared" = "yes" ; then
1451
  echo "BUILD_SHARED=yes" >> config.mak
1452
  echo "PIC=-fPIC -DPIC" >> config.mak
1453
  echo "SPPMAJOR=0" >> config.mak
1454
  echo "SPPVERSION=0.0.1" >> config.mak 
1455
fi
1456
echo "EXTRALIBS=$extralibs" >> config.mak
1457
version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1458
 cut -d '"' -f 2`
1459
echo "VERSION=$version" >>config.mak
1460
# If you do not want to use encoders, disable them.
1461
echo "#define CONFIG_ENCODERS 1" >> $TMPH
1462
echo "CONFIG_ENCODERS=yes" >> config.mak
1463

    
1464
# If you do not want to use decoders, disable them.
1465
echo "#define CONFIG_DECODERS 1" >> $TMPH
1466
echo "CONFIG_DECODERS=yes" >> config.mak
1467

    
1468
# muxers
1469
if test "$muxers" = "yes" ; then
1470
  echo "#define CONFIG_MUXERS 1" >> $TMPH
1471
  echo "CONFIG_MUXERS=yes" >> config.mak
1472
fi
1473

    
1474
# demuxers
1475
if test "$demuxers" = "yes" ; then
1476
  echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1477
  echo "CONFIG_DEMUXERS=yes" >> config.mak
1478
fi
1479

    
1480
# AC3
1481
if test "$a52" = "yes" ; then
1482
  echo "#define CONFIG_AC3 1" >> $TMPH
1483
  echo "CONFIG_AC3=yes" >> config.mak
1484

    
1485
  if test "$a52bin" = "yes" ; then
1486
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1487
    echo "CONFIG_A52BIN=yes" >> config.mak
1488
  fi
1489
fi
1490

    
1491
# DTS
1492
if test "$dts" = "yes" ; then
1493
  echo "#define CONFIG_DTS 1" >> $TMPH
1494
  echo "CONFIG_DTS=yes" >> config.mak
1495
fi
1496

    
1497
# PP
1498
if test "$pp" = "yes" ; then
1499
  echo "#define CONFIG_PP 1" >> $TMPH
1500
  echo "CONFIG_PP=yes" >> config.mak
1501

    
1502
  if test "$shared_pp" = "yes" ; then
1503
    echo "#define SHARED_PP 1" >> $TMPH
1504
    echo "SHARED_PP=yes" >> config.mak
1505
  fi
1506
fi
1507

    
1508
# MPEG audio high precision mode
1509
if test "$mpegaudio_hp" = "yes" ; then
1510
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1511
fi
1512

    
1513
if test "$v4l" = "yes" ; then
1514
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1515
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1516
fi
1517

    
1518
if test "$bktr" = "yes" ; then
1519
  echo "#define CONFIG_BKTR 1" >> $TMPH
1520
  echo "CONFIG_BKTR=yes" >> config.mak
1521
fi
1522

    
1523
if test "$dv1394" = "yes" ; then
1524
  echo "#define CONFIG_DV1394 1" >> $TMPH
1525
  echo "CONFIG_DV1394=yes" >> config.mak
1526
fi
1527

    
1528
if test "$dc1394" = "yes" ; then
1529
  echo "#define CONFIG_DC1394 1" >> $TMPH
1530
  echo "CONFIG_DC1394=yes" >> config.mak
1531
fi
1532

    
1533
if test "$dlopen" = "yes" ; then
1534
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1535
fi
1536

    
1537
if test "$dlfcn" = "yes" ; then
1538
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1539
fi
1540

    
1541
if test "$audio_oss" = "yes" ; then
1542
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1543
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1544
fi
1545

    
1546
if test "$audio_beos" = "yes" ; then
1547
  echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1548
  echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1549
fi
1550

    
1551
if test "$network" = "yes" ; then
1552
  echo "#define CONFIG_NETWORK 1" >> $TMPH
1553
  echo "CONFIG_NETWORK=yes" >> config.mak
1554
fi
1555

    
1556
if test "$ipv6" = "yes" ; then
1557
  echo "#define CONFIG_IPV6 1" >> $TMPH
1558
fi
1559

    
1560
if test "$zlib" = "yes" ; then
1561
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1562
  echo "CONFIG_ZLIB=yes" >> config.mak
1563
fi
1564

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

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

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

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

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

    
1590
if test "$faad" = "yes" ; then
1591
  echo "#define CONFIG_FAAD 1" >> $TMPH
1592
  echo "CONFIG_FAAD=yes" >> config.mak
1593
fi
1594

    
1595
if test "$faadbin" = "yes" ; then
1596
  echo "#define CONFIG_FAADBIN 1" >> $TMPH
1597
  echo "CONFIG_FAADBIN=yes" >> config.mak
1598
fi
1599

    
1600
if test "$faac" = "yes" ; then
1601
  echo "#define CONFIG_FAAC 1" >> $TMPH
1602
  echo "CONFIG_FAAC=yes" >> config.mak
1603
fi
1604

    
1605
if test "$xvid" = "yes" ; then
1606
  echo "#define CONFIG_XVID 1" >> $TMPH
1607
  echo "CONFIG_XVID=yes" >> config.mak
1608
fi
1609

    
1610
if test "$x264" = "yes" ; then
1611
  echo "#define CONFIG_X264 1" >> $TMPH
1612
  echo "CONFIG_X264=yes" >> config.mak
1613
fi
1614

    
1615
if test "$mingw32" = "yes" ; then
1616
  echo "#define CONFIG_WIN32 1" >> $TMPH
1617
  echo "CONFIG_WIN32=yes" >> config.mak
1618
  echo "HAVE_W32THREADS=yes" >> config.mak
1619
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1620
  echo "#define HAVE_THREADS 1" >> $TMPH
1621
  echo "#ifndef __MINGW32__" >> $TMPH
1622
  echo "#define __MINGW32__ 1" >> $TMPH
1623
  echo "#endif" >> $TMPH
1624
fi
1625

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

    
1631
if test "$TARGET_OS" = "SunOS" ; then
1632
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1633
fi
1634

    
1635
if test "$TARGET_OS" = "BeOS" ; then
1636
  echo "HAVE_BEOSTHREADS=yes" >> config.mak
1637
  echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1638
  echo "#define HAVE_THREADS 1" >> $TMPH
1639
fi
1640

    
1641
if test "$darwin" = "yes"; then
1642
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1643
  echo "CONFIG_DARWIN=yes" >> config.mak
1644
fi
1645

    
1646
if test "$_malloc_h" = "yes" ; then
1647
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1648
else
1649
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1650
fi
1651

    
1652
if test "$_memalign" = "yes" ; then
1653
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1654
else
1655
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1656
fi
1657

    
1658
if test "$memalignhack" = "yes" ; then
1659
  echo "#define MEMALIGN_HACK 1" >> $TMPH
1660
fi
1661

    
1662

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

    
1668
if test "$need_inet_aton" = "yes" ; then
1669
  echo "NEED_INET_ATON=yes" >> config.mak
1670
fi
1671

    
1672
if test "$simpleidct" = "yes" ; then
1673
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1674
fi
1675

    
1676
if test "$ffserver" = "yes" ; then
1677
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1678
  echo "CONFIG_FFSERVER=yes" >> config.mak
1679
fi
1680

    
1681
if test "$ffplay" = "yes" ; then
1682
  echo "CONFIG_FFPLAY=yes" >> config.mak
1683
fi
1684

    
1685
if test "$gpl" = "yes" ; then
1686
  echo "#define CONFIG_GPL 1" >> $TMPH
1687
  echo "CONFIG_GPL=yes" >> config.mak
1688
fi
1689

    
1690
echo "#define restrict $_restrict" >> $TMPH
1691

    
1692
if test "$optimize" = "small"; then
1693
  echo "#define always_inline"  >> $TMPH
1694
fi
1695

    
1696
# build tree in object directory if source path is different from current one
1697
if test "$source_path_used" = "yes" ; then
1698
    DIRS="\
1699
         doc \
1700
         libavformat \
1701
         libavcodec \
1702
         libavcodec/alpha \
1703
         libavcodec/armv4l \
1704
         libavcodec/i386 \
1705
         libavcodec/sparc \
1706
         libavcodec/mlib \
1707
         libavcodec/ppc \
1708
         libavcodec/liba52 \
1709
         libavcodec/libpostproc \
1710
         libavutil \
1711
         tests \
1712
         vhook \
1713
         "
1714
    FILES="\
1715
          Makefile \
1716
          libavformat/Makefile \
1717
          libavcodec/Makefile \
1718
          libavcodec/libpostproc/Makefile \
1719
          libavutil/Makefile \
1720
          tests/Makefile \
1721
          vhook/Makefile \
1722
          doc/Makefile \
1723
          doc/texi2pod.pl \
1724
          "
1725
    for dir in $DIRS ; do
1726
            mkdir -p $dir
1727
    done
1728
    for f in $FILES ; do
1729
        ln -sf "$source_path/$f" $f
1730
    done
1731
    echo "SRC_PATH=$source_path" >> config.mak
1732
else
1733
    echo "SRC_PATH='$source_path'" >> config.mak
1734
fi
1735

    
1736
if test "$amr_wb" = "yes" ; then
1737
  echo "#define AMR_WB 1" >> $TMPH
1738
  echo "AMR_WB=yes" >> config.mak
1739
  echo
1740
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1741
  echo "V5.1.0 from "
1742
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1743
  echo "and extracted the source to libavcodec/amrwb_float"
1744
  echo
1745
fi
1746

    
1747
if test "$amr_nb" = "yes" ; then
1748
  echo "#define AMR_NB 1" >> $TMPH
1749
  echo "AMR_NB=yes" >> config.mak
1750
  echo
1751
if test "$amr_nb_fixed" = "yes" ; then
1752
  echo "AMR_NB_FIXED=yes" >> config.mak
1753
  echo "#define AMR_NB_FIXED 1" >> $TMPH
1754
  echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1755
  echo "REL-5 version 5.1.0 from "
1756
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1757
  echo "and extracted src to libavcodec/amr"
1758
  echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1759
  echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1760
  echo
1761
else
1762
  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1763
  echo "REL-5 V5.1.0 from "
1764
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1765
  echo "and extracted the source to libavcodec/amr_float"
1766
  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1767
  echo
1768
fi
1769

    
1770
if test "$amr_if2" = "yes" ; then
1771
  echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1772
fi
1773

    
1774
fi
1775

    
1776
for codec in $CODEC_LIST ; do
1777
    echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1778
    echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1779
done
1780

    
1781
diff $TMPH config.h >/dev/null 2>&1
1782
if test $? -ne 0 ; then
1783
	mv -f $TMPH config.h
1784
else
1785
	echo "config.h is unchanged"
1786
fi
1787

    
1788
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1789

    
1790

    
1791
# build pkg-config files libav*.pc and libpostproc.pc
1792
lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1793
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1794
lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1795

    
1796
# libavutil.pc
1797
cat <<EOF >libavutil.pc
1798
prefix=$prefix
1799
exec_prefix=\${prefix}
1800
libdir=\${exec_prefix}/lib
1801
includedir=\${prefix}/include
1802

    
1803
Name: libavutil
1804
Description: FFmpeg utility library
1805
Version: $lavu_version
1806
Requires: 
1807
Conflicts:
1808
Libs: -L\${libdir} -lavutil
1809
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1810
EOF
1811

    
1812
cat <<EOF >libavutil-uninstalled.pc
1813
prefix=
1814
exec_prefix=
1815
libdir=\${pcfiledir}/libavutil
1816
includedir=\${pcfiledir}/libavutil
1817

    
1818
Name: libavutil
1819
Description: FFmpeg utility library
1820
Version: $lavu_version
1821
Requires: 
1822
Conflicts:
1823
Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1824
Cflags: -I\${includedir}
1825
EOF
1826

    
1827
# libavcodec.pc
1828
cat <<EOF >libavcodec.pc
1829
prefix=$prefix
1830
exec_prefix=\${prefix}
1831
libdir=\${exec_prefix}/lib
1832
includedir=\${prefix}/include
1833

    
1834
Name: libavcodec
1835
Description: FFmpeg codec library
1836
Version: $lavc_version
1837
Requires: $pkg_requires libavutil = $lavu_version
1838
Conflicts:
1839
Libs: -L\${libdir} -lavcodec $extralibs
1840
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1841
EOF
1842

    
1843
cat <<EOF >libavcodec-uninstalled.pc
1844
prefix=
1845
exec_prefix=
1846
libdir=\${pcfiledir}/libavcodec
1847
includedir=\${pcfiledir}/libavcodec
1848

    
1849
Name: libavcodec
1850
Description: FFmpeg codec library
1851
Version: $lavc_version
1852
Requires: $pkg_requires libavutil = $lavu_version
1853
Conflicts:
1854
Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1855
Cflags: -I\${includedir}
1856
EOF
1857

    
1858
# libavformat.pc
1859
cat <<EOF >libavformat.pc
1860
prefix=$prefix
1861
exec_prefix=\${prefix}
1862
libdir=\${exec_prefix}/lib
1863
includedir=\${prefix}/include
1864

    
1865
Name: libavformat
1866
Description: FFmpeg container format library
1867
Version: $lavf_version
1868
Requires: $pkg_requires libavcodec = $lavc_version
1869
Conflicts:
1870
Libs: -L\${libdir} -lavformat $extralibs
1871
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1872
EOF
1873

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

    
1880
Name: libavformat
1881
Description: FFmpeg container format library
1882
Version: $lavf_version
1883
Requires: $pkg_requires libavcodec = $lavc_version
1884
Conflicts:
1885
Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1886
Cflags: -I\${includedir}
1887
EOF
1888

    
1889

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

    
1897
Name: libpostproc
1898
Description: FFmpeg post processing library
1899
Version: $lavc_version
1900
Requires: 
1901
Conflicts:
1902
Libs: -L\${libdir} -lpostproc
1903
Cflags: -I\${includedir} -I\${includedir}/postproc
1904
EOF
1905

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

    
1912
Name: libpostproc
1913
Description: FFmpeg post processing library
1914
Version: $lavc_version
1915
Requires: 
1916
Conflicts:
1917
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1918
Cflags: -I\${includedir}
1919
EOF