Merge "Indent build/make/configure.sh"

This commit is contained in:
Johann 2014-11-22 13:14:56 -08:00 committed by Gerrit Code Review
commit dfdfb2d0ff

View File

@ -20,7 +20,6 @@ die_unknown(){
exit 1
}
die() {
echo "$@"
echo
@ -33,32 +32,27 @@ die() {
exit 1
}
log(){
echo "$@" >>$logfile
}
log_file(){
log BEGIN $1
cat -n $1 >>$logfile
log END $1
}
log_echo() {
echo "$@"
log "$@"
}
fwrite () {
outfile=$1
shift
echo "$@" >> ${outfile}
}
show_help_pre(){
for opt in ${CMDLINE_SELECT}; do
opt2=`echo $opt | sed -e 's;_;-;g'`
@ -100,7 +94,6 @@ Install options:
EOF
}
show_help_post(){
cat <<EOF
@ -119,7 +112,6 @@ EOF
exit 1
}
show_targets() {
while [ -n "$*" ]; do
if [ "${1%%-*}" = "${2%%-*}" ]; then
@ -137,7 +129,6 @@ show_targets() {
done
}
show_help() {
show_help_pre
show_help_post
@ -154,7 +145,6 @@ set_all(){
done
}
is_in(){
value=$1
shift
@ -164,33 +154,27 @@ is_in(){
return 1
}
add_cflags() {
CFLAGS="${CFLAGS} $@"
CXXFLAGS="${CXXFLAGS} $@"
}
add_cflags_only() {
CFLAGS="${CFLAGS} $@"
}
add_cxxflags_only() {
CXXFLAGS="${CXXFLAGS} $@"
}
add_ldflags() {
LDFLAGS="${LDFLAGS} $@"
}
add_asflags() {
ASFLAGS="${ASFLAGS} $@"
}
add_extralibs() {
extralibs="${extralibs} $@"
}
@ -214,7 +198,6 @@ disabled(){
eval test "x\$$1" = "xno"
}
soft_enable() {
for var in $*; do
if ! disabled $var; then
@ -233,7 +216,6 @@ soft_disable() {
done
}
#
# Text Processing Functions
#
@ -241,12 +223,10 @@ toupper(){
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}
tolower(){
echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
}
#
# Temporary File Functions
#
@ -325,7 +305,6 @@ int x;
EOF
}
check_cflags() {
log check_cflags "$@"
check_cc -Werror "$@" <<EOF
@ -338,11 +317,13 @@ check_cxxflags() {
# Catch CFLAGS that trigger CXX warnings
case "$CXX" in
*c++-analyzer|*clang++|*g++*) check_cxx -Werror "$@" <<EOF
*c++-analyzer|*clang++|*g++*)
check_cxx -Werror "$@" <<EOF
int x;
EOF
;;
*) check_cxx -Werror "$@" <<EOF
*)
check_cxx -Werror "$@" <<EOF
int x;
EOF
;;
@ -415,7 +396,7 @@ write_common_config_targets() {
fi
true;
done
true
true
}
write_common_target_config_mk() {
@ -474,7 +455,6 @@ EOF
CXX="${saved_CXX}"
}
write_common_target_config_h() {
print_webm_license ${TMP_H} "/*" " */"
cat >> ${TMP_H} << EOF
@ -497,7 +477,8 @@ process_common_cmdline() {
for opt in "$@"; do
optval="${opt#*=}"
case "$opt" in
--child) enable_feature child
--child)
enable_feature child
;;
--log*)
logging="$optval"
@ -507,13 +488,17 @@ process_common_cmdline() {
logfile=/dev/null
fi
;;
--target=*) toolchain="${toolchain:-${optval}}"
--target=*)
toolchain="${toolchain:-${optval}}"
;;
--force-target=*) toolchain="${toolchain:-${optval}}"; enable_feature force_toolchain
--force-target=*)
toolchain="${toolchain:-${optval}}"
enable_feature force_toolchain
;;
--cpu)
;;
--cpu=*) tune_cpu="$optval"
--cpu=*)
tune_cpu="$optval"
;;
--extra-cflags=*)
extra_cflags="${optval}"
@ -576,9 +561,11 @@ process_common_cmdline() {
--libc|--as|--prefix|--libdir|--sdk-path)
die "Option ${opt} requires argument"
;;
--help|-h) show_help
--help|-h)
show_help
;;
*) die_unknown $opt
*)
die_unknown $opt
;;
esac
done
@ -588,13 +575,13 @@ process_cmdline() {
for opt do
optval="${opt#*=}"
case "$opt" in
*) process_common_cmdline $opt
*)
process_common_cmdline $opt
;;
esac
done
}
post_process_common_cmdline() {
prefix="${prefix:-/usr/local}"
prefix="${prefix%/}"
@ -605,7 +592,6 @@ post_process_common_cmdline() {
fi
}
post_process_cmdline() {
true;
}
@ -726,8 +712,12 @@ process_common_toolchain() {
# Enable the architecture family
case ${tgt_isa} in
arm*) enable_feature arm;;
mips*) enable_feature mips;;
arm*)
enable_feature arm
;;
mips*)
enable_feature mips
;;
esac
# PIC is probably what we want when building shared libs
@ -849,8 +839,7 @@ EOF
check_add_cflags -march=armv7-a -mfloat-abi=${float_abi}
check_add_asflags -march=armv7-a -mfloat-abi=${float_abi}
if enabled neon || enabled neon_asm
then
if enabled neon || enabled neon_asm; then
check_add_cflags -mfpu=neon #-ftree-vectorize
check_add_asflags -mfpu=neon
fi
@ -1032,7 +1021,6 @@ EOF
enabled shared && add_cflags --shared
fi
;;
esac
;;
mips*)
@ -1209,7 +1197,8 @@ EOF
enabled debug && add_asflags -g
EXE_SFX=.exe
;;
*) log "Warning: Unknown os $tgt_os while setting up $AS flags"
*)
log "Warning: Unknown os $tgt_os while setting up $AS flags"
;;
esac
;;
@ -1275,25 +1264,29 @@ EOF
# Try to determine target endianness
check_cc <<EOF
unsigned int e = 'O'<<24 | '2'<<16 | 'B'<<8 | 'E';
unsigned int e = 'O'<<24 | '2'<<16 | 'B'<<8 | 'E';
EOF
[ -f "${TMP_O}" ] && od -A n -t x1 "${TMP_O}" | tr -d '\n' |
grep '4f *32 *42 *45' >/dev/null 2>&1 && enable_feature big_endian
# Try to find which inline keywords are supported
check_cc <<EOF && INLINE="inline"
static inline function() {}
static inline function() {}
EOF
check_cc <<EOF && INLINE="__inline__ __attribute__((always_inline))"
static __attribute__((always_inline)) function() {}
static __attribute__((always_inline)) function() {}
EOF
# Almost every platform uses pthreads.
if enabled multithread; then
case ${toolchain} in
*-win*-vs*);;
*-android-gcc);;
*) check_header pthread.h && add_extralibs -lpthread
*-win*-vs*)
;;
*-android-gcc)
;;
*)
check_header pthread.h && add_extralibs -lpthread
;;
esac
fi