Commit 7f211789 by Richard Stallman

*** empty log message ***

From-SVN: r804
parent 70252580
...@@ -2,8 +2,6 @@ $! Set the def dir to proper place for use in batch. Works for interactive too. ...@@ -2,8 +2,6 @@ $! Set the def dir to proper place for use in batch. Works for interactive too.
$flnm = f$enviroment("PROCEDURE") ! get current procedure name $flnm = f$enviroment("PROCEDURE") ! get current procedure name
$set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")' $set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
$! $!
$set symbol/scope=(nolocal,noglobal)
$!
$! Command file to build libgcc2.olb. You should only run this once you $! Command file to build libgcc2.olb. You should only run this once you
$! have the current compiler installed, otherwise some of the builtins will $! have the current compiler installed, otherwise some of the builtins will
$! not be recognized. Once you have built libgcc2.olb, you can merge this $! not be recognized. Once you have built libgcc2.olb, you can merge this
...@@ -28,6 +26,9 @@ $! ...@@ -28,6 +26,9 @@ $!
$gcc_as:=$gnu_cc:[000000]gcc-as $gcc_as:=$gnu_cc:[000000]gcc-as
$cpp_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.cpp $cpp_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.cpp
$s_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.s $s_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.s
$!
$set symbol/scope=(nolocal,noglobal)
$!
$goto compile $goto compile
$! $!
$nocompile: $nocompile:
...@@ -79,10 +80,10 @@ $! We do this by hand, since the VMS compiler driver does not have a way ...@@ -79,10 +80,10 @@ $! We do this by hand, since the VMS compiler driver does not have a way
$! of specifying an alternate location for the compiler executables. $! of specifying an alternate location for the compiler executables.
$! $!
$ gcc_cpp "-I[]" "-I[.CONFIG]" "-D''p1'" LIBGCC2.C 'cpp_file' $ gcc_cpp "-I[]" "-I[.CONFIG]" "-D''p1'" LIBGCC2.C 'cpp_file'
$ gcc_cc1 'cpp_file' -dumpbase LIBGCC2 - $ gcc_cc1 'cpp_file' -dumpbase 'objname' -
-quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file' -quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file'
$ delete/nolog 'cpp_file'; $ delete/nolog 'cpp_file';
$ gcc_as 's_file' -o 'p1'.OBJ $ gcc_as 's_file' -o 'objname'.OBJ
$ delete/nolog 's_file'; $ delete/nolog 's_file';
$! $!
$lib libgcc2.olb 'objname'.obj $lib libgcc2.olb 'objname'.obj
......
$ ! $ !
$ ! Set up to compile GCC on VMS $ ! 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" $ echo = "write sys$output"
$ ! $ !
$ if f$search("config.h") .nes. "" then delete config.h.* $ if f$search("config.h") .nes. "" then delete config.h.*
...@@ -54,8 +60,201 @@ $close ifile$ ...@@ -54,8 +60,201 @@ $close ifile$
$pur version.opt/nolog $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.* $ if f$search("config.status") .nes. "" then delete config.status.*
$ open/write file config.status $ open/write file config.status
$ write file "Links are now set up for use with a vax running VMS." $ write file "Links are now set up for use with a vax running VMS."
$ close file $ close file
$ type config.status $ type config.status
$ echo ""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment