Statistics
| Branch: | Revision:

ffmpeg / configure @ f593b273

History | View | Annotate | Download (48.6 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 "  --disable-encoder=NAME   disables encoder NAME"
83
echo "  --enable-encoder=NAME    enables encoder NAME"
84
echo "  --disable-decoder=NAME   disables decoder NAME"
85
echo "  --enable-decoder=NAME    enables decoder NAME"
86
echo "  --disable-encoders       disables all encoders"
87
echo "  --disable-decoders       disables all decoders"
88
echo "  --disable-muxers         disables all muxers"
89
echo "  --disable-demuxers       disables all demuxers"
90
echo ""
91
echo "NOTE: Object files are built at the place where configure is launched."
92
exit 1
93
fi
94

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

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

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

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

    
393
;;
394
*) ;;
395
esac
396

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

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

    
428
FFMPEG_CONFIGURATION=" "
429
for opt do
430
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
431
done
432

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

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

    
597
if test "$theora" = "yes" ; then
598
    if test "$libogg" = "no"; then
599
        echo "libogg must be enabled to enable Theora."
600
        fail="yes"
601
        theora="no"
602
    fi
603
fi
604

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

    
613
if test "$gpl" != "yes"; then
614
    if test "$pp" != "no" -o "$shared_pp" != "no"; then
615
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
616
        fail="yes"
617
    fi
618

    
619
    if test "$a52" != "no" -o "$a52bin" != "no"; then
620
        echo "liba52 is under GPL and --enable-gpl is not specified."
621
        fail="yes"
622
    fi
623

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

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

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

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

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

    
664

    
665
    if test "$fail" = "yes"; then
666
        exit 1
667
    fi
668
fi
669

    
670
# compute MMX state
671
if test $mmx = "default"; then
672
    if test $cpu = "x86" -o $cpu = "x86_64"; then
673
        mmx="yes"
674
    else
675
        mmx="no"
676
    fi
677
fi
678

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

    
687
    iwmmxt=no
688
    if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
689
        iwmmxt=yes
690
    fi
691
fi
692

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

    
720
# Can only do AltiVec on PowerPC
721
if test $altivec = "default"; then
722
    if test $cpu = "powerpc"; then
723
        altivec="yes"
724
    else
725
        altivec="no"
726
    fi
727
fi
728

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

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

    
804
# check if we have <altivec.h>
805
cat > $TMPC << EOF
806
#include <altivec.h>
807
int main( void ) { return 0; }
808
EOF
809

    
810
_altivec_h="no"
811
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
812
_altivec_h="yes"
813
fi
814

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

    
838
# mmi only available on mips
839
if test $mmi = "default"; then
840
    if test $cpu = "mips"; then
841
        mmi="yes"
842
    else
843
        mmi="no"
844
    fi
845
fi
846

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

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

    
873
cc="${cross_prefix}${cc}"
874
ar="${cross_prefix}${ar}"
875
ranlib="${cross_prefix}${ranlib}"
876
strip="${cross_prefix}${strip}"
877

    
878
if test -z "$cross_prefix" ; then
879

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

    
890
if $cc -o $TMPE $TMPC 2>/dev/null ; then
891
$TMPE && bigendian="yes"
892
else
893
echo big/little test failed
894
fi
895

    
896
else
897

    
898
# programs cannot be launched if cross compiling, so make a static guess
899
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
900
    bigendian="yes"
901
fi
902

    
903
fi
904

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

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

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

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

    
928
# ---
929
# check availability of some header files
930

    
931
cat > $TMPC << EOF
932
#include <malloc.h>
933
int main( void ) { return 0; }
934
EOF
935

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

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

    
959
cat > $TMPC << EOF
960
#include <time.h>
961
int main( void ) { localtime_r(NULL, NULL); }
962
EOF
963

    
964
localtime_r=no
965
if $cc -o $TMPE $TMPC 2> /dev/null ; then
966
  localtime_r=yes
967
fi
968

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

    
988
# test for lrintf in math.h
989
cat > $TMPC << EOF
990
#define _ISOC9X_SOURCE  1
991
#include <math.h>
992
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
993
EOF
994

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

    
1005
_restrict=
1006
for restrict_keyword in restrict __restrict__ __restrict; do
1007
  echo "void foo(char * $restrict_keyword p);" > $TMPC
1008
  if $cc -c -o $TMPO $TMPC 2> /dev/null; then
1009
    _restrict=$restrict_keyword
1010
    break;
1011
  fi
1012
done
1013

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

    
1027
builtin_vector=no
1028
if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
1029
  builtin_vector=yes
1030
fi
1031

    
1032
# dlopen/dlfcn.h probing
1033

    
1034
cat > $TMPC << EOF
1035
#include <dlfcn.h>
1036
int main( void ) { return (int) dlopen("foo", 0); }
1037
EOF
1038

    
1039
ldl=-ldl
1040

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

    
1046
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
1047
dlfcn=yes
1048
dlopen=yes
1049
ldl=""
1050
fi
1051

    
1052
cat > $TMPC << EOF
1053
int main( void ) { return (int) dlopen("foo", 0); }
1054
EOF
1055

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

    
1060
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1  ; then
1061
dlopen=yes
1062
ldl=""
1063
fi
1064

    
1065
if test "$vhook" = "default" ; then
1066
  vhook="$dlopen"
1067
fi
1068

    
1069
if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
1070
  extralibs="$extralibs $ldl"
1071
fi
1072

    
1073

    
1074
##########################################
1075
# imlib check
1076

    
1077
cat > $TMPC << EOF
1078
#include <X11/Xlib.h>
1079
#include <Imlib2.h>
1080
int main( void ) { return (int) imlib_load_font("foo"); }
1081
EOF
1082

    
1083
imlib2=no
1084
if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1  ; then
1085
imlib2=yes
1086
fi
1087

    
1088
##########################################
1089
# FreeType check
1090

    
1091
cat > $TMPC << EOF
1092
#include <ft2build.h>
1093
int main( void ) { return (int) FT_Init_FreeType(0); }
1094
EOF
1095

    
1096
freetype2=no
1097
if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
1098
  if (freetype-config --version) >/dev/null 2>&1 ; then
1099
    if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
1100
      freetype2=yes
1101
    fi
1102
  fi
1103
fi
1104

    
1105
##########################################
1106
# SDL check
1107

    
1108
cat > $TMPC << EOF
1109
#include <SDL.h>
1110
#undef main /* We don't want SDL to override our main() */
1111
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1112
EOF
1113

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

    
1127
##########################################
1128
# texi2html check
1129

    
1130
texi2html=no
1131
if (texi2html -version) >/dev/null 2>&1; then
1132
texi2html=yes
1133
fi
1134

    
1135
if test "$network" = "yes" ; then
1136
##########################################
1137
# IPv6 check
1138

    
1139
cat > $TMPC << EOF
1140
#include <sys/types.h>
1141
#include <sys/socket.h>
1142
#include <netinet/in.h>
1143
#include <netdb.h>
1144
int main( void ) {
1145
  struct sockaddr_storage saddr;
1146
  struct ipv6_mreq mreq6;
1147
  getaddrinfo(0,0,0,0);
1148
  getnameinfo(0,0,0,0,0,0,0);
1149
  IN6_IS_ADDR_MULTICAST(0);
1150
}
1151
EOF
1152

    
1153
ipv6=no
1154
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
1155
ipv6=yes
1156
fi
1157
fi
1158

    
1159
case "`$cc -v 2>&1 | grep version`" in
1160
    *gcc*)
1161
        CFLAGS="-Wall -Wno-switch $CFLAGS"
1162
        ;;
1163
    *)
1164
        ;;
1165
esac
1166

    
1167
if test "$sdl" = "no" ; then
1168
   ffplay=no
1169
fi
1170

    
1171
if test "$debug" = "yes"; then
1172
        CFLAGS="-g $CFLAGS"
1173
fi
1174

    
1175
if test "$optimize" = "small"; then
1176
#  CFLAGS=${CFLAGS//-O3/-Os}
1177
  CFLAGS="$CFLAGS -Os"
1178
fi
1179

    
1180
if test "$optimize" = "yes"; then
1181
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1182
        CFLAGS="$CFLAGS -O5"
1183
        LDFLAGS="$LDFLAGS -O5"
1184
    else
1185
        CFLAGS="-O3 $CFLAGS"
1186
    fi
1187
fi
1188

    
1189
# PIC flags for shared library objects where they are needed
1190
if test "$lshared" = "yes" ; then
1191
  # LIBOBJFLAGS may have already been set in the OS configuration
1192
  if test -z "$LIBOBJFLAGS" ; then
1193
    if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
1194
      LIBOBJFLAGS="\$(PIC)"
1195
    fi
1196
  fi
1197
fi
1198

    
1199
if test x"$bindir" = x""; then
1200
bindir="${prefix}/bin"
1201
fi
1202

    
1203
if test x"$libdir" = x""; then
1204
libdir="${prefix}/lib"
1205
fi
1206

    
1207
if test x"$mandir" = x""; then
1208
mandir="${prefix}/man"
1209
fi
1210

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

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

    
1281
echo "Creating config.mak and config.h..."
1282

    
1283
date >> config.log
1284
echo "   $0 $FFMPEG_CONFIGURATION" >> config.log
1285
echo "# Automatically generated by configure - do not modify!" > config.mak
1286
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1287
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1288

    
1289
echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1290
echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1291
echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1292
echo "mandir=\$(DESTDIR)$mandir" >> config.mak
1293
echo "MAKE=$make" >> config.mak
1294
echo "CC=$cc" >> config.mak
1295
echo "AR=$ar" >> config.mak
1296
echo "RANLIB=$ranlib" >> config.mak
1297
if test "$dostrip" = "yes" ; then
1298
echo "STRIP=$strip" >> config.mak
1299
echo "INSTALLSTRIP=$installstrip" >> config.mak
1300
else
1301
echo "STRIP=echo ignoring strip" >> config.mak
1302
echo "INSTALLSTRIP=" >> config.mak
1303
fi
1304

    
1305
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
1306
# shared modules on OS/X (vhook/Makefile).
1307
SHCFLAGS=$CFLAGS
1308
if test "$needmdynamicnopic" = yes; then
1309
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1310
fi
1311

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

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

    
1461

    
1462

    
1463
if test "$lshared" = "yes" ; then
1464
  echo "BUILD_SHARED=yes" >> config.mak
1465
  echo "PIC=-fPIC -DPIC" >> config.mak
1466
  echo "SPPMAJOR=${lavc_version/.*/}" >> config.mak
1467
  echo "SPPVERSION=$lavc_version" >> config.mak
1468
  echo "LAVCMAJOR=${lavc_version/.*/}" >> config.mak
1469
  echo "LAVCVERSION=$lavc_version" >> config.mak
1470
  echo "LAVFMAJOR=${lavf_version/.*/}" >> config.mak
1471
  echo "LAVFVERSION=$lavf_version" >> config.mak
1472
  echo "LAVUMAJOR=${lavu_version/.*/}" >> config.mak
1473
  echo "LAVUVERSION=$lavu_version" >> config.mak
1474
fi
1475
echo "EXTRALIBS=$extralibs" >> config.mak
1476
version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1477
 cut -d '"' -f 2`
1478
echo "VERSION=$version" >>config.mak
1479
# If you do not want to use encoders, disable them.
1480
echo "#define CONFIG_ENCODERS 1" >> $TMPH
1481
echo "CONFIG_ENCODERS=yes" >> config.mak
1482

    
1483
# If you do not want to use decoders, disable them.
1484
echo "#define CONFIG_DECODERS 1" >> $TMPH
1485
echo "CONFIG_DECODERS=yes" >> config.mak
1486

    
1487
# muxers
1488
if test "$muxers" = "yes" ; then
1489
  echo "#define CONFIG_MUXERS 1" >> $TMPH
1490
  echo "CONFIG_MUXERS=yes" >> config.mak
1491
fi
1492

    
1493
# demuxers
1494
if test "$demuxers" = "yes" ; then
1495
  echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1496
  echo "CONFIG_DEMUXERS=yes" >> config.mak
1497
fi
1498

    
1499
# AC3
1500
if test "$a52" = "yes" ; then
1501
  echo "#define CONFIG_AC3 1" >> $TMPH
1502
  echo "CONFIG_AC3=yes" >> config.mak
1503

    
1504
  if test "$a52bin" = "yes" ; then
1505
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1506
    echo "CONFIG_A52BIN=yes" >> config.mak
1507
  fi
1508
fi
1509

    
1510
# DTS
1511
if test "$dts" = "yes" ; then
1512
  echo "#define CONFIG_DTS 1" >> $TMPH
1513
  echo "CONFIG_DTS=yes" >> config.mak
1514
fi
1515

    
1516
# PP
1517
if test "$pp" = "yes" ; then
1518
  echo "#define CONFIG_PP 1" >> $TMPH
1519
  echo "CONFIG_PP=yes" >> config.mak
1520

    
1521
  if test "$shared_pp" = "yes" ; then
1522
    echo "#define SHARED_PP 1" >> $TMPH
1523
    echo "SHARED_PP=yes" >> config.mak
1524
  fi
1525
fi
1526

    
1527
# MPEG audio high precision mode
1528
if test "$mpegaudio_hp" = "yes" ; then
1529
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1530
fi
1531

    
1532
if test "$v4l" = "yes" ; then
1533
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1534
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1535
fi
1536

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

    
1542
if test "$dv1394" = "yes" ; then
1543
  echo "#define CONFIG_DV1394 1" >> $TMPH
1544
  echo "CONFIG_DV1394=yes" >> config.mak
1545
fi
1546

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

    
1552
if test "$dlopen" = "yes" ; then
1553
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1554
fi
1555

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

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

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

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

    
1575
if test "$ipv6" = "yes" ; then
1576
  echo "#define CONFIG_IPV6 1" >> $TMPH
1577
fi
1578

    
1579
if test "$zlib" = "yes" ; then
1580
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1581
  echo "CONFIG_ZLIB=yes" >> config.mak
1582
fi
1583

    
1584
if test "$libgsm" = "yes" ; then
1585
  echo "#define CONFIG_LIBGSM 1" >> $TMPH
1586
  echo "CONFIG_LIBGSM=yes" >> config.mak
1587
fi
1588

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

    
1594
if test "$libogg" = "yes" ; then
1595
  echo "#define CONFIG_LIBOGG 1" >> $TMPH
1596
  echo "CONFIG_LIBOGG=yes" >> config.mak
1597
fi
1598

    
1599
if test "$vorbis" = "yes" ; then
1600
  echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1601
  echo "CONFIG_LIBVORBIS=yes" >> config.mak
1602
fi
1603

    
1604
if test "$theora" = "yes" ; then
1605
  echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1606
  echo "CONFIG_LIBTHEORA=yes" >> config.mak
1607
fi
1608

    
1609
if test "$faad" = "yes" ; then
1610
  echo "#define CONFIG_FAAD 1" >> $TMPH
1611
  echo "CONFIG_FAAD=yes" >> config.mak
1612
fi
1613

    
1614
if test "$faadbin" = "yes" ; then
1615
  echo "#define CONFIG_FAADBIN 1" >> $TMPH
1616
  echo "CONFIG_FAADBIN=yes" >> config.mak
1617
fi
1618

    
1619
if test "$faac" = "yes" ; then
1620
  echo "#define CONFIG_FAAC 1" >> $TMPH
1621
  echo "CONFIG_FAAC=yes" >> config.mak
1622
fi
1623

    
1624
if test "$xvid" = "yes" ; then
1625
  echo "#define CONFIG_XVID 1" >> $TMPH
1626
  echo "CONFIG_XVID=yes" >> config.mak
1627
fi
1628

    
1629
if test "$x264" = "yes" ; then
1630
  echo "#define CONFIG_X264 1" >> $TMPH
1631
  echo "CONFIG_X264=yes" >> config.mak
1632
fi
1633

    
1634
if test "$mingw32" = "yes" ; then
1635
  echo "#define CONFIG_WIN32 1" >> $TMPH
1636
  echo "CONFIG_WIN32=yes" >> config.mak
1637
  echo "HAVE_W32THREADS=yes" >> config.mak
1638
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1639
  echo "#define HAVE_THREADS 1" >> $TMPH
1640
  echo "#ifndef __MINGW32__" >> $TMPH
1641
  echo "#define __MINGW32__ 1" >> $TMPH
1642
  echo "#endif" >> $TMPH
1643
fi
1644

    
1645
if test "$os2" = "yes" ; then
1646
  echo "#define CONFIG_OS2 1" >> $TMPH
1647
  echo "CONFIG_OS2=yes" >> config.mak
1648
fi
1649

    
1650
if test "$TARGET_OS" = "SunOS" ; then
1651
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1652
fi
1653

    
1654
if test "$TARGET_OS" = "BeOS" ; then
1655
  echo "HAVE_BEOSTHREADS=yes" >> config.mak
1656
  echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1657
  echo "#define HAVE_THREADS 1" >> $TMPH
1658
fi
1659

    
1660
if test "$darwin" = "yes"; then
1661
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1662
  echo "CONFIG_DARWIN=yes" >> config.mak
1663
fi
1664

    
1665
if test "$_malloc_h" = "yes" ; then
1666
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1667
else
1668
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1669
fi
1670

    
1671
if test "$_memalign" = "yes" ; then
1672
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1673
else
1674
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1675
fi
1676

    
1677
if test "$memalignhack" = "yes" ; then
1678
  echo "#define MEMALIGN_HACK 1" >> $TMPH
1679
fi
1680

    
1681

    
1682
if test "$netserver" = "yes" ; then
1683
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1684
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1685
fi
1686

    
1687
if test "$need_inet_aton" = "yes" ; then
1688
  echo "NEED_INET_ATON=yes" >> config.mak
1689
fi
1690

    
1691
if test "$simpleidct" = "yes" ; then
1692
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1693
fi
1694

    
1695
if test "$ffserver" = "yes" ; then
1696
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1697
  echo "CONFIG_FFSERVER=yes" >> config.mak
1698
fi
1699

    
1700
if test "$ffplay" = "yes" ; then
1701
  echo "CONFIG_FFPLAY=yes" >> config.mak
1702
fi
1703

    
1704
if test "$gpl" = "yes" ; then
1705
  echo "#define CONFIG_GPL 1" >> $TMPH
1706
  echo "CONFIG_GPL=yes" >> config.mak
1707
fi
1708

    
1709
echo "#define restrict $_restrict" >> $TMPH
1710

    
1711
if test "$optimize" = "small"; then
1712
  echo "#define always_inline"  >> $TMPH
1713
fi
1714

    
1715
# build tree in object directory if source path is different from current one
1716
if test "$source_path_used" = "yes" ; then
1717
    DIRS="\
1718
         doc \
1719
         libavformat \
1720
         libavcodec \
1721
         libavcodec/alpha \
1722
         libavcodec/armv4l \
1723
         libavcodec/i386 \
1724
         libavcodec/sparc \
1725
         libavcodec/mlib \
1726
         libavcodec/ppc \
1727
         libavcodec/liba52 \
1728
         libavcodec/libpostproc \
1729
         libavutil \
1730
         tests \
1731
         vhook \
1732
         "
1733
    FILES="\
1734
          Makefile \
1735
          libavformat/Makefile \
1736
          libavcodec/Makefile \
1737
          libavcodec/libpostproc/Makefile \
1738
          libavutil/Makefile \
1739
          tests/Makefile \
1740
          vhook/Makefile \
1741
          doc/Makefile \
1742
          doc/texi2pod.pl \
1743
          "
1744
    for dir in $DIRS ; do
1745
            mkdir -p $dir
1746
    done
1747
    for f in $FILES ; do
1748
        ln -sf "$source_path/$f" $f
1749
    done
1750
    echo "SRC_PATH=$source_path" >> config.mak
1751
else
1752
    echo "SRC_PATH='$source_path'" >> config.mak
1753
fi
1754

    
1755
if test "$amr_wb" = "yes" ; then
1756
  echo "#define AMR_WB 1" >> $TMPH
1757
  echo "AMR_WB=yes" >> config.mak
1758
  echo
1759
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1760
  echo "V5.1.0 from "
1761
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1762
  echo "and extracted the source to libavcodec/amrwb_float"
1763
  echo
1764
fi
1765

    
1766
if test "$amr_nb" = "yes" ; then
1767
  echo "#define AMR_NB 1" >> $TMPH
1768
  echo "AMR_NB=yes" >> config.mak
1769
  echo
1770
if test "$amr_nb_fixed" = "yes" ; then
1771
  echo "AMR_NB_FIXED=yes" >> config.mak
1772
  echo "#define AMR_NB_FIXED 1" >> $TMPH
1773
  echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1774
  echo "REL-5 version 5.1.0 from "
1775
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1776
  echo "and extracted src to libavcodec/amr"
1777
  echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1778
  echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1779
  echo
1780
else
1781
  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1782
  echo "REL-5 V5.1.0 from "
1783
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1784
  echo "and extracted the source to libavcodec/amr_float"
1785
  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1786
  echo
1787
fi
1788

    
1789
if test "$amr_if2" = "yes" ; then
1790
  echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1791
fi
1792

    
1793
fi
1794

    
1795
for codec in $CODEC_LIST ; do
1796
    echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
1797
    echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
1798
done
1799

    
1800
diff $TMPH config.h >/dev/null 2>&1
1801
if test $? -ne 0 ; then
1802
        mv -f $TMPH config.h
1803
else
1804
        echo "config.h is unchanged"
1805
fi
1806

    
1807
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1808

    
1809

    
1810
# build pkg-config files libav*.pc and libpostproc.pc
1811
# libavutil.pc
1812
cat <<EOF >libavutil.pc
1813
prefix=$prefix
1814
exec_prefix=\${prefix}
1815
libdir=\${exec_prefix}/lib
1816
includedir=\${prefix}/include
1817

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

    
1827
cat <<EOF >libavutil-uninstalled.pc
1828
prefix=
1829
exec_prefix=
1830
libdir=\${pcfiledir}/libavutil
1831
includedir=\${pcfiledir}/libavutil
1832

    
1833
Name: libavutil
1834
Description: FFmpeg utility library
1835
Version: $lavu_version
1836
Requires:
1837
Conflicts:
1838
Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
1839
Cflags: -I\${includedir}
1840
EOF
1841

    
1842
# libavcodec.pc
1843
cat <<EOF >libavcodec.pc
1844
prefix=$prefix
1845
exec_prefix=\${prefix}
1846
libdir=\${exec_prefix}/lib
1847
includedir=\${prefix}/include
1848

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

    
1858
cat <<EOF >libavcodec-uninstalled.pc
1859
prefix=
1860
exec_prefix=
1861
libdir=\${pcfiledir}/libavcodec
1862
includedir=\${pcfiledir}/libavcodec
1863

    
1864
Name: libavcodec
1865
Description: FFmpeg codec library
1866
Version: $lavc_version
1867
Requires: $pkg_requires libavutil = $lavu_version
1868
Conflicts:
1869
Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
1870
Cflags: -I\${includedir}
1871
EOF
1872

    
1873
# libavformat.pc
1874
cat <<EOF >libavformat.pc
1875
prefix=$prefix
1876
exec_prefix=\${prefix}
1877
libdir=\${exec_prefix}/lib
1878
includedir=\${prefix}/include
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: -L\${libdir} -lavformat $extralibs
1886
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
1887
EOF
1888

    
1889
cat <<EOF >libavformat-uninstalled.pc
1890
prefix=
1891
exec_prefix=
1892
libdir=\${pcfiledir}/libavformat
1893
includedir=\${pcfiledir}/libavformat
1894

    
1895
Name: libavformat
1896
Description: FFmpeg container format library
1897
Version: $lavf_version
1898
Requires: $pkg_requires libavcodec = $lavc_version
1899
Conflicts:
1900
Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
1901
Cflags: -I\${includedir}
1902
EOF
1903

    
1904

    
1905
# libpostproc.pc
1906
cat <<EOF >libpostproc.pc
1907
prefix=$prefix
1908
exec_prefix=\${prefix}
1909
libdir=\${exec_prefix}/lib
1910
includedir=\${prefix}/include
1911

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

    
1921
cat <<EOF >libpostproc-uninstalled.pc
1922
prefix=
1923
exec_prefix=
1924
libdir=\${pcfiledir}/libavcodec/libpostproc
1925
includedir=\${pcfiledir}/libavcodec/libpostproc
1926

    
1927
Name: libpostproc
1928
Description: FFmpeg post processing library
1929
Version: $lavc_version
1930
Requires:
1931
Conflicts:
1932
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
1933
Cflags: -I\${includedir}
1934
EOF