+# Terminate the list of string.
+echo "NULL"
+echo "};"
+
+# Output all of the matches now as option and that is the same as that, with
+# a semicolon trailer. Include all of the normal options as well.
+# Note, the format of the matches is reversed compared
+# to what we want, so switch them around.
+echo ""
+echo "static const char *const multilib_matches_raw[] = {"
+for match in ${matches}; do
+ l=`echo ${match} | sed -e 's/=.*$//' -e 's/?/=/g'`
+ r=`echo ${match} | sed -e 's/^.*=//' -e 's/?/=/g'`
+ echo "\"${r} ${l};\","
+done
+for set in ${options}; do
+ for opt in `echo ${set} | sed -e 's_[/|]_ _'g`; do
+ echo "\"${opt} ${opt};\","
+ done
+done
+echo "NULL"
+echo "};"
+
+# Output the default options now
+echo ""
+echo "static const char *multilib_extra = \"${extra}\";"
+
+# Output the exclusion rules now
+echo ""
+echo "static const char *const multilib_exclusions_raw[] = {"
+for rule in ${exclusions}; do
+ s=`echo ${rule} | sed -e 's,/, ,g'`
+ echo "\"${s};\","
+done
+echo "NULL"
+echo "};"
+
+# Output the options now
+moptions=`echo ${options} | sed -e 's,[ ][ ]*, ,g'`
+echo ""
+echo "static const char *multilib_options = \"${moptions}\";"
+
+# Finally output the disable flag if specified
+if [ "x${disable_multilib}" = xyes ]; then
+ echo ""
+ echo "#define DISABLE_MULTILIB 1"
+fi