1 $! make-l2.com -- VMS build procedure for libgcc2.
3 $! Change working directory to the location of this command procedure.
4 $ flnm = f$enviroment("PROCEDURE") !get current procedure name
5 $ set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
7 $! Command file to build libgcc2.olb. You should only run this once you
8 $! have the current compiler installed, otherwise some of the builtins will
9 $! not be recognized. Once you have built libgcc2.olb, you can merge this
10 $! with gnu_cc:[000000]gcclib.olb
12 $! All of the C source code is assumed to be in libgcc2.c, and a list of the
13 $! modules that we need from there is in libgcc2.list (which is generated
14 $! when vmsconfig.com is run). The C++ source is found in the [.cp.inc]
15 $! directory and managed via libgcc2-cxx.list.
17 $ if f$search("gcc-cc1.exe").eqs.""
19 $ gcc_cc1:=$gnu_cc:[000000]gcc-cc1
20 $ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile
22 $ gcc_cc1:=$sys$disk:[]gcc-cc1
25 $ if f$search("gcc-cpp.exe").eqs.""
27 $ gcc_cpp:=$gnu_cc:[000000]gcc-cpp
28 $ if f$extract(0,1,f$trnlnm("GNU_CC_VERSION")).eqs."1" then goto nocompile
29 $ Version:='f$trnlnm("GNU_CC_VERSION")'
31 $ gcc_cpp:=$sys$disk:[]gcc-cpp
32 $ open ifile$ version.opt
35 $ Version=line - "ident=""" - """
38 $ if f$search("gcc-cc1plus.exe").eqs.""
39 $ then gcc_cxx = "$gnu_cc:[000000]gcc-cc1plus"
40 $ else gcc_cxx = "$sys$disk:[]gcc-cc1plus"
43 $gcc_as:=$gnu_cc:[000000]gcc-as
44 $cpp_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.cpp
45 $ s_file:=sys$scratch:gcc_'f$getjpi(0,"pid")'.s
47 $set symbol/scope=(nolocal,noglobal)
49 $lib/create libgcc2.olb
50 $on error then goto c_err
51 $on control_y then goto c_err
53 $if f$trnlnm("IFILE$").nes."" then close/noLog ifile$
54 $open ifile$ libgcc2.list
57 $read ifile$ line/end=c_done
60 $flnm=f$element(i," ",line)
62 $if flnm.eqs."" then goto loop
63 $if flnm.eqs." " then goto loop
66 $if flnm.eqs."L_exit" then goto loop1
67 $write sys$output "$ gcc/debug/define=""''flnm'"" LIBGCC2.C"
70 $if flnm.eqs."L_builtin_New" then objname = "L_builtin_nnew"
72 $! We do this by hand, since the VMS compiler driver does not have a way
73 $! of specifying an alternate location for the compiler executables.
75 $ if arch .eqs. "alpha"
77 $ gcc_cpp "-D__IEEE_FLOAT" "-I[]" "-I[.config]" "-I[.ginclude]" "-D''flnm'" libgcc2.c 'cpp_file'
78 $ gcc_cc1 'cpp_file' -dumpbase 'objname' -
79 -quiet -mgas "-O1" -mfloat-ieee -o 's_file'
81 $ gcc_cpp "-I[]" "-I[.config]" "-I[.ginclude]" "-D''flnm'" libgcc2.c 'cpp_file'
82 $ gcc_cc1 'cpp_file' -dumpbase 'objname' -
83 -quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file'
85 $ delete/nolog 'cpp_file';
86 $ gcc_as 's_file' -o 'objname'.OBJ
89 $! Assemble again, preserving lowercase symbol names this time.
90 $ gcc_as -h3 's_file' -o 'objname'-c.OBJ
91 $ library libgcc2.olb 'objname'.obj,'objname'-c.obj
92 $ delete/nolog 'objname'.obj;,'objname'-c.obj;
94 $ library libgcc2.olb 'objname'.obj
95 $ delete/nolog 'objname'.obj;
97 $ delete/nolog 's_file';
102 $! In case of error or abort, go here (In order to close file).
104 $c_err: !'f$verify(0)
113 $ !gcc-2.8.0: C++ libgcc2 code disabled since it's not adequately tested
116 $ p1 = p1+" "+p2+" "+p3+" "+p4+" "+p5+" "+p6+" "+p7+" "+p8
117 $ p1 = " " + f$edit(p1,"COMPRESS,TRIM,UPCASE") + " "
118 $! (note: substring locations can only be equal when neither string is present)
119 $ if f$locate(" CC1PLUS ",p1).eq.f$locate(" CXX ",p1) then goto cxx_done
120 $ if f$search("libgcc2-cxx.list").eqs."" then goto cxx_done
122 $ open/read ifile$ libgcc2-cxx.list
124 $ read ifile$ line/end=cxx_done
127 $ flnm = f$element(i,",",line)
129 $ if flnm.eqs."" .or. flnm.eqs."," then goto cxx_line_loop
130 $ write sys$output "$ gcc/plus/debug ''flnm'.cc"
133 $ gcc_cpp -+ "-I[]" "-I[.ginclude]" "-I[.cp.inc]" [.cp]'flnm'.cc 'cpp_file'
134 $ gcc_cxx 'cpp_file' -dumpbase 'objname' -fexceptions -
135 -quiet -mgnu -g "-O1" -mvaxc-alignment -o 's_file'
136 $ delete/nolog 'cpp_file';
137 $ gcc_as "-vGNU CC V''Version'" 's_file' -o 'objname'.OBJ
138 $! Assemble again, preserving lowercase symbol names this time.
139 $ gcc_as "-vGNU CC V''Version'" -h3 's_file' -o 'objname'-c.OBJ
140 $ delete/nolog 's_file';
142 $ library libgcc2.olb 'objname'.obj,'objname'-c.obj
143 $ delete/nolog 'objname'.obj;,'objname'-c.obj;