Message ID | 20210720032529.44593-1-kito.cheng@sifive.com |
---|---|
State | New |
Headers | show |
Series | [committed] RISC-V: Detect python and pick best one for calling multilib-generator | expand |
On Jul 20 2021, Kito Cheng wrote: > diff --git a/gcc/config.gcc b/gcc/config.gcc > index 93e2b3219b9..3df9b52cf25 100644 > --- a/gcc/config.gcc > +++ b/gcc/config.gcc > @@ -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` which is a non-standard utility. Additionally, you will get extra output on stderr when one of the commands is not found. Andreas.
> > diff --git a/gcc/config.gcc b/gcc/config.gcc > > index 93e2b3219b9..3df9b52cf25 100644 > > --- a/gcc/config.gcc > > +++ b/gcc/config.gcc > > @@ -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` > > which is a non-standard utility. hmmm, good point, let me revert this at this moment. > Additionally, you will get extra > output on stderr when one of the commands is not found. I tried PYTHON will get an empty string if all of those are not found, no stderr from which command.
On Jul 21 2021, Kito Cheng wrote: >> Additionally, you will get extra >> output on stderr when one of the commands is not found. > > I tried PYTHON will get an empty string if all of those are not found, > no stderr from which command. $ PATH=/usr/bin which foo >/dev/null which: no foo in (/usr/bin) Andreas.
diff --git a/gcc/config.gcc b/gcc/config.gcc index 93e2b3219b9..3df9b52cf25 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -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