summaryrefslogtreecommitdiff
path: root/gcc/vmsconfig.com
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-04-20 14:43:07 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-04-20 14:43:07 +0000
commit56b9545790ccc539e41be8c26f69143f60f07486 (patch)
tree57c78dd5f90da17a930448853b2b03b9209c3e97 /gcc/vmsconfig.com
parent8de93f7de5345140e67c5a24cf016e92c2538192 (diff)
downloadgcc-56b9545790ccc539e41be8c26f69143f60f07486.tar.gz
*** empty log message ***
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@804 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/vmsconfig.com')
-rw-r--r--gcc/vmsconfig.com199
1 files changed, 199 insertions, 0 deletions
diff --git a/gcc/vmsconfig.com b/gcc/vmsconfig.com
index 3836e2fdebf..1a453d33eb4 100644
--- a/gcc/vmsconfig.com
+++ b/gcc/vmsconfig.com
@@ -1,6 +1,12 @@
$ !
$ ! Set up to compile GCC on VMS
$ !
+$! Set the def dir to proper place for use in batch. Works for interactive too.
+$flnm = f$enviroment("PROCEDURE") ! get current procedure name
+$set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
+$ !
+$set symbol/scope=(nolocal,noglobal)
+$ !
$ echo = "write sys$output"
$ !
$ if f$search("config.h") .nes. "" then delete config.h.*
@@ -54,8 +60,201 @@ $close ifile$
$pur version.opt/nolog
$!
$!
+$! create linker options files that lists all of the components for all
+$! possible compilers. We do this by editing the file Makefile.in, and
+$! generating the relevant files from it.
+$!
+$!
+$echo "Now processing Makefile.in to generate linker option files."
+$edit/tpu/nojournal/nosection/nodisplay/command=sys$input
+ PROCEDURE generate_option_file (TAG_NAME, outfile)
+ position (beginning_of (newbuffer));
+ recursive_fetch_tag (TAG_NAME);
+!
+! Now fix up a few things in the output buffer
+!
+ pat_replace (".o ",",");
+ pat_replace (".o",""); !appear at end of lines.
+!
+! Remove trailing commas, if present.
+!
+ position (beginning_of (newbuffer));
+ LOOP
+ range1:=search_quietly("," & ((SPAN(" ") & LINE_END) | LINE_END), FORWARD, EXACT);
+ exitif range1 = 0;
+ position (beginning_of (range1));
+ erase(range1);
+ split_line;
+ ENDLOOP;
+! get rid of leading spaces on lines.
+ position (beginning_of (current_buffer)) ;
+ LOOP
+ range1 := search_quietly ( LINE_BEGIN & " ", FORWARD, EXACT) ;
+ EXITIF range1 = 0;
+ position (end_of (range1));
+ erase_character(1);
+ ENDLOOP;
+!
+! Now write the output file.
+!
+ SET(OUTPUT_FILE, newbuffer, outfile);
+ write_file (newbuffer);
+ erase (newbuffer);
+ ENDPROCEDURE;
+
+!
+! Looks up a tag, copies it to newbuffer, and then translates any $(...)
+! definitions that appear. The translation is put at the current point.
+!
+ PROCEDURE recursive_fetch_tag (TAG_N);
+ fetch_tag (TAG_N);
+!
+! substitute any makefile symbols $(...)
+!
+ position (beginning_of (current_buffer)) ;
+ LOOP
+ range1 := search_quietly ("$(" &
+ SPAN("abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ#~0123456789") & ")", FORWARD, EXACT) ;
+ EXITIF range1 = 0;
+ position (beginning_of (range1));
+ move_horizontal(2);
+ mark_1 := MARK (NONE);
+ position (end_of (range1));
+ move_horizontal(-1);
+ mark_2 := MARK (NONE);
+ tag_range := CREATE_RANGE(MARK_1, MARK_2, NONE);
+ position (end_of (range1));
+ tag_string := STR (tag_range);
+ erase (range1);
+ fetch_tag (LINE_BEGIN & tag_string & ((SPAN(" ") & "=") | "="));
+ position (beginning_of (current_buffer)) ;
+ ENDLOOP;
+ ENDPROCEDURE;
+
+!
+! Looks up the translation of a tag, and inserts it at the current location
+! in the buffer
+!
+ PROCEDURE fetch_tag (TAG_N);
+ LOCAL mark1, mark2, mark3, range2;
+ mark3 := MARK(NONE) ;
+ position (beginning_of (mainbuffer)) ;
+ range2 := search_quietly (TAG_N, FORWARD, EXACT) ;
+ IF (range2 = 0) then
+ position (mark3);
+ return;
+ endif;
+ position (end_of (range2)) ;
+ MOVE_HORIZONTAL(1);
+ mark1 := MARK(NONE) ;
+ position (beginning_of (range2)) ;
+ MOVE_VERTICAL(1);
+ MOVE_HORIZONTAL(-2);
+ LOOP
+ EXITIF CURRENT_CHARACTER <> "\" ;
+ ERASE_CHARACTER(1);
+ MOVE_HORIZONTAL(1);
+ MOVE_VERTICAL(1);
+ MOVE_HORIZONTAL(-2);
+ ENDLOOP;
+ MOVE_HORIZONTAL(1);
+ mark2 := MARK(NONE) ;
+ range2 := CREATE_RANGE(mark1, mark2, NONE) ;
+ position (mark3);
+ if (length(range2) = 0) then return; endif;
+ copy_text(range2);
+ ENDPROCEDURE;
+
+ PROCEDURE pat_replace (
+ oldstring, !
+ newstring) !
+ LOCAL range2;
+ position (beginning_of (current_buffer)) ;
+ LOOP
+ range2 := search_quietly (oldstring, FORWARD, EXACT) ;
+ EXITIF range2 = 0 ;
+ position (beginning_of (range2)) ;
+ erase (range2) ;
+ copy_text (newstring) ;
+ ENDLOOP ;
+ ENDPROCEDURE ;
+
+! this is the start of the main procedure
+ filename := GET_INFO (COMMAND_LINE, 'file_name') ;
+ mainbuffer := CREATE_BUFFER ("Makefile.in", "Makefile.in") ;
+ newbuffer := CREATE_BUFFER("outfile");
+ compiler_list := CREATE_BUFFER("compilers");
+!
+! Add to this list, as required. The file "Makefile.in" is searched for a
+! tag that looks like "LINE_BEGIN + 'tag + (optional space) + "="". The
+! contents are assumed to be a list of object files, and from this list a
+! VMS linker options file is generated.
+!
+ position (beginning_of (compiler_list));
+ recursive_fetch_tag(LINE_BEGIN & "COMPILERS" & ((SPAN(" ") & "=") | "="));
+ position (beginning_of (compiler_list));
+ LOOP ! kill leading spaces.
+ exitif current_character <> " ";
+ erase_character(1);
+ ENDLOOP;
+ position (beginning_of (compiler_list));
+ LOOP ! remove any double spaces.
+ range1 := search_quietly (" ", FORWARD, EXACT) ; EXITIF range1 = 0 ;
+ position (beginning_of (range1)) ;
+ erase_character(1);
+ ENDLOOP ;
+ position (end_of (compiler_list));
+ move_horizontal(-1);
+ LOOP ! kill trailing spaces.
+ exitif current_character <> " ";
+ erase_character(1);
+ move_horizontal(-1);
+ ENDLOOP;
+ position (beginning_of (compiler_list));
+ LOOP
+ range1 := search_quietly (" ", FORWARD, EXACT) ;
+ EXITIF range1 = 0 ;
+ position (beginning_of (range1)) ;
+ erase (range1) ;
+ split_line;
+ ENDLOOP ;
+!
+! We now have a list of supported compilers. Now write it, and use it.
+!
+ SET(OUTPUT_FILE, compiler_list, "compilers.list");
+ write_file (compiler_list);
+ generate_option_file(LINE_BEGIN & "OBJS" & ((SPAN(" ") & "=") | "="),"independent.opt");
+!
+! Now change OBJS in the Makefile, so each language specific options file
+! does not pick up all of the language independent files.
+!
+ position (beginning_of (mainbuffer));
+ range1 := search_quietly (LINE_BEGIN & "OBJS" & ((SPAN(" ") & "=") | "="), FORWARD, EXACT) ;
+ position (end_of (range1));
+ split_line;
+ position (beginning_of (compiler_list));
+ LOOP
+ cmark := mark(NONE);
+ exitif cmark = end_of(compiler_list);
+ message(current_line);
+ generate_option_file(LINE_BEGIN & Current_line & ((SPAN(" ") & ":") | ":"),
+ current_line+"-objs.opt");
+ position (cmark);
+ move_vertical(1);
+ ENDLOOP ;
+ quit ;
+$ echo ""
+$!
+$! Remove excessive versions of the options file...
+$!
+$purge/nolog *.opt
+$purge/nolog compilers.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
$ type config.status
+$ echo ""