OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 ## | 2 ## |
3 ## configure | 3 ## configure |
4 ## | 4 ## |
5 ## This script is the front-end to the build system. It provides a similar | 5 ## This script is the front-end to the build system. It provides a similar |
6 ## interface to standard configure scripts with some extra bits for dealing | 6 ## interface to standard configure scripts with some extra bits for dealing |
7 ## with toolchains that differ from the standard POSIX interface and | 7 ## with toolchains that differ from the standard POSIX interface and |
8 ## for extracting subsets of the source tree. In theory, reusable parts | 8 ## for extracting subsets of the source tree. In theory, reusable parts |
9 ## of this script were intended to live in build/make/configure.sh, | 9 ## of this script were intended to live in build/make/configure.sh, |
10 ## but in practice, the line is pretty blurry. | 10 ## but in practice, the line is pretty blurry. |
11 ## | 11 ## |
12 ## This build system is based in part on the FFmpeg configure script. | 12 ## This build system is based in part on the FFmpeg configure script. |
13 ## | 13 ## |
14 | 14 |
15 #source_path="`dirname \"$0\"`" | 15 #source_path="`dirname \"$0\"`" |
16 source_path=${0%/*} | 16 source_path=${0%/*} |
17 . "${source_path}/build/make/configure.sh" | 17 . "${source_path}/build/make/configure.sh" |
18 | 18 |
19 show_help(){ | 19 show_help(){ |
20 show_help_pre | 20 show_help_pre |
21 cat << EOF | 21 cat << EOF |
22 Advanced options: | 22 Advanced options: |
23 ${toggle_libs} libraries | 23 ${toggle_libs} libraries |
24 ${toggle_examples} examples | 24 ${toggle_examples} examples |
25 ${toggle_docs} documentation | 25 ${toggle_docs} documentation |
26 ${toggle_unit_tests} unit tests | 26 ${toggle_unit_tests} unit tests |
27 ${toggle_decode_perf_tests} build decoder perf tests with unit tests | 27 ${toggle_decode_perf_tests} build decoder perf tests with unit tests |
| 28 ${toggle_encode_perf_tests} build encoder perf tests with unit tests |
28 --libc=PATH path to alternate libc | 29 --libc=PATH path to alternate libc |
29 --size-limit=WxH max size to allow in the decoder | 30 --size-limit=WxH max size to allow in the decoder |
30 --as={yasm|nasm|auto} use specified assembler [auto, yasm preferred] | 31 --as={yasm|nasm|auto} use specified assembler [auto, yasm preferred] |
31 --sdk-path=PATH path to root of sdk (android builds only) | 32 --sdk-path=PATH path to root of sdk (android builds only) |
32 ${toggle_fast_unaligned} don't use unaligned accesses, even when | 33 ${toggle_fast_unaligned} don't use unaligned accesses, even when |
33 supported by hardware [auto] | 34 supported by hardware [auto] |
34 ${toggle_codec_srcs} in/exclude codec library source code | 35 ${toggle_codec_srcs} in/exclude codec library source code |
35 ${toggle_debug_libs} in/exclude debug version of libraries | 36 ${toggle_debug_libs} in/exclude debug version of libraries |
36 ${toggle_static_msvcrt} use static MSVCRT (VS builds only) | 37 ${toggle_static_msvcrt} use static MSVCRT (VS builds only) |
37 ${toggle_vp8} VP8 codec support | 38 ${toggle_vp8} VP8 codec support |
38 ${toggle_vp9} VP9 codec support | 39 ${toggle_vp9} VP9 codec support |
39 ${toggle_internal_stats} output of encoder internal stats for debug, if
supported (encoders) | 40 ${toggle_internal_stats} output of encoder internal stats for debug, if
supported (encoders) |
40 ${toggle_mem_tracker} track memory usage | 41 ${toggle_mem_tracker} track memory usage |
41 ${toggle_postproc} postprocessing | 42 ${toggle_postproc} postprocessing |
42 ${toggle_vp9_postproc} vp9 specific postprocessing | 43 ${toggle_vp9_postproc} vp9 specific postprocessing |
43 ${toggle_multithread} multithreaded encoding and decoding | 44 ${toggle_multithread} multithreaded encoding and decoding |
44 ${toggle_spatial_resampling} spatial sampling (scaling) support | 45 ${toggle_spatial_resampling} spatial sampling (scaling) support |
45 ${toggle_realtime_only} enable this option while building for real-tim
e encoding | 46 ${toggle_realtime_only} enable this option while building for real-tim
e encoding |
46 ${toggle_onthefly_bitpacking} enable on-the-fly bitpacking in real-time enco
ding | 47 ${toggle_onthefly_bitpacking} enable on-the-fly bitpacking in real-time enco
ding |
47 ${toggle_error_concealment} enable this option to get a decoder which is a
ble to conceal losses | 48 ${toggle_error_concealment} enable this option to get a decoder which is a
ble to conceal losses |
| 49 ${toggle_coefficient_range_checking} |
| 50 enable decoder to check if intermediate |
| 51 transform coefficients are in valid range |
48 ${toggle_runtime_cpu_detect} runtime cpu detection | 52 ${toggle_runtime_cpu_detect} runtime cpu detection |
49 ${toggle_shared} shared library support | 53 ${toggle_shared} shared library support |
50 ${toggle_static} static library support | 54 ${toggle_static} static library support |
51 ${toggle_small} favor smaller size over speed | 55 ${toggle_small} favor smaller size over speed |
52 ${toggle_postproc_visualizer} macro block / block level visualizers | 56 ${toggle_postproc_visualizer} macro block / block level visualizers |
53 ${toggle_multi_res_encoding} enable multiple-resolution encoding | 57 ${toggle_multi_res_encoding} enable multiple-resolution encoding |
54 ${toggle_temporal_denoising} enable temporal denoising and disable the spat
ial denoiser | 58 ${toggle_temporal_denoising} enable temporal denoising and disable the spat
ial denoiser |
55 ${toggle_webm_io} enable input from and output to WebM container | 59 ${toggle_webm_io} enable input from and output to WebM container |
56 ${toggle_libyuv} enable libyuv | 60 ${toggle_libyuv} enable libyuv |
57 | 61 |
58 Codecs: | 62 Codecs: |
59 Codecs can be selectively enabled or disabled individually, or by family: | 63 Codecs can be selectively enabled or disabled individually, or by family: |
60 --disable-<codec> | 64 --disable-<codec> |
61 is equivalent to: | 65 is equivalent to: |
62 --disable-<codec>-encoder | 66 --disable-<codec>-encoder |
63 --disable-<codec>-decoder | 67 --disable-<codec>-decoder |
64 | 68 |
65 Codecs available in this distribution: | 69 Codecs available in this distribution: |
66 EOF | 70 EOF |
67 #restore editor state ' | 71 #restore editor state ' |
68 | 72 |
69 local family; | 73 family=""; |
70 local last_family; | 74 last_family=""; |
71 local c; | 75 c=""; |
72 local str; | 76 str=""; |
73 for c in ${CODECS}; do | 77 for c in ${CODECS}; do |
74 family=${c%_*} | 78 family=${c%_*} |
75 if [ "${family}" != "${last_family}" ]; then | 79 if [ "${family}" != "${last_family}" ]; then |
76 [ -z "${str}" ] || echo "${str}" | 80 [ -z "${str}" ] || echo "${str}" |
77 str="$(printf ' %10s:' ${family})" | 81 str="$(printf ' %10s:' ${family})" |
78 fi | 82 fi |
79 str="${str} $(printf '%10s' ${c#*_})" | 83 str="${str} $(printf '%10s' ${c#*_})" |
80 last_family=${family} | 84 last_family=${family} |
81 done | 85 done |
82 echo "${str}" | 86 echo "${str}" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 HAVE_LIST=" | 268 HAVE_LIST=" |
265 ${ARCH_EXT_LIST} | 269 ${ARCH_EXT_LIST} |
266 vpx_ports | 270 vpx_ports |
267 stdint_h | 271 stdint_h |
268 alt_tree_layout | 272 alt_tree_layout |
269 pthread_h | 273 pthread_h |
270 sys_mman_h | 274 sys_mman_h |
271 unistd_h | 275 unistd_h |
272 " | 276 " |
273 EXPERIMENT_LIST=" | 277 EXPERIMENT_LIST=" |
274 multiple_arf | |
275 spatial_svc | 278 spatial_svc |
276 denoising | 279 vp9_temporal_denoising |
277 fp_mb_stats | 280 fp_mb_stats |
278 " | 281 " |
279 CONFIG_LIST=" | 282 CONFIG_LIST=" |
280 external_build | 283 external_build |
281 install_docs | 284 install_docs |
282 install_bins | 285 install_bins |
283 install_libs | 286 install_libs |
284 install_srcs | 287 install_srcs |
285 use_x86inc | 288 use_x86inc |
286 debug | 289 debug |
(...skipping 30 matching lines...) Expand all Loading... |
317 error_concealment | 320 error_concealment |
318 shared | 321 shared |
319 static | 322 static |
320 small | 323 small |
321 postproc_visualizer | 324 postproc_visualizer |
322 os_support | 325 os_support |
323 unit_tests | 326 unit_tests |
324 webm_io | 327 webm_io |
325 libyuv | 328 libyuv |
326 decode_perf_tests | 329 decode_perf_tests |
| 330 encode_perf_tests |
327 multi_res_encoding | 331 multi_res_encoding |
328 temporal_denoising | 332 temporal_denoising |
| 333 coefficient_range_checking |
329 experimental | 334 experimental |
330 size_limit | 335 size_limit |
331 ${EXPERIMENT_LIST} | 336 ${EXPERIMENT_LIST} |
332 " | 337 " |
333 CMDLINE_SELECT=" | 338 CMDLINE_SELECT=" |
334 external_build | 339 external_build |
335 extra_warnings | 340 extra_warnings |
336 werror | 341 werror |
337 install_docs | 342 install_docs |
338 install_bins | 343 install_bins |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 onthefly_bitpacking | 378 onthefly_bitpacking |
374 error_concealment | 379 error_concealment |
375 shared | 380 shared |
376 static | 381 static |
377 small | 382 small |
378 postproc_visualizer | 383 postproc_visualizer |
379 unit_tests | 384 unit_tests |
380 webm_io | 385 webm_io |
381 libyuv | 386 libyuv |
382 decode_perf_tests | 387 decode_perf_tests |
| 388 encode_perf_tests |
383 multi_res_encoding | 389 multi_res_encoding |
384 temporal_denoising | 390 temporal_denoising |
| 391 coefficient_range_checking |
385 experimental | 392 experimental |
386 " | 393 " |
387 | 394 |
388 process_cmdline() { | 395 process_cmdline() { |
389 for opt do | 396 for opt do |
390 optval="${opt#*=}" | 397 optval="${opt#*=}" |
391 case "$opt" in | 398 case "$opt" in |
392 --disable-codecs) for c in ${CODECS}; do disable_feature $c; done ;; | 399 --disable-codecs) for c in ${CODECS}; do disable_feature $c; done ;; |
393 --enable-?*|--disable-?*) | 400 --enable-?*|--disable-?*) |
394 eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` | 401 eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` |
395 if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then | 402 if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then |
396 if enabled experimental; then | 403 if enabled experimental; then |
397 ${action}_feature $option | 404 ${action}_feature $option |
398 else | 405 else |
399 log_echo "Ignoring $opt -- not in experimental mode." | 406 log_echo "Ignoring $opt -- not in experimental mode." |
400 fi | 407 fi |
401 else | 408 else |
402 process_common_cmdline $opt | 409 process_common_cmdline $opt |
403 fi | 410 fi |
404 ;; | 411 ;; |
405 *) process_common_cmdline "$opt" | 412 *) process_common_cmdline "$opt" |
406 ;; | 413 ;; |
407 esac | 414 esac |
408 done | 415 done |
409 } | 416 } |
410 | 417 |
411 post_process_cmdline() { | 418 post_process_cmdline() { |
412 local c | 419 c="" |
413 | 420 |
414 # If the codec family is disabled, disable all components of that family. | 421 # If the codec family is disabled, disable all components of that family. |
415 # If the codec family is enabled, enable all components of that family. | 422 # If the codec family is enabled, enable all components of that family. |
416 log_echo "Configuring selected codecs" | 423 log_echo "Configuring selected codecs" |
417 for c in ${CODECS}; do | 424 for c in ${CODECS}; do |
418 disabled ${c%%_*} && disable_feature ${c} | 425 disabled ${c%%_*} && disable_feature ${c} |
419 enabled ${c%%_*} && enable_feature ${c} | 426 enabled ${c%%_*} && enable_feature ${c} |
420 done | 427 done |
421 | 428 |
422 # Enable all detected codecs, if they haven't been disabled | 429 # Enable all detected codecs, if they haven't been disabled |
(...skipping 26 matching lines...) Expand all Loading... |
449 done | 456 done |
450 fi | 457 fi |
451 | 458 |
452 # The write_common_config (config.mk) logic is deferred until after the | 459 # The write_common_config (config.mk) logic is deferred until after the |
453 # recursive calls to configure complete, because we want our universal | 460 # recursive calls to configure complete, because we want our universal |
454 # targets to be executed last. | 461 # targets to be executed last. |
455 write_common_config_targets | 462 write_common_config_targets |
456 enabled universal && echo "FAT_ARCHS=${fat_bin_archs}" >> config.mk | 463 enabled universal && echo "FAT_ARCHS=${fat_bin_archs}" >> config.mk |
457 | 464 |
458 # Calculate the default distribution name, based on the enabled features | 465 # Calculate the default distribution name, based on the enabled features |
459 local cf | 466 cf="" |
460 local DIST_DIR=vpx | 467 DIST_DIR=vpx |
461 for cf in $CODEC_FAMILIES; do | 468 for cf in $CODEC_FAMILIES; do |
462 if enabled ${cf}_encoder && enabled ${cf}_decoder; then | 469 if enabled ${cf}_encoder && enabled ${cf}_decoder; then |
463 DIST_DIR="${DIST_DIR}-${cf}" | 470 DIST_DIR="${DIST_DIR}-${cf}" |
464 elif enabled ${cf}_encoder; then | 471 elif enabled ${cf}_encoder; then |
465 DIST_DIR="${DIST_DIR}-${cf}cx" | 472 DIST_DIR="${DIST_DIR}-${cf}cx" |
466 elif enabled ${cf}_decoder; then | 473 elif enabled ${cf}_decoder; then |
467 DIST_DIR="${DIST_DIR}-${cf}dx" | 474 DIST_DIR="${DIST_DIR}-${cf}dx" |
468 fi | 475 fi |
469 done | 476 done |
470 enabled debug_libs && DIST_DIR="${DIST_DIR}-debug" | 477 enabled debug_libs && DIST_DIR="${DIST_DIR}-debug" |
471 enabled codec_srcs && DIST_DIR="${DIST_DIR}-src" | 478 enabled codec_srcs && DIST_DIR="${DIST_DIR}-src" |
472 ! enabled postproc && ! enabled vp9_postproc && DIST_DIR="${DIST_DIR}-nopost
" | 479 ! enabled postproc && ! enabled vp9_postproc && DIST_DIR="${DIST_DIR}-nopost
" |
473 ! enabled multithread && DIST_DIR="${DIST_DIR}-nomt" | 480 ! enabled multithread && DIST_DIR="${DIST_DIR}-nomt" |
474 ! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs" | 481 ! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs" |
475 DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}" | 482 DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}" |
476 case "${tgt_os}" in | 483 case "${tgt_os}" in |
477 win*) enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_
DIR}md" | 484 win*) enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_
DIR}md" |
478 DIST_DIR="${DIST_DIR}-${tgt_cc}" | 485 DIST_DIR="${DIST_DIR}-${tgt_cc}" |
479 ;; | 486 ;; |
480 esac | 487 esac |
481 if [ -f "${source_path}/build/make/version.sh" ]; then | 488 if [ -f "${source_path}/build/make/version.sh" ]; then |
482 local ver=`"$source_path/build/make/version.sh" --bare "$source_path"` | 489 ver=`"$source_path/build/make/version.sh" --bare "$source_path"` |
483 DIST_DIR="${DIST_DIR}-${ver}" | 490 DIST_DIR="${DIST_DIR}-${ver}" |
484 VERSION_STRING=${ver} | 491 VERSION_STRING=${ver} |
485 ver=${ver%%-*} | 492 ver=${ver%%-*} |
486 VERSION_PATCH=${ver##*.} | 493 VERSION_PATCH=${ver##*.} |
487 ver=${ver%.*} | 494 ver=${ver%.*} |
488 VERSION_MINOR=${ver##*.} | 495 VERSION_MINOR=${ver##*.} |
489 ver=${ver#v} | 496 ver=${ver#v} |
490 VERSION_MAJOR=${ver%.*} | 497 VERSION_MAJOR=${ver%.*} |
491 fi | 498 fi |
492 enabled child || cat <<EOF >> config.mk | 499 enabled child || cat <<EOF >> config.mk |
(...skipping 13 matching lines...) Expand all Loading... |
506 VERSION_PATCH=${VERSION_PATCH} | 513 VERSION_PATCH=${VERSION_PATCH} |
507 | 514 |
508 CONFIGURE_ARGS=${CONFIGURE_ARGS} | 515 CONFIGURE_ARGS=${CONFIGURE_ARGS} |
509 EOF | 516 EOF |
510 enabled child || echo "CONFIGURE_ARGS?=${CONFIGURE_ARGS}" >> config.mk | 517 enabled child || echo "CONFIGURE_ARGS?=${CONFIGURE_ARGS}" >> config.mk |
511 | 518 |
512 # | 519 # |
513 # Write makefiles for all enabled targets | 520 # Write makefiles for all enabled targets |
514 # | 521 # |
515 for tgt in libs examples docs solution; do | 522 for tgt in libs examples docs solution; do |
516 local tgt_fn="$tgt-$toolchain.mk" | 523 tgt_fn="$tgt-$toolchain.mk" |
517 | 524 |
518 if enabled $tgt; then | 525 if enabled $tgt; then |
519 echo "Creating makefiles for ${toolchain} ${tgt}" | 526 echo "Creating makefiles for ${toolchain} ${tgt}" |
520 write_common_target_config_mk $tgt_fn ${BUILD_PFX}vpx_config.h | 527 write_common_target_config_mk $tgt_fn ${BUILD_PFX}vpx_config.h |
521 #write_${tgt}_config | 528 #write_${tgt}_config |
522 fi | 529 fi |
523 done | 530 done |
524 | 531 |
525 } | 532 } |
526 | 533 |
(...skipping 18 matching lines...) Expand all Loading... |
545 header=$1 | 552 header=$1 |
546 shift | 553 shift |
547 var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'` | 554 var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'` |
548 disable_feature $var | 555 disable_feature $var |
549 # Headers common to all environments | 556 # Headers common to all environments |
550 case $header in | 557 case $header in |
551 stdio.h) | 558 stdio.h) |
552 true; | 559 true; |
553 ;; | 560 ;; |
554 *) | 561 *) |
555 local result=false | 562 result=false |
556 for d in "$@"; do | 563 for d in "$@"; do |
557 [ -f "${d##-I}/$header" ] && result=true && break | 564 [ -f "${d##-I}/$header" ] && result=true && break |
558 done | 565 done |
559 ${result:-true} | 566 ${result:-true} |
560 esac && enable_feature $var | 567 esac && enable_feature $var |
561 | 568 |
562 # Specialize windows and POSIX environments. | 569 # Specialize windows and POSIX environments. |
563 case $toolchain in | 570 case $toolchain in |
564 *-win*-*) | 571 *-win*-*) |
565 case $header-$toolchain in | 572 case $header-$toolchain in |
(...skipping 28 matching lines...) Expand all Loading... |
594 | 601 |
595 check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports | 602 check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports |
596 } | 603 } |
597 | 604 |
598 process_toolchain() { | 605 process_toolchain() { |
599 process_common_toolchain | 606 process_common_toolchain |
600 | 607 |
601 # Handle universal binaries for this architecture | 608 # Handle universal binaries for this architecture |
602 case $toolchain in | 609 case $toolchain in |
603 universal-darwin*) | 610 universal-darwin*) |
604 local darwin_ver=${tgt_os##darwin} | 611 darwin_ver=${tgt_os##darwin} |
605 | 612 |
606 # Snow Leopard (10.6/darwin10) dropped support for PPC | 613 # Snow Leopard (10.6/darwin10) dropped support for PPC |
607 # Include PPC support for all prior versions | 614 # Include PPC support for all prior versions |
608 if [ $darwin_ver -lt 10 ]; then | 615 if [ $darwin_ver -lt 10 ]; then |
609 fat_bin_archs="$fat_bin_archs ppc32-${tgt_os}-gcc" | 616 fat_bin_archs="$fat_bin_archs ppc32-${tgt_os}-gcc" |
610 fi | 617 fi |
611 | 618 |
612 # Tiger (10.4/darwin8) brought support for x86 | 619 # Tiger (10.4/darwin8) brought support for x86 |
613 if [ $darwin_ver -ge 8 ]; then | 620 if [ $darwin_ver -ge 8 ]; then |
614 fat_bin_archs="$fat_bin_archs x86-${tgt_os}-${tgt_cc}" | 621 fat_bin_archs="$fat_bin_archs x86-${tgt_os}-${tgt_cc}" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 ## | 776 ## |
770 ## END APPLICATION SPECIFIC CONFIGURATION | 777 ## END APPLICATION SPECIFIC CONFIGURATION |
771 ## | 778 ## |
772 CONFIGURE_ARGS="$@" | 779 CONFIGURE_ARGS="$@" |
773 process "$@" | 780 process "$@" |
774 print_webm_license ${BUILD_PFX}vpx_config.c "/*" " */" | 781 print_webm_license ${BUILD_PFX}vpx_config.c "/*" " */" |
775 cat <<EOF >> ${BUILD_PFX}vpx_config.c | 782 cat <<EOF >> ${BUILD_PFX}vpx_config.c |
776 static const char* const cfg = "$CONFIGURE_ARGS"; | 783 static const char* const cfg = "$CONFIGURE_ARGS"; |
777 const char *vpx_codec_build_config(void) {return cfg;} | 784 const char *vpx_codec_build_config(void) {return cfg;} |
778 EOF | 785 EOF |
OLD | NEW |