Permit relative path for standard_startfile_prefix
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 6 Aug 1993 20:45:36 +0000 (20:45 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 6 Aug 1993 20:45:36 +0000 (20:45 +0000)
From-SVN: r5091

gcc/gcc.c

index 1c17bb98d440f5ae9723cfbafd37483b36505940..2d2f5197ec05365e3b712eb3347df7131a7e0480 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3718,8 +3718,28 @@ main (argc, argv)
       add_prefix (&startfile_prefix, md_startfile_prefix_1, 0, 0, NULL_PTR);
 #endif
 
-      add_prefix (&startfile_prefix, standard_startfile_prefix, 0, 0,
-                 NULL_PTR);
+      /* If standard_startfile_prefix is relative, base it on
+        standard_exec_prefix.  This lets us move the installed tree
+        as a unit.  If GCC_EXEC_PREFIX is defined, base
+        standard_startfile_prefix on that as well.  */
+      if (*standard_startfile_prefix == '/')
+       add_prefix (&startfile_prefix, standard_startfile_prefix, 0, 0,
+                   NULL_PTR);
+      else
+       {
+         if (gcc_exec_prefix)
+           add_prefix (&startfile_prefix,
+                       concat (gcc_exec_prefix,
+                               machine_suffix,
+                               standard_startfile_prefix),
+                       0, 0, NULL_PTR);
+         add_prefix (&startfile_prefix,
+                     concat (standard_exec_prefix,
+                             machine_suffix,
+                             standard_startfile_prefix),
+                     0, 0, NULL_PTR);
+       }                      
+
       add_prefix (&startfile_prefix, standard_startfile_prefix_1, 0, 0,
                  NULL_PTR);
       add_prefix (&startfile_prefix, standard_startfile_prefix_2, 0, 0,