Further cleanup of GCC's builtin directory list in an attempt to
[dragonfly.git] / gnu / usr.bin / cc34 / cc_prep / patches / gcc.c.patch
1 $DragonFly: src/gnu/usr.bin/cc34/cc_prep/patches/gcc.c.patch,v 1.5 2006/01/06 16:38:55 joerg Exp $
2
3 --- gcc.c.orig  2005-05-24 06:29:31.000000000 +0000
4 +++ gcc.c       2005-10-19 07:30:43.000000000 +0000
5 @@ -712,6 +712,7 @@
6  static const char *asm_spec = ASM_SPEC;
7  static const char *asm_final_spec = ASM_FINAL_SPEC;
8  static const char *link_spec = LINK_SPEC;
9 +static const char *pre_lib_spec = PRE_LIB_SPEC;
10  static const char *lib_spec = LIB_SPEC;
11  static const char *libgcc_spec = LIBGCC_SPEC;
12  static const char *endfile_spec = ENDFILE_SPEC;
13 @@ -1384,33 +1385,12 @@
14  
15  /* Default prefixes to attach to command names.  */
16  
17 -#ifdef CROSS_COMPILE  /* Don't use these prefixes for a cross compiler.  */
18 -#undef MD_EXEC_PREFIX
19 -#undef MD_STARTFILE_PREFIX
20 -#undef MD_STARTFILE_PREFIX_1
21 -#endif
22 -
23 -/* If no prefixes defined, use the null string, which will disable them.  */
24 -#ifndef MD_EXEC_PREFIX
25 -#define MD_EXEC_PREFIX ""
26 -#endif
27 -#ifndef MD_STARTFILE_PREFIX
28 -#define MD_STARTFILE_PREFIX ""
29 -#endif
30 -#ifndef MD_STARTFILE_PREFIX_1
31 -#define MD_STARTFILE_PREFIX_1 ""
32 -#endif
33 -
34  static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
35  static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
36  static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
37 -static const char *md_exec_prefix = MD_EXEC_PREFIX;
38  
39 -static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
40 -static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
41  static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
42 -static const char *const standard_startfile_prefix_1 = "/lib/";
43 -static const char *const standard_startfile_prefix_2 = "/usr/lib/";
44 +static const char *const standard_startfile_prefix_1 = STANDARD_STARTFILE_PREFIX_1;
45  
46  static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
47  static const char *tooldir_prefix;
48 @@ -1470,6 +1450,7 @@
49    INIT_STATIC_SPEC ("link_gcc_c_sequence",     &link_gcc_c_sequence_spec),
50    INIT_STATIC_SPEC ("endfile",                 &endfile_spec),
51    INIT_STATIC_SPEC ("link",                    &link_spec),
52 +  INIT_STATIC_SPEC ("pre_lib",                 &pre_lib_spec),
53    INIT_STATIC_SPEC ("lib",                     &lib_spec),
54    INIT_STATIC_SPEC ("libgcc",                  &libgcc_spec),
55    INIT_STATIC_SPEC ("startfile",               &startfile_spec),
56 @@ -1484,9 +1465,6 @@
57    INIT_STATIC_SPEC ("multilib_options",                &multilib_options),
58    INIT_STATIC_SPEC ("linker",                  &linker_name_spec),
59    INIT_STATIC_SPEC ("link_libgcc",             &link_libgcc_spec),
60 -  INIT_STATIC_SPEC ("md_exec_prefix",          &md_exec_prefix),
61 -  INIT_STATIC_SPEC ("md_startfile_prefix",     &md_startfile_prefix),
62 -  INIT_STATIC_SPEC ("md_startfile_prefix_1",   &md_startfile_prefix_1),
63    INIT_STATIC_SPEC ("startfile_prefix_spec",   &startfile_prefix_spec),
64    INIT_STATIC_SPEC ("sysroot_suffix_spec",     &sysroot_suffix_spec),
65    INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec",        &sysroot_hdrs_suffix_spec),
66 @@ -3219,8 +3197,6 @@
67        set_std_prefix (gcc_exec_prefix, len);
68        add_prefix (&exec_prefixes, gcc_libexec_prefix, "GCC",
69                   PREFIX_PRIORITY_LAST, 0, NULL, 0);
70 -      add_prefix (&startfile_prefixes, gcc_exec_prefix, "GCC",
71 -                 PREFIX_PRIORITY_LAST, 0, NULL, 0);
72      }
73  
74    /* COMPILER_PATH and LIBRARY_PATH have values
75 @@ -3768,11 +3744,6 @@
76               PREFIX_PRIORITY_LAST, 2, warn_std_ptr, 0);
77  #endif
78  
79 -  add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
80 -             PREFIX_PRIORITY_LAST, 1, warn_std_ptr, 0);
81 -  add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
82 -             PREFIX_PRIORITY_LAST, 1, warn_std_ptr, 0);
83 -
84    tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
85                            dir_separator_str, NULL);
86  
87 @@ -3795,10 +3766,6 @@
88                       concat (gcc_exec_tooldir_prefix, "bin",
89                               dir_separator_str, NULL),
90                       NULL, PREFIX_PRIORITY_LAST, 0, NULL, 0);
91 -         add_prefix (&startfile_prefixes,
92 -                     concat (gcc_exec_tooldir_prefix, "lib",
93 -                             dir_separator_str, NULL),
94 -                     NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1);
95         }
96  
97        tooldir_prefix = concat (standard_exec_prefix, spec_machine,
98 @@ -3806,13 +3773,6 @@
99                                dir_separator_str, tooldir_prefix, NULL);
100      }
101  
102 -  add_prefix (&exec_prefixes,
103 -             concat (tooldir_prefix, "bin", dir_separator_str, NULL),
104 -             "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 0);
105 -  add_prefix (&startfile_prefixes,
106 -             concat (tooldir_prefix, "lib", dir_separator_str, NULL),
107 -             "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
108 -
109  #if defined(TARGET_SYSTEM_ROOT_RELOCATABLE) && !defined(VMS)
110    /* If the normal TARGET_SYSTEM_ROOT is inside of $exec_prefix,
111       then consider it to relocate with the rest of the GCC installation
112 @@ -6037,11 +5997,6 @@
113    n_compilers = n_default_compilers;
114  
115    /* Read specs from a file if there is one.  */
116 -
117 -  machine_suffix = concat (spec_machine, dir_separator_str,
118 -                          spec_version, dir_separator_str, NULL);
119 -  just_machine_suffix = concat (spec_machine, dir_separator_str, NULL);
120 -
121    specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, 0);
122    /* Read the specs file unless it is a default one.  */
123    if (specs_file != 0 && strcmp (specs_file, "specs"))
124 @@ -6051,11 +6006,9 @@
125  
126    /* We need to check standard_exec_prefix/just_machine_suffix/specs
127       for any override of as, ld and libraries.  */
128 -  specs_file = alloca (strlen (standard_exec_prefix)
129 -                      + strlen (just_machine_suffix) + sizeof ("specs"));
130 +  specs_file = alloca (strlen (standard_exec_prefix) + sizeof ("specs"));
131  
132    strcpy (specs_file, standard_exec_prefix);
133 -  strcat (specs_file, just_machine_suffix);
134    strcat (specs_file, "specs");
135    if (access (specs_file, R_OK) == 0)
136      read_specs (specs_file, TRUE);
137 @@ -6072,17 +6025,6 @@
138    for (i = 0; i < ARRAY_SIZE (driver_self_specs); i++)
139      do_self_spec (driver_self_specs[i]);
140  
141 -  /* If not cross-compiling, look for executables in the standard
142 -     places.  */
143 -  if (*cross_compile == '0')
144 -    {
145 -      if (*md_exec_prefix)
146 -       {
147 -         add_prefix (&exec_prefixes, md_exec_prefix, "GCC",
148 -                     PREFIX_PRIORITY_LAST, 0, NULL, 0);
149 -       }
150 -    }
151 -
152    /* Process sysroot_suffix_spec.  */
153    if (*sysroot_suffix_spec != 0
154        && do_spec_2 (sysroot_suffix_spec) == 0)
155 @@ -6115,49 +6057,12 @@
156      }
157    /* We should eventually get rid of all these and stick to
158       startfile_prefix_spec exclusively.  */
159 -  else if (*cross_compile == '0' || target_system_root)
160 +  else
161      {
162 -      if (*md_exec_prefix)
163 -       add_sysrooted_prefix (&startfile_prefixes, md_exec_prefix, "GCC",
164 -                             PREFIX_PRIORITY_LAST, 0, NULL, 1);
165 -
166 -      if (*md_startfile_prefix)
167 -       add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix,
168 -                             "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
169 -
170 -      if (*md_startfile_prefix_1)
171 -       add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix_1,
172 -                             "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
173 -
174 -      /* If standard_startfile_prefix is relative, base it on
175 -        standard_exec_prefix.  This lets us move the installed tree
176 -        as a unit.  If GCC_EXEC_PREFIX is defined, base
177 -        standard_startfile_prefix on that as well.
178 -
179 -         If the prefix is relative, only search it for native compilers;
180 -         otherwise we will search a directory containing host libraries.  */
181 -      if (IS_ABSOLUTE_PATH (standard_startfile_prefix))
182 -       add_sysrooted_prefix (&startfile_prefixes,
183 -                             standard_startfile_prefix, "BINUTILS",
184 -                             PREFIX_PRIORITY_LAST, 0, NULL, 1);
185 -      else if (*cross_compile == '0')
186 -       {
187 -         if (gcc_exec_prefix)
188 -           add_prefix (&startfile_prefixes,
189 -                       concat (gcc_exec_prefix, machine_suffix,
190 -                               standard_startfile_prefix, NULL),
191 -                       NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1);
192 -         add_prefix (&startfile_prefixes,
193 -                     concat (standard_exec_prefix,
194 -                             machine_suffix,
195 -                             standard_startfile_prefix, NULL),
196 -                     NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1);
197 -       }
198 -
199 -      add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_1,
200 -                           "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
201 -      add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_2,
202 -                           "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
203 +      add_prefix (&startfile_prefixes, standard_startfile_prefix,
204 +                           "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
205 +      add_prefix (&startfile_prefixes, standard_startfile_prefix_1,
206 +                           "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
207  #if 0 /* Can cause surprises, and one can use -B./ instead.  */
208        add_prefix (&startfile_prefixes, "./", NULL,
209                   PREFIX_PRIORITY_LAST, 1, NULL, 0);
210 @@ -6197,7 +6102,7 @@
211  
212    if (print_search_dirs)
213      {
214 -      printf (_("install: %s%s\n"), standard_exec_prefix, machine_suffix);
215 +      printf (_("install: %s\n"), standard_exec_prefix);
216        printf (_("programs: %s\n"), build_search_list (&exec_prefixes, "", 0));
217        printf (_("libraries: %s\n"), build_search_list (&startfile_prefixes, "", 0));
218        return (0);