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