Sync-up tests with libnet distribution
[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&
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
84d4ea48 157!&compiler& <<pp_sort.c &diag& &cpu& &cflags& -o pp_sort&s&
158&if (command_status) ^= 0 &then &return
0d6ca59a 159!&compiler& <<pp_sys.c &diag& &cpu& &cflags& -o pp_sys&s&
495c5fdc 160&if (command_status) ^= 0 &then &return
0d6ca59a 161!&compiler& <<regcomp.c &diag& &cpu& &cflags& -o regcomp&s&
495c5fdc 162&if (command_status) ^= 0 &then &return
0d6ca59a 163!&compiler& <<regexec.c &diag& &cpu& &cflags& -o regexec&s&
495c5fdc 164&if (command_status) ^= 0 &then &return
0d6ca59a 165!&compiler& <<run.c &diag& &cpu& &cflags& -o run&s&
495c5fdc 166&if (command_status) ^= 0 &then &return
0d6ca59a 167!&compiler& <<scope.c &diag& &cpu& &cflags& -o scope&s&
495c5fdc 168&if (command_status) ^= 0 &then &return
0d6ca59a 169!&compiler& <<sv.c &diag& &cpu& &cflags& -o sv&s&
495c5fdc 170&if (command_status) ^= 0 &then &return
0d6ca59a 171!&compiler& <<taint.c &diag& &cpu& &cflags& -o taint&s&
495c5fdc 172&if (command_status) ^= 0 &then &return
0d6ca59a 173!&compiler& <<toke.c &diag& &cpu& &cflags& -o toke&s&
495c5fdc 174&if (command_status) ^= 0 &then &return
0d6ca59a 175!&compiler& <<universal.c &diag& &cpu& &cflags& -o universal&s&
495c5fdc 176&if (command_status) ^= 0 &then &return
0d6ca59a 177!&compiler& <<utf8.c &diag& &cpu& &cflags& -o utf8&s&
495c5fdc 178&if (command_status) ^= 0 &then &return
0d6ca59a 179!&compiler& <<util.c &diag& &cpu& &cflags& -o util&s&
495c5fdc 180&if (command_status) ^= 0 &then &return
0d6ca59a 181!&compiler& <<xsutils.c &diag& &cpu& &cflags& -o xsutils&s&
495c5fdc 182&if (command_status) ^= 0 &then &return
5b8c1387 183&if &version& = alpha
184&then &do
0d6ca59a 185!&compiler& <vos_dummies.c &cpu& -O4 -o vos_dummies&s&
495c5fdc 186&if (command_status) ^= 0 &then &return
5b8c1387 187&end
495c5fdc 188&
0d6ca59a 189&if &compiler& = gcc
190&then &do
191 !delete_file perl.a
192 !ar rc perl.a av.o deb.o doio.o doop.o dump.o globals.o gv.o hv.o mg.o &+
193 op.o perl.o perlapi.o perlio.o perly.o pp.o pp_ctl.o pp_hot.o pp_sys.o &+
194 regcomp.o regexec.o run.o scope.o sv.o taint.o toke.o universal.o utf8.o &+
195 util.o xsutils.o
196&end
197&else &do
198 !&compiler& <<miniperlmain.c &diag& &cpu& &cflags& -o miniperlmain&s&
199 &if (command_status) ^= 0 &then &return
200&end
201&
495c5fdc 202& If requested, bind the executable program module.
203&
204&label CHECK_REBIND
205&if &rebind& = 0
206&then &return
207&
24e8e380 208&if (exists -directory (master_disk)>system>tcp_os>object_library&obj2&)
209&then &set_string tcp_objlib (master_disk)>system>tcp_os>object_library&obj2&
495c5fdc 210&else &set_string tcp_objlib (master_disk)>system>tcp_os>object_library
211&
5b8c1387 212&if (exists -directory (master_disk)>system>stcp>object_library&obj2&)
213&then &set_string stcp_objlib (master_disk)>system>stcp>object_library&obj2&
214&else &set_string stcp_objlib (master_disk)>system>stcp>object_library
215&
24e8e380 216&if (exists -directory (master_disk)>system>object_library&obj2&)
217&then &set_string objlib (master_disk)>system>object_library&obj2&
495c5fdc 218&else &set_string objlib (master_disk)>system>object_library
219&
24e8e380 220&if (exists -directory (master_disk)>system>c_object_library&obj2&)
221&then &set_string c_objlib (master_disk)>system>c_object_library&obj2&
495c5fdc 222&else &set_string c_objlib (master_disk)>system>c_object_library
223&
5b8c1387 224&if (exists -directory (master_disk)>system>posix_object_library&obj2&)
225&then &set_string posix_objlib (master_disk)>system>posix_object_library&obj2&
226&else &set_string posix_objlib (master_disk)>system>posix_object_library
227&
228&if &version& = alpha
229&then !set_library_paths object . &tcp_objlib& &+
495c5fdc 230 &POSIX&>c>sysv_runtime>obj&obj& &+
5b8c1387 231 &POSIX&>c>runtime>obj&obj& &+
232 &c_objlib& &objlib&
233&else !set_library_paths object . &stcp_objlib& &+
234 &stcp_objlib&>common &+
235 &stcp_objlib&>net &+
236 &stcp_objlib&>sbsd &+
237 &stcp_objlib&>socket &+
238 &posix_objlib&>bsd &+
239 &posix_objlib& &+
240 &c_objlib& &objlib&
0d6ca59a 241&if &compiler& = gcc
242&then &do
243 &set_string cflags (before &$cflags& -c)
244 !&compiler& <<miniperlmain.c perl.a &diag& &cpu& &cflags& -o perl.pm
245 &if (command_status) ^= 0 &then &return
246 !delete_file perl.a
247&end
248&else &do
249 &if &version& = alpha
250 &then !bind -control <perl.bind vos_dummies &+
5b8c1387 251 &tcp_objlib&>tcp_runtime &tcp_objlib&>tcp_gethost &+
252 &cpu& -target_module &tgt_mod& -map
0d6ca59a 253 &else !bind -control <perl.bind &cpu& -target_module &tgt_mod& -map
254 &if (command_status) ^= 0 &then &return
255&end
256!delete_file *&s& -no_ask -brief
257!unlink *&s& -no_ask -brief