1 $! Set the def dir to proper place for use in batch. Works for interactive too.
2 $flnm = f$enviroment("PROCEDURE") ! get current procedure name
3 $set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
6 $! CAUTION: If you want to link gcc-cc1 to the sharable image library
7 $! VAXCRTL, see the notes in gcc.texinfo (or INSTALL) first.
9 $! Build a GNU compiler on VMS
11 $! First we figure out what needs to be done. This is sort of like a limited
12 $! make facility - the command line options specify exactly what components
13 $! we want to build. The following options are understood:
15 $! LINK: Assume that the object modules for the selected compiler(s)
16 $! have already been compiled, perform link phase only.
18 $! CC1: Compile and link "C" compiler.
20 $! CC1PLUS:Compile and link "C++" compiler.
22 $! CC1OBJ: Compile and link objective C compiler.
24 $! ALL: Compile and link all of the CC1 passes.
27 $! Compile language independent source modules. (On by default).
29 $! DEBUG: Link images with /debug.
31 $! If you want to list more than one option, you should use a spaces to
34 $! Any one of the above options can be prefaced with a "NO". For example,
35 $! if you had already built GCC, and you wanted to build G++, you could use the
36 $! "CC1PLUS NOINDEPENDENT" options, which would only compile the C++ language
37 $! specific source files, and then link the C++ compiler.
39 $! If you do not specify which compiler you want to build, it is assumed that
40 $! you want to build GNU-C ("CC1").
42 $p1 = p1+" "+p2+" "+p3+" "+p4+" "+p5+" "+p6+" "+p7
43 $p1 = f$edit(p1,"COMPRESS")
54 $string = f$element(i," ",p1)
55 $if string.eqs." " then goto done
57 $if string.eqs."CC1PLUS" then DO_DEFAULT = 0
58 $if string.eqs."CC1OBJ" then DO_DEFAULT = 0
59 $if f$extract(0,2,string).nes."NO" then goto parse_option
60 $ string=f$extract(2,f$length(string)-2,string)
68 $if DO_DEFAULT.eq.1 then DO_CC1 = 1
69 $if DO_ALL.eq.1 then DO_CC1 = 1
70 $if DO_ALL.eq.1 then DO_CC1PLUS = 1
71 $if DO_ALL.eq.1 then DO_CC1OBJ = 1
72 $say:==write sys$Output
73 $say "This command file will now perform the following actions:
74 $if DO_LINK.eq.1 then goto link_only
75 $if DO_CC1.eq.1 then say " Compile C specific object modules."
76 $if DO_CC1PLUS.eq.1 then say " Compile C++ specific object modules."
77 $if DO_CC1OBJ.eq.1 then say " Compile obj-C specific object modules."
78 $if DO_INDEPENDENT.eq.1 then say " Compile language independent object modules."
80 $if DO_CC1.eq.1 then say " Link C compiler (gcc-cc1.exe)."
81 $if DO_CC1PLUS.eq.1 then say " Link C++ compiler (gcc-cc1plus.exe)."
82 $if DO_CC1OBJ.eq.1 then say " Link objective-C compiler (gcc-cc1obj.exe)."
83 $if DO_DEBUG.eq.1 then say " Link images to run under debugger."
86 Note: GCC 2.0 treats external variables differently than GCC 1.40 does.
87 Before you use GCC 2.0, you should obtain a version of the assembler which
88 contains the patches to work with GCC 2.0 (GCC-AS 1.38 does not contain
89 these patches - whatever comes after this probably will).
91 If you do not update the assembler, the compiler will still work,
92 but `extern const' variables will be treated as `extern'. This will result
93 in linker warning messages about mismatched psect attributes, and these
94 variables will be placed in read/write storage.
99 $! CAUTION: If you want to link gcc-cc1 to the sharable image library
100 $! VAXCRTL, see the notes in gcc.texinfo (or INSTALL) first.
102 $! Build the GNU "C" compiler on VMS
103 $! (To try to build with VAX C, replace `gcc' with `cc/noopt'
104 $! and delete `cc1_options="-mpcc-alignment"'.
105 $! Also add `/sel' after `gcclib/lib' except in the last link.
106 $! You also need to get alloca.mar from Bison
107 $! and to make definitions for bzero, bcopy and bcmp.)
118 $ CFLAGS = "/debug/cc1_options=""-mpcc-alignment""/inc=([],[.config])"
123 $ if DO_DEBUG.eq.1 then LDFLAGS :='LDFLAGS'/debug
127 $ LIBS := gnu_cc:[000000]gcclib/libr,sys$share:vaxcrtl/libr
132 $! Language independent object and header files.
134 $! create a linker options file that lists all of the language independent
137 $create independent.opt
139 ! List of object files for the linker - these are language independent
140 ! (i.e. the same files will be used for all of the compilers).
142 toplev,tree,print-tree,stor-layout,fold-const,varasm,rtl,rtlanal,expr,stmt
143 expmed,explow,optabs,emit-rtl,insn-emit,jump,cse,loop,flow,stupid,combine
144 regclass,local-alloc,global-alloc,reload,reload1,insn-peep,final,recog
145 insn-recog,insn-extract,insn-output,obstack,integrate,caller-save,calls
146 dwarfout,xcoffout,function,insn-attrtab,reorg,sched,sdbout,dbxout,unroll
147 reg-stack,aux-output,print-rtl,version
149 $pur/nolog independent.opt
151 $ if DO_LINK.eq.1 then goto compile_cc1
152 $if DO_INDEPENDENT.eq.0 THEN GOTO compile_cc1
154 $! First build a couple of header files from the machine description
155 $! These are used by many of the source modules, so we build them now.
158 $ 'CC 'CFLAGS obstack.c
159 $ 'CC 'CFLAGS print-rtl.c
160 $! Generate insn-attr.h
161 $ 'CC 'CFLAGS genattr.c
162 $ link 'LDFLAGS' genattr,rtl,obstack, 'LIBS'
163 $ assign/user insn-attr.h sys$output:
164 $ mcr sys$disk:[]genattr md
165 $! Generate insn-flags.h
166 $ 'CC 'CFLAGS genflags.c
167 $ link 'LDFLAGS' genflags,rtl,obstack, 'LIBS'
168 $ assign/user insn-flags.h sys$output:
169 $ mcr sys$disk:[]genflags md
170 $! Generate insn-codes.h
171 $ 'CC 'CFLAGS gencodes.c
172 $ link 'LDFLAGS' gencodes,rtl,obstack, 'LIBS'
173 $ assign/user insn-codes.h sys$output:
174 $ mcr sys$disk:[]gencodes md
175 $! Generate insn-config.h
176 $ 'CC 'CFLAGS genconfig.c
177 $ link 'LDFLAGS' genconfig,rtl,obstack, 'LIBS'
178 $ assign/user insn-config.h sys$output:
179 $ mcr sys$disk:[]genconfig md
181 $! Now compile the source modules
183 $ 'CC 'CFLAGS toplev.c
184 $ 'CC 'CFLAGS version.c
186 $ 'CC 'CFLAGS print-tree.c
187 $ 'CC 'CFLAGS stor-layout.c
188 $ 'CC 'CFLAGS fold-const.c
189 $ 'CC 'CFLAGS varasm.c
192 $ 'CC 'CFLAGS expmed.c
193 $ 'CC 'CFLAGS explow.c
194 $ 'CC 'CFLAGS optabs.c
195 $ 'CC 'CFLAGS rtlanal.c
196 $ 'CC 'CFLAGS emit-rtl.c
197 $! Generate insn-emit.c
198 $ 'CC 'CFLAGS genemit.c
199 $ link 'LDFLAGS' genemit,rtl,obstack, 'LIBS'
200 $ assign/user insn-emit.c sys$output:
201 $ mcr sys$disk:[]genemit md
203 $ 'CC 'CFLAGS insn-emit.c
208 $ 'CC 'CFLAGS stupid.c
209 $ 'CC 'CFLAGS combine.c
210 $ 'CC 'CFLAGS regclass.c
211 $ 'CC 'CFLAGS local-alloc.c
212 $ 'CC 'CFLAGS global-alloc.c
213 $ 'CC 'CFLAGS reload.c
214 $ 'CC 'CFLAGS reload1.c
215 $! Generate insn-peep.c
216 $ 'CC 'CFLAGS genpeep.c
217 $ link 'LDFLAGS' genpeep,rtl,obstack, 'LIBS'
218 $ assign/user insn-peep.c sys$output:
219 $ mcr sys$disk:[]genpeep md
221 $ 'CC 'CFLAGS insn-peep.c
222 $ 'CC 'CFLAGS final.c
223 $ 'CC 'CFLAGS recog.c
224 $! Generate insn-recog.c
225 $ 'CC 'CFLAGS genrecog.c
226 $ link 'LDFLAGS' genrecog,rtl,obstack, 'LIBS'
227 $ assign/user insn-recog.c sys$output:
228 $ mcr sys$disk:[]genrecog md
230 $ 'CC 'CFLAGS insn-recog.c
231 $! Generate insn-extract.c
232 $ 'CC 'CFLAGS genextract.c
233 $ link 'LDFLAGS' genextract,rtl,obstack, 'LIBS'
234 $ assign/user insn-extract.c sys$output:
235 $ mcr sys$disk:[]genextract md
237 $ 'CC 'CFLAGS insn-extract.c
238 $! Generate insn-output.c
239 $ 'CC 'CFLAGS genoutput.c
240 $ link 'LDFLAGS' genoutput,rtl,obstack, 'LIBS'
241 $ assign/user insn-output.c sys$output:
242 $ mcr sys$disk:[]genoutput md
244 $ 'CC 'CFLAGS insn-output.c
245 $ 'CC 'CFLAGS integrate.c
246 $ 'CC 'CFLAGS caller-save.c
247 $ 'CC 'CFLAGS calls.c
248 $ 'CC 'CFLAGS dwarfout.c
249 $ 'CC 'CFLAGS dbxout.c
250 $ 'CC 'CFLAGS xcoffout.c
251 $ 'CC 'CFLAGS reg-stack.c
252 $ 'CC 'CFLAGS function.c
253 $ 'CC 'CFLAGS reorg.c
254 $ 'CC 'CFLAGS sched.c
255 $ 'CC 'CFLAGS sdbout.c
256 $ 'CC 'CFLAGS unroll.c
257 $! Generate insn-attrtab.c
258 $ 'CC 'CFLAGS genattrtab.c
259 $ link 'LDFLAGS' genattrtab,rtl,rtlanal,obstack, 'LIBS'
260 $ assign/user insn-attrtab.c sys$output:
261 $ mcr sys$disk:[]genattrtab md
262 $ 'CC 'CFLAGS insn-attrtab.c
263 $ 'CC 'CFLAGS aux-output.c
267 $! C language specific modules
269 $if DO_CC1.eq.0 then goto compile_cc1plus
270 $if DO_LINK.eq.1 then goto link_cc1
272 $ if (f$search("C-PARSE.C") .eqs. "") then goto gcc_bison
273 $ if (f$cvtime(f$file_attributes("C-PARSE.Y","RDT")).les. -
274 f$cvtime(f$file_attributes("C-PARSE.C","RDT"))) -
275 then goto gcc_nobison
276 $gcc_bison: 'BISON' /define /verbose c-parse.y
277 $ 'RENAME' c-parse_tab.c c-parse.c
278 $ 'RENAME' c-parse_tab.h c-parse.h
280 $ 'CC 'CFLAGS c-parse.c
281 $ 'CC 'CFLAGS c-lex.c
282 $ 'CC 'CFLAGS c-decl.c
283 $ 'CC 'CFLAGS c-typeck.c
284 $ 'CC 'CFLAGS c-convert.c
285 $ 'CC 'CFLAGS c-aux-info.c
286 $ 'CC 'CFLAGS c-common.c
287 $ 'CC 'CFLAGS c-lang.c
289 $! CAUTION: If you want to link gcc-cc1 to the sharable image library
290 $! VAXCRTL, see the notes in gcc.texinfo (or INSTALL) first.
293 $ link 'LDFLAGS' /exe=gcc-cc1 version.opt/opt,sys$input:/opt, -
294 independent.opt/opt,'LIBS'
296 ! "CC1" Linker options file
299 c-parse,c-decl,c-typeck,c-convert,c-aux-info,c-common,c-lang,c-lex
301 $! C++ language specific modules
305 $if DO_CC1PLUS.eq.0 then goto compile_cc1obj
306 $if DO_LINK.eq.1 then goto link_cc1plus
308 $ if (f$search("CP-PARSE.C") .eqs. "") then goto cplus_bison
309 $ if (f$cvtime(f$file_attributes("CP-PARSE.Y","RDT")).les. -
310 f$cvtime(f$file_attributes("CP-PARSE.C","RDT"))) -
311 then goto cplus_nobison
313 $ 'BISON' /define /verbose cp-parse.y
314 $ 'RENAME' cp-parse_tab.c cp-parse.c
315 $ 'RENAME' cp-parse_tab.h cp-parse.h
318 $ 'CC 'CFLAGS cp-parse.c
319 $ 'CC 'CFLAGS cp-decl.c
320 $ 'CC 'CFLAGS cp-decl2.c
321 $ 'CC 'CFLAGS cp-typeck.c
322 $ 'CC 'CFLAGS cp-type2.c
323 $ 'CC 'CFLAGS cp-tree.c
324 $ 'CC 'CFLAGS cp-ptree.c
325 $ 'CC 'CFLAGS cp-cvt.c
326 $ 'CC 'CFLAGS cp-search.c
327 $ 'CC 'CFLAGS cp-lex.c
328 $ 'CC 'CFLAGS cp-gc.c
329 $ 'CC 'CFLAGS cp-call.c
330 $ 'CC 'CFLAGS cp-class.c
331 $ 'CC 'CFLAGS cp-init.c
332 $ 'CC 'CFLAGS cp-method.c
333 $ 'CC 'CFLAGS cp-except.c
334 $ 'CC 'CFLAGS cp-expr.c
335 $ 'CC 'CFLAGS cp-pt.c
336 $ 'CC 'CFLAGS cp-edsel.c
337 $ 'CC 'CFLAGS cp-xref.c
338 $ 'CC 'CFLAGS cp-spew.c
339 $ 'CC 'CFLAGS c-common.c
342 $ link 'LDFLAGS' /exe=gcc-cc1plus version.opt/opt,sys$input:/opt, -
343 independent.opt/opt,'LIBS'
345 ! "CC1PLUS" Linker options file
347 cp-parse,cp-decl,cp-decl2,cp-typeck,cp-type2,cp-tree
348 cp-ptree,cp-cvt,cp-search,cp-lex,cp-gc,cp-call,cp-class
349 cp-init,cp-method,cp-except,cp-expr,cp-pt,cp-edsel
350 cp-xref,cp-spew,c-common
352 $! objective language specific modules
355 $if DO_CC1OBJ.eq.0 then goto all_done
356 $if DO_LINK.eq.1 then goto LINK_CC1OBJ
358 $ if (f$search("OBJC-PARSE.C") .eqs. "") then goto objc_bison
359 $ if (f$cvtime(f$file_attributes("OBJC-PARSE.Y","RDT")).les. -
360 f$cvtime(f$file_attributes("OBJC-PARSE.C","RDT"))) -
361 then goto objc_nobison
363 $ 'BISON' /define /verbose OBJC-PARSE.y
364 $ 'RENAME' OBJC-PARSE_tab.c OBJC-PARSE.c
365 $ 'RENAME' OBJC-PARSE_tab.h OBJC-PARSE.h
367 $ 'CC 'CFLAGS objc-parse.c
368 $ 'CC 'CFLAGS objc-actions.c
370 $! If have also built CC1, we do not need to recompile these modules.
372 $if DO_CC1.eq.1 then goto LINK_CC1OBJ
373 $ 'CC 'CFLAGS c-lex.c
374 $ 'CC 'CFLAGS c-decl.c
375 $ 'CC 'CFLAGS c-typeck.c
376 $ 'CC 'CFLAGS c-convert.c
377 $ 'CC 'CFLAGS c-aux-info.c
378 $ 'CC 'CFLAGS c-common.c
382 $ link 'LDFLAGS' /exe=gcc-cc1obj version.opt/opt,sys$input:/opt, -
383 independent.opt/opt,'LIBS'
385 ! "Objective C" Linker options file
387 objc-parse,objc-actions,c-lex,c-decl,c-typeck,c-convert,c-aux-info,c-common