OSDN Git Service

(MULTILIB_SELECT): Delete definition.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 Jun 1996 02:44:31 +0000 (02:44 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 8 Jun 1996 02:44:31 +0000 (02:44 +0000)
(multilib_select): Delete static initializer.
(multilib_obstack, multilib_raw): New global variables.
(multilib.h): Include inside multilib_raw definition.
(main): Set multilib_select from multilib_raw.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12239 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/gcc.c

index 7c6de62..8ca9313 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -56,9 +56,6 @@ int __spawnvp ();
 #endif
 #include <stdio.h>
 
-/* Include multi-lib information.  */
-#include "multilib.h"
-
 #ifndef R_OK
 #define R_OK 4
 #define W_OK 2
@@ -475,13 +472,6 @@ proper position among the other output files.  */
 #endif
 #endif
 
-/* MULTILIB_SELECT comes from multilib.h.  It gives a
-   string interpreted by set_multilib_dir to select a library
-   subdirectory based on the compiler options.  */
-#ifndef MULTILIB_SELECT
-#define MULTILIB_SELECT ". ;"
-#endif
-
 static char *cpp_spec = CPP_SPEC;
 static char *cpp_predefines = CPP_PREDEFINES;
 static char *cc1_spec = CC1_SPEC;
@@ -495,7 +485,14 @@ static char *libgcc_spec = LIBGCC_SPEC;
 static char *endfile_spec = ENDFILE_SPEC;
 static char *startfile_spec = STARTFILE_SPEC;
 static char *switches_need_spaces = SWITCHES_NEED_SPACES;
-static char *multilib_select = MULTILIB_SELECT;
+
+/* Some compilers have limits on line lengths, and the multilib_select
+   string can be very long, so we build it at run time.  */
+static struct obstack multilib_obstack;
+static char *multilib_raw[] = {
+#include "multilib.h"
+};
+static char *multilib_select;
 
 #ifdef EXTRA_SPECS
 static struct { char *name, *spec; } extra_specs[] = { EXTRA_SPECS };
@@ -4201,6 +4198,19 @@ main (argc, argv)
 
   obstack_init (&obstack);
 
+  /* Build multilib_select from the separate lines that make up each multilib
+     selection.  */
+  {
+    char **q = multilib_raw;
+
+    obstack_init (&multilib_obstack);
+    while ((p = *q++) != (char *)0)
+      obstack_grow (&multilib_obstack, p, strlen (p));
+
+    obstack_1grow (&multilib_obstack, 0);
+    multilib_select = obstack_finish (&multilib_obstack);
+  }
+
   /* Set up to remember the pathname of gcc and any options
      needed for collect.  We use argv[0] instead of programname because
      we need the complete pathname.  */