configure 55.3 KB
Newer Older
Fabrice Bellard's avatar
Fabrice Bellard committed
1
#!/bin/sh
2
#
3 4 5 6 7
# FFmpeg configure script
#
# Copyright (c) 2000, 2001, 2002 Fabrice Bellard
# Copyright (c) 2005-2006 Diego Biurrun
# Copyright (c) 2005-2006 Mans Rullgard
8
#
9

10
# make sure we are running under a compatible shell
11 12 13
# try to make this part work with most shells

try_exec(){
14
    echo "Trying shell $1"
15 16 17
    type "$1" >/dev/null 2>&1 && exec "$@"
}

Måns Rullgård's avatar
Måns Rullgård committed
18
unset foo
19 20 21 22 23 24 25 26
(: ${foo%%bar}) 2>/dev/null
E1="$?"

(: ${foo?}) 2>/dev/null
E2="$?"

if test "$E1" != 0 || test "$E2" = 0; then
    echo "Broken shell detected.  Trying alternatives."
27 28 29 30 31 32 33 34 35 36 37 38
    export FF_CONF_EXEC
    if test "0$FF_CONF_EXEC" -lt 1; then
        FF_CONF_EXEC=1
        try_exec bash "$0" "$@"
    fi
    if test "0$FF_CONF_EXEC" -lt 2; then
        FF_CONF_EXEC=2
        try_exec ksh "$0" "$@"
    fi
    if test "0$FF_CONF_EXEC" -lt 3; then
        FF_CONF_EXEC=3
        try_exec /usr/xpg4/bin/sh "$0" "$@"
39 40
    fi
    echo "No compatible shell script interpreter found."
41 42 43 44 45 46
    echo "This configure script requires a POSIX compatible shell"
    echo "such as bash or ksh."
    if test "$BASH_VERSION" = '2.04.0(1)-release'; then
        echo "This bash version ($BASH_VERSION) is broken on your platform."
        echo "Upgrade to a later version if available."
    fi
47 48 49
    exit 1
fi

50 51 52 53 54 55
show_help(){
  echo "Usage: configure [options]"
  echo "Options: [defaults in brackets after descriptions]"
  echo
  echo "Standard options:"
  echo "  --help                   print this message"
56
  echo "  --log[=FILE|yes|no]      log tests and output to FILE [config.err]"
57
  echo "  --prefix=PREFIX          install in PREFIX [$PREFIX]"
58
  echo "  --libdir=DIR             install libs in DIR [PREFIX/lib]"
59
  echo "  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]"
60 61 62
  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]"
63
  echo "  --enable-libnut          enable NUT support via libnut [default=no]"
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
  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
90
  echo "  --enable-swscaler        software scaler support [default=no]"
91
  echo "  --enable-avisynth        allow reading AVISynth script files [default=no]"
92 93 94 95 96 97
  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]"
98
  echo "  --cross-compile          assume a cross-compiler is used"
99 100 101 102 103 104
  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 []"
105
  echo "  --arch=ARCH              select architecture  [$arch]"
106 107
  echo "  --cpu=CPU                selects the minimum cpu required (affects
                                   instruction selection, may crash on older CPUs)"
108 109 110
  echo "  --powerpc-perf-enable    enable performance report on PPC"
  echo "                           (requires enabling PMC)"
  echo "  --disable-mmx            disable MMX usage"
111
  echo "  --disable-armv5te        disable armv5te usage"
112 113 114 115 116 117 118 119 120
  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]"
121
  echo "  --disable-ipv6           disable ipv6 support [default=no]"
122 123 124 125 126
  echo "  --disable-zlib           disable zlib [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"
127
  echo "  --enable-extra-warnings  enable more compiler warnings"
128 129 130
  echo "  --disable-mpegaudio-hp   faster (but less accurate)"
  echo "                           MPEG audio decoding [default=no]"
  echo "  --disable-protocols      disable I/O protocols support [default=no]"
131
  echo "  --disable-ffmpeg         disable ffmpeg build"
132 133 134 135 136 137 138 139 140 141 142
  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"
143 144
  echo "  --disable-muxer=NAME     disables muxer NAME"
  echo "  --enable-muxer=NAME      enables muxer NAME"
145
  echo "  --disable-muxers         disables all muxers"
146 147
  echo "  --disable-demuxer=NAME   disables demuxer NAME"
  echo "  --enable-demuxer=NAME    enables demuxer NAME"
148
  echo "  --disable-demuxers       disables all demuxers"
149 150 151
  echo "  --enable-parser=NAME     enables parser NAME"
  echo "  --disable-parser=NAME    disables parser NAME"
  echo "  --disable-parsers        disables all parsers"
152 153 154 155
  echo ""
  echo "NOTE: Object files are built at the place where configure is launched."
  exit 1
}
156

157 158 159 160
log(){
    echo "$@" >>$logfile
}

161
log_file(){
Måns Rullgård's avatar
Måns Rullgård committed
162 163 164 165 166
    log BEGIN $1
    cat -n $1 >>$logfile
    log END $1
}

167
echolog(){
Måns Rullgård's avatar
Måns Rullgård committed
168
    log "$@"
169
    echo "$@"
170 171 172 173 174 175 176 177 178
}

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
179
    if enabled logging; then
180 181 182 183 184 185 186 187 188 189
        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
190 191 192 193
    rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
    exit 1
}

194
# "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z"
195 196 197 198
toupper(){
    echo "$@" | tr '[a-z]' '[A-Z]'
}

199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
set_all(){
    value=$1
    shift
    for var in $*; do
        eval $var=$value
    done
}

enable(){
    set_all yes $*
}

disable(){
    set_all no $*
}

215
enabled(){
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
    eval test "x\$$1" = "xyes"
}

enabled_all(){
    for opt; do
        enabled $opt || return 1
    done
}

enabled_any(){
    for opt; do
        enabled $opt && return 0
    done
}

print_config(){
    pfx=$1
    header=$2
    makefile=$3
    shift 3
    for cfg; do
        if enabled $cfg; then
            ucname="${pfx}`toupper $cfg`"
            echo "#define ${ucname} 1" >> $header
            echo "${ucname}=yes" >> $makefile
        fi
    done
243 244 245 246 247 248
}

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

249
save_flags(){
250
    flags_saved && return
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
    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 $*"
}

280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
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 "$@"
}

299
check_cmd(){
Måns Rullgård's avatar
Måns Rullgård committed
300
    log "$@"
301
    "$@" >>$logfile 2>&1
302 303
}

304
check_cc(){
305 306
    log check_cc "$@"
    cat >$TMPC
307
    log_file $TMPC
308
    check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
309 310 311 312
}

check_cpp(){
    log check_cpp "$@"
313
    cat >$TMPC
314
    log_file $TMPC
315
    check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
316 317 318
}

check_ld(){
319
    log check_ld "$@"
320
    check_cc || return
321
    check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
322 323 324
}

check_cflags(){
325 326
    log check_cflags "$@"
    check_cc "$@" <<EOF && add_cflags "$@"
327 328 329 330 331
int x;
EOF
}

check_ldflags(){
332 333 334 335 336
    log check_ldflags "$@"
    check_ld "$@" <<EOF && add_ldflags "$@"
int main(){
    return 0;
}
337 338 339 340
EOF
}

check_header(){
341
    log check_header "$@"
342 343
    header=$1
    shift
344
    check_cpp "$@" <<EOF
345 346 347
#include <$header>
int x;
EOF
348
    err=$?
349
    var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
350 351
    test "$err" = 0 && enable $var || disable $var
    return $err
352 353 354
}

check_func(){
355
    log check_func "$@"
356 357 358 359 360 361 362 363
    func=$1
    shift
    check_ld "$@" <<EOF
extern int $func();
int main(){
    $func();
}
EOF
364 365 366
    err=$?
    test "$err" = 0 && enable $func || disable $func
    return $err
367 368
}

369 370 371 372 373 374 375 376 377 378 379 380
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
}

381
check_exec(){
382
    check_ld "$@" && { test "$cross_compile" = yes || $TMPE >>$logfile 2>&1; }
383 384 385 386 387 388 389 390
}

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

393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
CONFIG_LIST='
    encoders
    decoders
    parsers
    muxers
    demuxers
    a52
    a52bin
    amr
    amr_nb
    amr_nb_fixed
    amr_wb
    audio_beos
    audio_oss
    avisynth
    beos_netserver
    bktr
    dc1394
    dts
    dv1394
    faac
    faad
    faadbin
    ffmpeg
    ffplay
    ffserver
    gpl
    ipv6
    libgsm
    libnut
    libogg
    libvorbis
    memalign_hack
    mp3lame
    mpegaudio_hp
    network
    pp
    protocols
    swscaler
    vhook
    video4linux
    video4linux2
435
    wince
436 437 438 439 440 441 442
    x264
    xvid
    zlib
'

HAVE_LIST='
    altivec_h
443
    beosthreads
444 445
    byteswap_h
    dcbzl
446
    dlfcn_h
447 448 449 450
    dlopen
    freetype2
    gprof
    imlib2
451
    inet_aton
452 453 454 455 456
    localtime_r
    lrintf
    malloc_h
    memalign
    mlib
457
    os2
458 459
    os2threads
    pthreads
460 461
    sdl
    sdl_video_size
462 463
    threads
    w32threads
464
'
465

466
# set temporary file name
Zdenek Kabelac's avatar
Zdenek Kabelac committed
467
if test ! -z "$TMPDIR" ; then
468
    TMPDIR1="${TMPDIR}"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
469
elif test ! -z "$TEMPDIR" ; then
470
    TMPDIR1="${TEMPDIR}"
Nick Kurshev's avatar
Nick Kurshev committed
471
else
472
    TMPDIR1="/tmp"
Nick Kurshev's avatar
Nick Kurshev committed
473 474
fi

475 476
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
477
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
478 479 480
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"

Fabrice Bellard's avatar
Fabrice Bellard committed
481
# default parameters
482
logging="yes"
483
logfile="config.err"
484 485
PREFIX="/usr/local"
libdir='${PREFIX}/lib'
486
shlibdir="$libdir"
487 488 489
incdir='${PREFIX}/include/ffmpeg'
mandir='${PREFIX}/man'
bindir='${PREFIX}/bin'
490
cross_prefix=""
491
cross_compile="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
492 493
cc="gcc"
ar="ar"
Michael Niedermayer's avatar
Michael Niedermayer committed
494
ranlib="ranlib"
495
make="make"
496
strip="strip"
497
arch=`uname -m`
498
cpu="generic"
499
powerpc_perf="no"
500
mmx="default"
501
cmov="no"
502
cmov_is_fast="no"
503
armv5te="default"
504
iwmmxt="default"
505
altivec="default"
506
dcbzl="no"
507
mmi="default"
508
case "$arch" in
509
  i386|i486|i586|i686|i86pc|BePC)
510
    arch="x86_32"
Fabrice Bellard's avatar
Fabrice Bellard committed
511
  ;;
512
  x86_64|amd64)
Diego Biurrun's avatar
typo  
Diego Biurrun committed
513
    arch="x86_32"
514
    canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
515 516
    if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
      if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
517
        arch="x86_64"
518
      fi
519 520
    fi
  ;;
521 522
  # armv4l is a subset of armv[567]*l
  arm|armv[4567]*l)
523
    arch="armv4l"
524
  ;;
525
  alpha)
526
    arch="alpha"
527
  ;;
528
  "Power Macintosh"|ppc|ppc64|powerpc)
529
    arch="powerpc"
530
  ;;
531
  mips|mipsel|IP*)
532
    arch="mips"
533
  ;;
534
  sun4u|sparc64)
535
    arch="sparc64"
536
  ;;
537
  sparc)
538
    arch="sparc"
539
  ;;
Alex Beregszaszi's avatar
Alex Beregszaszi committed
540
  sh4)
541
    arch="sh4"
Alex Beregszaszi's avatar
Alex Beregszaszi committed
542
  ;;
543
  parisc|parisc64)
544
    arch="parisc"
545 546
  ;;
  s390|s390x)
547
    arch="s390"
548 549
  ;;
  m68k)
550
    arch="m68k"
551 552
  ;;
  ia64)
553
    arch="ia64"
554
  ;;
Michael Benjamin's avatar
Michael Benjamin committed
555
  bfin)
556
    arch="bfin"
Michael Benjamin's avatar
Michael Benjamin committed
557
  ;;
Fabrice Bellard's avatar
Fabrice Bellard committed
558
  *)
559
    arch="unknown"
Fabrice Bellard's avatar
Fabrice Bellard committed
560 561 562
  ;;
esac
gprof="no"
563 564
video4linux="yes"
video4linux2="yes"
565
bktr="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
566
audio_oss="yes"
567
audio_beos="no"
568
dv1394="yes"
569
dc1394="no"
Fabrice Bellard's avatar
Fabrice Bellard committed
570
network="yes"
571
ipv6="yes"
572
zlib="yes"
573
libgsm="no"
574
mp3lame="no"
575
libnut="no"
576
libogg="no"
577
libvorbis="no"
578 579
faad="no"
faadbin="no"
580
faac="no"
581
xvid="no"
582
x264="no"
583
a52="no"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
584
a52bin="no"
585
dts="no"
586
pp="no"
587
mingw32="no"
588
wince="no"
589
os2="no"
590
lstatic="yes"
591
lshared="no"
592 593
optimize="yes"
debug="yes"
594
extrawarnings="no"
595
dostrip="yes"
596
installstrip="-s"
597
extralibs="-lm"
598
bigendian="no"
599
vhook="default"
600
avisynth="no"
601
dlfcn_h="no"
602
dlopen="no"
603
mpegaudio_hp="yes"
604
SHFLAGS='-shared -Wl,-soname,$@'
605
VHOOKSHFLAGS='$(SHFLAGS)'
606
beos_netserver="no"
607
protocols="yes"
608
ffmpeg="yes"
609
ffserver="yes"
610
ffplay="yes"
611
LIBOBJFLAGS=""
612
FFLDFLAGS=-Wl,--warn-common
613
LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
614
FFSERVERLDFLAGS=-Wl,-E
615
LDCONFIG="ldconfig"
616 617
LIBPREF="lib"
LIBSUF=".a"
618
LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
619 620
SLIBPREF="lib"
SLIBSUF=".so"
621
SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
622 623
SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
Fabrice Bellard's avatar
Fabrice Bellard committed
624
EXESUF=""
625
BUILDSUF=""
626
amr_nb="no"
627
amr_wb="no"
Zdenek Kabelac's avatar
Zdenek Kabelac committed
628
amr_nb_fixed="no"
629
amr_if2="no"
630
mlib="no"
631
pthreads="no"
Luca Abeni's avatar
Luca Abeni committed
632
swscaler="no"
633
gpl="no"
634
memalign_hack="no"
635
asmalign_pot="unknown"
636
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
637 638 639 640 641

# OS specific
targetos=`uname -s`
case $targetos in
BeOS)
642
PREFIX="/boot/home/config"
643
# helps building libavcodec
644
add_cflags "-DPIC -fomit-frame-pointer"
645
# 3 gcc releases known for BeOS, each with ugly bugs
646
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
647 648 649 650 651
case "$gcc_version" in
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
mmx="no"
;;
*20010315*) echo "BeBits gcc"
652
add_cflags "-fno-expensive-optimizations"
653 654
;;
esac
655
SHFLAGS=-nostart
Diego Biurrun's avatar
Diego Biurrun committed
656
# disable Linux things
657
audio_oss="no"
658 659
video4linux="no"
video4linux2="no"
660
dv1394="no"
Diego Biurrun's avatar
Diego Biurrun committed
661
# enable BeOS things
662
audio_beos="yes"
663
beosthreads="yes"
664 665 666 667 668
# 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
669
beos_netserver="yes"
670
extralibs="-lnet"
671
fi ;;
672
SunOS)
673 674
video4linux="no"
video4linux2="no"
675
audio_oss="no"
676
dv1394="no"
677
make="gmake"
678
FFLDFLAGS=""
679
FFSERVERLDFLAGS=""
680
SHFLAGS="-shared -Wl,-h,\$@"
681
add_extralibs "-lsocket -lnsl"
682
;;
683
NetBSD)
684 685
video4linux="no"
video4linux2="no"
686
bktr="yes"
687 688 689
audio_oss="yes"
dv1394="no"
make="gmake"
690
add_extralibs "-lossaudio"
691
;;
692
OpenBSD)
693 694
video4linux="no"
video4linux2="no"
695
bktr="yes"
696 697
audio_oss="yes"
dv1394="no"
698
need_memalign="no"
699
make="gmake"
700
LIBOBJFLAGS="\$(PIC)"
701
LDCONFIG="ldconfig -m \$(shlibdir)"
702 703 704 705
SHFLAGS='-shared'
SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBVERSION)'
SLIBNAME_WITH_VERSION='$(SLIBNAME)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME)'
706
add_extralibs "-lossaudio"
707
;;
708
FreeBSD)
709 710
video4linux="no"
video4linux2="no"
711
bktr="yes"
712
audio_oss="yes"
713
dv1394="no"
714
make="gmake"
715
need_memalign="no"
716
add_cflags "-pthread"
717
;;
718
GNU/kFreeBSD)
719 720
video4linux="no"
video4linux2="no"
721 722 723
bktr="yes"
audio_oss="yes"
dv1394="no"
724
add_cflags "-pthread"
725
;;
726
BSD/OS)
727 728
video4linux="no"
video4linux2="no"
729
bktr="yes"
Fabrice Bellard's avatar
Fabrice Bellard committed
730
audio_oss="yes"
731
dv1394="no"
732 733
extralibs="-lpoll -lgnugetopt -lm"
make="gmake"
734 735
strip="strip -d"
installstrip=""
736
;;
737
Darwin)
738
cc="cc"
739 740
video4linux="no"
video4linux2="no"
741
audio_oss="no"
742
dv1394="no"
743
need_memalign="no"
744
SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
745
VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@'
746
extralibs=""
747
strip="strip -x"
748
installstrip=""
749
FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
750
SLIBSUF=".dylib"
751
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
752
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
753
FFSERVERLDFLAGS=-Wl,-bind_at_load
754
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
755
;;
756
MINGW32*)
Fabrice Bellard's avatar
Fabrice Bellard committed
757
# Note: the rest of the mingw32 config is done afterwards as mingw32
Diego Biurrun's avatar
Diego Biurrun committed
758
# can be forced on the command line for Linux cross compilation.
759 760
mingw32="yes"
;;
761
CYGWIN*)
762
targetos=CYGWIN
763
shlibdir="$bindir"
764 765
video4linux="no"
video4linux2="no"
766
audio_oss="yes"
767
dv1394="no"
768
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
769
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
770
extralibs=""
771
EXESUF=".exe"
772 773 774 775 776
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'
777
;;
778
Linux)
779
LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
780
;;
781
IRIX*)
782
targetos=IRIX
783
ranlib="echo ignoring ranlib"
784 785
video4linux="no"
video4linux2="no"
786 787 788
audio_oss="no"
make="gmake"
;;
789 790
OS/2)
TMPE=$TMPE".exe"
791
ar="emxomfar -p128"
792 793
ranlib="echo ignoring ranlib"
strip="echo ignoring strip"
794
add_cflags "-Zomf"
795
FFLDFLAGS="-Zomf -Zstack 16384 -s"
796
SHFLAGS="-Zdll -Zomf"
797
FFSERVERLDFLAGS=""
798 799 800 801
LIBPREF=""
LIBSUF=".lib"
SLIBPREF=""
SLIBSUF=".dll"
Fabrice Bellard's avatar
Fabrice Bellard committed
802
EXESUF=".exe"
803
extralibs=""
804
pkg_requires=""
805 806
video4linux="no"
video4linux2="no"
807
audio_oss="no"
808
dv1394="no"
809
ffserver="no"
810
vhook="no"
811
os2="yes"
812
os2threads="yes"
813
;;
814 815 816
*)
targetos="${targetos}-UNKNOWN"
;;
817
esac
Fabrice Bellard's avatar
Fabrice Bellard committed
818

819
# find source path
820
source_path="`dirname \"$0\"`"
821 822
source_path_used="yes"
if test -z "$source_path" -o "$source_path" = "." ; then
823
    source_path="`pwd`"
824
    source_path_used="no"
825 826
else
    source_path="`cd \"$source_path\"; pwd`"
827 828
    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
829 830
fi

831 832