OSDN Git Service

More of previous change.
[pf3gnuchains/gcc-fork.git] / gcc / vmsconfig.com
index 1a453d3..4fe4e5e 100644 (file)
@@ -1,5 +1,5 @@
 $ !
-$ !    Set up to compile GCC on VMS
+$ !    Set up to compile GCC on VAX/VMS
 $ !
 $! Set the def dir to proper place for use in batch. Works for interactive too.
 $flnm = f$enviroment("PROCEDURE")     ! get current procedure name
@@ -10,20 +10,59 @@ $ !
 $ echo = "write sys$output"
 $ !
 $ if f$search("config.h") .nes. "" then delete config.h.*
-$ copy [.config]xm-vms.h []config.h
-$ echo "Linked `config.h' to `[.config]xm-vms.h'.
+$ copy [.config.vax]xm-vms.h []config.h
+$ echo "Linked `config.h' to `[.config.vax]xm-vms.h'.
+$ !
+$ if f$search("tconfig.h") .nes. "" then delete tconfig.h.*
+$ create []tconfig.h
+$DECK
+/* tconfig.h == config.h :: target and host configurations are the same */
+#include "config.h"
+$EOD
+$ echo "Created `tconfig.h'.
+$ !
+$ if f$search("hconfig.h") .nes. "" then delete hconfig.h.*
+$ create []hconfig.h
+$DECK
+/* hconfig.h == config.h :: host and target configurations are the same */
+#include "config.h"
+$EOD
+$ echo "Created `hconfig.h'.
 $ !
 $ if f$search("tm.h") .nes. "" then delete tm.h.*
-$ copy [.config]vms.h []tm.h
-$ echo "Linked `tm.h' to `[.config]vms.h'.
+$!! copy [.config.vax]vms.h []tm.h
+$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
+        [.config.vax]vms.h /output=[]tm.h
+$DECK
+!
+!  Copy file, changing lines of the form
+!      #include "vax/*"
+!  into
+!      #include "[.config.vax]*"
+!
+   file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
+   targ := LINE_BEGIN & '#include' & SPAN(ASCII(32)+ASCII(9)) & '"vax/';
+   rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
+   LOOP
+      incl := SEARCH_QUIETLY(targ, FORWARD, EXACT, rang);
+      EXITIF incl = 0;
+      POSITION(BEGINNING_OF(incl));
+      ERASE(incl);
+      COPY_TEXT('#include "[.config.vax]');
+      rang := CREATE_RANGE(END_OF(incl), END_OF(file));
+   ENDLOOP;
+   WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
+   QUIT
+$EOD
+$ echo "Generated `tm.h' from `[.config.vax]vms.h'.
 $ !
 $ if f$search("md.") .nes. "" then delete md..*
-$ copy [.config]vax.md []md.
-$ echo "Linked `md' to `[.config]vax.md'.
+$ copy [.config.vax]vax.md []md.
+$ echo "Linked `md' to `[.config.vax]vax.md'.
 $ !
 $ if f$search("aux-output.c") .nes. "" then delete aux-output.c.*
-$ copy [.config]vax.c []aux-output.c
-$ echo "Linked `aux-output.c' to `[.config]vax.c'.
+$ copy [.config.vax]vax.c []aux-output.c
+$ echo "Linked `aux-output.c' to `[.config.vax]vax.c'.
 $ !
 $!
 $!
@@ -33,7 +72,7 @@ $search version.c version_string,"="/match=and/output=t.tmp
 $open ifile$ t.tmp
 $read ifile$ line
 $close ifile$
-$delete/nolog t.tmp;
+$delete t.tmp;
 $ijk=f$locate("""",line)+1
 $line=f$extract(ijk,f$length(line)-ijk,line)
 $ijk=f$locate("""",line)
@@ -57,7 +96,7 @@ $write_ident:
 $open ifile$ version.opt/write
 $write ifile$ "ident="+""""+elm+""""
 $close ifile$
-$pur version.opt/nolog
+$purge version.opt
 $!
 $!
 $! create linker options files that lists all of the components for all
@@ -65,6 +104,12 @@ $! possible compilers.  We do this by editing the file Makefile.in, and
 $! generating the relevant files from it.
 $!
 $!
+$! Make a copy of the makefile if the sources are on a disk that is NFS 
+$!    mounted on a unix machine.
+$if f$search("Makefile.in").eqs."" .and. f$search("$M$akefile.in").nes."" -
+       then copy $M$akefile.in Makefile.in
+$!
+$!
 $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)
@@ -80,7 +125,8 @@ $edit/tpu/nojournal/nosection/nodisplay/command=sys$input
 !
        position (beginning_of (newbuffer));
        LOOP
-         range1:=search_quietly("," & ((SPAN(" ") & LINE_END) | LINE_END), FORWARD, EXACT);
+         range1 := search_quietly("," & ((SPAN(" ") & LINE_END) | LINE_END),
+                                  FORWARD, EXACT);
          exitif range1 = 0;
          position (beginning_of (range1));
          erase(range1);
@@ -113,8 +159,9 @@ $edit/tpu/nojournal/nosection/nodisplay/command=sys$input
 !
         position (beginning_of (current_buffer)) ;
        LOOP
-          range1 := search_quietly ("$(" &  
-            SPAN("abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ#~0123456789") & ")", FORWARD, EXACT) ;
+         range1 := search_quietly ("$(" &  
+      SPAN("abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ#~0123456789")
+                                   & ")", FORWARD, EXACT) ;
          EXITIF range1 = 0;
          position (beginning_of (range1));
          move_horizontal(2);
@@ -223,13 +270,17 @@ $edit/tpu/nojournal/nosection/nodisplay/command=sys$input
 !
        SET(OUTPUT_FILE, compiler_list, "compilers.list");
       write_file (compiler_list);
-   generate_option_file(LINE_BEGIN & "OBJS" & ((SPAN(" ") & "=") | "="),"independent.opt");
+   generate_option_file(LINE_BEGIN & "OBJS" & ((SPAN(" ") & "=") | "="),
+                       "independent.opt");
+   generate_option_file(LINE_BEGIN & "LIB2FUNCS" & ((SPAN(" ") & "=") | "="),
+                       "libgcc2.list");
 !
 ! 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) ;
+   range1 := search_quietly (LINE_BEGIN & "OBJS" & ((SPAN(" ") & "=") | "="),
+                            FORWARD, EXACT) ;
    position (end_of (range1));
    split_line;
    position (beginning_of (compiler_list));
@@ -238,17 +289,17 @@ $edit/tpu/nojournal/nosection/nodisplay/command=sys$input
      exitif cmark = end_of(compiler_list);
      message(current_line);
      generate_option_file(LINE_BEGIN & Current_line & ((SPAN(" ") & ":") | ":"),
-       current_line+"-objs.opt");
+                         current_line+"-objs.opt");
      position (cmark);
      move_vertical(1);
    ENDLOOP ;
    quit ;
 $ echo ""
 $!
-$! Remove excessive versions of the options file...
+$! Remove excessive versions of the option files...
 $!
-$purge/nolog *.opt
-$purge/nolog compilers.list
+$ purge *.opt
+$ purge compilers.list,libgcc2.list
 $!
 $!
 $!