]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/genmultilib
Update copyright years.
[thirdparty/gcc.git] / gcc / genmultilib
index 292ecc4e20dd7a2b9366c873a6a840a1ff580ec4..85b241cd72a73c399a82c44a8c6b41082a44e7aa 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh 
 # Generates multilib.h.
-#   Copyright (C) 1994-2020 Free Software Foundation, Inc.
+#   Copyright (C) 1994-2024 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -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
 
@@ -250,6 +250,10 @@ if [ -n "${dirnames}" ]; then
     for opts in `echo ${set} | sed -e 's|/| |'g`; do
       patt="/"
       for opt in `echo ${opts} | sed -e 's_|_ _'g`; do
+       if [ -z "$1" ]; then
+         echo 1>&2 "Error calling $0: No dirname for option: $opt"
+         exit 1
+       fi
         if [ "$1" != "${opt}" ]; then
           todirnames="${todirnames} -e s|/${opt}/|/${1}/|g"
          patt="${patt}${1}/"
@@ -306,6 +310,10 @@ if [ -n "${osdirnames}" ]; then
       for opts in `echo ${set} | sed -e 's|/| |'g`; do
         patt="/"
         for opt in `echo ${opts} | sed -e 's_|_ _'g`; do
+       if [ -z "$1" ]; then
+         echo 1>&2 "Error calling $0: No osdirname for option: $opt"
+         exit 1
+       fi
           if [ "$1" != "${opt}" ]; then
             toosdirnames="${toosdirnames} -e s|/${opt}/|/${1}/|g"
            patt="${patt}${1}/"
@@ -340,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
@@ -445,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.
@@ -483,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