]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/scripts/detect_cc.sh
12 err
"Detect compiler and linker versions, generate mk/cc.mk"
14 err
"Usage: ./detect_cc.sh [OPTION]..."
16 err
"Defaults for the options are specified in brackets."
19 err
" -h, --help Display this help and exit"
20 err
" --cc=path C compiler to use"
21 err
" --cxx=path C++ compiler to use"
22 err
" --lto=[y|n] Attempt to configure for LTO"
49 err
"Unrecognized option $i"
55 CC_TYPE
=$
($CC -v 2>&1 |
grep -o -E '\w+ version' |
head -1 |
awk '{ print $1 }')
56 CXX_TYPE
=$
($CXX -v 2>&1 |
grep -o -E '\w+ version' |
head -1 |
awk '{ print $1 }')
57 LD_TYPE
=$
(ld
-v 2>&1 |
awk '{print $2}')
59 if [ "$CC_TYPE" != "$CXX_TYPE" ]; then
60 err
"C compiler is $CC_TYPE but C++ compiler is $CXX_TYPE"
61 err
"This may result in errors"
65 if [ "$LTO" = "y" ]; then
66 if [ "$CC_TYPE" = "clang" ]; then
67 if [ "$LD_TYPE" != "gold" ]; then
68 err
"Using LTO with clang requires the gold linker."
80 echo "CC_TYPE=$CC_TYPE"