OSDN Git Service

Backport from 2012-03-28 mainline r185907.
[pf3gnuchains/gcc-fork.git] / gcc / config / avr / genmultilib.awk
index 7bc3b4a..0aab49a 100644 (file)
@@ -26,9 +26,6 @@
 # FORMAT = "Makefile": Generate Makefile Snipet that sets some
 #                      MULTILIB_* Variables as needed.
 #
-# FORMAT = "multilib.h": Generate C Header intended to override
-#                      (parts of) multilib.h used in gcc.c.
-#
 ##################################################################
 
 BEGIN {
@@ -41,7 +38,7 @@ BEGIN {
 
     mtiny[0] = ""
     mtiny[1] = "tiny-stack"
-    option["tiny-stack"] = "mtiny-stack"
+    option["tiny-stack"] = "msp8"
 }
 
 ##################################################################
@@ -54,18 +51,6 @@ BEGIN {
        next
     else if (comment == 1)
     {
-       if (FORMAT == "multilib.h")
-       {
-           print "/*"
-           print "   Auto-generated C header"
-           print "   Generated by    : ./gcc/config/avr/genmultilib.awk"
-           print "   Generated from  : ./gcc/config/avr/avr-mcus.def"
-           print "   Used by         : ./gcc/gcc.c via tm.h"
-           print "   Purpose         : Override multilib_raw[] from multilib.h"
-           print "*/"
-           print "/*"
-       }
-
        if (FORMAT == "Makefile")
        {
            print "# Auto-generated Makefile Snip"
@@ -78,15 +63,12 @@ BEGIN {
 
     comment = 2;
 
-    if (FORMAT == "multilib.h")
-       gsub ("#", "  ")
-
     print
 }
 
 /^$/ {
-    if (comment && FORMAT == "multilib.h")
-       print "*/"
+    # The first empty line stops copy-pasting the GPL comments
+    # from this file to the generated file.
 
     comment = 0
 }
@@ -144,7 +126,6 @@ BEGIN {
 #    m_dirnames    <->    MULTILIB_DIRNAMES           "
 #    m_exceptions  <->    MULTILIB_EXCEPTIONS         "
 #    m_matches     <->    MULTILIB_MATCHES            "
-#    m_raw         <->    avr_multilib_raw         multilib.h
 #
 ##################################################################
 
@@ -154,11 +135,9 @@ END {
     m_exceptions = "\nMULTILIB_EXCEPTIONS ="
     m_matches    = "\nMULTILIB_MATCHES ="
 
-    m_raw = ""
-
     ##############################################################
     # Compose MULTILIB_OPTIONS.  This represents the Cross-Product
-    #    (avr2, avr25, ...) x mtiny-stack
+    #    (avr2, avr25, ...) x msp8
 
     sep = ""
     for (c = 0; c < n_cores; c++)
@@ -167,54 +146,25 @@ END {
        sep = "/"
     }
 
-    # The ... x mtiny-stack
+    # The ... x msp8
     m_options = m_options " " option[mtiny[1]]
 
     ##############################################################
     # Map Device to its multilib
 
-    # All Mappings that cannot be represented by GCC's genmultilib
-    # Machinery must be handcrafted.
-
-    dot_excludes = ""
-    m_raw_sp8 = ""
-
     for (t = 0; t < n_mcu; t++)
     {
        core = toCore[mcu[t]]
        
-       if (tiny_stack[mcu[t]] == 1)
-       {
-           if (core == "avr2")
-               dir = mtiny[1]
-           else
-               dir = core "/" mtiny[1]
-
-           m_raw_sp8 = m_raw_sp8 "  \"" dir " " option[mcu[t]] ";\",\n"
-           dot_excludes = dot_excludes " !" option[mcu[t]]
-
-           line = option[mcu[t]] ":" option[mcu[t]]
-           gsub ("=", "?", line)
-           gsub (":", "=", line)
-
-           m_matches = m_matches " \\\n\t" line
-       }
+       line = option[core] ":" option[mcu[t]]
+       gsub ("=", "?", line)
+       gsub (":", "=", line)
 
-       # The SP = 16 Devices are vanilla: Do the same as
-       # MULTILIB_MATCHES would yield.  Don't list avr2 (default)
-
-       if (core != "avr2")
-       {
-           line = option[core] ":" option[mcu[t]]
-           gsub ("=", "?", line)
-           gsub (":", "=", line)
-
-           m_matches = m_matches " \\\n\t" line
-       }
+       m_matches = m_matches " \\\n\t" line
     }
 
     ####################################################################
-    # Compose MULTILIB_DIRNAMES, MULTILIB_EXEPTIONS and avr_multilib_raw
+    # Compose MULTILIB_DIRNAMES and MULTILIB_EXEPTIONS
 
     n_mtiny = 2
     for (t = 0; t < n_mtiny; t++)
@@ -248,38 +198,6 @@ END {
 
            if (core != "avr2" || mtiny[t] == "")
                m_dirnames = m_dirnames " " mdir
-
-           # Remainder deals with avr_multilib_raw Entries.
-           # Each Entry looks like
-           #     "multilib-dir option-to-match !option-to-avoid-match;"
-           # for Example:
-           #     "avr25/tiny-stack !mmcu=avr2 mmcu=avr25 !mmcu=avr3 ... mtiny-stack;"
-
-           if (mdir == "")
-               mdir = "."
-
-           line = mdir
-
-           for (s = 0; s < n_cores; s++)
-           {
-               if (cores[s] == core)
-                   line = line " " option[cores[s]]
-               else
-                   line = line " !" option[cores[s]]
-           }
-
-           if (tiny_stack[core] != 0)
-           {
-               if (mtiny[t] == "")
-                   line = line " !" option[mtiny[1]]
-               else
-                   line = line " " option[mtiny[1]]
-           }
-
-           if (mdir == ".")
-               line = line dot_excludes
-
-           m_raw = m_raw "  \"" line ";\",\n"
        }
 
     ############################################################
@@ -295,21 +213,4 @@ END {
        print m_exceptions
        print m_matches
     }
-
-    if (FORMAT == "multilib.h")
-    {
-       # Intended Target: ./gcc/config/avr/multilib.h
-
-       print "#if defined NULL && !defined AVR_MULTILIB_H"
-       print "#define AVR_MULTILIB_H"
-
-       print "static const char* const avr_multilib_raw[] = {"
-       print m_raw_sp8
-       print m_raw
-       print "  NULL\n};"
-
-       print "#undef  multilib_raw"
-       print "#define multilib_raw avr_multilib_raw"
-       print "#endif /* AVR_MULTILIB_H */"
-    }
 }