summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-06 15:50:28 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-06 15:50:28 +0000
commit6ea4242fb368994f583943b9cffdd14675cb6ad8 (patch)
tree8c9042406cd938c21327303d5cf16abd1b592581 /gcc/gcc.c
parentaeca56276abfceb1b854097772d329461773d700 (diff)
downloadlinaro-gcc-6ea4242fb368994f583943b9cffdd14675cb6ad8.tar.gz
linaro-gcc-6ea4242fb368994f583943b9cffdd14675cb6ad8.tar.bz2
linaro-gcc-6ea4242fb368994f583943b9cffdd14675cb6ad8.zip
fixincludes:
* mkheaders.in: Fix headers for each multilib required. gcc: PR bootstrap/31020 * configure.ac (CROSS_SYSTEM_HEADER_DIR, build_system_header_dir): Define using $${sysroot_headers_suffix}. * configure: Regenerate. * cppdefault.c (cpp_include_defaults): Make FIXED_INCLUDE_DIR a multilib-suffixed directory if SYSROOT_HEADERS_SUFFIX_SPEC defined. * doc/invoke.texi (-print-sysroot-headers-suffix): Document. * gcc.c (print_sysroot_headers_suffix): New. (option_map): Include --print-sysroot-headers-suffix. (display_help): Mention -print-sysroot-headers-suffix. (process_command): Handle -print-sysroot-headers-suffix. (do_spec_1): Append multilib directory to include-fixed path if sysroot suffixes in use. (main): Handle -print-sysroot-headers-suffix. * Makefile.in (start.encap): Don't depend on xlimits.h (xlimits.h): Remove. (stmp-int-hdrs): Don't depend on xlimits.h. Inline generation of limits.h for each multilib in fixinc_list. (fixinc_list, s-fixinc_list): New. (stmp-fixinc): Depend on fixinc_list. If not copying headers, generate them for each multilib in fixinc_list. (stmp-fixproto): Use include-fixed. Run fixproto for each multilib in fixinc_list. (mostlyclean): Don't remove xlimits.h. (clean): Remove include-fixed. (real-install-headers-tar, real-install-headers-cpio, real-install-headers-cp): Don't copy include, only include-fixed. (install-mkheaders): Depend on fixinc_list. Don't depend on xlimits.h. Save limits.h files for each multilib in fixinc_list. Always save mkinstalldirs. Preserve ${sysroot_headers_suffix} in SYSTEM_HEADER_DIR setting in mkheaders.conf. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122620 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 9cdf7c5faf4..7a5056a5ba0 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -168,6 +168,11 @@ static int print_multi_lib;
static int print_help_list;
+/* Flag saying to print the sysroot suffix used for searching for
+ headers. */
+
+static int print_sysroot_headers_suffix;
+
/* Flag indicating whether we should print the command and arguments */
static int verbose_flag;
@@ -1125,6 +1130,7 @@ static const struct option_map option_map[] =
{"--print-multi-directory", "-print-multi-directory", 0},
{"--print-multi-os-directory", "-print-multi-os-directory", 0},
{"--print-prog-name", "-print-prog-name=", "aj"},
+ {"--print-sysroot-headers-suffix", "-print-sysroot-headers-suffix", 0},
{"--profile", "-p", 0},
{"--profile-blocks", "-a", 0},
{"--quiet", "-q", 0},
@@ -3193,6 +3199,7 @@ display_help (void)
-print-multi-lib Display the mapping between command line options and\n\
multiple library search directories\n"), stdout);
fputs (_(" -print-multi-os-directory Display the relative path to OS libraries\n"), stdout);
+ fputs (_(" -print-sysroot-headers-suffix Display the sysroot suffix used to find headers\n"), stdout);
fputs (_(" -Wa,<options> Pass comma-separated <options> on to the assembler\n"), stdout);
fputs (_(" -Wp,<options> Pass comma-separated <options> on to the preprocessor\n"), stdout);
fputs (_(" -Wl,<options> Pass comma-separated <options> on to the linker\n"), stdout);
@@ -3637,6 +3644,8 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
print_multi_directory = 1;
else if (! strcmp (argv[i], "-print-multi-os-directory"))
print_multi_os_directory = 1;
+ else if (! strcmp (argv[i], "-print-sysroot-headers-suffix"))
+ print_sysroot_headers_suffix = 1;
else if (! strncmp (argv[i], "-Wa,", 4))
{
int prev, j;
@@ -4066,6 +4075,8 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
;
else if (! strcmp (argv[i], "-print-multi-os-directory"))
;
+ else if (! strcmp (argv[i], "-print-sysroot-headers-suffix"))
+ ;
else if (! strncmp (argv[i], "--sysroot=", strlen ("--sysroot=")))
{
target_system_root = argv[i] + strlen ("--sysroot=");
@@ -4978,6 +4989,9 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
spec_path, &info);
info.append = "include-fixed";
+ if (*sysroot_hdrs_suffix_spec)
+ info.append = concat (info.append, dir_separator_str,
+ multilib_dir, NULL);
info.append_len = strlen (info.append);
for_each_path (&include_prefixes, false, info.append_len,
spec_path, &info);
@@ -6394,6 +6408,19 @@ main (int argc, char **argv)
return (0);
}
+ if (print_sysroot_headers_suffix)
+ {
+ if (*sysroot_hdrs_suffix_spec)
+ {
+ printf("%s\n", target_sysroot_hdrs_suffix);
+ return (0);
+ }
+ else
+ /* The error status indicates that only one set of fixed
+ headers should be built. */
+ fatal ("not configured with sysroot headers suffix");
+ }
+
if (print_help_list)
{
display_help ();