RISC-V: Detect python and pick best one for calling multilib-generator
authorKito Cheng <kito.cheng@sifive.com>
Tue, 20 Jul 2021 03:02:27 +0000 (11:02 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 20 Jul 2021 03:24:39 +0000 (11:24 +0800)
gcc/

* config.gcc (riscv*-*-*): Detect which python is available.

gcc/config.gcc

index 93e2b32..3df9b52 100644 (file)
@@ -4730,9 +4730,10 @@ case "${target}" in
                                echo "--with-multilib-list= can't used with --with-multilib-generator= at same time" 1>&2
                                exit 1
                        fi
+                       PYTHON=`which python || which python3 || which python2`
                        case "${target}" in
                        riscv*-*-elf*)
-                               if ${srcdir}/config/riscv/multilib-generator \
+                               if ${PYTHON} ${srcdir}/config/riscv/multilib-generator \
                                        `echo ${with_multilib_generator} | sed 's/;/ /g'`\
                                        > t-multilib-config;
                                then