Commit 01d31e16 authored by Mans Rullgard's avatar Mans Rullgard

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: 's avatarMans Rullgard <mans@mansr.com>
parent cd52ec95
......@@ -589,11 +589,11 @@ add_cppflags(){
}
add_cflags(){
append CFLAGS $($filter_cflags "$@")
append CFLAGS $($cflags_filter "$@")
}
add_asflags(){
append ASFLAGS $($filter_asflags "$@")
append ASFLAGS $($asflags_filter "$@")
}
add_ldflags(){
......@@ -656,7 +656,7 @@ check_ld(){
for f; do
test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
done
check_cc $($filter_cflags $flags) || return
check_cc $($cflags_filter $flags) || return
check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs
}
......@@ -683,7 +683,7 @@ EOF
check_cflags(){
log check_cflags "$@"
set -- $($filter_cflags "$@")
set -- $($cflags_filter "$@")
check_cc "$@" <<EOF && append CFLAGS "$@"
int x;
EOF
......@@ -1945,8 +1945,8 @@ EOF
die "Sanity test failed."
fi
filter_asflags=echo
filter_cflags=echo
asflags_filter=echo
cflags_filter=echo
if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
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_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
speed_cflags='-O3'
size_cflags='-Os'
cflags_speed='-O3'
cflags_size='-Os'
elif $cc -v 2>&1 | grep -qi ^gcc; then
cc_type=gcc
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 $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
fi
speed_cflags='-O3'
size_cflags='-Os'
cflags_speed='-O3'
cflags_size='-Os'
elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc
cc_ident=$($cc --version | head -n1)
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
speed_cflags='-O3'
size_cflags='-Os'
noopt_cflags='-O1'
cflags_speed='-O3'
cflags_size='-Os'
cflags_noopt='-O1'
elif $cc -v 2>&1 | grep -q xlc; then
cc_type=xlc
cc_ident=$($cc -qversion 2>/dev/null | head -n1)
speed_cflags='-O5'
size_cflags='-O5 -qcompact'
cflags_speed='-O5'
cflags_size='-O5 -qcompact'
elif $cc -V 2>/dev/null | grep -q Compaq; then
cc_type=ccc
cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3)
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
debuglevel=3
add_ldflags -Wl,-z,now # calls to libots crash without this
speed_cflags='-fast'
size_cflags='-O1'
cflags_speed='-fast'
cflags_size='-O1'
elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
test -d "$sysroot" || die "No valid sysroot specified."
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"
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
speed_cflags='-O3'
size_cflags='-Os'
filter_asflags="filter_out -W${armcc_opt}*"
cflags_speed='-O3'
cflags_size='-Os'
asflags_filter="filter_out -W${armcc_opt}*"
elif $cc -version 2>/dev/null | grep -q TMS470; then
cc_type=tms470
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__=
CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
AS_DEPFLAGS='-MMD'
speed_cflags='-O3 -mf=5'
size_cflags='-O3 -mf=2'
filter_cflags=tms470_flags
cflags_speed='-O3 -mf=5'
cflags_size='-O3 -mf=2'
cflags_filter=tms470_flags
tms470_flags(){
for flag; do
case $flag in
......@@ -2052,17 +2052,17 @@ elif $cc -v 2>&1 | grep -q clang; then
cc_ident=$($cc --version | head -n1)
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
speed_cflags='-O3'
size_cflags='-Os'
cflags_speed='-O3'
cflags_size='-Os'
elif $cc -V 2>&1 | grep -q Sun; then
cc_type=suncc
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)'
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
add_ldflags -xc99
speed_cflags='-O5'
size_cflags='-O5 -xspace'
filter_cflags=suncc_flags
cflags_speed='-O5'
cflags_size='-O5 -xspace'
cflags_filter=suncc_flags
suncc_flags(){
for flag; do
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_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
speed_cflags='-O2'
size_cflags='-Os'
filter_cflags='filter_out -Wdisabled-optimization'
cflags_speed='-O2'
cflags_size='-Os'
cflags_filter='filter_out -Wdisabled-optimization'
elif $cc -v 2>&1 | grep -q Open64; then
cc_type=open64
cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
speed_cflags='-O2'
size_cflags='-Os'
filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
cflags_speed='-O2'
cflags_size='-Os'
cflags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
elif $cc -V 2>&1 | grep -q Portland; then
cc_type=pgi
cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
opt_common='-alias=ansi -Mlre -Mpre'
speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common"
size_cflags="-O2 -Munroll=c:1 $opt_common"
noopt_cflags="-O1"
filter_cflags=pgi_flags
cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
cflags_size="-O2 -Munroll=c:1 $opt_common"
cflags_noopt="-O1"
cflags_filter=pgi_flags
pgi_flags(){
for flag; do
case $flag in
......@@ -3115,11 +3115,11 @@ fi
if [ -n "$optflags" ]; then
add_cflags $optflags
elif enabled small; then
add_cflags $size_cflags
add_cflags $cflags_size
elif enabled optimizations; then
add_cflags $speed_cflags
add_cflags $cflags_speed
else
add_cflags $noopt_cflags
add_cflags $cflags_noopt
fi
check_cflags -fno-math-errno
check_cflags -fno-signed-zeros
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment