2 $! Set the def dir to proper place for use in batch. Works for interactive to.
3 $flnm = f$enviroment("PROCEDURE") ! get current procedure name
4 $set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")'
7 $! Command file to build a GNU assembler on VMS
9 $! If you are using a version of GCC that supports global constants
10 $! you should remove the define="const=" from the gcc lines.
12 $! Caution: Versions 1.38.1 and earlier had a bug in the handling of
13 $! some static constants. If you are using such a version of the
14 $! assembler, and you wish to compile without the "const=" hack,
15 $! you should first build this version *with* the "const="
16 $! definition, and then use that assembler to rebuild it without the
17 $! "const=" definition. Failure to do this will result in an assembler
18 $! that will mung floating point constants.
20 $! Note: The version of gas shipped on the GCC VMS tapes has been patched
21 $! to fix the above mentioned bug.
23 $ !The gcc-vms driver was modified to use `-1' quite some time ago,
24 $ !so don't echo this text any more...
25 $ !write sys$output "If this assembler is going to be used with GCC 1.n, you"
26 $ !write sys$output "need to modify the driver to supply the -1 switch to gas."
27 $ !write sys$output "This is required because of a small change in how global"
28 $ !write sys$output "constant variables are handled. Failure to include this"
29 $ !write sys$output "will result in linker warning messages about mismatched
30 $ !write sys$output "psect attributes."
33 $ arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2
34 $ arch = f$element(arch_indx,"|","|VAX|Alpha|")
50 $! C_DEFS :="""VMS""","""const="""
51 $ C_INCLUDES = "/Include=([],[.config],[-.include],[-.include.aout])"
52 $ C_FLAGS = "/noVerbose/Debug" + c_includes
55 $ on error then goto bail
56 $ if f$search("[-.libiberty]liberty.olb").eqs.""
57 $ then @[-.libiberty]vmsbuild.com
58 $ write sys$output "Now building gas."
60 $ if "''p1'" .eqs. "LINK" then goto Link
62 $! This helps gcc 1.nn find the aout/* files.
64 $ aout_dev = f$parse(flnm,,,"DEVICE")
65 $ tmp = aout_dev - ":"
66 $if f$trnlnm(tmp).nes."" then aout_dev = f$trnlnm(tmp)
67 $ aout_dir = aout_dev+f$parse(flnm,,,"DIRECTORY")' -
68 - "GAS]" + "INCLUDE.AOUT.]" - "]["
69 $assign 'aout_dir' aout/tran=conc
70 $ opcode_dir = aout_dev+f$parse(flnm,,,"DIRECTORY")' -
71 - "GAS]" + "INCLUDE.OPCODE.]" - "]["
72 $assign 'opcode_dir' opcode/tran=conc
76 $ gcc 'c_flags'/Define=('C_DEFS')/Object=[]tc-'cpu_type'.obj [.config]tc-'cpu_type'.c
77 $ gcc 'c_flags'/Define=('C_DEFS')/Object=[]obj-'obj_format'.obj [.config]obj-'obj_format'.c
78 $ gcc 'c_flags'/Define=('C_DEFS')/Object=[]atof-'atof'.obj [.config]atof-'atof'.c
79 $ gcc 'c_flags'/Define=('C_DEFS') app.c
80 $ gcc 'c_flags'/Define=('C_DEFS') as.c
81 $ gcc 'c_flags'/Define=('C_DEFS') atof-generic.c
82 $ gcc 'c_flags'/Define=('C_DEFS') bignum-copy.c
83 $ gcc 'c_flags'/Define=('C_DEFS') cond.c
84 $ gcc 'c_flags'/Define=('C_DEFS') depend.c
85 $ gcc 'c_flags'/Define=('C_DEFS') dwarf2dbg.c
86 $ gcc 'c_flags'/Define=('C_DEFS') dw2gencfi.c
87 $ gcc 'c_flags'/Define=('C_DEFS') ehopt.c
88 $ gcc 'c_flags'/Define=('C_DEFS') expr.c
89 $ gcc 'c_flags'/Define=('C_DEFS') flonum-konst.c
90 $ gcc 'c_flags'/Define=('C_DEFS') flonum-copy.c
91 $ gcc 'c_flags'/Define=('C_DEFS') flonum-mult.c
92 $ gcc 'c_flags'/Define=('C_DEFS') frags.c
93 $ gcc 'c_flags'/Define=('C_DEFS') hash.c
94 $ gcc 'c_flags'/Define=('C_DEFS') input-file.c
95 $ gcc 'c_flags'/Define=('C_DEFS') input-scrub.c
96 $ gcc 'c_flags'/Define=('C_DEFS') literal.c
97 $ gcc 'c_flags'/Define=('C_DEFS') messages.c
98 $ gcc 'c_flags'/Define=('C_DEFS') output-file.c
99 $ gcc 'c_flags'/Define=('C_DEFS') read.c
100 $ gcc 'c_flags'/Define=('C_DEFS') subsegs.c
101 $ gcc 'c_flags'/Define=('C_DEFS') symbols.c
102 $ gcc 'c_flags'/Define=('C_DEFS') write.c
103 $ gcc 'c_flags'/Define=('C_DEFS') listing.c
104 $ gcc 'c_flags'/Define=('C_DEFS') ecoff.c
105 $ gcc 'c_flags'/Define=('C_DEFS') stabs.c
106 $ gcc 'c_flags'/Define=('C_DEFS') sb.c
107 $ gcc 'c_flags'/Define=('C_DEFS') macro.c
110 $ if f$trnlnm("IFILE$").nes."" then close/noLog ifile$
113 ! Linker options file for GNU assembler
115 $ open/Append ifile$ gcc-as.opt
116 $ write ifile$ "tc-''cpu_type'.obj"
117 $ write ifile$ "obj-''obj_format'.obj"
118 $ write ifile$ "atof-''atof'.obj"
119 $ COPY sys$input: ifile$:
149 [-.libiberty]liberty.olb/Lib
150 gnu_cc:[000000]gcclib.olb/Lib,sys$library:vaxcrtl.olb/Lib
151 ! Tell linker exactly what psect attributes we want -- match VAXCRTL.
152 psect_attr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt
154 $ set verify=(Proc,noImag)
155 $ link/noMap/Exec=gcc-as.exe gcc-as.opt/Opt,version.opt/Opt
157 $bail: exit $status + 0*f$verify(v) !'f$verify(0)'