configure 57.9 KB
Newer Older
Fabrice Bellard's avatar
Fabrice Bellard committed
1
#!/bin/sh
2
#
Fabrice Bellard's avatar
Fabrice Bellard committed
3
# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
4
#
5

6 7 8 9 10 11 12 13 14 15 16 17 18 19
# make sure we are running under a compatible shell
(: ${foo%%bar}) 2>/dev/null
if test "$?" != 0; then
    if test "x$FFMPEG_CONFIGURE_EXEC" = x; then
        FFMPEG_CONFIGURE_EXEC=1
        export FFMPEG_CONFIGURE_EXEC
        exec bash "$0" "$@"
        exec ksh "$0" "$@"
        exec /usr/xpg4/bin/sh "$0" "$@"
    fi
    echo "No compatible shell script interpreter found."
    exit 1
fi

20 21 22 23 24 25
show_help(){
  echo "Usage: configure [options]"
  echo "Options: [defaults in brackets after descriptions]"
  echo
  echo "Standard options:"
  echo "  --help                   print this message"
26
  echo "  --log[=FILE|yes|no]      log tests and output to FILE [config.err]"
27
  echo "  --prefix=PREFIX          install in PREFIX [$PREFIX]"
28
  echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
29
  echo "  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]"
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
  echo "  --incdir=DIR             install includes in DIR [PREFIX/include/ffmpeg]"
  echo "  --mandir=DIR             install man page in DIR [PREFIX/man]"
  echo "  --enable-mp3lame         enable MP3 encoding via libmp3lame [default=no]"
  echo "  --enable-libogg          enable Ogg support via libogg [default=no]"
  echo "  --enable-vorbis          enable Vorbis support via libvorbis [default=no]"
  echo "  --enable-faad            enable FAAD support via libfaad [default=no]"
  echo "  --enable-faadbin         build FAAD support with runtime linking [default=no]"
  echo "  --enable-faac            enable FAAC support via libfaac [default=no]"
  echo "  --enable-libgsm          enable GSM support via libgsm [default=no]"
  echo "  --enable-xvid            enable XviD support via xvidcore [default=no]"
  echo "  --enable-x264            enable H.264 encoding via x264 [default=no]"
  echo "  --enable-mingw32         enable MinGW native/cross Windows compile"
  echo "  --enable-mingwce         enable MinGW native/cross WinCE compile"
  echo "  --enable-a52             enable GPLed A52 support [default=no]"
  echo "  --enable-a52bin          open liba52.so.0 at runtime [default=no]"
  echo "  --enable-dts             enable GPLed DTS support [default=no]"
  echo "  --enable-pp              enable GPLed postprocessing support [default=no]"
  echo "  --enable-static          build static libraries [default=yes]"
  echo "  --disable-static         do not build static libraries [default=no]"
  echo "  --enable-shared          build shared libraries [default=no]"
  echo "  --disable-shared         do not build shared libraries [default=yes]"
  echo "  --enable-amr_nb          enable amr_nb float audio codec"
  echo "  --enable-amr_nb-fixed    use fixed point for amr-nb codec"
  echo "  --enable-amr_wb          enable amr_wb float audio codec"
  echo "  --enable-amr_if2         enable amr_wb IF2 audio codec"
  echo "  --enable-sunmlib         use Sun medialib [default=no]"
  echo "  --enable-pthreads        use pthreads [default=no]"
  echo "  --enable-dc1394          enable IIDC-1394 grabbing using libdc1394"
  echo "                           and libraw1394 [default=no]"
  echo "  --enable-gpl             allow use of GPL code, the resulting libav*"
  echo "                           and ffmpeg will be under GPL [default=no]"
  echo ""
  echo "Advanced options (experts only):"
  echo "  --source-path=PATH       path to source code [$source_path]"
  echo "  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]"
65
  echo "  --cross-compile          assume a cross-compiler is used"
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
  echo "  --cc=CC                  use C compiler CC [$cc]"
  echo "  --make=MAKE              use specified make [$make]"
  echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
  echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
  echo "  --build-suffix=SUFFIX    suffix for application specific build []"
  echo "  --cpu=CPU                force cpu to CPU  [$cpu]"
  echo "  --tune=CPU               tune code for a particular CPU"
  echo "                           (may fail or perform badly on other CPUs)"
  echo "  --powerpc-perf-enable    enable performance report on PPC"
  echo "                           (requires enabling PMC)"
  echo "  --disable-mmx            disable MMX usage"
  echo "  --disable-iwmmxt         disable iwmmxt usage"
  echo "  --disable-altivec        disable AltiVec usage"
  echo "  --disable-audio-oss      disable OSS audio support [default=no]"
  echo "  --disable-audio-beos     disable BeOS audio support [default=no]"
  echo "  --disable-v4l            disable video4linux grabbing [default=no]"
  echo "  --disable-v4l2           disable video4linux2 grabbing [default=no]"
  echo "  --disable-bktr           disable bktr video grabbing [default=no]"
  echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
  echo "  --disable-network        disable network support [default=no]"
  echo "  --disable-zlib           disable zlib [default=no]"
  echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
  echo "  --disable-vhook          disable video hooking support"
  echo "  --enable-gprof           enable profiling with gprof [$gprof]"
  echo "  --disable-debug          disable debugging symbols"
  echo "  --disable-opts           disable compiler optimizations"
  echo "  --disable-mpegaudio-hp   faster (but less accurate)"
  echo "                           MPEG audio decoding [default=no]"
  echo "  --disable-protocols      disable I/O protocols support [default=no]"
  echo "  --disable-ffserver       disable ffserver build"
  echo "  --disable-ffplay         disable ffplay build"
  echo "  --enable-small           optimize for size instead of speed"
  echo "  --enable-memalign-hack   emulate memalign, interferes with memory debuggers"
  echo "  --disable-strip          disable stripping of executables and shared libraries"
  echo "  --disable-encoder=NAME   disables encoder NAME"
  echo "  --enable-encoder=NAME    enables encoder NAME"
  echo "  --disable-decoder=NAME   disables decoder NAME"
  echo "  --enable-decoder=NAME    enables decoder NAME"
  echo "  --disable-encoders       disables all encoders"
  echo "  --disable-decoders       disables all decoders"
107 108
  echo "  --disable-muxer=NAME     disables muxer NAME"
  echo "  --enable-muxer=NAME      enables muxer NAME"
109
  echo "  --disable-muxers         disables all muxers"
110 111
  echo "  --disable-demuxer=NAME   disables demuxer NAME"
  echo "  --enable-demuxer=NAME    enables demuxer NAME"
112
  echo "  --disable-demuxers       disables all demuxers"
113 114 115
  echo "  --enable-parser=NAME     enables parser NAME"
  echo "  --disable-parser=NAME    disables parser NAME"
  echo "  --disable-parsers        disables all parsers"
116 117 118 119
  echo ""
  echo "NOTE: Object files are built at the place where configure is launched."
  exit 1
}
120

121 122 123 124
log(){
    echo "$@" >>$logfile
}

125
log_file(){
Måns Rullgård's avatar
Måns Rullgård committed
126 127 128 129 130
    log BEGIN $1
    cat -n $1 >>$logfile
    log END $1
}

131
echolog(){
Måns Rullgård's avatar
Måns Rullgård committed
132
    log "$@"
133
    echo "$@"
134 135 136 137 138 139 140 141 142
}

die(){
    echolog "$@"
    cat <<EOF
If you think configure made a mistake, make sure you are using the latest
version from SVN.  If the latest version fails, report the problem to the
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
EOF
143
    if enabled logging; then
144 145 146 147 148 149 150 151 152 153
        cat <<EOF
Include the log file "$logfile" produced by configure as this will help
solving the problem.
EOF
    else
cat <<EOF
Rerun configure with logging enabled (do not use --log=no), and include the
log this produces with your report.
EOF
    fi
154 155 156 157 158 159 160 161 162 163 164 165
    rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
    exit 1
}

enabled(){
    eval test "\$$1" = "yes"
}

flags_saved(){
    (: ${SAVE_CFLAGS?}) 2>/dev/null
}

166
save_flags(){
167
    flags_saved && return
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
    SAVE_CFLAGS="$CFLAGS"
    SAVE_LDFLAGS="$LDFLAGS"
    SAVE_extralibs="$extralibs"
}

restore_flags(){
    CFLAGS="$SAVE_CFLAGS"
    LDFLAGS="$SAVE_LDFLAGS"
    extralibs="$SAVE_extralibs"
    unset SAVE_CFLAGS
    unset SAVE_LDFLAGS
    unset SAVE_extralibs
}

temp_cflags(){
    save_flags
    CFLAGS="$CFLAGS $*"
}

temp_ldflags(){
    save_flags
    LDFLAGS="$LDFLAGS $*"
}

temp_extralibs(){
    save_flags
    extralibs="$extralibs $*"
}

197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
append(){
    var=$1
    shift
    flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
    eval "$var=\"\$$var $*\""
}

add_cflags(){
    append CFLAGS "$@"
}

add_ldflags(){
    append LDFLAGS "$@"
}

add_extralibs(){
    append extralibs "$@"
}

216
check_cmd(){
Måns Rullgård's avatar
Måns Rullgård committed
217
    log "$@"
218
    "$@" >>$logfile 2>&1
219 220
}

221
check_cc(){
222 223
    log check_cc "$@"
    cat >$TMPC
224
    log_file $TMPC
225
    check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
226 227 228 229
}

check_cpp(){
    log check_cpp "$@"
230
    cat >$TMPC
231
    log_file $TMPC
232
    check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
233 234 235
}

check_ld(){
236
    log check_ld "$@"
237
    check_cc || return
238
    check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
239 240 241
}

check_cflags(){
242 243
    log check_cflags "$@"
    check_cc "$@" <<EOF && add_cflags "$@"
244 245 246 247 248
int x;
EOF
}

check_ldflags(){
249 250 251 252 253
    log check_ldflags "$@"
    check_ld "$@" <<EOF && add_ldflags "$@"
int main(){
    return 0;
}
254 255 256 257
EOF
}

check_header(){
258
    log check_header "$@"
259 260
    header=$1
    shift
261
    check_cpp "$@" <<EOF
262 263 264 265 266 267
#include <$header>
int x;
EOF
}

check_func(){
268
    log check_func "$@"
269 270 271 272 273 274 275 276 277 278
    func=$1
    shift
    check_ld "$@" <<EOF
extern int $func();
int main(){
    $func();
}
EOF
}

279 280 281 282 283 284 285 286 287 288 289 290
check_lib(){
    log check_lib "$@"
    header="$1"
    func="$2"
    shift 2
    temp_extralibs "$@"
    check_header $header && check_func $func && add_extralibs "$@"
    err=$?
    restore_flags
    return $err
}

291
check_exec(){
292
    check_ld "$@" && { test "$cross_compile" = yes || $TMPE >>$logfile 2>&1; }
293 294 295 296 297 298 299 300
}

require(){
    name="$1"
    header="$2"
    func="$3"
    shift 3
    check_lib $header $func "$@" || die "ERROR: $name not found"
301 302
}

Måns Rullgård's avatar
Måns Rullgård committed
303 304 305 306 307 308
filter_out(){
    pattern="$1"
    shift
    echo "$@" | sed "s%\\<$pattern\\>%%g"
}

309
# set temporary file name
Zdenek Kabelac's avatar
Zdenek Kabelac committed
310
if test ! -z "$TMPDIR" ; then
311
    TMPDIR1="${TMPDIR}"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
312
elif test ! -z "$TEMPDIR" ; then
313
    TMPDIR1="${TEMPDIR}"
Nick Kurshev's avatar
Nick Kurshev committed
314
else
315
    TMPDIR1="/tmp"
Nick Kurshev's avatar
Nick Kurshev committed
316 317
fi

318 319
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
320
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
321 322 323
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"

Fabrice Bellard's avatar
Fabrice Bellard committed
324
# default parameters
325
logging="yes"
326
logfile="config.err"
327 328
PREFIX="/usr/local"
libdir='${PREFIX}/lib'
329
shlibdir="$libdir"
330 331 332
incdir='${PREFIX}/include/ffmpeg'
mandir='${PREFIX}/man'
bindir='${PREFIX}/bin'
333
cross_prefix=""
334
cross_compile="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
335 336
cc="gcc"
ar="ar"
Michael Niedermayer's avatar
Michael Niedermayer committed
337
ranlib="ranlib"
338
make="make"
339
strip="strip"
Fabrice Bellard's avatar
Fabrice Bellard committed
340
cpu=`uname -m`
341
tune="generic"
342
powerpc_perf="no"
343
mmx="default"
344
iwmmxt="default"
345
altivec="default"
346
mmi="default"
Fabrice Bellard's avatar
Fabrice Bellard committed
347
case "$cpu" in
348
  i386|i486|i586|i686|i86pc|BePC)
Fabrice Bellard's avatar
Fabrice Bellard committed
349 350
    cpu="x86"
  ;;
351 352 353 354 355 356 357
  x86_64|amd64)
    cpu="x86"
    canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
    if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
      if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
        cpu="x86_64"
      fi
358 359
    fi
  ;;
360 361
  # armv4l is a subset of armv5tel
  armv4l|armv5tel)
362 363
    cpu="armv4l"
  ;;
364 365 366
  alpha)
    cpu="alpha"
  ;;
367
  "Power Macintosh"|ppc|ppc64|powerpc)
368 369
    cpu="powerpc"
  ;;
370
  mips|mipsel|IP*)
371 372
    cpu="mips"
  ;;
373
  sun4u|sparc64)
374 375
    cpu="sparc64"
  ;;
376 377 378
  sparc)
    cpu="sparc"
  ;;
Alex Beregszaszi's avatar
Alex Beregszaszi committed
379 380 381
  sh4)
    cpu="sh4"
  ;;
382 383 384 385 386 387 388 389 390 391 392 393
  parisc|parisc64)
    cpu="parisc"
  ;;
  s390|s390x)
    cpu="s390"
  ;;
  m68k)
    cpu="m68k"
  ;;
  ia64)
    cpu="ia64"
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
394
  *)
395
    cpu="unknown"
Fabrice Bellard's avatar
Fabrice Bellard committed
396 397 398
  ;;
esac
gprof="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
399
v4l="yes"
Luca Abeni's avatar
Luca Abeni committed
400
v4l2="yes"
401
bktr="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
402
audio_oss="yes"
403
audio_beos="no"
404
dv1394="yes"
405
dc1394="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
406
network="yes"
407
zlib="yes"
408
libgsm="no"
409
mp3lame="no"
410
libogg="no"
411
vorbis="no"
412 413
faad="no"
faadbin="no"
414
faac="no"
415
xvid="no"
416
x264="no"
417
a52="no"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
418
a52bin="no"
419
dts="no"
420
pp="no"
421
mingw32="no"
Gildas Bazin's avatar
Gildas Bazin committed
422
mingwce="no"
423
os2="no"
424
lstatic="yes"
425
lshared="no"
426 427
optimize="yes"
debug="yes"
428
dostrip="yes"
429
installstrip="-s"
430
extralibs="-lm"
431
simpleidct="yes"
432
bigendian="no"
433
inttypes="yes"
434
emu_fast_int="no"
435
vhook="default"
436 437
dlfcn="no"
dlopen="no"
438
mpegaudio_hp="yes"
439
SHFLAGS='-shared -Wl,-soname,$@'
440
VHOOKFLAGS="$SHFLAGS"
441
netserver="no"
442
need_inet_aton="no"
443
protocols="yes"
444
ffserver="yes"
445
ffplay="yes"
446
LIBOBJFLAGS=""
447
FFLDFLAGS=-Wl,--warn-common
448
FFSERVERLDFLAGS=-Wl,-E
449
LDCONFIG="ldconfig"
450 451
LIBPREF="lib"
LIBSUF=".a"
452
LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
453 454
SLIBPREF="lib"
SLIBSUF=".so"
455
SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
456 457
SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
Fabrice Bellard's avatar
Fabrice Bellard committed
458
EXESUF=""
459
BUILDSUF=""
460
amr_nb="no"
461
amr_wb="no"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
462
amr_nb_fixed="no"
463
amr_if2="no"
464
sunmlib="no"
465
pthreads="no"
466
gpl="no"
467
memalignhack="no"
468 469 470 471 472

# OS specific
targetos=`uname -s`
case $targetos in
BeOS)
473
PREFIX="/boot/home/config"
474
# helps building libavcodec
475
CFLAGS="$CFLAGS -DPIC -fomit-frame-pointer"
476
# 3 gcc releases known for BeOS, each with ugly bugs
477
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
478 479 480 481 482 483 484 485
case "$gcc_version" in
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
mmx="no"
;;
*20010315*) echo "BeBits gcc"
CFLAGS="$CFLAGS -fno-expensive-optimizations"
;;
esac
486
SHFLAGS=-nostart
Diego Biurrun's avatar
Diego Biurrun committed
487
# disable Linux things
488
audio_oss="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
489
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
490
v4l2="no"
491
dv1394="no"
Diego Biurrun's avatar
Diego Biurrun committed
492
# enable BeOS things
493
audio_beos="yes"
494 495 496 497 498
# no need for libm, but the inet stuff
# Check for BONE
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
extralibs="-lbind -lsocket"
else
499
netserver="yes"
500
need_inet_aton="yes"
501
extralibs="-lnet"
502
fi ;;
503 504
SunOS)
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
505
v4l2="no"
506
audio_oss="no"
507
dv1394="no"
508
make="gmake"
509
FFLDFLAGS=""
510
FFSERVERLDFLAGS=""
511
SHFLAGS="-shared -Wl,-h,\$@"
512 513 514
need_inet_aton="yes"
extralibs="$extralibs -lsocket -lnsl"
;;
515 516
NetBSD)
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
517
v4l2="no"
518
bktr="yes"
519 520 521
audio_oss="yes"
dv1394="no"
make="gmake"
522
extralibs="$extralibs -lossaudio"
523
;;
524 525
OpenBSD)
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
526
v4l2="no"
527
bktr="yes"
528 529 530
audio_oss="yes"
dv1394="no"
make="gmake"
531
LIBOBJFLAGS="\$(PIC)"
532
LDCONFIG="ldconfig -m \$(libdir)"
533 534
extralibs="$extralibs -lossaudio"
;;
535 536
FreeBSD)
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
537
v4l2="no"
538
bktr="yes"
539
audio_oss="yes"
540
dv1394="no"
541
make="gmake"
542
CFLAGS="$CFLAGS -pthread"
543
;;
544 545 546 547 548 549 550 551
GNU/kFreeBSD)
v4l="no"
v4l2="no"
bktr="yes"
audio_oss="yes"
dv1394="no"
CFLAGS="$CFLAGS -pthread"
;;
552
BSD/OS)
Fabrice Bellard's avatar
Fabrice Bellard committed
553
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
554
v4l2="no"
555
bktr="yes"
Fabrice Bellard's avatar
Fabrice Bellard committed
556
audio_oss="yes"
557
dv1394="no"
558 559
extralibs="-lpoll -lgnugetopt -lm"
make="gmake"
560 561
strip="strip -d"
installstrip=""
562
;;
563
Darwin)
564
cc="cc"
565
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
566
v4l2="no"
567
audio_oss="no"
568
dv1394="no"
569
SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
570
VHOOKFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(libdir)/vhook/$@'
571
extralibs=""
572
strip="strip -x"
573
installstrip=""
574
FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
575
SLIBSUF=".dylib"
576 577
SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
578
FFSERVERLDFLAGS=-Wl,-bind_at_load
579
;;
580
MINGW32*)
Fabrice Bellard's avatar
Fabrice Bellard committed
581
# Note: the rest of the mingw32 config is done afterwards as mingw32
Diego Biurrun's avatar
Diego Biurrun committed
582
# can be forced on the command line for Linux cross compilation.
583 584
mingw32="yes"
;;
585
CYGWIN*)
586
targetos=CYGWIN
587
shlibdir='${PREFIX}/bin'
588
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
589
v4l2="no"
590
audio_oss="yes"
591
dv1394="no"
592
vhook="no"
593
extralibs=""
594
EXESUF=".exe"
595 596 597 598 599
SLIBPREF="cyg"
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a'
600
;;
601 602
Linux)
;;
603
IRIX*)
604
targetos=IRIX
605 606
ranlib="echo ignoring ranlib"
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
607
v4l2="no"
608 609 610
audio_oss="no"
make="gmake"
;;
611 612
OS/2)
TMPE=$TMPE".exe"
613
ar="emxomfar -p128"
614 615
ranlib="echo ignoring ranlib"
strip="echo ignoring strip"
616
CFLAGS="$CFLAGS -Zomf"
617
FFLDFLAGS="-Zomf -Zstack 16384 -s"
618
SHFLAGS="-Zdll -Zomf"
619
FFSERVERLDFLAGS=""
620 621 622 623
LIBPREF=""
LIBSUF=".lib"
SLIBPREF=""
SLIBSUF=".dll"
Fabrice Bellard's avatar
Fabrice Bellard committed
624
EXESUF=".exe"
625
extralibs=""
626
pkg_requires=""
627
v4l="no"
Luca Abeni's avatar
Luca Abeni committed
628
v4l2="no"
629
audio_oss="no"
630
dv1394="no"
631
ffserver="no"
632
vhook="no"
633
os2="yes"
634

635
;;
636 637 638
*)
targetos="${targetos}-UNKNOWN"
;;
639
esac
Fabrice Bellard's avatar
Fabrice Bellard committed
640

641
# find source path
642
source_path="`dirname $0`"
643 644 645 646
source_path_used="yes"
if test -z "$source_path" -o "$source_path" = "." ; then
    source_path=`pwd`
    source_path_used="no"
647 648
else
    source_path="`cd \"$source_path\"; pwd`"
Fabrice Bellard's avatar
Fabrice Bellard committed
649 650
fi

651 652 653 654
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
    show_help
fi

655 656 657 658 659
FFMPEG_CONFIGURATION=" "
for opt do
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
done

660 661
ENCODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_encoder)' $source_path/libavcodec/allcodecs.c  | sed 's/.*&\(.*\)).*/\1/'`
DECODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_decoder)' $source_path/libavcodec/allcodecs.c  | sed 's/.*&\(.*\)).*/\1/'`
662
PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' $source_path/libavcodec/allcodecs.c  | sed 's/.*&\(.*\)).*/\1/'`
663 664
MUXER_LIST=`grep 'av_register_output_format(&[a-z]' $source_path/libavformat/allformats.c  | sed 's/.*&\(.*\)).*/\1/'`
DEMUXER_LIST=`grep 'av_register_input_format(&[a-z]' $source_path/libavformat/allformats.c  | sed 's/.*&\(.*\)).*/\1/'`
665

Fabrice Bellard's avatar
Fabrice Bellard committed
666
for opt do
Måns Rullgård's avatar
Måns Rullgård committed
667
  optval="${opt#*=}"
Fabrice Bellard's avatar
Fabrice Bellard committed
668
  case "$opt" in
669 670
  --log)
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
671
  --log=*) logging="$optval"
672
  ;;
673
  --prefix=*) PREFIX="$optval"; force_prefix=yes
Fabrice Bellard's avatar
Fabrice Bellard committed
674
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
675
  --libdir=*) libdir="$optval"; force_libdir=yes
676
  ;;
677 678
  --shlibdir=*) shlibdir="$optval"
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
679
  --incdir=*) incdir="$optval"
Diego Biurrun's avatar
Diego Biurrun committed
680
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
681
  --mandir=*) mandir="$optval"
682
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
683
  --source-path=*) source_path="$optval"
684
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
685
  --cross-prefix=*) cross_prefix="$optval"
686
  ;;
687 688
  --cross-compile) cross_compile=yes
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
689
  --cc=*) cc="$optval"
Fabrice Bellard's avatar
Fabrice Bellard committed
690
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
691
  --make=*) make="$optval"
692
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
693
  --extra-cflags=*) CFLAGS="$CFLAGS $optval"
694
  ;;
695
  --extra-ldflags=*) EXTRALDFLAGS="$optval"
696
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
697
  --extra-libs=*) extralibs="$optval"
698
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
699
  --build-suffix=*) BUILDSUF="$optval"
700
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
701
  --cpu=*) cpu="$optval"
Fabrice Bellard's avatar
Fabrice Bellard committed
702
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
703
  --tune=*) tune="$optval"
704
  ;;
705 706
  --powerpc-perf-enable) powerpc_perf="yes"
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
707 708
  --disable-mmx) mmx="no"
  ;;
709 710
  --disable-iwmmxt) iwmmxt="no"
  ;;
711 712
  --disable-altivec) altivec="no"
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
713 714
  --enable-gprof) gprof="yes"
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
715 716
  --disable-v4l) v4l="no"
  ;;
Luca Abeni's avatar
Luca Abeni committed
717 718
  --disable-v4l2) v4l2="no"
  ;;
719 720
  --disable-bktr) bktr="no"
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
721 722
  --disable-audio-oss) audio_oss="no"
  ;;
723 724
  --disable-audio-beos) audio_beos="no"
  ;;
725 726
  --disable-dv1394) dv1394="no"
  ;;
727
  --disable-network) network="no"; ffserver="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
728
  ;;
729 730
  --disable-zlib) zlib="no"
  ;;
731
  --enable-a52) a52="yes"
732
  ;;
Michael Niedermayer's avatar
Michael Niedermayer committed
733
  --enable-a52bin) a52bin="yes"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
734
  ;;
735
  --enable-dts) dts="yes"
736
  ;;
737
  --enable-pp) pp="yes"
738
  ;;
739 740
  --enable-libgsm) libgsm="yes"
  ;;
741
  --enable-mp3lame) mp3lame="yes"
742
  ;;
743
  --enable-libogg) libogg="yes"
744
    pkg_requires="$pkg_requires ogg >= 1.1"
Nilesh Bansal's avatar
Nilesh Bansal committed
745
  ;;
746
  --enable-vorbis) vorbis="yes"
747
    pkg_requires="$pkg_requires vorbis vorbisenc"
748
  ;;
Zdenek Kabelac's avatar
Zdenek Kabelac committed
749 750 751 752
  --enable-faad) faad="yes"
  ;;
  --enable-faadbin) faadbin="yes"
  ;;
753
  --enable-faac) faac="yes"
754
  ;;
755 756
  --enable-xvid) xvid="yes"
  ;;
757
  --enable-x264) x264="yes"
758
  ;;
759
  --enable-dc1394) dc1394="yes"
760
    pkg_requires="$pkg_requires libraw1394"
761
  ;;
762 763
  --disable-vhook) vhook="no"
  ;;
764
  --disable-simple_idct) simpleidct="no"
765
  ;;
766 767
  --enable-mingw32) mingw32="yes"
  ;;
Gildas Bazin's avatar
Gildas Bazin committed
768 769
  --enable-mingwce) mingwce="yes"
  ;;
770 771 772 773
  --enable-static) lstatic="yes"
  ;;
  --disable-static) lstatic="no"
  ;;
774
  --enable-shared) lshared="yes"
Nick Kurshev's avatar
Nick Kurshev committed
775
  ;;
776 777
  --disable-shared) lshared="no"
  ;;
778 779 780 781
  --disable-debug) debug="no"
  ;;
  --disable-opts) optimize="no"
  ;;
782 783
  --disable-mpegaudio-hp) mpegaudio_hp="no"
  ;;
784 785
  --disable-protocols) protocols="no"; network="no"; ffserver="no"
  ;;
786 787
  --disable-ffserver) ffserver="no"
  ;;
788 789
  --disable-ffplay) ffplay="no"
  ;;
790
  --enable-small) optimize="small"
791
  ;;
Diego Biurrun's avatar
Diego Biurrun committed
792
  --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
793
  ;;
Diego Biurrun's avatar
Diego Biurrun committed
794
  --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
795
  ;;
Diego Biurrun's avatar
Diego Biurrun committed
796
  --enable-amr_wb) amr="yes"; amr_wb="yes"
797
  ;;
Diego Biurrun's avatar
Diego Biurrun committed
798
  --enable-amr_if2) amr="yes"; amr_if2="yes"
799
  ;;
800 801
  --enable-sunmlib) sunmlib="yes"
  ;;