1$!make-gas.com 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")' 5$v = 'f$verify(0)' 6$! 7$! Command file to build a GNU assembler on VMS 8$! 9$! If you are using a version of GCC that supports global constants 10$! you should remove the define="const=" from the gcc lines. 11$! 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. 19$! 20$! Note: The version of gas shipped on the GCC VMS tapes has been patched 21$! to fix the above mentioned bug. 22$! 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." 31$! 32$ gas_host="vms" 33$ arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 34$ arch = f$element(arch_indx,"|","|VAX|Alpha|") 35$ if arch.eqs."VAX" 36$ then 37$ cpu_type="vax" 38$ obj_format="vms" 39$ atof="vax" 40$ else 41$ cpu_type="alpha" 42$ obj_format="evax" 43$ atof="ieee" 44$ endif 45$ emulation="generic" 46$! 47$ COPY = "copy/noLog" 48$! 49$ C_DEFS :="""VMS""" 50$! C_DEFS :="""VMS""","""const=""" 51$ C_INCLUDES = "/Include=([],[.config],[-.include],[-.include.aout])" 52$ C_FLAGS = "/noVerbose/Debug" + c_includes 53$! 54$! 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." 59$ endif 60$ if "''p1'" .eqs. "LINK" then goto Link 61$! 62$! This helps gcc 1.nn find the aout/* files. 63$! 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 73$! 74$ set verify 75$! 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 108$link: 109$!'f$verify(0)' 110$ if f$trnlnm("IFILE$").nes."" then close/noLog ifile$ 111$ create gcc-as.opt 112! 113! Linker options file for GNU assembler 114! 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$: 120app.obj,- 121as.obj,- 122atof-generic.obj,- 123bignum-copy.obj,- 124cond.obj,- 125depend.obj,- 126dwarf2dbg.obj,- 127dw2gencfi.obj,- 128ehopt.obj,- 129expr.obj,- 130flonum-konst.obj,- 131flonum-copy.obj,- 132flonum-mult.obj,- 133frags.obj,- 134hash.obj,- 135input-file.obj,- 136input-scrub.obj,- 137literal.obj,- 138messages.obj,- 139output-file.obj,- 140read.obj,- 141subsegs.obj,- 142symbols.obj,- 143write.obj,- 144listing.obj,- 145ecoff.obj,- 146stabs.obj,- 147sb.obj,- 148macro.obj,- 149[-.libiberty]liberty.olb/Lib 150gnu_cc:[000000]gcclib.olb/Lib,sys$library:vaxcrtl.olb/Lib 151! Tell linker exactly what psect attributes we want -- match VAXCRTL. 152psect_attr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt 153$ close ifile$ 154$ set verify=(Proc,noImag) 155$ link/noMap/Exec=gcc-as.exe gcc-as.opt/Opt,version.opt/Opt 156$! 157$bail: exit $status + 0*f$verify(v) !'f$verify(0)' 158