configure 63.7 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
# make sure we are running under a compatible shell
Måns Rullgård's avatar
Måns Rullgård committed
7 8
unset foo
(: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null
9 10 11 12 13 14 15 16 17 18 19 20
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

21 22 23 24 25 26
show_help(){
  echo "Usage: configure [options]"
  echo "Options: [defaults in brackets after descriptions]"
  echo
  echo "Standard options:"
  echo "  --help                   print this message"
27
  echo "  --log[=FILE|yes|no]      log tests and output to FILE [config.err]"
28
  echo "  --prefix=PREFIX          install in PREFIX [$PREFIX]"
29
  echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
30
  echo "  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]"
31 32 33
  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]"
34
  echo "  --enable-libnut          enable NUT support via libnut [default=no]"
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
  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]"
Luca Abeni's avatar
Luca Abeni committed
61
  echo "  --enable-swscaler        software scaler support [default=no]"
62
  echo "  --enable-avisynth        allow reading AVISynth script files [default=no]"
63 64 65 66 67 68
  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]"
69
  echo "  --cross-compile          assume a cross-compiler is used"
70 71 72 73 74 75
  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 []"
76
  echo "  --arch=ARCH              select architecture  [$arch]"
77 78
  echo "  --cpu=CPU                selects the minimum cpu required (affects
                                   instruction selection, may crash on older CPUs)"
79 80 81
  echo "  --powerpc-perf-enable    enable performance report on PPC"
  echo "                           (requires enabling PMC)"
  echo "  --disable-mmx            disable MMX usage"
82
  echo "  --disable-armv5te        disable armv5te usage"
83 84 85 86 87 88 89 90 91
  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]"
92
  echo "  --disable-ipv6           disable ipv6 support [default=no]"
93 94 95 96 97 98
  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"
99
  echo "  --enable-extra-warnings  enable more compiler warnings"
100 101 102
  echo "  --disable-mpegaudio-hp   faster (but less accurate)"
  echo "                           MPEG audio decoding [default=no]"
  echo "  --disable-protocols      disable I/O protocols support [default=no]"
103
  echo "  --disable-ffmpeg         disable ffmpeg build"
104 105 106 107 108 109 110 111 112 113 114
  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"
115 116
  echo "  --disable-muxer=NAME     disables muxer NAME"
  echo "  --enable-muxer=NAME      enables muxer NAME"
117
  echo "  --disable-muxers         disables all muxers"
118 119
  echo "  --disable-demuxer=NAME   disables demuxer NAME"
  echo "  --enable-demuxer=NAME    enables demuxer NAME"
120
  echo "  --disable-demuxers       disables all demuxers"
121 122 123
  echo "  --enable-parser=NAME     enables parser NAME"
  echo "  --disable-parser=NAME    disables parser NAME"
  echo "  --disable-parsers        disables all parsers"
124 125 126 127
  echo ""
  echo "NOTE: Object files are built at the place where configure is launched."
  exit 1
}
128

129 130 131 132
log(){
    echo "$@" >>$logfile
}

133
log_file(){
Måns Rullgård's avatar
Måns Rullgård committed
134 135 136 137 138
    log BEGIN $1
    cat -n $1 >>$logfile
    log END $1
}

139
echolog(){
Måns Rullgård's avatar
Måns Rullgård committed
140
    log "$@"
141
    echo "$@"
142 143 144 145 146 147 148 149 150
}

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
151
    if enabled logging; then
152 153 154 155 156 157 158 159 160 161
        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
162 163 164 165 166 167 168 169 170 171 172 173
    rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
    exit 1
}

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

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

174
save_flags(){
175
    flags_saved && return
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
    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 $*"
}

205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
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 "$@"
}

224
check_cmd(){
Måns Rullgård's avatar
Måns Rullgård committed
225
    log "$@"
226
    "$@" >>$logfile 2>&1
227 228
}

229
check_cc(){
230 231
    log check_cc "$@"
    cat >$TMPC
232
    log_file $TMPC
233
    check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
234 235 236 237
}

check_cpp(){
    log check_cpp "$@"
238
    cat >$TMPC
239
    log_file $TMPC
240
    check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
241 242 243
}

check_ld(){
244
    log check_ld "$@"
245
    check_cc || return
246
    check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
247 248 249
}

check_cflags(){
250 251
    log check_cflags "$@"
    check_cc "$@" <<EOF && add_cflags "$@"
252 253 254 255 256
int x;
EOF
}

check_ldflags(){
257 258 259 260 261
    log check_ldflags "$@"
    check_ld "$@" <<EOF && add_ldflags "$@"
int main(){
    return 0;
}
262 263 264 265
EOF
}

check_header(){
266
    log check_header "$@"
267 268
    header=$1
    shift
269
    check_cpp "$@" <<EOF
270 271 272 273 274 275
#include <$header>
int x;
EOF
}

check_func(){
276
    log check_func "$@"
277 278 279 280 281 282 283 284 285 286
    func=$1
    shift
    check_ld "$@" <<EOF
extern int $func();
int main(){
    $func();
}
EOF
}

287 288 289 290 291 292 293 294 295 296 297 298
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
}

299
check_exec(){
300
    check_ld "$@" && { test "$cross_compile" = yes || $TMPE >>$logfile 2>&1; }
301 302 303 304 305 306 307 308
}

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

Måns Rullgård's avatar
Måns Rullgård committed
311 312 313 314 315 316
filter_out(){
    pattern="$1"
    shift
    echo "$@" | sed "s%\\<$pattern\\>%%g"
}

317
# set temporary file name
Zdenek Kabelac's avatar
Zdenek Kabelac committed
318
if test ! -z "$TMPDIR" ; then
319
    TMPDIR1="${TMPDIR}"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
320
elif test ! -z "$TEMPDIR" ; then
321
    TMPDIR1="${TEMPDIR}"
Nick Kurshev's avatar
Nick Kurshev committed
322
else
323
    TMPDIR1="/tmp"
Nick Kurshev's avatar
Nick Kurshev committed
324 325
fi

326 327
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
328
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
329 330 331
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"

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

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

662
;;
663 664 665
*)
targetos="${targetos}-UNKNOWN"
;;
666
esac
Fabrice Bellard's avatar
Fabrice Bellard committed
667

668
# find source path
669
source_path="`dirname \"$0\"`"
670 671
source_path_used="yes"
if test -z "$source_path" -o "$source_path" = "." ; then
672
    source_path="`pwd`"
673
    source_path_used="no"
674 675
else
    source_path="`cd \"$source_path\"; pwd`"
676 677
    echo "$source_path" | grep -q '[[:blank:]]' &&
      die "Out of tree builds are impossible with whitespace in source path."
Fabrice Bellard's avatar
Fabrice Bellard committed
678 679
fi

680 681 682 683
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
    show_help
fi

684 685 686 687 688
FFMPEG_CONFIGURATION=" "
for opt do
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
done

689 690 691 692 693
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/'`
PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' "$source_path/libavcodec/allcodecs.c"  | sed 's/.*&\(.*\)).*/\1/'`
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/'`
694

Fabrice Bellard's avatar
Fabrice Bellard committed
695
for opt do
Måns Rullgård's avatar
Måns Rullgård committed
696
  optval="${opt#*=}"
Fabrice Bellard's avatar
Fabrice Bellard committed
697
  case "$opt" in
698 699
  --log)
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
700
  --log=*) logging="$optval"
701
  ;;
702
  --prefix=*) PREFIX="$optval"; force_prefix=yes
Fabrice Bellard's avatar
Fabrice Bellard committed
703
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
704
  --libdir=*) libdir="$optval"; force_libdir=yes
705
  ;;
706 707
  --shlibdir=*) shlibdir="$optval"
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
708
  --incdir=*) incdir="$optval"
Diego Biurrun's avatar
Diego Biurrun committed
709
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
710
  --mandir=*) mandir="$optval"
711
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
712
  --source-path=*) source_path="$optval"
713
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
714
  --cross-prefix=*) cross_prefix="$optval"
715
  ;;
716 717
  --cross-compile) cross_compile=yes
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
718
  --cc=*) cc="$optval"
Fabrice Bellard's avatar
Fabrice Bellard committed
719
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
720
  --make=*) make="$optval"
721
  ;;
722
  --extra-cflags=*) add_cflags "$optval"
723
  ;;
724
  --extra-ldflags=*) add_ldflags "$optval"
725
  ;;
726
  --extra-libs=*) add_extralibs "$optval"
727
  ;;
Måns Rullgård's avatar
Måns Rullgård committed
728
  --build-suffix=*) BUILDSUF="$optval"
729
  ;;
730
  --arch=*) arch="$optval"
Fabrice Bellard's avatar
Fabrice Bellard committed
731
  ;;
732
  --cpu=*) cpu="$optval"
733
  ;;
734 735
  --powerpc-perf-enable) powerpc_perf="yes"
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
736 737
  --disable-mmx) mmx="no"
  ;;
738 739
  --disable-armv5te) armv5te="no"
  ;;
740 741
  --disable-iwmmxt) iwmmxt="no"
  ;;
742 743
  --disable-altivec) altivec="no"
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
744 745
  --enable-gprof) gprof="yes"
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
746 747
  --disable-v4l) v4l="no"
  ;;
Luca Abeni's avatar
Luca Abeni committed
748 749
  --disable-v4l2) v4l2="no"
  ;;
750 751
  --disable-bktr) bktr="no"
  ;;