#!/bin/sh
# Generates multilib.h.
-# Copyright (C) 1994, 1995, 1996, 1997, 1999, 2002, 2007
+# Copyright (C) 1994, 1995, 1996, 1997, 1999, 2002, 2007, 2012
# Free Software Foundation, Inc.
#This file is part of GCC.
# the os directory names are used exclusively. Use the mapping when
# there is no one-to-one equivalence between GCC levels and the OS.
+# The optional eighth argument is the multiarch name.
+
# The last option should be "yes" if multilibs are enabled. If it is not
# "yes", all GCC multilib dir names will be ".".
extra=$5
exclusions=$6
osdirnames=$7
-enable_multilib=$8
+multiarch=$8
+enable_multilib=$9
echo "static const char *const multilib_raw[] = {"
# names.
toosdirnames=
defaultosdirname=
+if [ -n "${multiarch}" ]; then
+ defaultosdirname=::${multiarch}
+fi
if [ -n "${osdirnames}" ]; then
set x ${osdirnames}
shift
case "$1" in
.=*)
defaultosdirname=`echo $1 | sed 's|^.=|:|'`
+ if [ -n "${multiarch}" ]; then
+ defaultosdirname=${defaultosdirname}:${multiarch}
+ fi
shift
;;
*=*)
dirout=`echo ${combo} | sed -e 's/=/-/g'`
fi
# Remove the leading and trailing slashes.
- dirout=`echo ${dirout} | sed -e 's|^/||' -e 's|/$||g'`
+ dirout=`echo ${dirout} | sed -e 's|^/||' -e 's|/*:/*|:|' -e 's|/$||g'`
# Use the OS directory names rather than the option names.
if [ -n "${toosdirnames}" ]; then
osdirout=`echo ${combo} | sed ${toosdirnames}`
# Remove the leading and trailing slashes.
- osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/$||g'`
+ osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/*:/*|:|' -e 's|/$||g'`
if [ "x${enable_multilib}" != xyes ]; then
dirout=".:${osdirout}"
disable_multilib=yes