configure: name some variables more consistently

Name variables pertaining to various types of flags with 'cflags' etc
as prefix instead of suffix.

Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
Mans Rullgard 2012-07-20 12:02:18 +01:00
parent cd52ec95bb
commit 01d31e16f1
1 changed files with 41 additions and 41 deletions

82
configure vendored
View File

@ -589,11 +589,11 @@ add_cppflags(){
} }
add_cflags(){ add_cflags(){
append CFLAGS $($filter_cflags "$@") append CFLAGS $($cflags_filter "$@")
} }
add_asflags(){ add_asflags(){
append ASFLAGS $($filter_asflags "$@") append ASFLAGS $($asflags_filter "$@")
} }
add_ldflags(){ add_ldflags(){
@ -656,7 +656,7 @@ check_ld(){
for f; do for f; do
test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f" test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
done done
check_cc $($filter_cflags $flags) || return check_cc $($cflags_filter $flags) || return
check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs
} }
@ -683,7 +683,7 @@ EOF
check_cflags(){ check_cflags(){
log check_cflags "$@" log check_cflags "$@"
set -- $($filter_cflags "$@") set -- $($cflags_filter "$@")
check_cc "$@" <<EOF && append CFLAGS "$@" check_cc "$@" <<EOF && append CFLAGS "$@"
int x; int x;
EOF EOF
@ -1945,8 +1945,8 @@ EOF
die "Sanity test failed." die "Sanity test failed."
fi fi
filter_asflags=echo asflags_filter=echo
filter_cflags=echo cflags_filter=echo
if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
cc_type=llvm_gcc cc_type=llvm_gcc
@ -1954,8 +1954,8 @@ if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
cc_ident="llvm-gcc $($cc -dumpversion) $gcc_extra_ver" cc_ident="llvm-gcc $($cc -dumpversion) $gcc_extra_ver"
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
speed_cflags='-O3' cflags_speed='-O3'
size_cflags='-Os' cflags_size='-Os'
elif $cc -v 2>&1 | grep -qi ^gcc; then elif $cc -v 2>&1 | grep -qi ^gcc; then
cc_type=gcc cc_type=gcc
gcc_version=$($cc --version | head -n1) gcc_version=$($cc --version | head -n1)
@ -1967,29 +1967,29 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
fi fi
speed_cflags='-O3' cflags_speed='-O3'
size_cflags='-Os' cflags_size='-Os'
elif $cc --version 2>/dev/null | grep -q Intel; then elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc cc_type=icc
cc_ident=$($cc --version | head -n1) cc_ident=$($cc --version | head -n1)
CC_DEPFLAGS='-MMD' CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD'
speed_cflags='-O3' cflags_speed='-O3'
size_cflags='-Os' cflags_size='-Os'
noopt_cflags='-O1' cflags_noopt='-O1'
elif $cc -v 2>&1 | grep -q xlc; then elif $cc -v 2>&1 | grep -q xlc; then
cc_type=xlc cc_type=xlc
cc_ident=$($cc -qversion 2>/dev/null | head -n1) cc_ident=$($cc -qversion 2>/dev/null | head -n1)
speed_cflags='-O5' cflags_speed='-O5'
size_cflags='-O5 -qcompact' cflags_size='-O5 -qcompact'
elif $cc -V 2>/dev/null | grep -q Compaq; then elif $cc -V 2>/dev/null | grep -q Compaq; then
cc_type=ccc cc_type=ccc
cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3) cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3)
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M' DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
debuglevel=3 debuglevel=3
add_ldflags -Wl,-z,now # calls to libots crash without this add_ldflags -Wl,-z,now # calls to libots crash without this
speed_cflags='-fast' cflags_speed='-fast'
size_cflags='-O1' cflags_size='-O1'
elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
test -d "$sysroot" || die "No valid sysroot specified." test -d "$sysroot" || die "No valid sysroot specified."
cc_type=armcc cc_type=armcc
@ -2005,9 +2005,9 @@ elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
as_default="${cross_prefix}gcc" as_default="${cross_prefix}gcc"
CC_DEPFLAGS='-MMD' CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD'
speed_cflags='-O3' cflags_speed='-O3'
size_cflags='-Os' cflags_size='-Os'
filter_asflags="filter_out -W${armcc_opt}*" asflags_filter="filter_out -W${armcc_opt}*"
elif $cc -version 2>/dev/null | grep -q TMS470; then elif $cc -version 2>/dev/null | grep -q TMS470; then
cc_type=tms470 cc_type=tms470
cc_ident=$($cc -version | head -n1 | tr -s ' ') cc_ident=$($cc -version | head -n1 | tr -s ' ')
@ -2020,9 +2020,9 @@ elif $cc -version 2>/dev/null | grep -q TMS470; then
add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__= add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)' CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
AS_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD'
speed_cflags='-O3 -mf=5' cflags_speed='-O3 -mf=5'
size_cflags='-O3 -mf=2' cflags_size='-O3 -mf=2'
filter_cflags=tms470_flags cflags_filter=tms470_flags
tms470_flags(){ tms470_flags(){
for flag; do for flag; do
case $flag in case $flag in
@ -2052,17 +2052,17 @@ elif $cc -v 2>&1 | grep -q clang; then
cc_ident=$($cc --version | head -n1) cc_ident=$($cc --version | head -n1)
CC_DEPFLAGS='-MMD' CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD'
speed_cflags='-O3' cflags_speed='-O3'
size_cflags='-Os' cflags_size='-Os'
elif $cc -V 2>&1 | grep -q Sun; then elif $cc -V 2>&1 | grep -q Sun; then
cc_type=suncc cc_type=suncc
cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-) cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1' DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
add_ldflags -xc99 add_ldflags -xc99
speed_cflags='-O5' cflags_speed='-O5'
size_cflags='-O5 -xspace' cflags_size='-O5 -xspace'
filter_cflags=suncc_flags cflags_filter=suncc_flags
suncc_flags(){ suncc_flags(){
for flag; do for flag; do
case $flag in case $flag in
@ -2101,25 +2101,25 @@ elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
speed_cflags='-O2' cflags_speed='-O2'
size_cflags='-Os' cflags_size='-Os'
filter_cflags='filter_out -Wdisabled-optimization' cflags_filter='filter_out -Wdisabled-optimization'
elif $cc -v 2>&1 | grep -q Open64; then elif $cc -v 2>&1 | grep -q Open64; then
cc_type=open64 cc_type=open64
cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
speed_cflags='-O2' cflags_speed='-O2'
size_cflags='-Os' cflags_size='-Os'
filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' cflags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
elif $cc -V 2>&1 | grep -q Portland; then elif $cc -V 2>&1 | grep -q Portland; then
cc_type=pgi cc_type=pgi
cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')" cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
opt_common='-alias=ansi -Mlre -Mpre' opt_common='-alias=ansi -Mlre -Mpre'
speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common" cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
size_cflags="-O2 -Munroll=c:1 $opt_common" cflags_size="-O2 -Munroll=c:1 $opt_common"
noopt_cflags="-O1" cflags_noopt="-O1"
filter_cflags=pgi_flags cflags_filter=pgi_flags
pgi_flags(){ pgi_flags(){
for flag; do for flag; do
case $flag in case $flag in
@ -3115,11 +3115,11 @@ fi
if [ -n "$optflags" ]; then if [ -n "$optflags" ]; then
add_cflags $optflags add_cflags $optflags
elif enabled small; then elif enabled small; then
add_cflags $size_cflags add_cflags $cflags_size
elif enabled optimizations; then elif enabled optimizations; then
add_cflags $speed_cflags add_cflags $cflags_speed
else else
add_cflags $noopt_cflags add_cflags $cflags_noopt
fi fi
check_cflags -fno-math-errno check_cflags -fno-math-errno
check_cflags -fno-signed-zeros check_cflags -fno-signed-zeros