Regen embed enable slab for PERL_IMPLICIT_SYS
[p5sagit/p5-mst-13.2.git] / vos / build.cm
CommitLineData
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&
868439a2 35&if &compiler& = gcc & &version& = alpha
36&then &do
37 &display_line build: "-compiler gcc" is incompatible with "-version alpha"
38 &return 1
39 &end
40&
495c5fdc 41& Set up the appropriate directory suffix for each architecture.
42&
43&if &cpu& = mc68020
44&then &set_string obj ''
45&if &cpu& = i80860
46&then &set_string obj .860
47&if &cpu& = pa7100
48&then &set_string obj .7100
49&if &cpu& = pa8000
50&then &set_string obj .8000
51&
24e8e380 52&if &cpu& = mc68020
53&then &set_string obj2 .68k
54&else &set_string obj2 &obj&
55&
868439a2 56&if &cpu& = mc68020
57&then &set_string bindsize -size large
58&else &set_string bindsize ''
59&
0d6ca59a 60&if &compiler& = cc
61&then &do
495c5fdc 62&set_string cpu -processor &cpu&
0d6ca59a 63&set_string s .obj
64&end
65&else &do
66&set_string cpu ''
67&set_string s .o
68&end
495c5fdc 69&
495c5fdc 70& Suppress several harmless compiler warning and advice messages.
24e8e380 71& Use -list -show_include all -show_macros both_ways when debugging.
495c5fdc 72&
868439a2 73&set_string cflags -D_SVID_SOURCE -D_POSIX_C_SOURCE=199506L -DPERL_CORE -O4
74&
0d6ca59a 75&if &compiler& = cc
868439a2 76&then &set_string cflags &cflags& '-u'
77&else &set_string cflags &cflags& '-c'
5b8c1387 78&
79& The following is a work-around for stcp-1437,8,9
80&
81&if &version& = ga
82&then &set_string cflags &cflags& -D_BSD_SOURCE
24e8e380 83&
0d6ca59a 84&if &compiler& = cc
85&then &set_string diag -suppress_diag 2006 2064 2065
86&else &set_string diag ''
87&
88& The following is a work-around for stcp-1570 and GCC.
868439a2 89& (and for some perl errors that only cc finds)
0d6ca59a 90&
91&if &compiler& = gcc
92&then &set_string diag &diag& -w
868439a2 93&else &set_string diag &diag& -w1
94&
95&if &version& = alpha
96&then !set_library_paths include << < &POSIX&>incl &+
97 (master_disk)>system>include_library
98&else !set_library_paths include << < &+
99 (master_disk)>system>stcp>include_library &+
100 (master_disk)>system>include_library>sysv &+
101 (master_disk)>system>include_library
102&
103&if &compiler& = gcc
104&then !set_library_paths command '(current_dir)' &+
105 (master_disk)>system>gnu_library>bin &+
106 (master_disk)>system>command_library
107&else !set_library_paths command '(current_dir)' &+
108 (master_disk)>system>command_library
109&
110& If requested, compile the source code.
111&
112&if &recompile& = 0
113&then &goto CHECK_REBIND
114&
115& Some of the compiler invocations need more VM than
116& the defaults allow. Raise the limits.
117!update_process_cmd_limits -initial_total_limit 100000000 -no_ask
0d6ca59a 118&
119!&compiler& <<av.c &diag& &cpu& &cflags& -o av&s&
495c5fdc 120&if (command_status) ^= 0 &then &return
0d6ca59a 121!&compiler& <<deb.c &diag& &cpu& &cflags& -o deb&s&
495c5fdc 122&if (command_status) ^= 0 &then &return
0d6ca59a 123!&compiler& <<doio.c &diag& &cpu& &cflags& -o doio&s&
495c5fdc 124&if (command_status) ^= 0 &then &return
0d6ca59a 125!&compiler& <<doop.c &diag& &cpu& &cflags& -o doop&s&
495c5fdc 126&if (command_status) ^= 0 &then &return
0d6ca59a 127!&compiler& <<dump.c &diag& &cpu& &cflags& -o dump&s&
495c5fdc 128&if (command_status) ^= 0 &then &return
0d6ca59a 129!&compiler& <<globals.c &diag& &cpu& &cflags& -o globals&s&
495c5fdc 130&if (command_status) ^= 0 &then &return
0d6ca59a 131!&compiler& <<gv.c &diag& &cpu& &cflags& -o gv&s&
495c5fdc 132&if (command_status) ^= 0 &then &return
0d6ca59a 133!&compiler& <<hv.c &diag& &cpu& &cflags& -o hv&s&
495c5fdc 134&if (command_status) ^= 0 &then &return
4849278d 135!&compiler& <<locale.c &diag& &cpu& &cflags& -o locale&s&
136&if (command_status) ^= 0 &then &return
0d6ca59a 137& !&compiler& <<malloc.c &diag& &cpu& &cflags& -o malloc&s&
495c5fdc 138& &if (command_status) ^= 0 &then &return
0d6ca59a 139!&compiler& <<mg.c &diag& &cpu& &cflags& -o mg&s&
24e8e380 140&if (command_status) ^= 0 &then &return
4849278d 141!&compiler& <<numeric.c &diag& &cpu& &cflags& -o numeric&s&
142&if (command_status) ^= 0 &then &return
0d6ca59a 143!&compiler& <<op.c &diag& &cpu& &cflags& -o op&s&
24e8e380 144&if (command_status) ^= 0 &then &return
5b8c1387 145&
146& We are essentially building miniperl for now. Until we
147& get a POSIX shell on VOS we won't add any of the extensions.
148&
149& !link <<op.c opmini.c -delete
150& &if (command_status) ^= 0 &then &return
0d6ca59a 151& !&compiler& opmini.c &diag& &cpu& &cflags& -DPERL_EXTERNAL_GLOB -o opmini&s&
5b8c1387 152& &if (command_status) ^= 0 &then &return
153& !unlink opmini.c
154& &if (command_status) ^= 0 &then &return
155&
0d6ca59a 156!&compiler& <<perl.c &diag& &cpu& &cflags& -o perl&s& &+
5b8c1387 157 -DARCHLIB="/system/ported/perl/lib/5.7&obj2&" &+
158 -DARCHLIB_EXP="/system/ported/perl/lib/5.7&obj2&" &+
159 -DSITEARCH="/system/ported/perl/lib/site/5.7&obj2&" &+
160 -DSITEARCH_EXP="/system/ported/perl/lib/site/5.7&obj2&"
495c5fdc 161&if (command_status) ^= 0 &then &return
0d6ca59a 162!&compiler& <<perlapi.c &diag& &cpu& &cflags& -o perlapi&s&
495c5fdc 163&if (command_status) ^= 0 &then &return
0d6ca59a 164!&compiler& <<perlio.c &diag& &cpu& &cflags& -o perlio&s&
495c5fdc 165&if (command_status) ^= 0 &then &return
0d6ca59a 166!&compiler& <<perly.c &diag& &cpu& &cflags& -o perly&s&
495c5fdc 167&if (command_status) ^= 0 &then &return
24e8e380 168& compiling pp.c for the PA-RISC hits compiler bug pcg-98; avoid it.
169& The bug is fixed in VOS 14.1.0 and all later releases.
170&if (index (string &cpu&) pa) > 0 & (module_info os_release) < 'VOS Release 14.1.0'
0d6ca59a 171&then !&compiler& <<pp.c &diag& &cpu& &cflags& -no_schedule -o pp&s&
172&else !&compiler& <<pp.c &diag& &cpu& &cflags& -o pp&s&
495c5fdc 173&if (command_status) ^= 0 &then &return
0d6ca59a 174!&compiler& <<pp_ctl.c &diag& &cpu& &cflags& -o pp_ctl&s&
495c5fdc 175&if (command_status) ^= 0 &then &return
0d6ca59a 176!&compiler& <<pp_hot.c &diag& &cpu& &cflags& -o pp_hot&s&
495c5fdc 177&if (command_status) ^= 0 &then &return
4849278d 178!&compiler& <<pp_pack.c &diag& &cpu& &cflags& -o pp_pack&s&
179&if (command_status) ^= 0 &then &return
84d4ea48 180!&compiler& <<pp_sort.c &diag& &cpu& &cflags& -o pp_sort&s&
181&if (command_status) ^= 0 &then &return
0d6ca59a 182!&compiler& <<pp_sys.c &diag& &cpu& &cflags& -o pp_sys&s&
495c5fdc 183&if (command_status) ^= 0 &then &return
0d6ca59a 184!&compiler& <<regcomp.c &diag& &cpu& &cflags& -o regcomp&s&
495c5fdc 185&if (command_status) ^= 0 &then &return
0d6ca59a 186!&compiler& <<regexec.c &diag& &cpu& &cflags& -o regexec&s&
495c5fdc 187&if (command_status) ^= 0 &then &return
0d6ca59a 188!&compiler& <<run.c &diag& &cpu& &cflags& -o run&s&
495c5fdc 189&if (command_status) ^= 0 &then &return
0d6ca59a 190!&compiler& <<scope.c &diag& &cpu& &cflags& -o scope&s&
495c5fdc 191&if (command_status) ^= 0 &then &return
0d6ca59a 192!&compiler& <<sv.c &diag& &cpu& &cflags& -o sv&s&
495c5fdc 193&if (command_status) ^= 0 &then &return
868439a2 194!&compiler& <<sharedsv.c &diag& &cpu& &cflags& -o sharedsv&s&
195&if (command_status) ^= 0 &then &return
0d6ca59a 196!&compiler& <<taint.c &diag& &cpu& &cflags& -o taint&s&
495c5fdc 197&if (command_status) ^= 0 &then &return
0d6ca59a 198!&compiler& <<toke.c &diag& &cpu& &cflags& -o toke&s&
495c5fdc 199&if (command_status) ^= 0 &then &return
0d6ca59a 200!&compiler& <<universal.c &diag& &cpu& &cflags& -o universal&s&
495c5fdc 201&if (command_status) ^= 0 &then &return
0d6ca59a 202!&compiler& <<utf8.c &diag& &cpu& &cflags& -o utf8&s&
495c5fdc 203&if (command_status) ^= 0 &then &return
0d6ca59a 204!&compiler& <<util.c &diag& &cpu& &cflags& -o util&s&
495c5fdc 205&if (command_status) ^= 0 &then &return
0d6ca59a 206!&compiler& <<xsutils.c &diag& &cpu& &cflags& -o xsutils&s&
495c5fdc 207&if (command_status) ^= 0 &then &return
5b8c1387 208&if &version& = alpha
209&then &do
0d6ca59a 210!&compiler& <vos_dummies.c &cpu& -O4 -o vos_dummies&s&
495c5fdc 211&if (command_status) ^= 0 &then &return
5b8c1387 212&end
495c5fdc 213&
0d6ca59a 214&if &compiler& = gcc
215&then &do
216 !delete_file perl.a
868439a2 217 !ar rc perl.a av.o deb.o doio.o doop.o dump.o globals.o gv.o hv.o locale.o &+
218 mg.o numeric.o op.o perl.o perlapi.o perlio.o perly.o pp.o pp_ctl.o &+
219 pp_hot.o pp_pack.o pp_sort.o pp_sys.o regcomp.o regexec.o run.o scope.o &+
220 sharedsv.o sv.o taint.o toke.o universal.o utf8.o util.o xsutils.o
221 !delete_file *.o -no_ask -brief
0d6ca59a 222&end
223&else &do
224 !&compiler& <<miniperlmain.c &diag& &cpu& &cflags& -o miniperlmain&s&
225 &if (command_status) ^= 0 &then &return
226&end
227&
495c5fdc 228& If requested, bind the executable program module.
229&
230&label CHECK_REBIND
231&if &rebind& = 0
232&then &return
233&
24e8e380 234&if (exists -directory (master_disk)>system>tcp_os>object_library&obj2&)
235&then &set_string tcp_objlib (master_disk)>system>tcp_os>object_library&obj2&
495c5fdc 236&else &set_string tcp_objlib (master_disk)>system>tcp_os>object_library
237&
5b8c1387 238&if (exists -directory (master_disk)>system>stcp>object_library&obj2&)
239&then &set_string stcp_objlib (master_disk)>system>stcp>object_library&obj2&
240&else &set_string stcp_objlib (master_disk)>system>stcp>object_library
241&
24e8e380 242&if (exists -directory (master_disk)>system>object_library&obj2&)
243&then &set_string objlib (master_disk)>system>object_library&obj2&
495c5fdc 244&else &set_string objlib (master_disk)>system>object_library
245&
24e8e380 246&if (exists -directory (master_disk)>system>c_object_library&obj2&)
247&then &set_string c_objlib (master_disk)>system>c_object_library&obj2&
495c5fdc 248&else &set_string c_objlib (master_disk)>system>c_object_library
249&
5b8c1387 250&if (exists -directory (master_disk)>system>posix_object_library&obj2&)
251&then &set_string posix_objlib (master_disk)>system>posix_object_library&obj2&
252&else &set_string posix_objlib (master_disk)>system>posix_object_library
253&
254&if &version& = alpha
255&then !set_library_paths object . &tcp_objlib& &+
495c5fdc 256 &POSIX&>c>sysv_runtime>obj&obj& &+
5b8c1387 257 &POSIX&>c>runtime>obj&obj& &+
258 &c_objlib& &objlib&
259&else !set_library_paths object . &stcp_objlib& &+
260 &stcp_objlib&>common &+
261 &stcp_objlib&>net &+
262 &stcp_objlib&>sbsd &+
263 &stcp_objlib&>socket &+
868439a2 264 &posix_objlib&>sysv &+
5b8c1387 265 &posix_objlib&>bsd &+
266 &posix_objlib& &+
267 &c_objlib& &objlib&
0d6ca59a 268&if &compiler& = gcc
269&then &do
270 &set_string cflags (before &$cflags& -c)
271 !&compiler& <<miniperlmain.c perl.a &diag& &cpu& &cflags& -o perl.pm
272 &if (command_status) ^= 0 &then &return
273 !delete_file perl.a
274&end
275&else &do
276 &if &version& = alpha
277 &then !bind -control <perl.bind vos_dummies &+
5b8c1387 278 &tcp_objlib&>tcp_runtime &tcp_objlib&>tcp_gethost &+
868439a2 279 &cpu& -target_module &tgt_mod& &bindsize& -map
0d6ca59a 280 &else !bind -control <perl.bind &cpu& -target_module &tgt_mod& -map
281 &if (command_status) ^= 0 &then &return
282&end
283!delete_file *&s& -no_ask -brief