configure 58.3 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_cc(){
217 218
    log check_cc "$@"
    cat >$TMPC
219
    log_file $TMPC
220 221 222 223 224 225
    log $cc $CFLAGS "$@" -c -o $TMPO $TMPC
    $cc $CFLAGS "$@" -c -o $TMPO $TMPC >>$logfile 2>&1
}

check_cpp(){
    log check_cpp "$@"
226
    cat >$TMPC
227
    log_file $TMPC
228 229
    log $cc $CFLAGS "$@" -E -o $TMPO $TMPC
    $cc $CFLAGS "$@" -E -o $TMPO $TMPC >>$logfile 2>&1
230 231 232
}

check_ld(){
233
    log check_ld "$@"
234 235 236
    check_cc || return
    log $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
    $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs >>$logfile 2>&1
237 238 239
}

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

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

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

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

277 278 279 280 281 282 283 284 285 286 287 288
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
}

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

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

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

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

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

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

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

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

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

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

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

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

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