1$! vmsbuild.com -- Commands to build GAWK		Pat Rankin, Dec'89
2$!
3$ if (f$getsyi("HW_MODEL") .lt. 1024)
4$ then
5$   arch_name = "VAX"
6$ else
7$   arch_name = f$edit(f$getsyi("ARCH_NAME"), "UPCASE")
8$ endif
9$!
10$ CCFLAGS = "/noList"	! "/noOpt/Debug"
11$! CCFLAGS = "/list/show=(expan,incl)
12$ CDEFS	  = "GAWK,HAVE_CONFIG_H"
13$! Do not specify _POSIX_EXIT here, we are using other tricks for that.
14$!
15$!
16$ if p1.eqs."" then  p1 = "DECC"	!default compiler
17$ if p1.eqs."GNUC"
18$ then
19$! assumes VAX
20$   CC = "gcc"
21$   if f$type(gcc).eqs."STRING" then  CC = gcc
22$   CFLAGS = "/Incl=([],[.vms],[.SUPPORT],[.SUPPORT.MALLOC])"
23$   CFLAGS = CFLAGS + "/Obj=[]/Def=(''CDEFS')''CCFLAGS'"
24$   LIBS = "gnu_cc:[000000]gcclib.olb/Library,sys$library:vaxcrtl.olb/Library"
25$   if p2.eqs."DO_GNUC_SETUP" then  set command gnu_cc:[000000]gcc
26$ else	!!GNUC
27$  if p1.eqs."VAXC"
28$  then
29$!  always VAX; version V3.x of VAX C assumed (for V2.x, remove /Opt=noInline)
30$   CC = "cc"
31$   if f$trnlnm("DECC$CC_DEFAULT").nes."" then  CC = "cc/VAXC"
32$   CFLAGS = "/Incl=[]/Obj=[]/Opt=noInline/Def=(''CDEFS')''CCFLAGS'"
33$   LIBS = "sys$share:vaxcrtl.exe/Shareable"
34$  else  !!VAXC
35$!  neither GNUC nor VAXC, assume DECC (same for either VAX or Alpha)
36$ if arch_name .eqs. "VAX"
37$ then
38$   CFLOAT = ""
39$ else
40$   CFLOAT = "/float=ieee/ieee_mode=denorm_results"
41$ endif
42$   CC = "cc/DECC/Prefix=All"
43$   CNAME = "/NAME=(AS_IS,SHORT)
44$   CINC = "/NESTED_INCLUDE=NONE"
45$   CINC1 = "[],[.vms],[.support],[.support.malloc]"
46$   CFLAGS = "/Incl=(''CINC1')/Obj=[]/Def=(''CDEFS')''CINC'''CCFLAGS'"
47$   CFLAGS = CNAME + CFLOAT + CFLAGS
48$   LIBS = ""	! DECC$SHR instead of VAXCRTL, no special link option needed
49$  endif !VAXC
50$ endif !GNUC
51$!
52$ cc = CC + CFLAGS
53$ show symbol cc
54$!
55$ if f$search("config.h") .nes. ""
56$ then
57$    if f$cvtime(f$file_attr("config.h", "RDT")) .ges. -
58        f$cvtime(f$file_attr("configh.in","RDT")) then  goto config_ok
59$ endif
60$ v = f$verify(0)
61$ @[.vms]generate_config_vms_h_gawk.com
62$ @[.vms]config_h.com NOBUILTINS
63$!
64$config_ok:
65$ if f$search("awkgram.c").nes."" then  goto awkgram_ok
66$	write sys$output " You must process `awkgram.y' with ""yacc"" or ""bison"""
67$	if f$search("awkgram_tab.c").nes."" then -	!bison was run manually
68	  write sys$output " or else rename `awkgram_tab.c' to `awkgram.c'."
69$	if f$search("ytab.c").nes."" .or. f$search("y_tab.c").nes."" then - !yacc
70	  write sys$output " or else rename `ytab.c' or `y_tab.c' to `awkgram.c'."
71$	exit
72$awkgram_ok:
73$ if f$search("command.c").nes."" then  goto command_ok
74$	write sys$output " You must process `command.y' with ""yacc"" or ""bison"""
75$	if f$search("command_tab.c").nes."" then -	!bison was run manually
76	  write sys$output " or else rename `command_tab.c' to `command.c'."
77$	if f$search("ytab.c").nes."" .or. f$search("y_tab.c").nes."" then - !yacc
78	  write sys$output " or else rename `ytab.c' or `y_tab.c' to `command.c'."
79$	exit
80$command_ok:
81$ v1 = f$verify(1)
82$ cc array.c
83$ cc awkgram.c
84$ cc builtin.c
85$ cc [.support]dfa.c
86$ define/user malloc sys$disk:[.support.malloc]
87$ cc [.support.malloc]dynarray_resize.c
88$ cc ext.c
89$ cc field.c
90$ cc floatcomp.c
91$ cc gawkmisc.c
92$ cc [.support]getopt.c
93$ cc [.support]getopt1.c
94$ cc io.c
95$ cc [.support]localeinfo.c
96$ cc main.c
97$ cc msg.c
98$ cc node.c
99$ cc [.support]random.c
100$ cc re.c
101$ define/user malloc sys$disk:[.support.malloc]
102$ cc [.support]regex.c
103$ cc replace.c
104$ cc version.c
105$ cc eval.c
106$ cc profile.c
107$ cc command.c
108$ cc debug.c
109$ cc int_array.c
110$ cc cint_array.c
111$ cc gawkapi.c
112$ cc mpfr.c
113$ cc str_array.c
114$ cc symbol.c
115$ cc [.vms]vms_misc.c
116$ cc [.vms]vms_popen.c
117$ cc [.vms]vms_fwrite.c
118$ cc [.vms]vms_args.c
119$ cc [.vms]vms_gawk.c
120$ cc [.vms]vms_cli.c
121$ cc [.vms]vms_crtl_init.c
122$ set command/Object=[]gawk_cmd.obj sys$disk:[.vms]gawk.cld
123$! 'f$verify(v)'
124$!
125$ close/noLog Fopt
126$ create gawk.opt
127! GAWK -- GNU awk
128array.obj,awkgram.obj,builtin.obj,dfa.obj,dynarray_resize.obj
129ext.obj,field.obj,floatcomp.obj
130gawkmisc.obj,getopt.obj,getopt1.obj,io.obj,localeinfo.obj
131main.obj,msg.obj,node.obj
132random.obj,re.obj,regex.obj,replace.obj,version.obj,eval.obj,profile.obj
133command.obj,debug.obj,int_array.obj,cint_array.obj,gawkapi.obj,mpfr.obj
134str_array.obj,symbol.obj
135[]vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj
136[]vms_gawk.obj,vms_cli.obj,gawk_cmd.obj,vms_crtl_init.obj
137psect_attr=environ,noshr	!extern [noshare] char **
138stack=48	!preallocate more pages (default is 20)
139iosegment=128	!ditto (default is 32)
140$!
141$ @[.vms]gawk_ident.com
142$ v1 = f$verify(1)
143$ open/append Fopt gawk.opt
144$ write Fopt libs
145$ close Fopt
146$!
147$ v1 = f$verify(1)
148$ link/exe=gawk.exe gawk.opt/options
149$! 'f$verify(v)'
150$ exit
151