From 42ab401fd3227ec1235d71f368f21f7fa08c77d3 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 21 Aug 2013 18:11:45 -0700 Subject: [PATCH] configure: rename enable() to enable_feature() + disable() -> disable_feature() for balance this avoids shadowing the bash builtin 'enable' allowing the scripts to be linted with checkbashisms Change-Id: Ia11cf86c92ec25bd14e69427b0ac0a9a61a5f7a5 --- build/make/configure.sh | 60 ++++++++++++++++---------------- configure | 76 ++++++++++++++++++++--------------------- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/build/make/configure.sh b/build/make/configure.sh index d8e65e32d..52aea9d49 100755 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -198,11 +198,11 @@ add_extralibs() { # # Boolean Manipulation Functions # -enable(){ +enable_feature(){ set_all yes $* } -disable(){ +disable_feature(){ set_all no $* } @@ -219,7 +219,7 @@ soft_enable() { for var in $*; do if ! disabled $var; then log_echo " enabling $var" - enable $var + enable_feature $var fi done } @@ -228,7 +228,7 @@ soft_disable() { for var in $*; do if ! enabled $var; then log_echo " disabling $var" - disable $var + disable_feature $var fi done } @@ -251,10 +251,10 @@ tolower(){ # Temporary File Functions # source_path=${0%/*} -enable source_path_used +enable_feature source_path_used if test -z "$source_path" -o "$source_path" = "." ; then source_path="`pwd`" - disable source_path_used + disable_feature source_path_used fi if test ! -z "$TMPDIR" ; then @@ -317,8 +317,8 @@ check_header(){ header=$1 shift var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'` - disable $var - check_cpp "$@" </dev/null | grep GNU >/dev/null && enable gnu_strip + ${STRIP} -V 2>/dev/null | grep GNU >/dev/null && enable_feature gnu_strip # Try to determine target endianness check_cc </dev/null 2>&1 && enable big_endian + grep '4f *32 *42 *45' >/dev/null 2>&1 && enable_feature big_endian # Try to find which inline keywords are supported check_cc </dev/null 2>&1 && enable install_docs -enable install_bins -enable install_libs - -enable static -enable optimizations -enable fast_unaligned #allow unaligned accesses, if supported by hw -enable md5 -enable spatial_resampling -enable multithread -enable os_support -enable temporal_denoising - -[ -d ${source_path}/../include ] && enable alt_tree_layout +enabled doxygen && php -v >/dev/null 2>&1 && enable_feature install_docs +enable_feature install_bins +enable_feature install_libs + +enable_feature static +enable_feature optimizations +enable_feature fast_unaligned #allow unaligned accesses, if supported by hw +enable_feature md5 +enable_feature spatial_resampling +enable_feature multithread +enable_feature os_support +enable_feature temporal_denoising + +[ -d ${source_path}/../include ] && enable_feature alt_tree_layout for d in vp8 vp9; do - [ -d ${source_path}/${d} ] && disable alt_tree_layout; + [ -d ${source_path}/${d} ] && disable_feature alt_tree_layout; done if ! enabled alt_tree_layout; then @@ -200,10 +200,10 @@ else [ -f ${source_path}/../include/vpx/vp8dx.h ] && CODECS="${CODECS} vp8_decoder" [ -f ${source_path}/../include/vpx/vp9cx.h ] && CODECS="${CODECS} vp9_encoder" [ -f ${source_path}/../include/vpx/vp9dx.h ] && CODECS="${CODECS} vp9_decoder" -[ -f ${source_path}/../include/vpx/vp8cx.h ] || disable vp8_encoder -[ -f ${source_path}/../include/vpx/vp8dx.h ] || disable vp8_decoder -[ -f ${source_path}/../include/vpx/vp9cx.h ] || disable vp9_encoder -[ -f ${source_path}/../include/vpx/vp9dx.h ] || disable vp9_decoder +[ -f ${source_path}/../include/vpx/vp8cx.h ] || disable_feature vp8_encoder +[ -f ${source_path}/../include/vpx/vp8dx.h ] || disable_feature vp8_decoder +[ -f ${source_path}/../include/vpx/vp9cx.h ] || disable_feature vp9_encoder +[ -f ${source_path}/../include/vpx/vp9dx.h ] || disable_feature vp9_decoder [ -f ${source_path}/../lib/*/*mt.lib ] && soft_enable static_msvcrt fi @@ -358,7 +358,7 @@ process_cmdline() { for opt do optval="${opt#*=}" case "$opt" in - --disable-codecs) for c in ${CODECS}; do disable $c; done ;; + --disable-codecs) for c in ${CODECS}; do disable_feature $c; done ;; --enable-?*|--disable-?*) eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then @@ -384,8 +384,8 @@ post_process_cmdline() { # If the codec family is enabled, enable all components of that family. log_echo "Configuring selected codecs" for c in ${CODECS}; do - disabled ${c%%_*} && disable ${c} - enabled ${c%%_*} && enable ${c} + disabled ${c%%_*} && disable_feature ${c} + enabled ${c%%_*} && enable_feature ${c} done # Enable all detected codecs, if they haven't been disabled @@ -393,12 +393,12 @@ post_process_cmdline() { # Enable the codec family if any component of that family is enabled for c in ${CODECS}; do - enabled $c && enable ${c%_*} + enabled $c && enable_feature ${c%_*} done # Set the {en,de}coders variable if any algorithm in that class is enabled for c in ${CODECS}; do - enabled ${c} && enable ${c##*_}s + enabled ${c} && enable_feature ${c##*_}s done } @@ -508,13 +508,13 @@ process_detect() { fi if [ -z "$CC" ] || enabled external_build; then echo "Bypassing toolchain for environment detection." - enable external_build + enable_feature external_build check_header() { log fake_check_header "$@" header=$1 shift var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'` - disable $var + disable_feature $var # Headers common to all environments case $header in stdio.h) @@ -526,7 +526,7 @@ process_detect() { [ -f "${d##-I}/$header" ] && result=true && break done ${result:-true} - esac && enable $var + esac && enable_feature $var # Specialize windows and POSIX environments. case $toolchain in @@ -534,7 +534,7 @@ process_detect() { case $header-$toolchain in stdint*-gcc) true;; *) false;; - esac && enable $var + esac && enable_feature $var ;; *) case $header in @@ -543,7 +543,7 @@ process_detect() { sys/mman.h) true;; unistd.h) true;; *) false;; - esac && enable $var + esac && enable_feature $var esac enabled $var } @@ -561,7 +561,7 @@ EOF check_header sys/mman.h check_header unistd.h # for sysconf(3) and friends. - check_header vpx/vpx_integer.h -I${source_path} && enable vpx_ports + check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports } process_toolchain() { @@ -643,14 +643,14 @@ process_toolchain() { # ccache only really works on gcc toolchains enabled gcc || soft_disable ccache if enabled mips; then - enable dequant_tokens - enable dc_recon + enable_feature dequant_tokens + enable_feature dc_recon fi # Enable the postbuild target if building for visual studio. case "$tgt_cc" in - vs*) enable msvs - enable solution + vs*) enable_feature msvs + enable_feature solution vs_version=${tgt_cc##vs} case $vs_version in [789]) -- 2.40.0