OSDN Git Service

(output_toc): Align DF constants if STRICT_ALIGNMENT.
[pf3gnuchains/gcc-fork.git] / gcc / vmsconfig.com
index 4ff9377..0b58b2d 100644 (file)
@@ -6,6 +6,7 @@ $flnm = f$enviroment("PROCEDURE")     ! get current procedure name
 $set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
 $ !
 $set symbol/scope=(nolocal,noglobal)
+$if f$trnlnm("IFILE$").nes."" then close/noLog ifile$
 $ !
 $ echo = "write sys$output"
 $ !
@@ -61,9 +62,13 @@ $ if f$search("config-vax.h") .nes. "" then delete config-vax.h;*
 $ copy [.config.vax]vax.h []config-vax.h
 $ echo "Linked `config-vax.h' to `[.config.vax]vax.h' for `tm.h'."
 $ !
-$ if f$search("md.") .nes. "" then delete md..*
-$ copy [.config.vax]vax.md []md.
-$ echo "Linked `md' to `[.config.vax]vax.md'.
+$ call make_lang_incl "options.h"
+$ !
+$ call make_lang_incl "specs.h"
+$ !
+$ if f$search("vax.md") .nes. "" then delete vax.md;*
+$ copy [.config.vax]vax.md []vax.md
+$ echo "Copied `vax.md' from `[.config.vax]vax.md'."
 $ !
 $ if f$search("aux-output.c") .nes. "" then delete aux-output.c.*
 $ copy [.config.vax]vax.c []aux-output.c
@@ -127,7 +132,7 @@ VARIABLE makefile_buf, opt_file_buf, complist_buf, extra_compilers; ! Globals.
 !!
 PROCEDURE process_makefile( )
   !
-  ! Intepret Makefile.in and subsidiary Make-lang.in templates.
+  ! Interpret Makefile.in and subsidiary Make-lang.in templates.
   !
   LOCAL range1, cmark, makefilename;
 
@@ -140,6 +145,10 @@ PROCEDURE process_makefile( )
   SET (NO_WRITE, makefile_buf, ON);    ! Used as workspace; don't save it.
   SET (OUTPUT_FILE, complist_buf, "compilers.list");
   !
+  ! Make some textual substitutions.
+  !
+  configure_makefile ();
+  !
   ! Collect a list of supported compilers (``COMPILERS=xxx'' macro).
   !
   identify_compilers ();
@@ -158,7 +167,7 @@ PROCEDURE process_makefile( )
   !
   generate_option_file ("OBJS",      "=", "independent.opt");
   generate_option_file ("LIB2FUNCS", "=", "libgcc2.list");
-  generate_option_file ("BC_ALL",    "=", "bc_all.opt");
+  generate_option_file ("BC_ALL",    "=", "bc_all.list");
   generate_option_file ("BI_OBJ",    "=", "bi_all.opt");
   !
   ! Now change OBJS in the Makefile, so each language specific options file
@@ -183,6 +192,43 @@ PROCEDURE process_makefile( )
 ENDPROCEDURE; !process_makefile
 !!
 
+PROCEDURE process_objc_lib( )
+  !
+  ! Interpret objc/Makefile, after finishing the top makefile.
+  !
+  ON_ERROR
+    [TPU$_OPENIN]:
+      MESSAGE ("Cannot load objc/Makefile for ""ObjClib""; skipping it.");
+      RETURN;
+  ENDON_ERROR;
+
+  ERASE (makefile_buf);                        !discard top Makefile
+  POSITION (END_OF (makefile_buf));
+  READ_FILE ("[.objc]Makefile");       !load objc one
+  MESSAGE ("objclib");
+  pat_replace (ASCII(9), " ");         !change any <tab> to <space>
+  generate_option_file ("OBJC_O", "=", "objc-objs.opt");
+  POSITION (BEGINNING_OF (makefile_buf));
+  ! Join any continuation lines; we want the header list to be one line.
+  pat_replace ("\" & LINE_END, );
+  generate_option_file ("OBJC_H", "=", "objc-hdrs.list");
+ENDPROCEDURE; !process_objc_lib
+!!
+
+PROCEDURE configure_makefile( )
+  !
+  ! Plug in some values normally handled by `configure'.  Rather than
+  ! replacing the dummy entries, insert the real entries before them.
+  !
+  POSITION (BEGINNING_OF (makefile_buf));
+  COPY_TEXT ("target=vax-vms");                        SPLIT_LINE;
+  COPY_TEXT ("out_file=aux-output.c");         SPLIT_LINE;     ! vax/vax.c
+  COPY_TEXT ("out_object_file=aux-output.o");  SPLIT_LINE;     ! aux-output.obj
+  COPY_TEXT ("md_file=vax.md");                        SPLIT_LINE;     ! vax/vax.md
+  COPY_TEXT ("tm_file=tm.h");                  SPLIT_LINE;     ! vax/tm-vms.h
+ENDPROCEDURE; !configure_makefile
+!!
+
 PROCEDURE identify_compilers( )
   !
   ! Retrieve the list of supported compilers from Makefile.in, and put them
@@ -254,10 +300,11 @@ PROCEDURE generate_option_file( tag_name, punct, outfile_name )
   ! Now fix up a few things in the output buffer.
   pat_replace (("bytecode"|"Makefile") & (SPAN(" ")|LINE_END), " ");
 !#  FILL (CURRENT_BUFFER, " ", 1, 80, 0);      ! Condense things a bit.
-  pat_replace ("." & ("o"|"c"|"h"|"y") & ((SPAN(" ")&LINE_END)|LINE_END), LINE_END);
-  pat_replace ("." & ("o"|"c"|"h"|"y") & SPAN(" "), ",");
-!#  ! Remove trailing commas, if present.  {Above patterns preclude any such.}
-!#  pat_replace ("," & ((SPAN(" ")&LINE_END)|LINE_END), LINE_END);
+  pat_replace ("." & ("o"|"c"|"y") & ((SPAN(" ")&LINE_END)|LINE_END), LINE_END);
+  pat_replace ("." & ("o"|"c"|"y") & SPAN(" "), ",");
+  pat_replace (".h" & (SPAN(" ")|LINE_END), ".h,");
+  ! Remove trailing commas, if present.
+  pat_replace ("," & ((SPAN(" ")&LINE_END)|LINE_END), LINE_END);
   ! Get rid of spaces and blank lines.
   pat_replace (SPAN(" "), LINE_END);
   pat_replace (LINE_BEGIN & LINE_END, );
@@ -325,7 +372,7 @@ PROCEDURE fetch_tag( tag_n, punct )
   mark0 := MARK (NONE);     ! Remember where we started; restore before return.
   POSITION (BEGINNING_OF (makefile_buf));
   ! The tag definition always starts in the first column, and might have
-  ! optional space(es) before "=" or ":" punctutation.
+  ! optional space(es) before "=" or ":" punctuation.
   range2 := SEARCH_QUIETLY (LINE_BEGIN & tag_n & ((SPAN(" ") & punct) | punct),
                            FORWARD, EXACT);
   IF (range2 = 0) THEN
@@ -355,7 +402,7 @@ ENDPROCEDURE; !fetch_tag
 
 PROCEDURE pat_replace( oldstring, newstring )
   !
-  ! Replace all occurences of a pattern.
+  ! Replace all occurrences of a pattern.
   !
   LOCAL range1, range2, kill_it, count;
 
@@ -384,20 +431,44 @@ ENDPROCEDURE; !pat_replace
 ! This is the main routine.
 !
 process_makefile ();
+process_objc_lib ();   !this uses a different makefile
 QUIT;  ! All done; don't write any modified buffers.
 !!
 $ echo ""
 $!
 $! Remove excessive versions of the option files...
 $!
-$ purge *.opt
-$ purge compilers.list,libgcc2.list
+$ purge *.opt,*.list
 $!
 $!
 $!
 $ if f$search("config.status") .nes. "" then delete config.status.*
-$ open/write file config.status
-$ write file "Links are now set up for use with a vax running VMS."
-$ close file
+$ create config.status
+Links are now set up for use with a vax running VMS.
 $ type config.status
 $ echo ""
+$!
+$ exit
+$
+$!
+$! Construct a header file based on subdirectory contents
+$!
+$make_lang_incl: subroutine
+$  if f$search(p1).nes."" then delete 'p1';*
+$  create 'p1' !empty file with ordinary text-file attributes
+$  open/Append ifile$ 'p1'
+$  write ifile$ "/* ''p1' */"
+$  hfile = f$search("[]''p1'")
+$  topdir = f$parse(hfile,,,"DIRECTORY") - "]"
+$lang_incl_loop:
+$  hfile = f$search("[.*]lang-''p1'")
+$  if hfile.eqs."" then goto lang_incl_done
+$  dir = f$parse(hfile,,,"DIRECTORY") - "]"
+$! convert absolute path to relative one, yielding "[.subdir]"
+$  dir = "[" + f$edit(dir - topdir,"LOWERCASE") + "]"
+$  write ifile$ "#include ""''dir'lang-''p1'"""
+$  goto lang_incl_loop
+$lang_incl_done:
+$  close ifile$
+$  echo "Created `''p1''."
+$ endsubroutine !make_lang_incl