public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-299] Use CONFIG_SHELL-/bin/sh in genmultilib
Date: Thu, 27 Apr 2023 12:00:27 +0000 (GMT)	[thread overview]
Message-ID: <20230427120027.D8A5638555AE@sourceware.org> (raw)

https://gcc.gnu.org/g:b5f04a4db59f61f416f23801902cbf4d0f50dc15

commit r14-299-gb5f04a4db59f61f416f23801902cbf4d0f50dc15
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Apr 27 09:00:14 2023 -0300

    Use CONFIG_SHELL-/bin/sh in genmultilib
    
    There are still shells on some systems that lack the ability to start
    scripts when not using the shell name explicitly.  Adjust genmultilib
    to use ${CONFIG_SHELL-/bin/sh} the same way configure does.
    
    
    for  gcc/ChangeLog
    
            * genmultilib: Use CONFIG_SHELL to run sub-scripts.

Diff:
---
 gcc/genmultilib | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/gcc/genmultilib b/gcc/genmultilib
index f8bd90b116c..6683c349026 100644
--- a/gcc/genmultilib
+++ b/gcc/genmultilib
@@ -170,23 +170,23 @@ if [ "$#" != "0" ]; then
     all=${initial}`echo $first | sed -e 's_|_/_'g`
     first=`echo $first | sed -e 's_|_ _'g`
     echo ${all}/
-    initial="${initial}${all}/" ./tmpmultilib $@
-    ./tmpmultilib $first $@ | grep -v "^${all}"
+    initial="${initial}${all}/" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib $@
+    ${CONFIG_SHELL-/bin/sh} ./tmpmultilib $first $@ | grep -v "^${all}"
     ;;
   *)
     for opt in `echo $first | sed -e 's|/| |'g`; do
       echo ${initial}${opt}/
     done
-    ./tmpmultilib $@
+    ${CONFIG_SHELL-/bin/sh} ./tmpmultilib $@
     for opt in `echo $first | sed -e 's|/| |'g`; do
-      initial="${initial}${opt}/" ./tmpmultilib $@
+      initial="${initial}${opt}/" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib $@
     done
   esac
 fi
 EOF
 chmod +x tmpmultilib
 
-combinations=`initial=/ ./tmpmultilib ${options}`
+combinations=`initial=/ ${CONFIG_SHELL-/bin/sh} ./tmpmultilib ${options}`
 
 # If there exceptions, weed them out now
 if [ -n "${exceptions}" ]; then
@@ -210,7 +210,7 @@ cat >>tmpmultilib2 <<\EOF
   done
 EOF
   chmod +x tmpmultilib2
-  combinations=`./tmpmultilib2 ${combinations}`
+  combinations=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 ${combinations}`
 fi
 
 # If the MULTILIB_REQUIRED list are provided,
@@ -236,7 +236,7 @@ cat >>tmpmultilib2 <<\EOF
 EOF
 
    chmod +x tmpmultilib2
-   combinations=`./tmpmultilib2 ${combinations}`
+   combinations=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 ${combinations}`
 
 fi
 
@@ -348,12 +348,12 @@ if [ "$#" = "0" ]; then
 else
   first=$1
   shift
-  dirout="${dirout}" optout="${optout}" ./tmpmultilib2 $@
+  dirout="${dirout}" optout="${optout}" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 $@
   l=`echo ${first} | sed -e 's/=.*$//' -e 's/?/=/g'`
   r=`echo ${first} | sed -e 's/^.*=//' -e 's/?/=/g'`
   if expr " ${optout} " : ".* ${l} .*" > /dev/null; then
     newopt=`echo " ${optout} " | sed -e "s/ ${l} / ${r} /" -e 's/^ //' -e 's/ $//'`
-    dirout="${dirout}" optout="${newopt}" ./tmpmultilib2 $@
+    dirout="${dirout}" optout="${newopt}" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib2 $@
   fi
 fi
 EOF
@@ -453,14 +453,14 @@ chmod +x tmpmultilib4
 # correct list of options and negations.
 for combo in ${combinations}; do
   # Use the directory names rather than the option names.
-  dirout=`./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"`
+  dirout=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"`
 
   # Look through the options.  We must output each option that is
   # present, and negate each option that is not present.
-  optout=`./tmpmultilib4 "${combo}" "${options}"`
+  optout=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib4 "${combo}" "${options}"`
 
   # Output the line with all appropriate matches.
-  dirout="${dirout}" optout="${optout}" ./tmpmultilib2
+  dirout="${dirout}" optout="${optout}" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib2
 done
 
 # Terminate the list of string.
@@ -491,11 +491,11 @@ for rrule in ${multilib_reuse}; do
   if expr "${combinations} " : ".*/${combo}/.*" > /dev/null; then
     if echo "/${copts}/" | grep -E "${options_re}" > /dev/null; then
       combo="/${combo}/"
-      dirout=`./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"`
+      dirout=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib3 "${combo}" "${todirnames}" "${toosdirnames}" "${enable_multilib}"`
       copts="/${copts}/"
-      optout=`./tmpmultilib4 "${copts}" "${options}"`
+      optout=`${CONFIG_SHELL-/bin/sh} ./tmpmultilib4 "${copts}" "${options}"`
       # Output the line with all appropriate matches.
-      dirout="${dirout}" optout="${optout}" ./tmpmultilib2
+      dirout="${dirout}" optout="${optout}" ${CONFIG_SHELL-/bin/sh} ./tmpmultilib2
     else
       echo "The rule ${rrule} contains an option absent from MULTILIB_OPTIONS." >&2
       exit 1

                 reply	other threads:[~2023-04-27 12:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230427120027.D8A5638555AE@sourceware.org \
    --to=aoliva@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).