Commit | Line | Data |
495c5fdc |
1 | &begin_parameters |
2 | cpu option(-processor)name,allow(mc68020,i80860,pa7100,pa8000),=mc68020 |
3 | recompile switch(-recompile),=1 |
4 | rebind switch(-rebind),=1 |
5b8c1387 |
5 | tgt_mod option(-target_module)module_name,='(current_module)' |
6 | version option(-version)name,allow(alpha,ga),=ga |
0d6ca59a |
7 | compiler option(-compiler)name,allow(cc,gcc)=cc |
495c5fdc |
8 | &end_parameters |
9 | &echo command_lines |
10 | & |
11 | & This is a VOS command macro to build Perl 5 for the Stratus VOS |
12 | & operating system. You need to have the VOS POSIX.1 support |
13 | & loaded on your system. Change the following statement, if |
14 | & necessary, to assign the correct pathname of the directory that |
15 | & contains VOS POSIX.1 support. |
16 | & |
5b8c1387 |
17 | &if &version& = alpha |
18 | &then &set_string POSIX >vos_ftp_site>pub>vos>alpha>posix |
19 | &else &set_string POSIX >system>posix_object_library |
495c5fdc |
20 | & |
21 | & See if the site has VOS POSIX.1 support loaded. If not, quit now. |
22 | & |
23 | &if ^ (exists &POSIX& -directory) |
24 | &then &do |
25 | &display_line build: VOS POSIX.1 support not found. &POSIX& |
5b8c1387 |
26 | &return 1 |
27 | &end |
28 | & |
29 | &if &cpu& = mc68020 & &version& = ga | &cpu& = i80860 & &version& = ga |
30 | &then &do |
31 | &display_line build: "-version ga" is incompatible with "-processor mc68020 or i80860" |
32 | &return 1 |
495c5fdc |
33 | &end |
34 | & |
35 | & Set up the appropriate directory suffix for each architecture. |
36 | & |
37 | &if &cpu& = mc68020 |
38 | &then &set_string obj '' |
39 | &if &cpu& = i80860 |
40 | &then &set_string obj .860 |
41 | &if &cpu& = pa7100 |
42 | &then &set_string obj .7100 |
43 | &if &cpu& = pa8000 |
44 | &then &set_string obj .8000 |
45 | & |
24e8e380 |
46 | &if &cpu& = mc68020 |
47 | &then &set_string obj2 .68k |
48 | &else &set_string obj2 &obj& |
49 | & |
0d6ca59a |
50 | &if &compiler& = cc |
51 | &then &do |
495c5fdc |
52 | &set_string cpu -processor &cpu& |
0d6ca59a |
53 | &set_string s .obj |
54 | &end |
55 | &else &do |
56 | &set_string cpu '' |
57 | &set_string s .o |
58 | &end |
495c5fdc |
59 | & |
60 | & If requested, compile the source code. |
61 | & |
62 | &if &recompile& = 0 |
63 | &then &goto CHECK_REBIND |
64 | & |
5b8c1387 |
65 | &if &version& = alpha |
66 | &then !set_library_paths include << < &POSIX&>incl &+ |
67 | (master_disk)>system>include_library |
68 | &else !set_library_paths include << < &+ |
69 | (master_disk)>system>stcp>include_library &+ |
495c5fdc |
70 | (master_disk)>system>include_library |
71 | & |
24e8e380 |
72 | &if (exists *.obj -link) |
73 | &then !unlink *.obj -no_ask -brief |
74 | & |
495c5fdc |
75 | & Suppress several harmless compiler warning and advice messages. |
24e8e380 |
76 | & Use -list -show_include all -show_macros both_ways when debugging. |
495c5fdc |
77 | & |
0d6ca59a |
78 | &if &compiler& = cc |
79 | &then &set_string cflags '-O4 -D_POSIX_C_SOURCE=199506L -DPERL_CORE -u' |
80 | &else &set_string cflags '-O4 -D_POSIX_C_SOURCE=199506L -DPERL_CORE -c' |
5b8c1387 |
81 | & |
82 | & The following is a work-around for stcp-1437,8,9 |
83 | & |
84 | &if &version& = ga |
85 | &then &set_string cflags &cflags& -D_BSD_SOURCE |
24e8e380 |
86 | & |
0d6ca59a |
87 | &if &compiler& = cc |
88 | &then &set_string diag -suppress_diag 2006 2064 2065 |
89 | &else &set_string diag '' |
90 | & |
91 | & The following is a work-around for stcp-1570 and GCC. |
92 | & |
93 | &if &compiler& = gcc |
94 | &then &set_string diag &diag& -w |
95 | & |
96 | !&compiler& <<av.c &diag& &cpu& &cflags& -o av&s& |
495c5fdc |
97 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
98 | !&compiler& <<deb.c &diag& &cpu& &cflags& -o deb&s& |
495c5fdc |
99 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
100 | !&compiler& <<doio.c &diag& &cpu& &cflags& -o doio&s& |
495c5fdc |
101 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
102 | !&compiler& <<doop.c &diag& &cpu& &cflags& -o doop&s& |
495c5fdc |
103 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
104 | !&compiler& <<dump.c &diag& &cpu& &cflags& -o dump&s& |
495c5fdc |
105 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
106 | !&compiler& <<globals.c &diag& &cpu& &cflags& -o globals&s& |
495c5fdc |
107 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
108 | !&compiler& <<gv.c &diag& &cpu& &cflags& -o gv&s& |
495c5fdc |
109 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
110 | !&compiler& <<hv.c &diag& &cpu& &cflags& -o hv&s& |
495c5fdc |
111 | &if (command_status) ^= 0 &then &return |
4849278d |
112 | !&compiler& <<locale.c &diag& &cpu& &cflags& -o locale&s& |
113 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
114 | & !&compiler& <<malloc.c &diag& &cpu& &cflags& -o malloc&s& |
495c5fdc |
115 | & &if (command_status) ^= 0 &then &return |
0d6ca59a |
116 | !&compiler& <<mg.c &diag& &cpu& &cflags& -o mg&s& |
24e8e380 |
117 | &if (command_status) ^= 0 &then &return |
4849278d |
118 | !&compiler& <<numeric.c &diag& &cpu& &cflags& -o numeric&s& |
119 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
120 | !&compiler& <<op.c &diag& &cpu& &cflags& -o op&s& |
24e8e380 |
121 | &if (command_status) ^= 0 &then &return |
5b8c1387 |
122 | & |
123 | & We are essentially building miniperl for now. Until we |
124 | & get a POSIX shell on VOS we won't add any of the extensions. |
125 | & |
126 | & !link <<op.c opmini.c -delete |
127 | & &if (command_status) ^= 0 &then &return |
0d6ca59a |
128 | & !&compiler& opmini.c &diag& &cpu& &cflags& -DPERL_EXTERNAL_GLOB -o opmini&s& |
5b8c1387 |
129 | & &if (command_status) ^= 0 &then &return |
130 | & !unlink opmini.c |
131 | & &if (command_status) ^= 0 &then &return |
132 | & |
0d6ca59a |
133 | !&compiler& <<perl.c &diag& &cpu& &cflags& -o perl&s& &+ |
5b8c1387 |
134 | -DARCHLIB="/system/ported/perl/lib/5.7&obj2&" &+ |
135 | -DARCHLIB_EXP="/system/ported/perl/lib/5.7&obj2&" &+ |
136 | -DSITEARCH="/system/ported/perl/lib/site/5.7&obj2&" &+ |
137 | -DSITEARCH_EXP="/system/ported/perl/lib/site/5.7&obj2&" |
495c5fdc |
138 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
139 | !&compiler& <<perlapi.c &diag& &cpu& &cflags& -o perlapi&s& |
495c5fdc |
140 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
141 | !&compiler& <<perlio.c &diag& &cpu& &cflags& -o perlio&s& |
495c5fdc |
142 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
143 | !&compiler& <<perly.c &diag& &cpu& &cflags& -o perly&s& |
495c5fdc |
144 | &if (command_status) ^= 0 &then &return |
24e8e380 |
145 | & compiling pp.c for the PA-RISC hits compiler bug pcg-98; avoid it. |
146 | & The bug is fixed in VOS 14.1.0 and all later releases. |
147 | &if (index (string &cpu&) pa) > 0 & (module_info os_release) < 'VOS Release 14.1.0' |
0d6ca59a |
148 | &then !&compiler& <<pp.c &diag& &cpu& &cflags& -no_schedule -o pp&s& |
149 | &else !&compiler& <<pp.c &diag& &cpu& &cflags& -o pp&s& |
495c5fdc |
150 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
151 | !&compiler& <<pp_ctl.c &diag& &cpu& &cflags& -o pp_ctl&s& |
495c5fdc |
152 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
153 | !&compiler& <<pp_hot.c &diag& &cpu& &cflags& -o pp_hot&s& |
495c5fdc |
154 | &if (command_status) ^= 0 &then &return |
4849278d |
155 | !&compiler& <<pp_pack.c &diag& &cpu& &cflags& -o pp_pack&s& |
156 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
157 | !&compiler& <<pp_sys.c &diag& &cpu& &cflags& -o pp_sys&s& |
495c5fdc |
158 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
159 | !&compiler& <<regcomp.c &diag& &cpu& &cflags& -o regcomp&s& |
495c5fdc |
160 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
161 | !&compiler& <<regexec.c &diag& &cpu& &cflags& -o regexec&s& |
495c5fdc |
162 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
163 | !&compiler& <<run.c &diag& &cpu& &cflags& -o run&s& |
495c5fdc |
164 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
165 | !&compiler& <<scope.c &diag& &cpu& &cflags& -o scope&s& |
495c5fdc |
166 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
167 | !&compiler& <<sv.c &diag& &cpu& &cflags& -o sv&s& |
495c5fdc |
168 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
169 | !&compiler& <<taint.c &diag& &cpu& &cflags& -o taint&s& |
495c5fdc |
170 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
171 | !&compiler& <<toke.c &diag& &cpu& &cflags& -o toke&s& |
495c5fdc |
172 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
173 | !&compiler& <<universal.c &diag& &cpu& &cflags& -o universal&s& |
495c5fdc |
174 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
175 | !&compiler& <<utf8.c &diag& &cpu& &cflags& -o utf8&s& |
495c5fdc |
176 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
177 | !&compiler& <<util.c &diag& &cpu& &cflags& -o util&s& |
495c5fdc |
178 | &if (command_status) ^= 0 &then &return |
0d6ca59a |
179 | !&compiler& <<xsutils.c &diag& &cpu& &cflags& -o xsutils&s& |
495c5fdc |
180 | &if (command_status) ^= 0 &then &return |
5b8c1387 |
181 | &if &version& = alpha |
182 | &then &do |
0d6ca59a |
183 | !&compiler& <vos_dummies.c &cpu& -O4 -o vos_dummies&s& |
495c5fdc |
184 | &if (command_status) ^= 0 &then &return |
5b8c1387 |
185 | &end |
495c5fdc |
186 | & |
0d6ca59a |
187 | &if &compiler& = gcc |
188 | &then &do |
189 | !delete_file perl.a |
190 | !ar rc perl.a av.o deb.o doio.o doop.o dump.o globals.o gv.o hv.o mg.o &+ |
191 | op.o perl.o perlapi.o perlio.o perly.o pp.o pp_ctl.o pp_hot.o pp_sys.o &+ |
192 | regcomp.o regexec.o run.o scope.o sv.o taint.o toke.o universal.o utf8.o &+ |
193 | util.o xsutils.o |
194 | &end |
195 | &else &do |
196 | !&compiler& <<miniperlmain.c &diag& &cpu& &cflags& -o miniperlmain&s& |
197 | &if (command_status) ^= 0 &then &return |
198 | &end |
199 | & |
495c5fdc |
200 | & If requested, bind the executable program module. |
201 | & |
202 | &label CHECK_REBIND |
203 | &if &rebind& = 0 |
204 | &then &return |
205 | & |
24e8e380 |
206 | &if (exists -directory (master_disk)>system>tcp_os>object_library&obj2&) |
207 | &then &set_string tcp_objlib (master_disk)>system>tcp_os>object_library&obj2& |
495c5fdc |
208 | &else &set_string tcp_objlib (master_disk)>system>tcp_os>object_library |
209 | & |
5b8c1387 |
210 | &if (exists -directory (master_disk)>system>stcp>object_library&obj2&) |
211 | &then &set_string stcp_objlib (master_disk)>system>stcp>object_library&obj2& |
212 | &else &set_string stcp_objlib (master_disk)>system>stcp>object_library |
213 | & |
24e8e380 |
214 | &if (exists -directory (master_disk)>system>object_library&obj2&) |
215 | &then &set_string objlib (master_disk)>system>object_library&obj2& |
495c5fdc |
216 | &else &set_string objlib (master_disk)>system>object_library |
217 | & |
24e8e380 |
218 | &if (exists -directory (master_disk)>system>c_object_library&obj2&) |
219 | &then &set_string c_objlib (master_disk)>system>c_object_library&obj2& |
495c5fdc |
220 | &else &set_string c_objlib (master_disk)>system>c_object_library |
221 | & |
5b8c1387 |
222 | &if (exists -directory (master_disk)>system>posix_object_library&obj2&) |
223 | &then &set_string posix_objlib (master_disk)>system>posix_object_library&obj2& |
224 | &else &set_string posix_objlib (master_disk)>system>posix_object_library |
225 | & |
226 | &if &version& = alpha |
227 | &then !set_library_paths object . &tcp_objlib& &+ |
495c5fdc |
228 | &POSIX&>c>sysv_runtime>obj&obj& &+ |
5b8c1387 |
229 | &POSIX&>c>runtime>obj&obj& &+ |
230 | &c_objlib& &objlib& |
231 | &else !set_library_paths object . &stcp_objlib& &+ |
232 | &stcp_objlib&>common &+ |
233 | &stcp_objlib&>net &+ |
234 | &stcp_objlib&>sbsd &+ |
235 | &stcp_objlib&>socket &+ |
236 | &posix_objlib&>bsd &+ |
237 | &posix_objlib& &+ |
238 | &c_objlib& &objlib& |
0d6ca59a |
239 | &if &compiler& = gcc |
240 | &then &do |
241 | &set_string cflags (before &$cflags& -c) |
242 | !&compiler& <<miniperlmain.c perl.a &diag& &cpu& &cflags& -o perl.pm |
243 | &if (command_status) ^= 0 &then &return |
244 | !delete_file perl.a |
245 | &end |
246 | &else &do |
247 | &if &version& = alpha |
248 | &then !bind -control <perl.bind vos_dummies &+ |
5b8c1387 |
249 | &tcp_objlib&>tcp_runtime &tcp_objlib&>tcp_gethost &+ |
250 | &cpu& -target_module &tgt_mod& -map |
0d6ca59a |
251 | &else !bind -control <perl.bind &cpu& -target_module &tgt_mod& -map |
252 | &if (command_status) ^= 0 &then &return |
253 | &end |
254 | !delete_file *&s& -no_ask -brief |
255 | !unlink *&s& -no_ask -brief |