]>
Commit | Line | Data |
---|---|---|
eee7810f KR |
1 | #!/bin/sh |
2 | ||
3 | cat << 'EOF' | |
4 | $! Set the def dir to proper place for use in batch. Works for interactive to. | |
5 | $flnm = f$enviroment("PROCEDURE") ! get current procedure name | |
6 | $set default 'f$parse(flnm,,,"DEVICE")''f$parse(flnm,,,"DIRECTORY")' | |
c0b8690d | 7 | $v = 'f$verify(0)' |
eee7810f KR |
8 | $! |
9 | $! Command file to build a GNU assembler on VMS | |
10 | $! | |
11 | $! If you are using a version of GCC that supports global constants | |
12 | $! you should remove the define="const=" from the gcc lines. | |
13 | $! | |
14 | $! Caution: Versions 1.38.1 and earlier had a bug in the handling of | |
15 | $! some static constants. If you are using such a version of the | |
16 | $! assembler, and you wish to compile without the "const=" hack, | |
17 | $! you should first build this version *with* the "const=" | |
18 | $! definition, and then use that assembler to rebuild it without the | |
19 | $! "const=" definition. Failure to do this will result in an assembler | |
20 | $! that will mung floating point constants. | |
21 | $! | |
22 | $! Note: The version of gas shipped on the GCC VMS tapes has been patched | |
23 | $! to fix the above mentioned bug. | |
24 | $! | |
26f4447a KR |
25 | $ !The gcc-vms driver was modified to use `-1' quite some time ago, |
26 | $ !so don't echo this text any more... | |
27 | $ !write sys$output "If this assembler is going to be used with GCC 1.n, you" | |
28 | $ !write sys$output "need to modify the driver to supply the -1 switch to gas." | |
29 | $ !write sys$output "This is required because of a small change in how global" | |
30 | $ !write sys$output "constant variables are handled. Failure to include this" | |
31 | $ !write sys$output "will result in linker warning messages about mismatched | |
32 | $ !write sys$output "psect attributes." | |
eee7810f KR |
33 | $! |
34 | $ C_DEFS :="""VMS""" | |
35 | $! C_DEFS :="""VMS""","""const=""" | |
c0b8690d KR |
36 | $ C_INCLUDES = "/Include=([],[.config],[-.include],[-.include.aout])" |
37 | $ C_FLAGS = "/noVerbose/Debug" + c_includes | |
eee7810f KR |
38 | $! |
39 | $! | |
c0b8690d | 40 | $ on error then goto bail |
a088fb62 KR |
41 | $ if f$search("[-.libiberty]liberty.olb").eqs."" |
42 | $ then @[-.libiberty]vmsbuild.com | |
43 | $ write sys$output "Now building gas." | |
44 | $ endif | |
eee7810f KR |
45 | $ if "''p1'" .eqs. "LINK" then goto Link |
46 | $! | |
47 | $! This helps gcc 1.nn find the aout/* files. | |
48 | $! | |
49 | $ aout_dev = f$parse(flnm,,,"DEVICE") | |
50 | $ tmp = aout_dev - ":" | |
51 | $if f$trnlnm(tmp).nes."" then aout_dev = f$trnlnm(tmp) | |
52 | $ aout_dir = aout_dev+f$parse(flnm,,,"DIRECTORY")' - | |
53 | - "GAS]" + "INCLUDE.AOUT.]" - "][" | |
54 | $assign 'aout_dir' aout/tran=conc | |
55 | $ opcode_dir = aout_dev+f$parse(flnm,,,"DIRECTORY")' - | |
56 | - "GAS]" + "INCLUDE.OPCODE.]" - "][" | |
57 | $assign 'opcode_dir' opcode/tran=conc | |
58 | $! | |
c0b8690d KR |
59 | $ set verify |
60 | $! | |
eee7810f KR |
61 | EOF |
62 | ||
63 | cfiles="`echo $* | sed -e 's/\.o/.c/g' -e 's!../\([^ /]*\)/\([^ /]*\.c\)![-.\1]\2!g'`" | |
64 | ||
65 | for cfile in $cfiles ; do | |
eee7810f | 66 | case $cfile in |
c92d9ee9 KR |
67 | "[-."*) |
68 | base=`echo $cfile | sed -e 's/\[.*\]//' -e 's/\.c$//'` | |
c0b8690d | 69 | echo "\$ gcc 'c_flags'/Define=('C_DEFS')/Object=[]$base.obj $cfile" |
c92d9ee9 KR |
70 | ;; |
71 | *) | |
c0b8690d | 72 | echo "\$ gcc 'c_flags'/Define=('C_DEFS') $cfile" |
c92d9ee9 | 73 | ;; |
eee7810f KR |
74 | esac |
75 | done | |
76 | ||
eee7810f | 77 | cat << 'EOF' |
c92d9ee9 | 78 | $link: |
c0b8690d KR |
79 | $!'f$verify(0)' |
80 | $ set verify=(Proc,noImag) | |
81 | $ link/noMap/Exec=gcc-as version.opt/Opt+sys$input:/Opt | |
eee7810f KR |
82 | ! |
83 | ! Linker options file for GNU assembler | |
84 | ! | |
85 | EOF | |
86 | ||
87 | for obj in $* ; do | |
c92d9ee9 KR |
88 | # Change "foo.o" into "foo.obj". |
89 | echo ${obj}bj,- | sed 's!.*/!!g' | |
eee7810f KR |
90 | done |
91 | ||
92 | cat << 'EOF' | |
a088fb62 | 93 | [-.libiberty]liberty.olb/Lib |
c0b8690d | 94 | gnu_cc:[000000]gcclib.olb/Lib,sys$library:vaxcrtl.olb/Lib |
c92d9ee9 | 95 | ! Tell linker exactly what psect attributes we want -- match VAXCRTL. |
c06e55d9 | 96 | psect_attr=ENVIRON,long,pic,ovr,rel,gbl,noshr,noexe,rd,wrt |
c0b8690d KR |
97 | $! |
98 | $bail: exit $status + 0*f$verify(v) !'f$verify(0)' | |
eee7810f | 99 | EOF |