Statistics
| Branch: | Revision:

ffmpeg / configure @ fb17fac8

History | View | Annotate | Download (55.1 KB)

1 de6d9b64 Fabrice Bellard
#!/bin/sh
2 0f3cb305 Fabrice Bellard
#
3 f57620d5 Måns Rullgård
# FFmpeg configure script
4
#
5
# Copyright (c) 2000, 2001, 2002 Fabrice Bellard
6
# Copyright (c) 2005-2006 Diego Biurrun
7
# Copyright (c) 2005-2006 Mans Rullgard
8 0f3cb305 Fabrice Bellard
#
9 cf9d24ad Dan Christiansen
10 cde2d79a Måns Rullgård
# make sure we are running under a compatible shell
11 c21d6325 Måns Rullgård
# try to make this part work with most shells
12
13
try_exec(){
14 0dbe81bb Måns Rullgård
    echo "Trying shell $1"
15 c21d6325 Måns Rullgård
    type "$1" >/dev/null 2>&1 && exec "$@"
16
}
17
18 5237ce67 Måns Rullgård
unset foo
19 0dbe81bb Måns Rullgård
(: ${foo%%bar}) 2>/dev/null
20
E1="$?"
21
22
(: ${foo?}) 2>/dev/null
23
E2="$?"
24
25
if test "$E1" != 0 || test "$E2" = 0; then
26
    echo "Broken shell detected.  Trying alternatives."
27 c21d6325 Måns Rullgård
    export FF_CONF_EXEC
28
    if test "0$FF_CONF_EXEC" -lt 1; then
29
        FF_CONF_EXEC=1
30
        try_exec bash "$0" "$@"
31
    fi
32
    if test "0$FF_CONF_EXEC" -lt 2; then
33
        FF_CONF_EXEC=2
34
        try_exec ksh "$0" "$@"
35
    fi
36
    if test "0$FF_CONF_EXEC" -lt 3; then
37
        FF_CONF_EXEC=3
38
        try_exec /usr/xpg4/bin/sh "$0" "$@"
39 cde2d79a Måns Rullgård
    fi
40
    echo "No compatible shell script interpreter found."
41 c21d6325 Måns Rullgård
    echo "This configure script requires a POSIX compatible shell"
42
    echo "such as bash or ksh."
43
    if test "$BASH_VERSION" = '2.04.0(1)-release'; then
44
        echo "This bash version ($BASH_VERSION) is broken on your platform."
45
        echo "Upgrade to a later version if available."
46
    fi
47 cde2d79a Måns Rullgård
    exit 1
48
fi
49
50 74c53c2d Måns Rullgård
show_help(){
51
  echo "Usage: configure [options]"
52
  echo "Options: [defaults in brackets after descriptions]"
53
  echo
54
  echo "Standard options:"
55
  echo "  --help                   print this message"
56 2ba042a7 Måns Rullgård
  echo "  --log[=FILE|yes|no]      log tests and output to FILE [config.err]"
57 2266e085 Diego Biurrun
  echo "  --prefix=PREFIX          install in PREFIX [$PREFIX]"
58 74c53c2d Måns Rullgård
  echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
59 84c22efd Diego Biurrun
  echo "  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]"
60 74c53c2d Måns Rullgård
  echo "  --incdir=DIR             install includes in DIR [PREFIX/include/ffmpeg]"
61
  echo "  --mandir=DIR             install man page in DIR [PREFIX/man]"
62
  echo "  --enable-mp3lame         enable MP3 encoding via libmp3lame [default=no]"
63 f956e129 Oded Shimon
  echo "  --enable-libnut          enable NUT support via libnut [default=no]"
64 74c53c2d Måns Rullgård
  echo "  --enable-libogg          enable Ogg support via libogg [default=no]"
65
  echo "  --enable-vorbis          enable Vorbis support via libvorbis [default=no]"
66
  echo "  --enable-faad            enable FAAD support via libfaad [default=no]"
67
  echo "  --enable-faadbin         build FAAD support with runtime linking [default=no]"
68
  echo "  --enable-faac            enable FAAC support via libfaac [default=no]"
69
  echo "  --enable-libgsm          enable GSM support via libgsm [default=no]"
70
  echo "  --enable-xvid            enable XviD support via xvidcore [default=no]"
71
  echo "  --enable-x264            enable H.264 encoding via x264 [default=no]"
72
  echo "  --enable-mingw32         enable MinGW native/cross Windows compile"
73
  echo "  --enable-mingwce         enable MinGW native/cross WinCE compile"
74
  echo "  --enable-a52             enable GPLed A52 support [default=no]"
75
  echo "  --enable-a52bin          open liba52.so.0 at runtime [default=no]"
76
  echo "  --enable-dts             enable GPLed DTS support [default=no]"
77
  echo "  --enable-pp              enable GPLed postprocessing support [default=no]"
78
  echo "  --enable-static          build static libraries [default=yes]"
79
  echo "  --disable-static         do not build static libraries [default=no]"
80
  echo "  --enable-shared          build shared libraries [default=no]"
81
  echo "  --disable-shared         do not build shared libraries [default=yes]"
82
  echo "  --enable-amr_nb          enable amr_nb float audio codec"
83
  echo "  --enable-amr_nb-fixed    use fixed point for amr-nb codec"
84
  echo "  --enable-amr_wb          enable amr_wb float audio codec"
85
  echo "  --enable-amr_if2         enable amr_wb IF2 audio codec"
86
  echo "  --enable-sunmlib         use Sun medialib [default=no]"
87
  echo "  --enable-pthreads        use pthreads [default=no]"
88
  echo "  --enable-dc1394          enable IIDC-1394 grabbing using libdc1394"
89
  echo "                           and libraw1394 [default=no]"
90 790c9ca7 Luca Abeni
  echo "  --enable-swscaler        software scaler support [default=no]"
91 8ac17293 Steve L'Homme
  echo "  --enable-avisynth        allow reading AVISynth script files [default=no]"
92 74c53c2d Måns Rullgård
  echo "  --enable-gpl             allow use of GPL code, the resulting libav*"
93
  echo "                           and ffmpeg will be under GPL [default=no]"
94
  echo ""
95
  echo "Advanced options (experts only):"
96
  echo "  --source-path=PATH       path to source code [$source_path]"
97
  echo "  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]"
98 fac252f9 Måns Rullgård
  echo "  --cross-compile          assume a cross-compiler is used"
99 74c53c2d Måns Rullgård
  echo "  --cc=CC                  use C compiler CC [$cc]"
100
  echo "  --make=MAKE              use specified make [$make]"
101
  echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
102
  echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
103
  echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
104
  echo "  --build-suffix=SUFFIX    suffix for application specific build []"
105 cc6a90dd Guillaume Poirier
  echo "  --arch=ARCH              select architecture  [$arch]"
106 38d0a8aa Guillaume Poirier
  echo "  --cpu=CPU                selects the minimum cpu required (affects
107
                                   instruction selection, may crash on older CPUs)"
108 74c53c2d Måns Rullgård
  echo "  --powerpc-perf-enable    enable performance report on PPC"
109
  echo "                           (requires enabling PMC)"
110
  echo "  --disable-mmx            disable MMX usage"
111 1839e854 Siarhei Siamashka
  echo "  --disable-armv5te        disable armv5te usage"
112 74c53c2d Måns Rullgård
  echo "  --disable-iwmmxt         disable iwmmxt usage"
113
  echo "  --disable-altivec        disable AltiVec usage"
114
  echo "  --disable-audio-oss      disable OSS audio support [default=no]"
115
  echo "  --disable-audio-beos     disable BeOS audio support [default=no]"
116
  echo "  --disable-v4l            disable video4linux grabbing [default=no]"
117
  echo "  --disable-v4l2           disable video4linux2 grabbing [default=no]"
118
  echo "  --disable-bktr           disable bktr video grabbing [default=no]"
119
  echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
120
  echo "  --disable-network        disable network support [default=no]"
121 0c7bb0e5 Luca Barbato
  echo "  --disable-ipv6           disable ipv6 support [default=no]"
122 74c53c2d Måns Rullgård
  echo "  --disable-zlib           disable zlib [default=no]"
123
  echo "  --disable-vhook          disable video hooking support"
124
  echo "  --enable-gprof           enable profiling with gprof [$gprof]"
125
  echo "  --disable-debug          disable debugging symbols"
126
  echo "  --disable-opts           disable compiler optimizations"
127 78fcba8f Måns Rullgård
  echo "  --enable-extra-warnings  enable more compiler warnings"
128 74c53c2d Måns Rullgård
  echo "  --disable-mpegaudio-hp   faster (but less accurate)"
129
  echo "                           MPEG audio decoding [default=no]"
130
  echo "  --disable-protocols      disable I/O protocols support [default=no]"
131 786b30af Diego Biurrun
  echo "  --disable-ffmpeg         disable ffmpeg build"
132 74c53c2d Måns Rullgård
  echo "  --disable-ffserver       disable ffserver build"
133
  echo "  --disable-ffplay         disable ffplay build"
134
  echo "  --enable-small           optimize for size instead of speed"
135
  echo "  --enable-memalign-hack   emulate memalign, interferes with memory debuggers"
136
  echo "  --disable-strip          disable stripping of executables and shared libraries"
137
  echo "  --disable-encoder=NAME   disables encoder NAME"
138
  echo "  --enable-encoder=NAME    enables encoder NAME"
139
  echo "  --disable-decoder=NAME   disables decoder NAME"
140
  echo "  --enable-decoder=NAME    enables decoder NAME"
141
  echo "  --disable-encoders       disables all encoders"
142
  echo "  --disable-decoders       disables all decoders"
143 ff70e601 Måns Rullgård
  echo "  --disable-muxer=NAME     disables muxer NAME"
144
  echo "  --enable-muxer=NAME      enables muxer NAME"
145 74c53c2d Måns Rullgård
  echo "  --disable-muxers         disables all muxers"
146 ff70e601 Måns Rullgård
  echo "  --disable-demuxer=NAME   disables demuxer NAME"
147
  echo "  --enable-demuxer=NAME    enables demuxer NAME"
148 74c53c2d Måns Rullgård
  echo "  --disable-demuxers       disables all demuxers"
149 af9e7d18 Måns Rullgård
  echo "  --enable-parser=NAME     enables parser NAME"
150
  echo "  --disable-parser=NAME    disables parser NAME"
151
  echo "  --disable-parsers        disables all parsers"
152 74c53c2d Måns Rullgård
  echo ""
153
  echo "NOTE: Object files are built at the place where configure is launched."
154
  exit 1
155
}
156 cf9d24ad Dan Christiansen
157 57bd82d4 Måns Rullgård
log(){
158
    echo "$@" >>$logfile
159
}
160
161 720c69da Måns Rullgård
log_file(){
162 c8e9f801 Måns Rullgård
    log BEGIN $1
163
    cat -n $1 >>$logfile
164
    log END $1
165
}
166
167 2ba042a7 Måns Rullgård
echolog(){
168 c8e9f801 Måns Rullgård
    log "$@"
169 57bd82d4 Måns Rullgård
    echo "$@"
170 2ba042a7 Måns Rullgård
}
171
172
die(){
173
    echolog "$@"
174
    cat <<EOF
175
If you think configure made a mistake, make sure you are using the latest
176
version from SVN.  If the latest version fails, report the problem to the
177
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
178
EOF
179 720c69da Måns Rullgård
    if enabled logging; then
180 2ba042a7 Måns Rullgård
        cat <<EOF
181
Include the log file "$logfile" produced by configure as this will help
182
solving the problem.
183
EOF
184
    else
185
cat <<EOF
186
Rerun configure with logging enabled (do not use --log=no), and include the
187
log this produces with your report.
188
EOF
189
    fi
190 57bd82d4 Måns Rullgård
    rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
191
    exit 1
192
}
193
194 904e48f1 Måns Rullgård
# "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z"
195 44161118 Måns Rullgård
toupper(){
196
    echo "$@" | tr '[a-z]' '[A-Z]'
197
}
198
199 a8d04fba Måns Rullgård
set_all(){
200
    value=$1
201
    shift
202
    for var in $*; do
203
        eval $var=$value
204
    done
205
}
206
207
enable(){
208
    set_all yes $*
209
}
210
211
disable(){
212
    set_all no $*
213
}
214
215 57bd82d4 Måns Rullgård
enabled(){
216 44161118 Måns Rullgård
    eval test "x\$$1" = "xyes"
217
}
218
219
enabled_all(){
220
    for opt; do
221
        enabled $opt || return 1
222
    done
223
}
224
225
enabled_any(){
226
    for opt; do
227
        enabled $opt && return 0
228
    done
229
}
230
231
print_config(){
232
    pfx=$1
233
    header=$2
234
    makefile=$3
235
    shift 3
236
    for cfg; do
237
        if enabled $cfg; then
238
            ucname="${pfx}`toupper $cfg`"
239
            echo "#define ${ucname} 1" >> $header
240
            echo "${ucname}=yes" >> $makefile
241
        fi
242
    done
243 57bd82d4 Måns Rullgård
}
244
245
flags_saved(){
246
    (: ${SAVE_CFLAGS?}) 2>/dev/null
247
}
248
249 dcd479c0 Måns Rullgård
save_flags(){
250 57bd82d4 Måns Rullgård
    flags_saved && return
251 dcd479c0 Måns Rullgård
    SAVE_CFLAGS="$CFLAGS"
252
    SAVE_LDFLAGS="$LDFLAGS"
253
    SAVE_extralibs="$extralibs"
254
}
255
256
restore_flags(){
257
    CFLAGS="$SAVE_CFLAGS"
258
    LDFLAGS="$SAVE_LDFLAGS"
259
    extralibs="$SAVE_extralibs"
260
    unset SAVE_CFLAGS
261
    unset SAVE_LDFLAGS
262
    unset SAVE_extralibs
263
}
264
265
temp_cflags(){
266
    save_flags
267
    CFLAGS="$CFLAGS $*"
268
}
269
270
temp_ldflags(){
271
    save_flags
272
    LDFLAGS="$LDFLAGS $*"
273
}
274
275
temp_extralibs(){
276
    save_flags
277
    extralibs="$extralibs $*"
278
}
279
280 57bd82d4 Måns Rullgård
append(){
281
    var=$1
282
    shift
283
    flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
284
    eval "$var=\"\$$var $*\""
285
}
286
287
add_cflags(){
288
    append CFLAGS "$@"
289
}
290
291
add_ldflags(){
292
    append LDFLAGS "$@"
293
}
294
295
add_extralibs(){
296
    append extralibs "$@"
297
}
298
299 b0cfb663 Måns Rullgård
check_cmd(){
300 b3cb5d51 Måns Rullgård
    log "$@"
301 9b4f605c Måns Rullgård
    "$@" >>$logfile 2>&1
302 b0cfb663 Måns Rullgård
}
303
304 dcd479c0 Måns Rullgård
check_cc(){
305 57bd82d4 Måns Rullgård
    log check_cc "$@"
306
    cat >$TMPC
307 720c69da Måns Rullgård
    log_file $TMPC
308 b0cfb663 Måns Rullgård
    check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
309 57bd82d4 Måns Rullgård
}
310
311
check_cpp(){
312
    log check_cpp "$@"
313 dcd479c0 Måns Rullgård
    cat >$TMPC
314 720c69da Måns Rullgård
    log_file $TMPC
315 b0cfb663 Måns Rullgård
    check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
316 dcd479c0 Måns Rullgård
}
317
318
check_ld(){
319 57bd82d4 Måns Rullgård
    log check_ld "$@"
320 0607887f Måns Rullgård
    check_cc || return
321 b0cfb663 Måns Rullgård
    check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
322 dcd479c0 Måns Rullgård
}
323
324
check_cflags(){
325 57bd82d4 Måns Rullgård
    log check_cflags "$@"
326
    check_cc "$@" <<EOF && add_cflags "$@"
327 dcd479c0 Måns Rullgård
int x;
328
EOF
329
}
330
331
check_ldflags(){
332 57bd82d4 Måns Rullgård
    log check_ldflags "$@"
333
    check_ld "$@" <<EOF && add_ldflags "$@"
334
int main(){
335
    return 0;
336
}
337 dcd479c0 Måns Rullgård
EOF
338
}
339
340
check_header(){
341 57bd82d4 Måns Rullgård
    log check_header "$@"
342 dcd479c0 Måns Rullgård
    header=$1
343
    shift
344 57bd82d4 Måns Rullgård
    check_cpp "$@" <<EOF
345 dcd479c0 Måns Rullgård
#include <$header>
346
int x;
347
EOF
348 0701ca7f Måns Rullgård
    err=$?
349 0dbe81bb Måns Rullgård
    var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
350 0701ca7f Måns Rullgård
    test "$err" = 0 && enable $var || disable $var
351
    return $err
352 dcd479c0 Måns Rullgård
}
353
354
check_func(){
355 57bd82d4 Måns Rullgård
    log check_func "$@"
356 dcd479c0 Måns Rullgård
    func=$1
357
    shift
358
    check_ld "$@" <<EOF
359
extern int $func();
360
int main(){
361
    $func();
362
}
363
EOF
364 0701ca7f Måns Rullgård
    err=$?
365
    test "$err" = 0 && enable $func || disable $func
366
    return $err
367 dcd479c0 Måns Rullgård
}
368
369 57bd82d4 Måns Rullgård
check_lib(){
370
    log check_lib "$@"
371
    header="$1"
372
    func="$2"
373
    shift 2
374
    temp_extralibs "$@"
375
    check_header $header && check_func $func && add_extralibs "$@"
376
    err=$?
377
    restore_flags
378
    return $err
379
}
380
381 dcd479c0 Måns Rullgård
check_exec(){
382 bd4700b1 Måns Rullgård
    check_ld "$@" && { test "$cross_compile" = yes || $TMPE >>$logfile 2>&1; }
383 57bd82d4 Måns Rullgård
}
384
385
require(){
386
    name="$1"
387
    header="$2"
388
    func="$3"
389
    shift 3
390
    check_lib $header $func "$@" || die "ERROR: $name not found"
391 dcd479c0 Måns Rullgård
}
392
393 c88f5d72 Måns Rullgård
CONFIG_LIST='
394
    encoders
395
    decoders
396
    parsers
397
    muxers
398
    demuxers
399
    a52
400
    a52bin
401
    amr
402
    amr_nb
403
    amr_nb_fixed
404
    amr_wb
405
    audio_beos
406
    audio_oss
407
    avisynth
408
    beos_netserver
409
    bktr
410
    dc1394
411
    dts
412
    dv1394
413
    faac
414
    faad
415
    faadbin
416
    ffmpeg
417
    ffplay
418
    ffserver
419
    gpl
420
    ipv6
421
    libgsm
422
    libnut
423
    libogg
424
    libvorbis
425
    memalign_hack
426
    mp3lame
427
    mpegaudio_hp
428
    network
429
    pp
430
    protocols
431
    swscaler
432
    vhook
433
    video4linux
434
    video4linux2
435 860391a5 Måns Rullgård
    wince
436 c88f5d72 Måns Rullgård
    x264
437
    xvid
438
    zlib
439
'
440
441
HAVE_LIST='
442
    altivec_h
443 b265431e Måns Rullgård
    beosthreads
444 c88f5d72 Måns Rullgård
    byteswap_h
445
    dcbzl
446 18b67ae5 Måns Rullgård
    dlfcn_h
447 c88f5d72 Måns Rullgård
    dlopen
448
    freetype2
449
    gprof
450
    imlib2
451 2e1913b1 Måns Rullgård
    inet_aton
452 c88f5d72 Måns Rullgård
    localtime_r
453
    lrintf
454
    malloc_h
455
    memalign
456
    mlib
457 9c914398 Måns Rullgård
    os2
458 b265431e Måns Rullgård
    os2threads
459
    pthreads
460 c88f5d72 Måns Rullgård
    sdl
461
    sdl_video_size
462 b265431e Måns Rullgård
    threads
463
    w32threads
464 c88f5d72 Måns Rullgård
'
465 44161118 Måns Rullgård
466 0f3cb305 Fabrice Bellard
# set temporary file name
467 57514323 Zdenek Kabelac
if test ! -z "$TMPDIR" ; then
468 0f3cb305 Fabrice Bellard
    TMPDIR1="${TMPDIR}"
469 57514323 Zdenek Kabelac
elif test ! -z "$TEMPDIR" ; then
470 0f3cb305 Fabrice Bellard
    TMPDIR1="${TEMPDIR}"
471 3d204385 Nick Kurshev
else
472 0f3cb305 Fabrice Bellard
    TMPDIR1="/tmp"
473 3d204385 Nick Kurshev
fi
474
475 0f3cb305 Fabrice Bellard
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
476
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
477 f3ec2d46 Slavik Gnatenko
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
478 0f3cb305 Fabrice Bellard
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
479
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
480
481 de6d9b64 Fabrice Bellard
# default parameters
482 720c69da Måns Rullgård
logging="yes"
483 2ba042a7 Måns Rullgård
logfile="config.err"
484 2266e085 Diego Biurrun
PREFIX="/usr/local"
485
libdir='${PREFIX}/lib'
486 84c22efd Diego Biurrun
shlibdir="$libdir"
487 2266e085 Diego Biurrun
incdir='${PREFIX}/include/ffmpeg'
488
mandir='${PREFIX}/man'
489
bindir='${PREFIX}/bin'
490 0f3cb305 Fabrice Bellard
cross_prefix=""
491 fac252f9 Måns Rullgård
cross_compile="no"
492 de6d9b64 Fabrice Bellard
cc="gcc"
493
ar="ar"
494 be7109c1 Michael Niedermayer
ranlib="ranlib"
495 4a908fbc Alex Beregszaszi
make="make"
496 0f3cb305 Fabrice Bellard
strip="strip"
497 cc6a90dd Guillaume Poirier
arch=`uname -m`
498 38d0a8aa Guillaume Poirier
cpu="generic"
499 e45a2872 Romain Dolbeau
powerpc_perf="no"
500 0f3cb305 Fabrice Bellard
mmx="default"
501 e7768fc5 Guillaume Poirier
cmov="no"
502 94e4c3a3 Guillaume Poirier
cmov_is_fast="no"
503 1839e854 Siarhei Siamashka
armv5te="default"
504 eba9ae3c Gildas Bazin
iwmmxt="default"
505 ab6c65f6 Brian Foley
altivec="default"
506 87ea51e0 Luca Barbato
dcbzl="no"
507 d46aba26 Leon van Stuivenberg
mmi="default"
508 cc6a90dd Guillaume Poirier
case "$arch" in
509 ef0bc4c9 François Revol
  i386|i486|i586|i686|i86pc|BePC)
510 419b8784 Diego Biurrun
    arch="x86_32"
511 de6d9b64 Fabrice Bellard
  ;;
512 7bf9648e Jacob Meuser
  x86_64|amd64)
513 a63e5f1c Diego Biurrun
    arch="x86_32"
514 32255f6c Reimar Döffinger
    canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
515 7bf9648e Jacob Meuser
    if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
516
      if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
517 cc6a90dd Guillaume Poirier
        arch="x86_64"
518 7bf9648e Jacob Meuser
      fi
519 053dea12 Aurelien Jacobs
    fi
520
  ;;
521 6dc7b6b3 Diego Biurrun
  # armv4l is a subset of armv[567]*l
522
  arm|armv[4567]*l)
523 cc6a90dd Guillaume Poirier
    arch="armv4l"
524 6ed7422a Fabrice Bellard
  ;;
525 91d1f1a4 Nick Kurshev
  alpha)
526 cc6a90dd Guillaume Poirier
    arch="alpha"
527 91d1f1a4 Nick Kurshev
  ;;
528 2645e80f Guillaume Poirier
  "Power Macintosh"|ppc|ppc64|powerpc)
529 cc6a90dd Guillaume Poirier
    arch="powerpc"
530 90cee0c3 Michael Niedermayer
  ;;
531 b028a866 Diego Biurrun
  mips|mipsel|IP*)
532 cc6a90dd Guillaume Poirier
    arch="mips"
533 d46aba26 Leon van Stuivenberg
  ;;
534 bb476ff3 James Morrison
  sun4u|sparc64)
535 cc6a90dd Guillaume Poirier
    arch="sparc64"
536 a7beab73 Roman Shaposhnik
  ;;
537 bb476ff3 James Morrison
  sparc)
538 cc6a90dd Guillaume Poirier
    arch="sparc"
539 bb476ff3 James Morrison
  ;;
540 bdb2e37c Alex Beregszaszi
  sh4)
541 cc6a90dd Guillaume Poirier
    arch="sh4"
542 bdb2e37c Alex Beregszaszi
  ;;
543 67860b26 Sam Hocevar
  parisc|parisc64)
544 cc6a90dd Guillaume Poirier
    arch="parisc"
545 67860b26 Sam Hocevar
  ;;
546
  s390|s390x)
547 cc6a90dd Guillaume Poirier
    arch="s390"
548 67860b26 Sam Hocevar
  ;;
549
  m68k)
550 cc6a90dd Guillaume Poirier
    arch="m68k"
551 67860b26 Sam Hocevar
  ;;
552
  ia64)
553 cc6a90dd Guillaume Poirier
    arch="ia64"
554 67860b26 Sam Hocevar
  ;;
555 81a9b052 Michael Benjamin
  bfin)
556 cc6a90dd Guillaume Poirier
    arch="bfin"
557 81a9b052 Michael Benjamin
  ;;
558 de6d9b64 Fabrice Bellard
  *)
559 cc6a90dd Guillaume Poirier
    arch="unknown"
560 de6d9b64 Fabrice Bellard
  ;;
561
esac
562
gprof="no"
563 9d2a0f1c Måns Rullgård
video4linux="yes"
564
video4linux2="yes"
565 6beefa40 Michael Niedermayer
bktr="no"
566 5cbcf02c Fabrice Bellard
audio_oss="yes"
567 dfdfa47c François Revol
audio_beos="no"
568 8aa3ee32 Max Krasnyansky
dv1394="yes"
569 f02be79d Roman Shaposhnik
dc1394="no"
570 5cbcf02c Fabrice Bellard
network="yes"
571 0c7bb0e5 Luca Barbato
ipv6="yes"
572 0147f198 François Revol
zlib="yes"
573 bb4c2140 Michael Niedermayer
libgsm="no"
574 a6741398 Juanjo
mp3lame="no"
575 f956e129 Oded Shimon
libnut="no"
576 9146ca37 Måns Rullgård
libogg="no"
577 be74741c Måns Rullgård
libvorbis="no"
578 0fc50e58 Zdenek Kabelac
faad="no"
579
faadbin="no"
580 29d48296 Michael Niedermayer
faac="no"
581 1ddadfa9 Adam Thayer
xvid="no"
582 6662ec29 Michael Niedermayer
x264="no"
583 ba9261e5 Michael Niedermayer
a52="no"
584 57514323 Zdenek Kabelac
a52bin="no"
585 23c99253 Michael Niedermayer
dts="no"
586 ba9261e5 Michael Niedermayer
pp="no"
587 732d9245 Bill Eldridge
mingw32="no"
588 860391a5 Måns Rullgård
wince="no"
589 f3ec2d46 Slavik Gnatenko
os2="no"
590 320d060a Diego Biurrun
lstatic="yes"
591 83286d2a Zdenek Kabelac
lshared="no"
592 cddf3f45 Glenn Maynard
optimize="yes"
593
debug="yes"
594 78fcba8f Måns Rullgård
extrawarnings="no"
595 65d1bea2 Michel Bardiaux
dostrip="yes"
596 da186ae2 Steven M. Schultz
installstrip="-s"
597 ef0bc4c9 François Revol
extralibs="-lm"
598 0f3cb305 Fabrice Bellard
bigendian="no"
599 a8721c09 Fabrice Bellard
vhook="default"
600 8ac17293 Steve L'Homme
avisynth="no"
601 18b67ae5 Måns Rullgård
dlfcn_h="no"
602 adbc0510 Philip Gladstone
dlopen="no"
603 1eb2212e Fabrice Bellard
mpegaudio_hp="yes"
604 baa3a937 Måns Rullgård
SHFLAGS='-shared -Wl,-soname,$@'
605 cab3ef82 Diego Biurrun
VHOOKSHFLAGS='$(SHFLAGS)'
606 8e72b130 Måns Rullgård
beos_netserver="no"
607 04f46ced Gildas Bazin
protocols="yes"
608 786b30af Diego Biurrun
ffmpeg="yes"
609 8154d2e0 Fabrice Bellard
ffserver="yes"
610 a86b921c Fabrice Bellard
ffplay="yes"
611 80581e98 Michael Niedermayer
LIBOBJFLAGS=""
612 e89b8b0a Diego Biurrun
FFLDFLAGS=-Wl,--warn-common
613 e240ee67 Luca Barbato
LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
614 c536cb09 Diego Biurrun
FFSERVERLDFLAGS=-Wl,-E
615 f39e56a8 Jacob Meuser
LDCONFIG="ldconfig"
616 f3ec2d46 Slavik Gnatenko
LIBPREF="lib"
617
LIBSUF=".a"
618 4bdd05e7 Diego Biurrun
LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
619 f3ec2d46 Slavik Gnatenko
SLIBPREF="lib"
620
SLIBSUF=".so"
621 4bdd05e7 Diego Biurrun
SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
622 b29bddab Diego Biurrun
SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
623
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
624 951bf3e6 Fabrice Bellard
EXESUF=""
625 eb94aca9 Charles Yates
BUILDSUF=""
626 891f64b3 joca@rixmail.se
amr_nb="no"
627 d663a1fd Michael Niedermayer
amr_wb="no"
628 bc634f6f Zdenek Kabelac
amr_nb_fixed="no"
629 2a515c08 Torsten Martinsen
amr_if2="no"
630 bde24d6e Måns Rullgård
mlib="no"
631 9c3d33d6 Michael Niedermayer
pthreads="no"
632 790c9ca7 Luca Abeni
swscaler="no"
633 b2e3c528 Michael Niedermayer
gpl="no"
634 9ddbcae6 Måns Rullgård
memalign_hack="no"
635 4454dc1b John Dalgliesh
asmalign_pot="unknown"
636 d4596ae3 Diego Biurrun
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
637 ef0bc4c9 François Revol
638
# OS specific
639
targetos=`uname -s`
640
case $targetos in
641
BeOS)
642 2266e085 Diego Biurrun
PREFIX="/boot/home/config"
643 ef0bc4c9 François Revol
# helps building libavcodec
644 30a3e5d4 Nigel Pearson
add_cflags "-DPIC -fomit-frame-pointer"
645 31ba0b4d François Revol
# 3 gcc releases known for BeOS, each with ugly bugs
646 b2924696 Roman Shaposhnik
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
647 31ba0b4d François Revol
case "$gcc_version" in
648
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
649
mmx="no"
650
;;
651
*20010315*) echo "BeBits gcc"
652 30a3e5d4 Nigel Pearson
add_cflags "-fno-expensive-optimizations"
653 31ba0b4d François Revol
;;
654
esac
655 e1707f52 Michael Niedermayer
SHFLAGS=-nostart
656 29799f8b Diego Biurrun
# disable Linux things
657 e1707f52 Michael Niedermayer
audio_oss="no"
658 9d2a0f1c Måns Rullgård
video4linux="no"
659
video4linux2="no"
660 8aa3ee32 Max Krasnyansky
dv1394="no"
661 29799f8b Diego Biurrun
# enable BeOS things
662 dfdfa47c François Revol
audio_beos="yes"
663 b265431e Måns Rullgård
beosthreads="yes"
664 ef0bc4c9 François Revol
# no need for libm, but the inet stuff
665
# Check for BONE
666
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
667
extralibs="-lbind -lsocket"
668
else
669 8e72b130 Måns Rullgård
beos_netserver="yes"
670 26b35efb François Revol
extralibs="-lnet"
671 ef0bc4c9 François Revol
fi ;;
672 4baca069 Philip Gladstone
SunOS)
673 9d2a0f1c Måns Rullgård
video4linux="no"
674
video4linux2="no"
675 4baca069 Philip Gladstone
audio_oss="no"
676 8aa3ee32 Max Krasnyansky
dv1394="no"
677 4baca069 Philip Gladstone
make="gmake"
678 e89b8b0a Diego Biurrun
FFLDFLAGS=""
679 c536cb09 Diego Biurrun
FFSERVERLDFLAGS=""
680 813457e5 Måns Rullgård
SHFLAGS="-shared -Wl,-h,\$@"
681 30a3e5d4 Nigel Pearson
add_extralibs "-lsocket -lnsl"
682 4baca069 Philip Gladstone
;;
683 b7aa4a59 Steven M. Schultz
NetBSD)
684 9d2a0f1c Måns Rullgård
video4linux="no"
685
video4linux2="no"
686 6beefa40 Michael Niedermayer
bktr="yes"
687 b7aa4a59 Steven M. Schultz
audio_oss="yes"
688
dv1394="no"
689
make="gmake"
690 30a3e5d4 Nigel Pearson
add_extralibs "-lossaudio"
691 b7aa4a59 Steven M. Schultz
;;
692 8c802695 Jacob Meuser
OpenBSD)
693 9d2a0f1c Måns Rullgård
video4linux="no"
694
video4linux2="no"
695 6beefa40 Michael Niedermayer
bktr="yes"
696 8c802695 Jacob Meuser
audio_oss="yes"
697
dv1394="no"
698
make="gmake"
699 80581e98 Michael Niedermayer
LIBOBJFLAGS="\$(PIC)"
700 a1309f8f Diego Biurrun
LDCONFIG="ldconfig -m \$(shlibdir)"
701 30a3e5d4 Nigel Pearson
add_extralibs "-lossaudio"
702 8c802695 Jacob Meuser
;;
703 9c938e77 Philip Gladstone
FreeBSD)
704 9d2a0f1c Måns Rullgård
video4linux="no"
705
video4linux2="no"
706 6beefa40 Michael Niedermayer
bktr="yes"
707 9c938e77 Philip Gladstone
audio_oss="yes"
708 8aa3ee32 Max Krasnyansky
dv1394="no"
709 9c938e77 Philip Gladstone
make="gmake"
710 30a3e5d4 Nigel Pearson
add_cflags "-pthread"
711 9c938e77 Philip Gladstone
;;
712 38f0d3ce Diego Biurrun
GNU/kFreeBSD)
713 9d2a0f1c Måns Rullgård
video4linux="no"
714
video4linux2="no"
715 38f0d3ce Diego Biurrun
bktr="yes"
716
audio_oss="yes"
717
dv1394="no"
718 30a3e5d4 Nigel Pearson
add_cflags "-pthread"
719 38f0d3ce Diego Biurrun
;;
720 4a908fbc Alex Beregszaszi
BSD/OS)
721 9d2a0f1c Måns Rullgård
video4linux="no"
722
video4linux2="no"
723 6beefa40 Michael Niedermayer
bktr="yes"
724 6063bce7 Fabrice Bellard
audio_oss="yes"
725 8aa3ee32 Max Krasnyansky
dv1394="no"
726 4a908fbc Alex Beregszaszi
extralibs="-lpoll -lgnugetopt -lm"
727
make="gmake"
728 1db68540 Steven M. Schultz
strip="strip -d"
729
installstrip=""
730 4a908fbc Alex Beregszaszi
;;
731 90cee0c3 Michael Niedermayer
Darwin)
732 a43bd1d7 Heliodoro Tammaro
cc="cc"
733 9d2a0f1c Måns Rullgård
video4linux="no"
734
video4linux2="no"
735 90cee0c3 Michael Niedermayer
audio_oss="no"
736 8aa3ee32 Max Krasnyansky
dv1394="no"
737 a1309f8f Diego Biurrun
SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
738 408382a4 Diego Biurrun
VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@'
739 90cee0c3 Michael Niedermayer
extralibs=""
740 47930f09 Philip Gladstone
strip="strip -x"
741 da186ae2 Steven M. Schultz
installstrip=""
742 e89b8b0a Diego Biurrun
FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
743 4e159595 Diego Biurrun
SLIBSUF=".dylib"
744 f3b60109 Diego Biurrun
SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
745
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
746 c536cb09 Diego Biurrun
FFSERVERLDFLAGS=-Wl,-bind_at_load
747 d4596ae3 Diego Biurrun
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
748 90cee0c3 Michael Niedermayer
;;
749 732d9245 Bill Eldridge
MINGW32*)
750 951bf3e6 Fabrice Bellard
# Note: the rest of the mingw32 config is done afterwards as mingw32
751 29799f8b Diego Biurrun
# can be forced on the command line for Linux cross compilation.
752 732d9245 Bill Eldridge
mingw32="yes"
753
;;
754 3f027ca7 Felix Bünemann
CYGWIN*)
755 b2828252 Diego Biurrun
targetos=CYGWIN
756 6bc0e1cf Diego Biurrun
shlibdir="$bindir"
757 9d2a0f1c Måns Rullgård
video4linux="no"
758
video4linux2="no"
759 3f027ca7 Felix Bünemann
audio_oss="yes"
760 8aa3ee32 Max Krasnyansky
dv1394="no"
761 07a1b05e Diego Biurrun
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
762 fbb9d104 Víctor Paesa
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
763 3f027ca7 Felix Bünemann
extralibs=""
764 487c2fad Michael Niedermayer
EXESUF=".exe"
765 4581fdff Víctor Paesa
SLIBPREF="cyg"
766
SLIBSUF=".dll"
767
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
768
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
769
SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a'
770 3f027ca7 Felix Bünemann
;;
771 b55e4ef4 Philip Gladstone
Linux)
772 e240ee67 Luca Barbato
LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
773 b55e4ef4 Philip Gladstone
;;
774 99614dd4 Michel Bardiaux
IRIX*)
775 b2828252 Diego Biurrun
targetos=IRIX
776 99614dd4 Michel Bardiaux
ranlib="echo ignoring ranlib"
777 9d2a0f1c Måns Rullgård
video4linux="no"
778
video4linux2="no"
779 99614dd4 Michel Bardiaux
audio_oss="no"
780
make="gmake"
781
;;
782 f3ec2d46 Slavik Gnatenko
OS/2)
783
TMPE=$TMPE".exe"
784 3ca4b654 Michael Niedermayer
ar="emxomfar -p128"
785 69db4e10 Slavik Gnatenko
ranlib="echo ignoring ranlib"
786
strip="echo ignoring strip"
787 30a3e5d4 Nigel Pearson
add_cflags "-Zomf"
788 e89b8b0a Diego Biurrun
FFLDFLAGS="-Zomf -Zstack 16384 -s"
789 3ca4b654 Michael Niedermayer
SHFLAGS="-Zdll -Zomf"
790 c536cb09 Diego Biurrun
FFSERVERLDFLAGS=""
791 f3ec2d46 Slavik Gnatenko
LIBPREF=""
792
LIBSUF=".lib"
793
SLIBPREF=""
794
SLIBSUF=".dll"
795 951bf3e6 Fabrice Bellard
EXESUF=".exe"
796 f3ec2d46 Slavik Gnatenko
extralibs=""
797 c99dd233 j@v2v.cc
pkg_requires=""
798 9d2a0f1c Måns Rullgård
video4linux="no"
799
video4linux2="no"
800 f3ec2d46 Slavik Gnatenko
audio_oss="no"
801 8aa3ee32 Max Krasnyansky
dv1394="no"
802 f3ec2d46 Slavik Gnatenko
ffserver="no"
803 3ca4b654 Michael Niedermayer
vhook="no"
804 f3ec2d46 Slavik Gnatenko
os2="yes"
805 b265431e Måns Rullgård
os2threads="yes"
806 f3ec2d46 Slavik Gnatenko
;;
807 b2828252 Diego Biurrun
*)
808
targetos="${targetos}-UNKNOWN"
809
;;
810 ef0bc4c9 François Revol
esac
811 de6d9b64 Fabrice Bellard
812 0f3cb305 Fabrice Bellard
# find source path
813 997baf01 Måns Rullgård
source_path="`dirname \"$0\"`"
814 0f3cb305 Fabrice Bellard
source_path_used="yes"
815
if test -z "$source_path" -o "$source_path" = "." ; then
816 997baf01 Måns Rullgård
    source_path="`pwd`"
817 0f3cb305 Fabrice Bellard
    source_path_used="no"
818 e7a4dafb Måns Rullgård
else
819
    source_path="`cd \"$source_path\"; pwd`"
820 997baf01 Måns Rullgård
    echo "$source_path" | grep -q '[[:blank:]]' &&
821
      die "Out of tree builds are impossible with whitespace in source path."
822 de6d9b64 Fabrice Bellard
fi
823
824 7d6ed4aa Måns Rullgård
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
825
    show_help
826
fi
827
828 f255e0ab Michel Bardiaux
FFMPEG_CONFIGURATION=" "
829
for opt do
830
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
831
done
832
833 f3902026 Aurelien Jacobs
ENCODER_LIST=`sed -n 's/^[^#]*ENC.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"`
834
DECODER_LIST=`sed -n 's/^[^#]*DEC.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"`
835
PARSER_LIST=`sed -n 's/^[^#]*PARSER.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"`
836 5b9b3b68 Aurelien Jacobs
MUXER_LIST=`sed -n 's/^[^#]*_MUX.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"`
837
DEMUXER_LIST=`sed -n 's/^[^#]*DEMUX.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"`
838 009cf97d Michael Niedermayer
839 a8d04fba Måns Rullgård
enable $ENCODER_LIST $DECODER_LIST $PARSER_LIST $MUXER_LIST $DEMUXER_LIST
840
841 de6d9b64 Fabrice Bellard
for opt do
842 fce53524 Måns Rullgård
  optval="${opt#*=}"
843 de6d9b64 Fabrice Bellard
  case "$opt" in
844 2ba042a7 Måns Rullgård
  --log)
845
  ;;
846 fce53524 Måns Rullgård
  --log=*) logging="$optval"
847 57bd82d4 Måns Rullgård
  ;;
848 e48dc873 Ramiro Polla
  --prefix=*) PREFIX="$optval"
849 de6d9b64 Fabrice Bellard
  ;;
850 e48dc873 Ramiro Polla
  --libdir=*) libdir="$optval"
851 cc973ecb Luca Barbato
  ;;
852 84c22efd Diego Biurrun
  --shlibdir=*) shlibdir="$optval"
853
  ;;
854 fce53524 Måns Rullgård
  --incdir=*) incdir="$optval"
855 1d67a1d4 Diego Biurrun
  ;;
856 fce53524 Måns Rullgård
  --mandir=*) mandir="$optval"
857 23a65308 Fabrice Bellard
  ;;
858 fce53524 Måns Rullgård
  --source-path=*) source_path="$optval"
859 0f3cb305 Fabrice Bellard
  ;;
860 fce53524 Måns Rullgård
  --cross-prefix=*) cross_prefix="$optval"
861 0f3cb305 Fabrice Bellard
  ;;
862 fac252f9 Måns Rullgård
  --cross-compile) cross_compile=yes
863
  ;;
864 fce53524 Måns Rullgård
  --cc=*) cc="$optval"
865 de6d9b64 Fabrice Bellard
  ;;
866 fce53524 Måns Rullgård
  --make=*) make="$optval"
867 4a908fbc Alex Beregszaszi
  ;;
868 30a3e5d4 Nigel Pearson
  --extra-cflags=*) add_cflags "$optval"
869 0f3cb305 Fabrice Bellard
  ;;
870 28d8e661 Diego Biurrun
  --extra-ldflags=*) add_ldflags "$optval"
871 0f3cb305 Fabrice Bellard
  ;;
872 28d8e661 Diego Biurrun
  --extra-libs=*) add_extralibs "$optval"
873 0f3cb305 Fabrice Bellard
  ;;
874 fce53524 Måns Rullgård
  --build-suffix=*) BUILDSUF="$optval"
875 eb94aca9 Charles Yates
  ;;
876 cc6a90dd Guillaume Poirier
  --arch=*) arch="$optval"
877 de6d9b64 Fabrice Bellard
  ;;
878 38d0a8aa Guillaume Poirier
  --cpu=*) cpu="$optval"
879 a4adb608 Michael Niedermayer
  ;;
880 e45a2872 Romain Dolbeau
  --powerpc-perf-enable) powerpc_perf="yes"
881
  ;;
882 de6d9b64 Fabrice Bellard
  --disable-mmx) mmx="no"
883
  ;;
884 1839e854 Siarhei Siamashka
  --disable-armv5te) armv5te="no"
885
  ;;
886 eba9ae3c Gildas Bazin
  --disable-iwmmxt) iwmmxt="no"
887
  ;;
888 ab6c65f6 Brian Foley
  --disable-altivec) altivec="no"
889
  ;;
890 de6d9b64 Fabrice Bellard
  --enable-gprof) gprof="yes"
891
  ;;
892 9d2a0f1c Måns Rullgård
  --disable-v4l) video4linux="no"
893 5cbcf02c Fabrice Bellard
  ;;
894 9d2a0f1c Måns Rullgård
  --disable-v4l2) video4linux2="no"
895 0a7b514f Luca Abeni
  ;;
896 6beefa40 Michael Niedermayer
  --disable-bktr) bktr="no"
897
  ;;
898 5cbcf02c Fabrice Bellard
  --disable-audio-oss) audio_oss="no"
899
  ;;
900 dfdfa47c François Revol
  --disable-audio-beos) audio_beos="no"
901
  ;;
902 8aa3ee32 Max Krasnyansky
  --disable-dv1394) dv1394="no"
903
  ;;
904 ffc0ef96 Luca Abeni
  --disable-network) network="no"; ffserver="no"
905 5cbcf02c Fabrice Bellard
  ;;
906 0c7bb0e5 Luca Barbato
  --disable-ipv6) ipv6="no";
907
  ;;
908 0147f198 François Revol
  --disable-zlib) zlib="no"
909
  ;;
910 ba9261e5 Michael Niedermayer
  --enable-a52) a52="yes"
911 6ed7422a Fabrice Bellard
  ;;
912 bfd2edeb Michael Niedermayer
  --enable-a52bin) a52bin="yes"
913 57514323 Zdenek Kabelac
  ;;
914 c99dd233 j@v2v.cc
  --enable-dts) dts="yes"
915 23c99253 Michael Niedermayer
  ;;
916 ba9261e5 Michael Niedermayer
  --enable-pp) pp="yes"
917 bba9b16c Michael Niedermayer
  ;;
918 bb4c2140 Michael Niedermayer
  --enable-libgsm) libgsm="yes"
919
  ;;
920 c99dd233 j@v2v.cc
  --enable-mp3lame) mp3lame="yes"
921 a6741398 Juanjo
  ;;
922 f956e129 Oded Shimon
  --enable-libnut) libnut="yes"
923
  ;;
924 9146ca37 Måns Rullgård
  --enable-libogg) libogg="yes"
925 c99dd233 j@v2v.cc
    pkg_requires="$pkg_requires ogg >= 1.1"
926 5c5dea3f Nilesh Bansal
  ;;
927 be74741c Måns Rullgård
  --enable-vorbis) libvorbis="yes"
928 c99dd233 j@v2v.cc
    pkg_requires="$pkg_requires vorbis vorbisenc"
929 81e0d0b4 Mark Hills
  ;;
930 445ad18d Zdenek Kabelac
  --enable-faad) faad="yes"
931
  ;;
932
  --enable-faadbin) faadbin="yes"
933
  ;;
934 c99dd233 j@v2v.cc
  --enable-faac) faac="yes"
935 29d48296 Michael Niedermayer
  ;;
936 1ddadfa9 Adam Thayer
  --enable-xvid) xvid="yes"
937
  ;;
938 c99dd233 j@v2v.cc
  --enable-x264) x264="yes"
939 6662ec29 Michael Niedermayer
  ;;
940 8ac17293 Steve L'Homme
  --enable-avisynth) avisynth="yes";
941
  ;;
942 f02be79d Roman Shaposhnik
  --enable-dc1394) dc1394="yes"
943 c99dd233 j@v2v.cc
    pkg_requires="$pkg_requires libraw1394"
944 f02be79d Roman Shaposhnik
  ;;
945 68892110 Philip Gladstone
  --disable-vhook) vhook="no"
946
  ;;
947 732d9245 Bill Eldridge
  --enable-mingw32) mingw32="yes"
948
  ;;
949 860391a5 Måns Rullgård
  --enable-mingwce) wince="yes"
950 ac44871c Gildas Bazin
  ;;
951 320d060a Diego Biurrun
  --enable-static) lstatic="yes"
952
  ;;
953
  --disable-static) lstatic="no"
954
  ;;
955 83286d2a Zdenek Kabelac
  --enable-shared) lshared="yes"
956 0319c531 Nick Kurshev
  ;;
957 320d060a Diego Biurrun
  --disable-shared) lshared="no"
958
  ;;
959 cddf3f45 Glenn Maynard
  --disable-debug) debug="no"
960
  ;;
961
  --disable-opts) optimize="no"
962
  ;;
963 78fcba8f Måns Rullgård
  --enable-extra-warnings) extrawarnings="yes"
964
  ;;
965 1eb2212e Fabrice Bellard
  --disable-mpegaudio-hp) mpegaudio_hp="no"
966
  ;;
967 04f46ced Gildas Bazin
  --disable-protocols) protocols="no"; network="no"; ffserver="no"
968
  ;;
969 786b30af Diego Biurrun
  --disable-ffmpeg) ffmpeg="no"
970
  ;;
971 8154d2e0 Fabrice Bellard
  --disable-ffserver) ffserver="no"
972
  ;;
973 a86b921c Fabrice Bellard
  --disable-ffplay) ffplay="no"
974
  ;;
975 cddf3f45 Glenn Maynard
  --enable-small) optimize="small"
976 553a6284 Michael Niedermayer
  ;;
977 60827a1a Diego Biurrun
  --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
978 891f64b3 joca@rixmail.se
  ;;
979 60827a1a Diego Biurrun
  --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
980 bc634f6f Zdenek Kabelac
  ;;
981 60827a1a Diego Biurrun
  --enable-amr_wb) amr="yes"; amr_wb="yes"
982 115329f1 Diego Biurrun
  ;;
983 60827a1a Diego Biurrun
  --enable-amr_if2) amr="yes"; amr_if2="yes"
984 2a515c08 Torsten Martinsen
  ;;
985 bde24d6e Måns Rullgård
  --enable-sunmlib) mlib="yes"
986 f80f7964 Roman Shaposhnik
  ;;
987 9c3d33d6 Michael Niedermayer
  --enable-pthreads) pthreads="yes"
988
  ;;
989 790c9ca7 Luca Abeni
  --enable-swscaler) swscaler="yes"
990
  ;;
991 b2e3c528 Michael Niedermayer
  --enable-gpl) gpl="yes"
992
  ;;
993 9ddbcae6 Måns Rullgård
  --enable-memalign-hack) memalign_hack="yes"
994 da9b170c Michael Niedermayer
  ;;
995 65d1bea2 Michel Bardiaux
  --disable-strip) dostrip="no"
996
  ;;
997 a8d04fba Måns Rullgård
  --enable-encoder=*) enable ${optval}_encoder
998 009cf97d Michael Niedermayer
  ;;
999 a8d04fba Måns Rullgård
  --enable-decoder=*) enable ${optval}_decoder
1000 f593b273 Diego Biurrun
  ;;
1001 a8d04fba Måns Rullgård
  --disable-encoder=*) disable ${optval}_encoder
1002 f593b273 Diego Biurrun
  ;;
1003 a8d04fba Måns Rullgård
  --disable-decoder=*) disable ${optval}_decoder
1004 009cf97d Michael Niedermayer
  ;;
1005 a8d04fba Måns Rullgård
  --disable-encoders) disable $ENCODER_LIST
1006 009cf97d Michael Niedermayer
  ;;
1007 a8d04fba Måns Rullgård
  --disable-decoders) disable $DECODER_LIST
1008 b4cad537 Emiliano Parasassi
  ;;
1009 a8d04fba Måns Rullgård
  --enable-muxer=*) enable ${optval}_muxer
1010 a9e35095 Diego Biurrun
  ;;
1011 a8d04fba Måns Rullgård
  --disable-muxer=*) disable ${optval}_muxer
1012 ff70e601 Måns Rullgård
  ;;
1013 a8d04fba Måns Rullgård
  --disable-muxers) disable $MUXER_LIST; ffserver="no"
1014 ff70e601 Måns Rullgård
  ;;
1015 a8d04fba Måns Rullgård
  --enable-demuxer=*) enable ${optval}_demuxer
1016 ff70e601 Måns Rullgård
  ;;
1017 a8d04fba Måns Rullgård
  --disable-demuxer=*) disable ${optval}_demuxer
1018 ff70e601 Måns Rullgård
  ;;
1019 a8d04fba Måns Rullgård
  --disable-demuxers) disable $DEMUXER_LIST
1020 a9e35095 Diego Biurrun
  ;;
1021 a8d04fba Måns Rullgård
  --enable-parser=*) enable ${optval}_parser
1022 af9e7d18 Måns Rullgård
  ;;
1023 a8d04fba Måns Rullgård
  --disable-parser=*) disable ${optval}_parser
1024 af9e7d18 Måns Rullgård
  ;;
1025 a8d04fba Måns Rullgård
  --disable-parsers) disable $PARSER_LIST
1026 af9e7d18 Måns Rullgård
  ;;
1027 74c53c2d Måns Rullgård
  --help) show_help
1028
  ;;
1029 b34c63f7 Diego Biurrun
  *)
1030
  echo "Unknown option \"$opt\"."
1031
  echo "See $0 --help for available options."
1032
  exit 1
1033
  ;;
1034 de6d9b64 Fabrice Bellard
  esac
1035
done
1036
1037 720c69da Måns Rullgård
if test "$logging" != no; then
1038
    test "$logging" = yes || logfile="$logging"
1039 57bd82d4 Måns Rullgård
    echo "# $0 $@" >$logfile
1040
    set >>$logfile
1041 2ba042a7 Måns Rullgård
else
1042
    logfile=/dev/null
1043 57bd82d4 Måns Rullgård
fi
1044 e89b8b0a Diego Biurrun
1045 860391a5 Måns Rullgård
if test "$mingw32" = "yes" -o "$wince" = "yes"; then
1046 e67bcdd9 Diego Biurrun
    if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
1047
        cat <<EOF
1048
You can only build one library type at once on MinGW.
1049
Specify --disable-static --enable-shared to only build
1050
the shared libraries. To build only the static libraries
1051
you do not need to pass additional options.
1052
EOF
1053
        exit 1
1054
    fi
1055 9d2a0f1c Måns Rullgård
    video4linux="no"
1056
    video4linux2="no"
1057 e67bcdd9 Diego Biurrun
    bktr="no"
1058
    audio_oss="no"
1059
    dv1394="no"
1060
    dc1394="no"
1061
    ffserver="no"
1062
    network="no"
1063 b265431e Måns Rullgård
    if enabled mingw32; then
1064
        w32threads="yes"
1065
    fi
1066 860391a5 Måns Rullgård
    if test "$wince" = "yes"; then
1067 e67bcdd9 Diego Biurrun
        protocols="no"
1068
    fi
1069
    SLIBPREF=""
1070
    SLIBSUF=".dll"
1071
    EXESUF=".exe"
1072 d6a07a13 Diego Biurrun
    SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
1073
    SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
1074 dfeb80a5 Diego Biurrun
    SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
1075 a77caa4d Måns Rullgård
    SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc"
1076 e67bcdd9 Diego Biurrun
fi
1077
1078 28d8e661 Diego Biurrun
# Combine FFLDFLAGS and the LDFLAGS environment variable.
1079
LDFLAGS="$FFLDFLAGS $LDFLAGS"
1080 e89b8b0a Diego Biurrun
1081 fac252f9 Måns Rullgård
test -n "$cross_prefix" && cross_compile=yes
1082 1ea46bed Måns Rullgård
cc="${cross_prefix}${cc}"
1083
ar="${cross_prefix}${ar}"
1084
ranlib="${cross_prefix}${ranlib}"
1085
strip="${cross_prefix}${strip}"
1086
1087 320d060a Diego Biurrun
# we need to build at least one lib type
1088
if test "$lstatic" = "no" && test "$lshared" = "no" ; then
1089
    cat <<EOF
1090
At least one library type must be built.
1091
Specify --enable-static to build the static libraries or --enable-shared to
1092
build the shared libraries as well. To only build the shared libraries specify
1093
--disable-static in addition to --enable-shared.
1094
EOF
1095
    exit 1;
1096
fi
1097
1098 be74741c Måns Rullgård
if test "$libvorbis" = "yes" ; then
1099 9146ca37 Måns Rullgård
    if test "$libogg" = "no"; then
1100 29799f8b Diego Biurrun
        echo "libogg must be enabled to enable Vorbis."
1101 5c5dea3f Nilesh Bansal
        fail="yes"
1102
    fi
1103
fi
1104
1105 b2e3c528 Michael Niedermayer
if test "$gpl" != "yes"; then
1106 ba64106a Diego Biurrun
    if test "$pp" != "no"; then
1107 29799f8b Diego Biurrun
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
1108 b2e3c528 Michael Niedermayer
        fail="yes"
1109
    fi
1110
1111
    if test "$a52" != "no" -o "$a52bin" != "no"; then
1112 29799f8b Diego Biurrun
        echo "liba52 is under GPL and --enable-gpl is not specified."
1113 b2e3c528 Michael Niedermayer
        fail="yes"
1114
    fi
1115 23c99253 Michael Niedermayer
1116 1ddadfa9 Adam Thayer
    if test "$xvid" != "no"; then
1117 29799f8b Diego Biurrun
        echo "libxvidcore is under GPL and --enable-gpl is not specified."
1118 1ddadfa9 Adam Thayer
        fail="yes"
1119
    fi
1120
1121 6662ec29 Michael Niedermayer
    if test "$x264" != "no"; then
1122 29799f8b Diego Biurrun
        echo "x264 is under GPL and --enable-gpl is not specified."
1123 6662ec29 Michael Niedermayer
        fail="yes"
1124
    fi
1125
1126 23c99253 Michael Niedermayer
    if test "$dts" != "no"; then
1127 29799f8b Diego Biurrun
        echo "libdts is under GPL and --enable-gpl is not specified."
1128 23c99253 Michael Niedermayer
        fail="yes"
1129
    fi
1130 115329f1 Diego Biurrun
1131 b2e3c528 Michael Niedermayer
    if test "$faad" != "no" -o "$faadbin" != "no"; then
1132 dcd479c0 Måns Rullgård
        if check_header faad.h; then
1133
            check_cc << EOF
1134 b2e3c528 Michael Niedermayer
                #include <faad.h>
1135
                #ifndef FAAD2_VERSION
1136
                ok faad1
1137
                #endif
1138
                int main( void ) { return 0; }
1139
EOF
1140 dcd479c0 Måns Rullgård
            if test $? = 0 ; then
1141 29799f8b Diego Biurrun
                echo "FAAD2 is under GPL and --enable-gpl is not specified."
1142 b2e3c528 Michael Niedermayer
                fail="yes"
1143
            fi
1144
        else
1145
            faad="no"
1146
            faadbin="no"
1147 29799f8b Diego Biurrun
            echo "FAAD test failed."
1148 b2e3c528 Michael Niedermayer
        fi
1149
    fi
1150 115329f1 Diego Biurrun
1151 790c9ca7 Luca Abeni
    if test "$swscaler" != "no"; then
1152
        echo "The software scaler is under GPL and --enable-gpl is not specified."
1153
        fail="yes"
1154
    fi
1155 ebb810d9 Ramiro Polla
fi
1156 b2e3c528 Michael Niedermayer
1157 ebb810d9 Ramiro Polla
if test "$fail" = "yes"; then
1158
    exit 1
1159 b2e3c528 Michael Niedermayer
fi
1160
1161 29799f8b Diego Biurrun
# compute MMX state
1162 0f3cb305 Fabrice Bellard
if test $mmx = "default"; then
1163 419b8784 Diego Biurrun
    if test $arch = "x86_32" -o $arch = "x86_64"; then
1164 0f3cb305 Fabrice Bellard
        mmx="yes"
1165
    else
1166
        mmx="no"
1167
    fi
1168
fi
1169
1170 cf9d24ad Dan Christiansen
#Darwin CC versions
1171 75388c74 Michael Niedermayer
needmdynamicnopic="no"
1172 cf9d24ad Dan Christiansen
if test $targetos = Darwin; then
1173 b2924696 Roman Shaposhnik
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1174 30a3e5d4 Nigel Pearson
        add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
1175 cf9d24ad Dan Christiansen
    else
1176 bb270c08 Diego Biurrun
        gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
1177
        case "$gcc_version" in
1178
            *2.95*)
1179 30a3e5d4 Nigel Pearson
                add_cflags "-no-cpp-precomp -pipe"
1180 bb270c08 Diego Biurrun
                ;;
1181
            *[34].*)
1182 30a3e5d4 Nigel Pearson
                add_cflags "-no-cpp-precomp -pipe -force_cpusubtype_ALL -Wno-sign-compare"
1183 bb270c08 Diego Biurrun
                if test "$lshared" = no; then
1184
                   needmdynamicnopic="yes"
1185
                fi
1186
                ;;
1187
            *)
1188 30a3e5d4 Nigel Pearson
                add_cflags "-no-cpp-precomp -pipe"
1189 bb270c08 Diego Biurrun
                if test "$lshared" = no; then
1190
                   needmdynamicnopic="yes"
1191
                fi
1192
                ;;
1193
        esac
1194 cf9d24ad Dan Christiansen
    fi
1195 2a1a6b64 Michael Niedermayer
fi
1196
1197
if test $optimize != "no"; then
1198
    add_cflags "-fomit-frame-pointer"
1199 cf9d24ad Dan Christiansen
fi
1200
1201 ab6c65f6 Brian Foley
# Can only do AltiVec on PowerPC
1202
if test $altivec = "default"; then
1203 cc6a90dd Guillaume Poirier
    if test $arch = "powerpc"; then
1204 ab6c65f6 Brian Foley
        altivec="yes"
1205
    else
1206
        altivec="no"
1207
    fi
1208
fi
1209
1210 a4adb608 Michael Niedermayer
# Add processor-specific flags
1211 9007f514 Romain Dolbeau
POWERPCMODE="32bits"
1212 38d0a8aa Guillaume Poirier
if test $cpu != "generic"; then
1213
    case $cpu in
1214 bb270c08 Diego Biurrun
        601|ppc601|PowerPC601)
1215 1c5d830c Guillaume Poirier
            add_cflags "-mcpu=601"
1216 bb270c08 Diego Biurrun
            if test $altivec = "yes"; then
1217
                echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
1218
            fi
1219
        ;;
1220
        603*|ppc603*|PowerPC603*)
1221 1c5d830c Guillaume Poirier
            add_cflags "-mcpu=603"
1222 bb270c08 Diego Biurrun
            if test $altivec = "yes"; then
1223
                echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
1224
            fi
1225
        ;;
1226
        604*|ppc604*|PowerPC604*)
1227 1c5d830c Guillaume Poirier
            add_cflags "-mcpu=604"
1228 bb270c08 Diego Biurrun
            if test $altivec = "yes"; then
1229
                echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
1230
            fi
1231
        ;;
1232
        G3|g3|75*|ppc75*|PowerPC75*)
1233 1c5d830c Guillaume Poirier
            add_cflags "-mcpu=750 -mpowerpc-gfxopt"
1234 bb270c08 Diego Biurrun
            if test $altivec = "yes"; then
1235
                echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
1236
            fi
1237
        ;;
1238
        G4|g4|745*|ppc745*|PowerPC745*)
1239 1c5d830c Guillaume Poirier
            add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
1240 bb270c08 Diego Biurrun
            if test $altivec = "no"; then
1241
                echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
1242
            fi
1243
        ;;
1244
        74*|ppc74*|PowerPC74*)
1245 1c5d830c Guillaume Poirier
            add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
1246 bb270c08 Diego Biurrun
            if test $altivec = "no"; then
1247
                echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
1248
            fi
1249
        ;;
1250
        G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
1251 1c5d830c Guillaume Poirier
            add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
1252 bb270c08 Diego Biurrun
            if test $altivec = "no"; then
1253
                echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
1254
            fi
1255 9007f514 Romain Dolbeau
            POWERPCMODE="64bits"
1256 bb270c08 Diego Biurrun
        ;;
1257 e7768fc5 Guillaume Poirier
        # targets that do NOT support conditional mov (cmov)
1258
        i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
1259 38d0a8aa Guillaume Poirier
            add_cflags "-march=$cpu"
1260 e7768fc5 Guillaume Poirier
            cmov="no"
1261
        ;;
1262
        # targets that do support conditional mov (cmov)
1263 94e4c3a3 Guillaume Poirier
        i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx)
1264 e7768fc5 Guillaume Poirier
            add_cflags "-march=$cpu"
1265 4c8d81fa Guillaume Poirier
            cmov="yes"
1266 94e4c3a3 Guillaume Poirier
            cmov_is_fast="yes"
1267
        ;;
1268
        # targets that do support conditional mov but on which it's slow
1269
        pentium4|prescott|nocona)
1270
            add_cflags "-march=$cpu"
1271
            cmov="yes"
1272
            cmov_is_fast="no"
1273 bb270c08 Diego Biurrun
        ;;
1274 d7b34d08 Diego Biurrun
        sparc64)
1275 1c5d830c Guillaume Poirier
            add_cflags "-mcpu=v9"
1276 d7b34d08 Diego Biurrun
        ;;
1277 bb270c08 Diego Biurrun
        *)
1278 38d0a8aa Guillaume Poirier
        echo "WARNING: Unknown CPU \"$cpu\", ignored."
1279 bb270c08 Diego Biurrun
        ;;
1280 a4adb608 Michael Niedermayer
    esac
1281
fi
1282
1283 be0d52ab Måns Rullgård
# make sure we can execute files in $TMPDIR
1284
cat >$TMPE 2>>$logfile <<EOF
1285
#! /bin/sh
1286
EOF
1287
chmod +x $TMPE >>$logfile 2>&1
1288
if ! $TMPE >>$logfile 2>&1; then
1289
    cat <<EOF
1290
Unable to create and execute files in $TMPDIR1.  Set the TMPDIR environment
1291 68300911 Diego Biurrun
variable to another directory and make sure that $TMPDIR1 is not mounted
1292
noexec.
1293 be0d52ab Måns Rullgård
EOF
1294
    die "Sanity test failed."
1295
fi
1296 0244f743 Måns Rullgård
rm $TMPE
1297 be0d52ab Måns Rullgård
1298 1a268acc Måns Rullgård
# compiler sanity check
1299
check_exec <<EOF
1300
int main(){
1301
    return 0;
1302
}
1303
EOF
1304
if test "$?" != 0; then
1305
    echo "$cc is unable to create an executable file."
1306
    if test -z "$cross_prefix" -a "$cross_compile" = no; then
1307
        echo "If $cc is a cross-compiler, use the --cross-compile option."
1308 c7ae6345 Måns Rullgård
        echo "Only do this if you know what cross compiling means."
1309 1a268acc Måns Rullgård
    fi
1310
    die "C compiler test failed."
1311
fi
1312
1313 87ea51e0 Luca Barbato
# check for assembler specific support
1314
1315 cc6a90dd Guillaume Poirier
if test $arch = "powerpc"; then
1316 87ea51e0 Luca Barbato
check_cc <<EOF && dcbzl=yes
1317
int main(void) {
1318
    register long zero = 0;
1319
    char data[1024];
1320
    asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
1321
return 0;
1322
}
1323
EOF
1324
fi
1325
1326 57bd82d4 Måns Rullgård
# check for SIMD availability
1327
1328 115329f1 Diego Biurrun
# AltiVec flags: The FSF version of GCC differs from the Apple version
1329 cc6a90dd Guillaume Poirier
if test $arch = "powerpc"; then
1330 b6e52719 Magnus Damm
    if test $altivec = "yes"; then
1331 b2924696 Roman Shaposhnik
        if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
1332 30a3e5d4 Nigel Pearson
            add_cflags "-faltivec"
1333 b6e52719 Magnus Damm
        else
1334 30a3e5d4 Nigel Pearson
            add_cflags "-maltivec -mabi=altivec"
1335 b6e52719 Magnus Damm
        fi
1336
    fi
1337
fi
1338
1339 0701ca7f Måns Rullgård
check_header altivec.h
1340 a9a07762 Michael Niedermayer
1341 29799f8b Diego Biurrun
# check if our compiler supports Motorola AltiVec C API
1342 ab6c65f6 Brian Foley
if test $altivec = "yes"; then
1343 6e7a01e4 Måns Rullgård
    if test $altivec_h = "yes"; then
1344 f25fc9b1 Måns Rullgård
        inc_altivec_h="#include <altivec.h>"
1345
    else
1346
        inc_altivec_h=
1347
    fi
1348
    check_cc <<EOF || altivec=no
1349 dcd479c0 Måns Rullgård
$inc_altivec_h
1350 a9a07762 Michael Niedermayer
int main(void) {
1351
    vector signed int v1, v2, v3;
1352
    v1 = vec_add(v2,v3);
1353
    return 0;
1354
}
1355
EOF
1356
fi
1357 ab6c65f6 Brian Foley
1358 854fdb51 Måns Rullgård
# check armv5te instructions support
1359 cc6a90dd Guillaume Poirier
if test $armv5te = "default" -a $arch = "armv4l"; then
1360 854fdb51 Måns Rullgård
    armv5te=no
1361
    check_cc <<EOF && armv5te=yes
1362
        int main(void) {
1363
        __asm__ __volatile__ ("qadd r0, r0, r0");
1364
        }
1365
EOF
1366
fi
1367
1368
# check iwmmxt support
1369 cc6a90dd Guillaume Poirier
if test $iwmmxt = "default" -a $arch = "armv4l"; then
1370 854fdb51 Måns Rullgård
    iwmmxt=no
1371
    check_cc <<EOF && iwmmxt=yes
1372
        int main(void) {
1373
        __asm__ __volatile__ ("wunpckelub wr6, wr4");
1374
        }
1375
EOF
1376
fi
1377
1378 29799f8b Diego Biurrun
# mmi only available on mips
1379 d46aba26 Leon van Stuivenberg
if test $mmi = "default"; then
1380 cc6a90dd Guillaume Poirier
    if test $arch = "mips"; then
1381 d46aba26 Leon van Stuivenberg
        mmi="yes"
1382
    else
1383
        mmi="no"
1384
    fi
1385
fi
1386
1387 29799f8b Diego Biurrun
# check if our compiler supports mmi
1388 57bd82d4 Måns Rullgård
enabled mmi && check_cc <<EOF || mmi="no"
1389 d46aba26 Leon van Stuivenberg
int main(void) {
1390
    __asm__ ("lq \$2, 0(\$2)");
1391
    return 0;
1392
}
1393
EOF
1394 57bd82d4 Måns Rullgård
1395
# ---
1396
# big/little-endian test
1397 fac252f9 Måns Rullgård
if test "$cross_compile" = "no"; then
1398 57bd82d4 Måns Rullgård
    check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
1399 a3999908 Michael Niedermayer
#include <inttypes.h>
1400
int main(int argc, char ** argv){
1401 bb270c08 Diego Biurrun
        volatile uint32_t i=0x01234567;
1402
        return (*((uint8_t*)(&i))) == 0x67;
1403 a3999908 Michael Niedermayer
}
1404
EOF
1405 487a54d7 Fabrice Bellard
else
1406 f25fc9b1 Måns Rullgård
    # programs cannot be launched if cross compiling, so make a static guess
1407 cc6a90dd Guillaume Poirier
    if test "$arch" = "powerpc" -o "$arch" = "mips" ; then
1408 f25fc9b1 Måns Rullgård
        bigendian="yes"
1409
    fi
1410 487a54d7 Fabrice Bellard
fi
1411
1412 a3999908 Michael Niedermayer
# ---
1413 3d204385 Nick Kurshev
# check availability of some header files
1414
1415 0701ca7f Måns Rullgård
check_header malloc.h
1416
check_func memalign
1417 3d204385 Nick Kurshev
1418 1981aafc Måns Rullgård
if test "$memalign" = "no" -a "$mmx" = "yes" -a \
1419 9ddbcae6 Måns Rullgård
        "$memalign_hack" != "yes" -a "$targetos" != "Darwin" -a \
1420 a9907393 Dennis Melentyev
        "$targetos" != "FreeBSD" ; then
1421 57bd82d4 Måns Rullgård
    die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
1422 8bf5d58f Michael Niedermayer
fi
1423
1424 0701ca7f Måns Rullgård
check_header byteswap.h
1425 47d23bbf Måns Rullgård
1426 0701ca7f Måns Rullgård
check_func inet_aton
1427
check_func localtime_r
1428 57bd82d4 Måns Rullgård
enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
1429
1430
# check for some common methods of building with pthread support
1431
# do this before the optional library checks as some of them require pthreads
1432
if enabled pthreads; then
1433 9e7fd101 Måns Rullgård
    if check_func pthread_create; then
1434
        :
1435
    elif check_func pthread_create -pthread; then
1436
        add_cflags -pthread
1437
        add_ldflags -pthread
1438
    elif check_func pthread_create -pthreads; then
1439
        add_cflags -pthreads
1440
        add_ldflags -pthreads
1441
    elif ! check_lib pthread.h pthread_create -lpthread; then
1442
        die "ERROR: can't find pthreads library"
1443
    fi
1444 57bd82d4 Måns Rullgård
fi
1445
1446
# these are off by default, so fail if requested and not available
1447 4cbed916 Måns Rullgård
enabled dts     && require libdts dts.h dts_init -ldts -lm
1448 57bd82d4 Måns Rullgård
enabled libgsm  && require libgsm gsm.h gsm_create -lgsm
1449 4cbed916 Måns Rullgård
enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
1450 be74741c Måns Rullgård
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc -logg
1451 aedf11f8 Måns Rullgård
enabled libogg  && require libogg ogg/ogg.h ogg_sync_init -logg
1452 4d8aa1c3 Oded Shimon
enabled libnut  && require libnut libnut.h nut_demuxer_init -lnut
1453 57bd82d4 Måns Rullgård
enabled xvid    && require XviD xvid.h xvid_global -lxvidcore
1454
enabled x264    && require x264 x264.h x264_encoder_open -lx264
1455
enabled dc1394  && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
1456 bde24d6e Måns Rullgård
enabled mlib    && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
1457 e0f80bd7 Reimar Döffinger
1458 3b9bee88 Måns Rullgård
# Ugh, faac uses stdcall calling convention on win32 so we can't use
1459
# the generic test functions
1460
if enabled faac; then
1461
    save_flags
1462
    temp_extralibs -lfaac
1463
    check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found"
1464
#include <stdint.h>
1465
#include <faac.h>
1466
int main(){
1467
    char *id, *cpr;
1468
    faacEncGetVersion(&id, &cpr);
1469
    return 0;
1470
}
1471
EOF
1472
    restore_flags
1473
fi
1474
1475 87f1c97e Måns Rullgård
# Ugh, recent faad2 versions have renamed all functions and #define the
1476
# old names in faad.h.  Generic tests won't work.
1477
if enabled faad; then
1478
    save_flags
1479
    temp_extralibs -lfaad
1480
    check_ld <<EOF && add_extralibs -lfaad || die "ERROR: libfaad not found"
1481
#include <faad.h>
1482
int main(){
1483
    faacDecOpen();
1484
    return 0;
1485
}
1486
EOF
1487
    restore_flags
1488
fi
1489
1490 8ac17293 Steve L'Homme
# Ugh, avisynth uses WINAPI calls. Generic tests won't work.
1491
if enabled avisynth; then
1492
    save_flags
1493
    temp_extralibs -lvfw32
1494
    check_ld <<EOF && add_extralibs -lvfw32 || die "ERROR: vfw32 not found"
1495
#include <windows.h>
1496
#include <vfw.h>
1497
int main(){
1498
    AVIFileInit();
1499
    return 0;
1500
}
1501
EOF
1502
    restore_flags
1503
fi
1504
1505
1506 95e2ce4a Michael Niedermayer
# test for lrintf in math.h
1507 fc2b267f Måns Rullgård
check_exec <<EOF && lrintf=yes || lrintf=no
1508 95e2ce4a Michael Niedermayer
#define _ISOC9X_SOURCE  1
1509
#include <math.h>
1510
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1511
EOF
1512
1513 c13e1abd Falk Hüffner
_restrict=
1514
for restrict_keyword in restrict __restrict__ __restrict; do
1515 57bd82d4 Måns Rullgård
    check_cc <<EOF && _restrict=$restrict_keyword && break
1516 dcd479c0 Måns Rullgård
void foo(char * $restrict_keyword p);
1517
EOF
1518 c13e1abd Falk Hüffner
done
1519
1520 a8721c09 Fabrice Bellard
# dlopen/dlfcn.h probing
1521
1522 0701ca7f Måns Rullgård
check_header dlfcn.h
1523 a8721c09 Fabrice Bellard
1524 dcd479c0 Måns Rullgård
if check_func dlopen; then
1525
    ldl=
1526 0701ca7f Måns Rullgård
elif check_func dlopen -ldl; then
1527
    ldl=-ldl
1528 a8721c09 Fabrice Bellard
fi
1529
1530 f25fc9b1 Måns Rullgård
if test "$vhook" = "default"; then
1531
    vhook="$dlopen"
1532 a8721c09 Fabrice Bellard
fi
1533
1534 22df6d18 Måns Rullgård
if enabled_any vhook a52bin faadbin; then
1535 57bd82d4 Måns Rullgård
    add_extralibs $ldl
1536 bfd2edeb Michael Niedermayer
fi
1537
1538 fbb9d104 Víctor Paesa
if test "$targetos" = "CYGWIN" -a "$lstatic" = "yes" ; then
1539
    vhook="no"
1540
    echo
1541
    echo "At the moment vhooks don't work on Cygwin static builds."
1542
    echo "Patches welcome."
1543
    echo
1544
fi
1545
1546 8d923001 Måns Rullgård
if enabled vhook; then
1547
    check_ldflags -rdynamic
1548
    check_ldflags -export-dynamic
1549
fi
1550 bfd2edeb Michael Niedermayer
1551 9464f2b8 Diego Biurrun
if enabled audio_beos; then
1552
    add_extralibs "-lmedia -lbe"
1553
fi
1554
1555 a86b921c Fabrice Bellard
##########################################
1556 29799f8b Diego Biurrun
# imlib check
1557 a86b921c Fabrice Bellard
1558 dcd479c0 Måns Rullgård
temp_extralibs -lImlib2
1559
check_ld <<EOF && imlib2=yes || imlib2=no
1560 a8721c09 Fabrice Bellard
#include <X11/Xlib.h>
1561
#include <Imlib2.h>
1562
int main( void ) { return (int) imlib_load_font("foo"); }
1563
EOF
1564 dcd479c0 Måns Rullgård
restore_flags
1565 52b41d7f Fabrice Bellard
1566 a86b921c Fabrice Bellard
##########################################
1567 29799f8b Diego Biurrun
# FreeType check
1568 a86b921c Fabrice Bellard
1569 04511d53 Philip Gladstone
freetype2=no
1570 e2a5fd20 Michael Niedermayer
if test "x$targetos" != "xBeOS"; then
1571 e2a3cd59 Roman Shaposhnik
  if (freetype-config --version) >/dev/null 2>&1 ; then
1572 dcd479c0 Måns Rullgård
      temp_cflags `freetype-config --cflags`
1573
      temp_extralibs `freetype-config --libs`
1574
      check_ld <<EOF && freetype2=yes
1575
#include <ft2build.h>
1576
int main( void ) { return (int) FT_Init_FreeType(0); }
1577
EOF
1578
      restore_flags
1579 dee076fc François Revol
  fi
1580 04511d53 Philip Gladstone
fi
1581
1582 a86b921c Fabrice Bellard
##########################################
1583 29799f8b Diego Biurrun
# SDL check
1584 a86b921c Fabrice Bellard
1585
sdl_too_old=no
1586
sdl=no
1587 6a1a892f Frantisek Dvorak
SDL_CONFIG="${cross_prefix}sdl-config"
1588
if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
1589 dcd479c0 Måns Rullgård
    temp_cflags `"${SDL_CONFIG}" --cflags`
1590
    temp_extralibs `"${SDL_CONFIG}" --libs`
1591
    check_ld <<EOF
1592
#include <SDL.h>
1593
#undef main /* We don't want SDL to override our main() */
1594
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1595
EOF
1596
    if test $? = 0; then
1597
        _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
1598 29f3b38a Måns Rullgård
        if test "$_sdlversion" -lt 121 ; then
1599 dcd479c0 Måns Rullgård
            sdl_too_old=yes
1600
        else
1601
            sdl=yes
1602 29f3b38a Måns Rullgård
            check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no
1603
#include <SDL.h>
1604
int main(void){
1605
    const SDL_VideoInfo *vi = SDL_GetVideoInfo();
1606
    int w = vi->current_w;
1607
    return 0;
1608
}
1609
EOF
1610 dcd479c0 Måns Rullgård
        fi
1611
    fi
1612 29f3b38a Måns Rullgård
    restore_flags
1613 c3f6b472 Michael Niedermayer
fi
1614 a86b921c Fabrice Bellard
1615 57bd82d4 Måns Rullgård
enabled sdl || ffplay=no
1616
1617 146ea952 Nicolas Boos
##########################################
1618 29799f8b Diego Biurrun
# texi2html check
1619 146ea952 Nicolas Boos
1620
texi2html=no
1621 e2a3cd59 Roman Shaposhnik
if (texi2html -version) >/dev/null 2>&1; then
1622 146ea952 Nicolas Boos
texi2html=yes
1623
fi
1624
1625 7a91333f Hans Zandbelt
##########################################
1626 29799f8b Diego Biurrun
# IPv6 check
1627 7a91333f Hans Zandbelt
1628 0c7bb0e5 Luca Barbato
enabled network && enabled ipv6 && check_ld <<EOF && ipv6=yes || ipv6=no
1629 7a91333f Hans Zandbelt
#include <sys/types.h>
1630
#include <sys/socket.h>
1631
#include <netinet/in.h>
1632
#include <netdb.h>
1633
int main( void ) {
1634
  struct sockaddr_storage saddr;
1635
  struct ipv6_mreq mreq6;
1636
  getaddrinfo(0,0,0,0);
1637
  getnameinfo(0,0,0,0,0,0,0);
1638 12fe88b4 Dan Villiom Podlaski Christiansen
  IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
1639 7a91333f Hans Zandbelt
}
1640
EOF
1641
1642 47f38850 Luca Abeni
# check for video4linux2 --- V4L2_PIX_FMT_YUV420
1643 9d2a0f1c Måns Rullgård
enabled video4linux2 && check_cc <<EOF || video4linux2="no"
1644 84fe9963 Alex Beregszaszi
#include <sys/time.h>
1645 f743a062 Luca Abeni
#include <asm/types.h>
1646
#include <linux/videodev2.h>
1647 47f38850 Luca Abeni
int dummy = V4L2_PIX_FMT_YUV420;
1648 490c189b Luca Abeni
struct v4l2_buffer dummy1;
1649 47f38850 Luca Abeni
EOF
1650
1651 57bd82d4 Måns Rullgård
enabled debug && add_cflags -g
1652
1653
# add some useful compiler flags if supported
1654
check_cflags -Wdeclaration-after-statement
1655 dcd479c0 Måns Rullgård
check_cflags -Wall
1656
check_cflags -Wno-switch
1657 c07bd6a9 Michael Niedermayer
check_cflags -Wdisabled-optimization
1658
check_cflags -Wpointer-arith
1659
check_cflags -Wredundant-decls
1660 78fcba8f Måns Rullgård
enabled extrawarnings && check_cflags -Winline
1661 cf9d24ad Dan Christiansen
1662 57bd82d4 Måns Rullgård
# add some linker flags
1663 e240ee67 Luca Barbato
check_ldflags $LDLATEFLAGS
1664 94a3401e Fabrice Bellard
1665 57bd82d4 Måns Rullgård
# not all compilers support -Os
1666
test "$optimize" = "small" && check_cflags -Os
1667 cddf3f45 Glenn Maynard
1668 57bd82d4 Måns Rullgård
if enabled optimize; then
1669 b2924696 Roman Shaposhnik
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1670 30a3e5d4 Nigel Pearson
        add_cflags  "-O5"
1671
        add_ldflags "-O5"
1672 cf9d24ad Dan Christiansen
    else
1673 30a3e5d4 Nigel Pearson
        add_cflags "-O3"
1674 cf9d24ad Dan Christiansen
    fi
1675 cddf3f45 Glenn Maynard
fi
1676
1677 80581e98 Michael Niedermayer
# PIC flags for shared library objects where they are needed
1678
if test "$lshared" = "yes" ; then
1679 f25fc9b1 Måns Rullgård
    # LIBOBJFLAGS may have already been set in the OS configuration
1680
    if test -z "$LIBOBJFLAGS" ; then
1681 cc6a90dd Guillaume Poirier
        case "$arch" in
1682 813457e5 Måns Rullgård
            x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;;
1683
        esac
1684 80581e98 Michael Niedermayer
    fi
1685
fi
1686
1687 1db54e20 Diego Biurrun
if test "$gprof" = "yes" ; then
1688 30a3e5d4 Nigel Pearson
    add_cflags  "-p"
1689
    add_ldflags "-p"
1690 1db54e20 Diego Biurrun
fi
1691
1692 18451f7d Måns Rullgård
VHOOKCFLAGS="-fPIC $CFLAGS"
1693
test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
1694
1695 4454dc1b John Dalgliesh
# find if .align arg is power-of-two or not
1696
if test $asmalign_pot = "unknown"; then
1697
    asmalign_pot="no"
1698
    echo 'asm (".align 3");' | check_cc && asmalign_pot="yes"
1699
fi
1700
1701 2266e085 Diego Biurrun
echo "install prefix   $PREFIX"
1702 29799f8b Diego Biurrun
echo "source path      $source_path"
1703 de6d9b64 Fabrice Bellard
echo "C compiler       $cc"
1704 4a908fbc Alex Beregszaszi
echo "make             $make"
1705 38d0a8aa Guillaume Poirier
echo "ARCH             $arch ($cpu)"
1706 eb94aca9 Charles Yates
if test "$BUILDSUF" != ""; then
1707 f25fc9b1 Måns Rullgård
    echo "build suffix     $BUILDSUF"
1708 eb94aca9 Charles Yates
fi
1709 29799f8b Diego Biurrun
echo "big-endian       $bigendian"
1710 419b8784 Diego Biurrun
if test $arch = "x86_32" -o $arch = "x86_64"; then
1711 f25fc9b1 Måns Rullgård
    echo "MMX enabled      $mmx"
1712 e7768fc5 Guillaume Poirier
    echo "CMOV enabled     $cmov"
1713 94e4c3a3 Guillaume Poirier
    echo "CMOV is fast     $cmov_is_fast"
1714 e41e8342 Fabrice Bellard
fi
1715 cc6a90dd Guillaume Poirier
if test $arch = "armv4l"; then
1716 1839e854 Siarhei Siamashka
    echo "ARMv5TE enabled  $armv5te"
1717 f25fc9b1 Måns Rullgård
    echo "IWMMXT enabled   $iwmmxt"
1718 eba9ae3c Gildas Bazin
fi
1719 cc6a90dd Guillaume Poirier
if test $arch = "mips"; then
1720 f25fc9b1 Måns Rullgård
    echo "MMI enabled      $mmi"
1721 e41e8342 Fabrice Bellard
fi
1722 cc6a90dd Guillaume Poirier
if test $arch = "powerpc"; then
1723 f25fc9b1 Måns Rullgård
    echo "AltiVec enabled  $altivec"
1724 87ea51e0 Luca Barbato
    echo "dcbzl available  $dcbzl"
1725 e41e8342 Fabrice Bellard
fi
1726 de6d9b64 Fabrice Bellard
echo "gprof enabled    $gprof"
1727 0147f198 François Revol
echo "zlib enabled     $zlib"
1728 bb4c2140 Michael Niedermayer
echo "libgsm enabled   $libgsm"
1729 a6741398 Juanjo
echo "mp3lame enabled  $mp3lame"
1730 f956e129 Oded Shimon
echo "libnut enabled   $libnut"
1731 9146ca37 Måns Rullgård
echo "libogg enabled   $libogg"
1732 be74741c Måns Rullgård
echo "Vorbis enabled   $libvorbis"
1733 29799f8b Diego Biurrun
echo "FAAD enabled     $faad"
1734 445ad18d Zdenek Kabelac
echo "faadbin enabled  $faadbin"
1735 29799f8b Diego Biurrun
echo "FAAC enabled     $faac"
1736
echo "XviD enabled     $xvid"
1737 6662ec29 Michael Niedermayer
echo "x264 enabled     $x264"
1738 5cbcf02c Fabrice Bellard
echo "a52 support      $a52"
1739 57514323 Zdenek Kabelac
echo "a52 dlopened     $a52bin"
1740 29799f8b Diego Biurrun
echo "DTS support      $dts"
1741 bba9b16c Michael Niedermayer
echo "pp support       $pp"
1742 790c9ca7 Luca Abeni
echo "Software Scaler enabled $swscaler"
1743 8ac17293 Steve L'Homme
echo "AVISynth enabled $avisynth"
1744 cddf3f45 Glenn Maynard
echo "debug symbols    $debug"
1745 65d1bea2 Michel Bardiaux
echo "strip symbols    $dostrip"
1746 cddf3f45 Glenn Maynard
echo "optimize         $optimize"
1747 320d060a Diego Biurrun
echo "static           $lstatic"
1748 1ddf5ba1 Diego Biurrun
echo "shared           $lshared"
1749 29799f8b Diego Biurrun
echo "video hooking    $vhook"
1750 a86b921c Fabrice Bellard
echo "SDL support      $sdl"
1751
if test $sdl_too_old = "yes"; then
1752 f25fc9b1 Måns Rullgård
    echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
1753 a86b921c Fabrice Bellard
fi
1754 68892110 Philip Gladstone
1755 f25fc9b1 Måns Rullgård
if test "$vhook" = "yes"; then
1756
    echo "Imlib2 support   $imlib2"
1757
    echo "FreeType support $freetype2"
1758 68892110 Philip Gladstone
fi
1759 bde24d6e Måns Rullgård
echo "Sun medialib support"  $mlib
1760 9c3d33d6 Michael Niedermayer
echo "pthreads support"      $pthreads
1761 bc634f6f Zdenek Kabelac
echo "AMR-NB float support"  $amr_nb
1762
echo "AMR-NB fixed support"  $amr_nb_fixed
1763 d663a1fd Michael Niedermayer
echo "AMR-WB float support"  $amr_wb
1764 2a515c08 Torsten Martinsen
echo "AMR-WB IF2 support"    $amr_if2
1765 7a91333f Hans Zandbelt
echo "network support      $network"
1766
if test "$network" = "yes" ; then
1767 f25fc9b1 Måns Rullgård
    echo "IPv6 support         $ipv6"
1768 7a91333f Hans Zandbelt
fi
1769 4454dc1b John Dalgliesh
echo ".align is power-of-two" $asmalign_pot
1770 b2e3c528 Michael Niedermayer
if test "$gpl" = "no" ; then
1771 f25fc9b1 Måns Rullgård
    echo "License: LGPL"
1772 b2e3c528 Michael Niedermayer
else
1773 f25fc9b1 Måns Rullgård
    echo "License: GPL"
1774 b2e3c528 Michael Niedermayer
fi
1775 de6d9b64 Fabrice Bellard
1776 29799f8b Diego Biurrun
echo "Creating config.mak and config.h..."
1777 de6d9b64 Fabrice Bellard
1778 29799f8b Diego Biurrun
echo "# Automatically generated by configure - do not modify!" > config.mak
1779
echo "/* Automatically generated by configure - do not modify! */" > $TMPH
1780 f255e0ab Michel Bardiaux
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1781 de6d9b64 Fabrice Bellard
1782 2266e085 Diego Biurrun
echo "PREFIX=$PREFIX" >> config.mak
1783
echo "prefix=\$(DESTDIR)\${PREFIX}" >> config.mak
1784 9a695e98 Diego Biurrun
echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1785 84c22efd Diego Biurrun
echo "shlibdir=\$(DESTDIR)$shlibdir" >> config.mak
1786 1d67a1d4 Diego Biurrun
echo "incdir=\$(DESTDIR)$incdir" >> config.mak
1787 9a695e98 Diego Biurrun
echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1788
echo "mandir=\$(DESTDIR)$mandir" >> config.mak
1789 4a908fbc Alex Beregszaszi
echo "MAKE=$make" >> config.mak
1790 980fc7b8 Fabrice Bellard
echo "CC=$cc" >> config.mak
1791
echo "AR=$ar" >> config.mak
1792 be7109c1 Michael Niedermayer
echo "RANLIB=$ranlib" >> config.mak
1793 65d1bea2 Michel Bardiaux
if test "$dostrip" = "yes" ; then
1794 f25fc9b1 Måns Rullgård
    echo "STRIP=$strip" >> config.mak
1795
    echo "INSTALLSTRIP=$installstrip" >> config.mak
1796 65d1bea2 Michel Bardiaux
else
1797 f25fc9b1 Måns Rullgård
    echo "STRIP=echo ignoring strip" >> config.mak
1798
    echo "INSTALLSTRIP=" >> config.mak
1799 65d1bea2 Michel Bardiaux
fi
1800 75388c74 Michael Niedermayer
1801 a9b3f630 Nick Kurshev
echo "OPTFLAGS=$CFLAGS" >> config.mak
1802 408382a4 Diego Biurrun
echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak
1803 0f3cb305 Fabrice Bellard
echo "LDFLAGS=$LDFLAGS" >> config.mak
1804 f39e56a8 Jacob Meuser
echo "LDCONFIG=$LDCONFIG" >> config.mak
1805 c536cb09 Diego Biurrun
echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
1806 e1707f52 Michael Niedermayer
echo "SHFLAGS=$SHFLAGS" >> config.mak
1807 408382a4 Diego Biurrun
echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
1808 fbb9d104 Víctor Paesa
echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
1809 80581e98 Michael Niedermayer
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
1810 b12f8273 Diego Biurrun
echo "BUILD_STATIC=$lstatic" >> config.mak
1811 eb94aca9 Charles Yates
echo "BUILDSUF=$BUILDSUF" >> config.mak
1812 f3ec2d46 Slavik Gnatenko
echo "LIBPREF=$LIBPREF" >> config.mak
1813 eb94aca9 Charles Yates
echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
1814 320d060a Diego Biurrun
if test "$lstatic" = "yes" ; then
1815
  echo "LIB=$LIB" >> config.mak
1816 1a44a8b6 Alexander Strasser
else # Some Make complain if this variable does not exist.
1817
  echo "LIB=" >> config.mak
1818 320d060a Diego Biurrun
fi
1819 f3ec2d46 Slavik Gnatenko
echo "SLIBPREF=$SLIBPREF" >> config.mak
1820 eb94aca9 Charles Yates
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1821
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
1822 b2828252 Diego Biurrun
echo "TARGET_OS=$targetos" >> config.mak
1823 4dc62701 Måns Rullgård
1824
ucarch=`toupper $arch`
1825
echo "TARGET_ARCH_${ucarch}=yes" >> config.mak
1826
echo "#define ARCH_${ucarch} 1" >> $TMPH
1827
1828
# special cases
1829
case "$arch" in
1830
    x86_32|x86_64)
1831
        echo "TARGET_ARCH_X86=yes" >> config.mak
1832
        echo "#define ARCH_X86 1" >> $TMPH
1833
        ;;
1834
    powerpc)
1835
        if test "$POWERPCMODE" = "64bits"; then
1836
            echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1837
        fi
1838
        if test "$powerpc_perf" = "yes"; then
1839
            echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1840
        fi
1841
        ;;
1842
    sparc64)
1843
        echo "TARGET_ARCH_SPARC=yes" >> config.mak
1844
        echo "#define ARCH_SPARC 1" >> $TMPH
1845
        ;;
1846
esac
1847
1848 0f3cb305 Fabrice Bellard
if test "$bigendian" = "yes" ; then
1849
  echo "WORDS_BIGENDIAN=yes" >> config.mak
1850
  echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1851 91d1f1a4 Nick Kurshev
fi
1852 57514323 Zdenek Kabelac
if test "$mmx" = "yes" ; then
1853 980fc7b8 Fabrice Bellard
  echo "TARGET_MMX=yes" >> config.mak
1854 045ed63f Zdenek Kabelac
  echo "#define HAVE_MMX 1" >> $TMPH
1855 e82c5a8c Michael Niedermayer
  echo "#define __CPU__ 586" >> $TMPH
1856 de6d9b64 Fabrice Bellard
fi
1857 e7768fc5 Guillaume Poirier
if test "$cmov" = "yes" ; then
1858
  echo "TARGET_CMOV=yes" >> config.mak
1859
  echo "#define HAVE_CMOV 1" >> $TMPH
1860
fi
1861 94e4c3a3 Guillaume Poirier
if test "$cmov_is_fast" = "yes" ; then
1862
  echo "TARGET_CMOV_IS_FAST=yes" >> config.mak
1863
  echo "#define CMOV_IS_FAST 1" >> $TMPH
1864
fi
1865 1839e854 Siarhei Siamashka
if test "$armv5te" = "yes" ; then
1866
  echo "TARGET_ARMV5TE=yes" >> config.mak
1867
  echo "#define HAVE_ARMV5TE 1" >> $TMPH
1868
fi
1869 eba9ae3c Gildas Bazin
if test "$iwmmxt" = "yes" ; then
1870
  echo "TARGET_IWMMXT=yes" >> config.mak
1871
  echo "#define HAVE_IWMMXT 1" >> $TMPH
1872
fi
1873 d46aba26 Leon van Stuivenberg
if test "$mmi" = "yes" ; then
1874
  echo "TARGET_MMI=yes" >> config.mak
1875
  echo "#define HAVE_MMI 1" >> $TMPH
1876
fi
1877 87ea51e0 Luca Barbato
1878 ab6c65f6 Brian Foley
if test "$altivec" = "yes" ; then
1879
  echo "TARGET_ALTIVEC=yes" >> config.mak
1880
  echo "#define HAVE_ALTIVEC 1" >> $TMPH
1881 f80f7964 Roman Shaposhnik
fi
1882 44161118 Måns Rullgård
1883 a86b921c Fabrice Bellard
if test "$sdl" = "yes" ; then
1884 6a1a892f Frantisek Dvorak
  echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
1885
  echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
1886 a86b921c Fabrice Bellard
fi
1887 146ea952 Nicolas Boos
if test "$texi2html" = "yes"; then
1888
  echo "BUILD_DOC=yes" >> config.mak
1889
fi
1890 5a872801 Luca Barbato
1891 790c9ca7 Luca Abeni
sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
1892 6d9a2421 Diego Biurrun
pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
1893 5a872801 Luca Barbato
lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1894
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1895
lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1896
1897
1898
1899 57514323 Zdenek Kabelac
if test "$lshared" = "yes" ; then
1900 0319c531 Nick Kurshev
  echo "BUILD_SHARED=yes" >> config.mak
1901 97006039 Jacob Meuser
  echo "PIC=-fPIC -DPIC" >> config.mak
1902 39503a27 Diego Biurrun
  echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
1903 5a872801 Luca Barbato
  echo "SPPVERSION=$lavc_version" >> config.mak
1904 39503a27 Diego Biurrun
  echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
1905 5a872801 Luca Barbato
  echo "LAVCVERSION=$lavc_version" >> config.mak
1906 39503a27 Diego Biurrun
  echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
1907 5a872801 Luca Barbato
  echo "LAVFVERSION=$lavf_version" >> config.mak
1908 39503a27 Diego Biurrun
  echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
1909 5a872801 Luca Barbato
  echo "LAVUVERSION=$lavu_version" >> config.mak
1910 790c9ca7 Luca Abeni
  echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
1911
  echo "SWSVERSION=$sws_version" >> config.mak
1912 4bdd05e7 Diego Biurrun
  echo "SLIBNAME=${SLIBNAME}" >> config.mak
1913 f3b60109 Diego Biurrun
  echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1914
  echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
1915 5cb854e1 Diego Biurrun
  echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
1916 0319c531 Nick Kurshev
fi
1917 d7e27559 Diego Biurrun
echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
1918 ef0bc4c9 François Revol
echo "EXTRALIBS=$extralibs" >> config.mak
1919 d2845d68 Diego Biurrun
1920 44161118 Måns Rullgård
enabled_any $ENCODER_LIST && enable encoders
1921
enabled_any $DECODER_LIST && enable decoders
1922
enabled_any $MUXER_LIST   && enable muxers
1923
enabled_any $DEMUXER_LIST && enable demuxers
1924 f956e129 Oded Shimon
1925 b265431e Måns Rullgård
enabled_any pthreads beosthreads os2threads w32threads && enable threads
1926
1927 44161118 Måns Rullgård
print_config HAVE_   $TMPH config.mak $HAVE_LIST
1928
print_config CONFIG_ $TMPH config.mak $CONFIG_LIST
1929 8ac17293 Steve L'Homme
1930 b2828252 Diego Biurrun
if test "$targetos" = "Darwin"; then
1931 90cee0c3 Michael Niedermayer
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1932
fi
1933
1934 c13e1abd Falk Hüffner
echo "#define restrict $_restrict" >> $TMPH
1935
1936 bb801c97 Michael Niedermayer
if test "$optimize" = "small"; then
1937
  echo "#define always_inline"  >> $TMPH
1938 e5f28e8f Michael Niedermayer
  echo "#define CONFIG_SMALL 1" >> $TMPH
1939 bb801c97 Michael Niedermayer
fi
1940
1941 997baf01 Måns Rullgård
echo "SRC_PATH=\"$source_path\"" >> config.mak
1942
echo "SRC_PATH_BARE=$source_path" >> config.mak
1943
echo "BUILD_ROOT=\"$PWD\"" >> config.mak
1944 0f3cb305 Fabrice Bellard
1945 2a515c08 Torsten Martinsen
if test "$amr_if2" = "yes" ; then
1946
  echo "AMR_CFLAGS=-DIF2=1" >> config.mak
1947
fi
1948
1949 8156056e John Dalgliesh
# Apparently it's not possible to portably echo a backslash.
1950 4454dc1b John Dalgliesh
if test "$asmalign_pot" = "yes" ; then
1951 8156056e John Dalgliesh
  printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH
1952 4454dc1b John Dalgliesh
else
1953 8156056e John Dalgliesh
  printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
1954 4454dc1b John Dalgliesh
fi
1955
1956 bc634f6f Zdenek Kabelac
1957 55006fc0 Diego Biurrun
for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do
1958 44161118 Måns Rullgård
    ucname="`toupper $codec`"
1959 a8d04fba Måns Rullgård
    config_name="CONFIG_$ucname"
1960
    enabled_name="ENABLE_$ucname"
1961
    if enabled $codec; then
1962
        echo "#define $config_name 1" >> $TMPH
1963
        echo "#define $enabled_name 1" >> $TMPH
1964
        echo "$config_name=yes" >> config.mak
1965
    else
1966
        echo "#define $enabled_name 0" >> $TMPH
1967
    fi
1968 009cf97d Michael Niedermayer
done
1969
1970 9cb2cf10 Diego Biurrun
# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
1971 c683a5d1 Måns Rullgård
if ! cmp -s $TMPH config.h; then
1972 9cb2cf10 Diego Biurrun
        mv -f $TMPH config.h
1973
else
1974
        echo "config.h is unchanged"
1975
fi
1976 3d204385 Nick Kurshev
1977 f3ec2d46 Slavik Gnatenko
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
1978 def4272a Aurelien Jacobs
1979 165af439 Måns Rullgård
# build tree in object directory if source path is different from current one
1980
if test "$source_path_used" = "yes" ; then
1981
    DIRS="\
1982
         doc \
1983
         libavformat \
1984
         libavcodec \
1985
         libavcodec/alpha \
1986
         libavcodec/armv4l \
1987
         libavcodec/bfin \
1988
         libavcodec/i386 \
1989
         libavcodec/sparc \
1990
         libavcodec/mlib \
1991
         libavcodec/ppc \
1992
         libavcodec/liba52 \
1993
         libpostproc \
1994
         libavutil \
1995
         libswscale \
1996
         tests \
1997
         vhook \
1998
         "
1999
    FILES="\
2000
          Makefile \
2001
          common.mak \
2002
          libavformat/Makefile \
2003
          libavcodec/Makefile \
2004
          libpostproc/Makefile \
2005
          libavutil/Makefile \
2006
          libswscale/Makefile \
2007
          tests/Makefile \
2008
          vhook/Makefile \
2009
          doc/Makefile \
2010
          doc/texi2pod.pl \
2011
          "
2012
    for dir in $DIRS ; do
2013
            mkdir -p $dir
2014
    done
2015
    for f in $FILES ; do
2016
        ln -sf "$source_path/$f" $f
2017
    done
2018
fi
2019 def4272a Aurelien Jacobs
2020 29799f8b Diego Biurrun
# build pkg-config files libav*.pc and libpostproc.pc
2021 31abdc45 j@v2v.cc
# libavutil.pc
2022
cat <<EOF >libavutil.pc
2023 2266e085 Diego Biurrun
prefix=$PREFIX
2024 a94e666c Diego Biurrun
exec_prefix=\${prefix}
2025 31abdc45 j@v2v.cc
libdir=\${exec_prefix}/lib
2026 a94e666c Diego Biurrun
includedir=\${prefix}/include
2027 31abdc45 j@v2v.cc
2028
Name: libavutil
2029
Description: FFmpeg utility library
2030
Version: $lavu_version
2031 115329f1 Diego Biurrun
Requires:
2032 31abdc45 j@v2v.cc
Conflicts:
2033
Libs: -L\${libdir} -lavutil
2034
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2035
EOF
2036
2037
cat <<EOF >libavutil-uninstalled.pc
2038
prefix=
2039
exec_prefix=
2040
libdir=\${pcfiledir}/libavutil
2041
includedir=\${pcfiledir}/libavutil
2042
2043
Name: libavutil
2044
Description: FFmpeg utility library
2045
Version: $lavu_version
2046 115329f1 Diego Biurrun
Requires:
2047 31abdc45 j@v2v.cc
Conflicts:
2048
Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
2049
Cflags: -I\${includedir}
2050
EOF
2051 def4272a Aurelien Jacobs
2052
# libavcodec.pc
2053
cat <<EOF >libavcodec.pc
2054 2266e085 Diego Biurrun
prefix=$PREFIX
2055 a94e666c Diego Biurrun
exec_prefix=\${prefix}
2056 def4272a Aurelien Jacobs
libdir=\${exec_prefix}/lib
2057 a94e666c Diego Biurrun
includedir=\${prefix}/include
2058 def4272a Aurelien Jacobs
2059
Name: libavcodec
2060
Description: FFmpeg codec library
2061 31abdc45 j@v2v.cc
Version: $lavc_version
2062 c99dd233 j@v2v.cc
Requires: $pkg_requires libavutil = $lavu_version
2063 def4272a Aurelien Jacobs
Conflicts:
2064
Libs: -L\${libdir} -lavcodec $extralibs
2065
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2066
EOF
2067
2068
cat <<EOF >libavcodec-uninstalled.pc
2069
prefix=
2070
exec_prefix=
2071
libdir=\${pcfiledir}/libavcodec
2072
includedir=\${pcfiledir}/libavcodec
2073
2074
Name: libavcodec
2075
Description: FFmpeg codec library
2076 31abdc45 j@v2v.cc
Version: $lavc_version
2077 c99dd233 j@v2v.cc
Requires: $pkg_requires libavutil = $lavu_version
2078 def4272a Aurelien Jacobs
Conflicts:
2079
Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
2080
Cflags: -I\${includedir}
2081
EOF
2082
2083
# libavformat.pc
2084
cat <<EOF >libavformat.pc
2085 2266e085 Diego Biurrun
prefix=$PREFIX
2086 a94e666c Diego Biurrun
exec_prefix=\${prefix}
2087 def4272a Aurelien Jacobs
libdir=\${exec_prefix}/lib
2088 a94e666c Diego Biurrun
includedir=\${prefix}/include
2089 def4272a Aurelien Jacobs
2090
Name: libavformat
2091
Description: FFmpeg container format library
2092 31abdc45 j@v2v.cc
Version: $lavf_version
2093 c99dd233 j@v2v.cc
Requires: $pkg_requires libavcodec = $lavc_version
2094 def4272a Aurelien Jacobs
Conflicts:
2095
Libs: -L\${libdir} -lavformat $extralibs
2096
Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2097
EOF
2098
2099
cat <<EOF >libavformat-uninstalled.pc
2100
prefix=
2101
exec_prefix=
2102
libdir=\${pcfiledir}/libavformat
2103
includedir=\${pcfiledir}/libavformat
2104
2105
Name: libavformat
2106
Description: FFmpeg container format library
2107 31abdc45 j@v2v.cc
Version: $lavf_version
2108 c99dd233 j@v2v.cc
Requires: $pkg_requires libavcodec = $lavc_version
2109 def4272a Aurelien Jacobs
Conflicts:
2110
Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
2111
Cflags: -I\${includedir}
2112
EOF
2113
2114
2115
# libpostproc.pc
2116
cat <<EOF >libpostproc.pc
2117 2266e085 Diego Biurrun
prefix=$PREFIX
2118 a94e666c Diego Biurrun
exec_prefix=\${prefix}
2119 def4272a Aurelien Jacobs
libdir=\${exec_prefix}/lib
2120 a94e666c Diego Biurrun
includedir=\${prefix}/include
2121 def4272a Aurelien Jacobs
2122
Name: libpostproc
2123
Description: FFmpeg post processing library
2124 31abdc45 j@v2v.cc
Version: $lavc_version
2125 115329f1 Diego Biurrun
Requires:
2126 def4272a Aurelien Jacobs
Conflicts:
2127
Libs: -L\${libdir} -lpostproc
2128
Cflags: -I\${includedir} -I\${includedir}/postproc
2129
EOF
2130
2131
cat <<EOF >libpostproc-uninstalled.pc
2132
prefix=
2133
exec_prefix=
2134 6d9a2421 Diego Biurrun
libdir=\${pcfiledir}/libpostproc
2135
includedir=\${pcfiledir}/libpostproc
2136 def4272a Aurelien Jacobs
2137
Name: libpostproc
2138
Description: FFmpeg post processing library
2139 31abdc45 j@v2v.cc
Version: $lavc_version
2140 115329f1 Diego Biurrun
Requires:
2141 def4272a Aurelien Jacobs
Conflicts:
2142
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
2143
Cflags: -I\${includedir}
2144
EOF
2145 790c9ca7 Luca Abeni
2146 6c0d0413 j@v2v.cc
if test "$swscaler" != "no"; then
2147
  sws_pc_libs="-L\${libdir} -lswscale"
2148
  sws_pc_uninstalled_libs="\${libdir}/${LIBPREF}swscale${LIBSUF}"
2149
  sws_pc_requires="$pkg_requires libavutil = $lavu_version"
2150
else
2151
  sws_pc_libs=""
2152
  sws_pc_uninstalled_libs=""
2153
  sws_pc_requires="$pkg_requires libavcodec = $lavc_version"
2154
fi
2155 790c9ca7 Luca Abeni
# libswscale.pc
2156
cat <<EOF >libswscale.pc
2157
prefix=$PREFIX
2158
exec_prefix=\${prefix}
2159
libdir=\${exec_prefix}/lib
2160
includedir=\${prefix}/include
2161
2162
Name: libswscale
2163
Description: FFmpeg image rescaling library
2164
Version: $sws_version
2165 6c0d0413 j@v2v.cc
Requires: $sws_pc_requires
2166 790c9ca7 Luca Abeni
Conflicts:
2167 6c0d0413 j@v2v.cc
Libs: $sws_pc_libs
2168 790c9ca7 Luca Abeni
Cflags: -I\${includedir} -I\${includedir}/swscale
2169
EOF
2170
2171
cat <<EOF >libswscale-uninstalled.pc
2172
prefix=
2173
exec_prefix=
2174
libdir=\${pcfiledir}/libswscale
2175
includedir=\${pcfiledir}/libswscale
2176
2177
Name: libswscale
2178
Description: FFmpeg image rescaling library
2179
Version: $sws_version
2180 6c0d0413 j@v2v.cc
Requires: $sws_pc_requires
2181 790c9ca7 Luca Abeni
Conflicts:
2182 6c0d0413 j@v2v.cc
Libs: $sws_pc_uninstalled_libs
2183 790c9ca7 Luca Abeni
Cflags: -I\${includedir}
2184
EOF