configure 58 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(){
217
    "$@" >>$logfile 2>&1
218 219
}

220
check_cc(){
221 222
    log check_cc "$@"
    cat >$TMPC
223
    log_file $TMPC
224
    log $cc $CFLAGS "$@" -c -o $TMPO $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
    log $cc $CFLAGS "$@" -E -o $TMPO $TMPC
233
    check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
234 235 236
}

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

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

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

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

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

281 282 283 284 285 286 287 288 289 290 291 292
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
}

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

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

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

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

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

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

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

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

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

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

657 658 659 660 661
FFMPEG_CONFIGURATION=" "
for opt do
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
done

662 663
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/'`
664
PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' $source_path/libavcodec/allcodecs.c  | sed 's/.*&\(.*\)).*/\1/'`
665 666
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/'`
667

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