diff options
Diffstat (limited to 'gcc/gengtype.c')
-rw-r--r-- | gcc/gengtype.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 65bb8d1cfc8..90e64349365 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -1657,13 +1657,21 @@ get_file_langdir (const char *f) int lang_index; const char * srcdir_relative_path = get_file_srcdir_relative_path (f); + const char * r; if (!srcdir_relative_path) return NULL; lang_index = get_prefix_langdir_index (srcdir_relative_path); + if (lang_index < 0 + && strncmp (srcdir_relative_path, "c-family", 8) == 0) + r = "c-family"; + else if (lang_index >= 0) + r = lang_dir_names [lang_index]; + else + r = NULL; - return (lang_index >= 0) ? lang_dir_names [lang_index] : NULL; + return r; } /* The gt- output file name for F. */ @@ -1743,8 +1751,10 @@ get_output_file_with_visibility (const char *input_file) (and gengtype doesn't know how to direct spewage into multiple gtype-<lang>.h headers at this time). Instead, we pair up these headers with source files (and their special purpose gt-*.h headers). */ - else if (strcmp (basename, "c-common.h") == 0) - output_name = "gt-c-common.h", for_name = "c-common.c"; + else if (strncmp (basename, "c-family", 8) == 0 + && IS_DIR_SEPARATOR (basename[8]) + && strcmp (basename + 9, "c-common.h") == 0) + output_name = "gt-c-family-c-common.h", for_name = "c-family/c-common.c"; else if (strcmp (basename, "c-lang.h") == 0) output_name = "gt-c-decl.h", for_name = "c-decl.c"; else if (strcmp (basename, "c-tree.h") == 0) |