Re: Patch for hints/darwin.sh
[p5sagit/p5-mst-13.2.git] / vos / build.cm
index f749538..ea36499 100644 (file)
@@ -4,6 +4,7 @@
      rebind    switch(-rebind),=1
      tgt_mod   option(-target_module)module_name,='(current_module)'
      version   option(-version)name,allow(alpha,ga),=ga
+     compiler  option(-compiler)name,allow(cc,gcc)=cc
 &end_parameters
 &echo command_lines
 &
 &then &set_string obj2 .68k
 &else &set_string obj2 &obj&
 &
+&if &compiler& = cc
+&then &do
 &set_string cpu -processor &cpu&
+&set_string s .obj
+&end
+&else &do
+&set_string cpu ''
+&set_string s .o
+&end
 &
 & If requested, compile the source code.
 &
 & Suppress several harmless compiler warning and advice messages.
 & Use -list -show_include all -show_macros both_ways when debugging.
 &
-&set_string cflags '-u -O4 -D_POSIX_C_SOURCE=199506L -DPERL_CORE'
+&if &compiler& = cc
+&then &set_string cflags '-O4 -D_POSIX_C_SOURCE=199506L -DPERL_CORE -u'
+&else &set_string cflags '-O4 -D_POSIX_C_SOURCE=199506L -DPERL_CORE -c'
 &
 & The following is a work-around for stcp-1437,8,9
 &
 &if &version& = ga
 &then &set_string cflags &cflags& -D_BSD_SOURCE
 &
-!cc <<av.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+&if &compiler& = cc
+&then &set_string diag -suppress_diag 2006 2064 2065
+&else &set_string diag ''
+&
+& The following is a work-around for stcp-1570 and GCC.
+&
+&if &compiler& = gcc
+&then &set_string diag &diag& -w
+&
+!&compiler& <<av.c &diag& &cpu& &cflags& -o av&s&
 &if (command_status) ^= 0 &then &return
-!cc <<deb.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<deb.c &diag& &cpu& &cflags& -o deb&s&
 &if (command_status) ^= 0 &then &return
-!cc <<doio.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<doio.c &diag& &cpu& &cflags& -o doio&s&
 &if (command_status) ^= 0 &then &return
-!cc <<doop.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<doop.c &diag& &cpu& &cflags& -o doop&s&
 &if (command_status) ^= 0 &then &return
-!cc <<dump.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<dump.c &diag& &cpu& &cflags& -o dump&s&
 &if (command_status) ^= 0 &then &return
-!cc <<ebcdic.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<globals.c &diag& &cpu& &cflags& -o globals&s&
 &if (command_status) ^= 0 &then &return
-!cc <<globals.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<gv.c &diag& &cpu& &cflags& -o gv&s&
 &if (command_status) ^= 0 &then &return
-!cc <<gv.c -suppress_diag 2006 2065 &cpu& &cflags&
+!&compiler& <<hv.c &diag& &cpu& &cflags& -o hv&s&
 &if (command_status) ^= 0 &then &return
-!cc <<hv.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<locale.c &diag& &cpu& &cflags& -o locale&s&
 &if (command_status) ^= 0 &then &return
-&   !cc <<malloc.c -suppress_diag 2006 &cpu& &cflags&
+&   !&compiler& <<malloc.c &diag& &cpu& &cflags& -o malloc&s&
 &   &if (command_status) ^= 0 &then &return
-!cc <<mg.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+!&compiler& <<mg.c &diag& &cpu& &cflags& -o mg&s&
 &if (command_status) ^= 0 &then &return
-!cc <<miniperlmain.c -suppress_diag 2006 2065 &cpu& &cflags&
+!&compiler& <<numeric.c &diag& &cpu& &cflags& -o numeric&s&
 &if (command_status) ^= 0 &then &return
-!cc <<op.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+!&compiler& <<op.c &diag& &cpu& &cflags& -o op&s&
 &if (command_status) ^= 0 &then &return
 &
 & We are essentially building miniperl for now. Until we
 &
 & !link <<op.c opmini.c -delete
 & &if (command_status) ^= 0 &then &return
-& !cc opmini.c -suppress_diag 2006 2064 2065 &cpu& &cflags& -DPERL_EXTERNAL_GLOB
+& !&compiler& opmini.c &diag& &cpu& &cflags& -DPERL_EXTERNAL_GLOB -o opmini&s&
 & &if (command_status) ^= 0 &then &return
 & !unlink opmini.c
 & &if (command_status) ^= 0 &then &return
 &
-!cc <<perl.c -suppress_diag 2006 2053 2065 &cpu& &cflags& &+
+!&compiler& <<perl.c &diag& &cpu& &cflags& -o perl&s& &+
      -DARCHLIB="/system/ported/perl/lib/5.7&obj2&" &+
      -DARCHLIB_EXP="/system/ported/perl/lib/5.7&obj2&" &+
      -DSITEARCH="/system/ported/perl/lib/site/5.7&obj2&" &+
      -DSITEARCH_EXP="/system/ported/perl/lib/site/5.7&obj2&"
 &if (command_status) ^= 0 &then &return
-!cc <<perlapi.c &cpu& &cflags&
+!&compiler& <<perlapi.c &diag& &cpu& &cflags& -o perlapi&s&
 &if (command_status) ^= 0 &then &return
-!cc <<perlio.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<perlio.c &diag& &cpu& &cflags& -o perlio&s&
 &if (command_status) ^= 0 &then &return
-!cc <<perly.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<perly.c &diag& &cpu& &cflags& -o perly&s&
 &if (command_status) ^= 0 &then &return
 & compiling pp.c for the PA-RISC hits compiler bug pcg-98; avoid it.
 & The bug is fixed in VOS 14.1.0 and all later releases.
 &if (index (string &cpu&) pa) > 0 & (module_info os_release) < 'VOS Release 14.1.0'
-&then !cc <<pp.c -suppress_diag 2006 2064 2065 &cpu& &cflags& -no_schedule
-&else !cc <<pp.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+&then !&compiler& <<pp.c &diag& &cpu& &cflags& -no_schedule -o pp&s&
+&else !&compiler& <<pp.c &diag& &cpu& &cflags& -o pp&s&
 &if (command_status) ^= 0 &then &return
-!cc <<pp_ctl.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+!&compiler& <<pp_ctl.c &diag& &cpu& &cflags& -o pp_ctl&s&
 &if (command_status) ^= 0 &then &return
-!cc <<pp_hot.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+!&compiler& <<pp_hot.c &diag& &cpu& &cflags& -o pp_hot&s&
 &if (command_status) ^= 0 &then &return
-!cc <<pp_sys.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+!&compiler& <<pp_pack.c &diag& &cpu& &cflags& -o pp_pack&s&
 &if (command_status) ^= 0 &then &return
-!cc <<regcomp.c -suppress_diag 2006 2064 &cpu& &cflags&
+!&compiler& <<pp_sys.c &diag& &cpu& &cflags& -o pp_sys&s&
 &if (command_status) ^= 0 &then &return
-!cc <<regexec.c -suppress_diag 2006 2064 &cpu& &cflags&
+!&compiler& <<regcomp.c &diag& &cpu& &cflags& -o regcomp&s&
 &if (command_status) ^= 0 &then &return
-!cc <<run.c -suppress_diag 2006 2065 &cpu& &cflags&
+!&compiler& <<regexec.c &diag& &cpu& &cflags& -o regexec&s&
 &if (command_status) ^= 0 &then &return
-!cc <<scope.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+!&compiler& <<run.c &diag& &cpu& &cflags& -o run&s&
 &if (command_status) ^= 0 &then &return
-!cc <<sv.c -suppress_diag 2006 2065 &cpu& &cflags&
+!&compiler& <<scope.c &diag& &cpu& &cflags& -o scope&s&
 &if (command_status) ^= 0 &then &return
-!cc <<taint.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<sv.c &diag& &cpu& &cflags& -o sv&s&
 &if (command_status) ^= 0 &then &return
-!cc <<toke.c -suppress_diag 2006 2064 2065 &cpu& &cflags&
+!&compiler& <<taint.c &diag& &cpu& &cflags& -o taint&s&
 &if (command_status) ^= 0 &then &return
-!cc <<universal.c -suppress_diag 2006 &cpu& &cflags&
+!&compiler& <<toke.c &diag& &cpu& &cflags& -o toke&s&
 &if (command_status) ^= 0 &then &return
-!cc <<utf8.c -suppress_diag 2065 &cpu& &cflags&
+!&compiler& <<universal.c &diag& &cpu& &cflags& -o universal&s&
 &if (command_status) ^= 0 &then &return
-!cc <<util.c -suppress_diag 2006 2065 &cpu& &cflags&
+!&compiler& <<utf8.c &diag& &cpu& &cflags& -o utf8&s&
 &if (command_status) ^= 0 &then &return
-!cc <<xsutils.c &cpu& &cflags&
+!&compiler& <<util.c &diag& &cpu& &cflags& -o util&s&
+&if (command_status) ^= 0 &then &return
+!&compiler& <<xsutils.c &diag& &cpu& &cflags& -o xsutils&s&
 &if (command_status) ^= 0 &then &return
 &if &version& = alpha
 &then &do
-!cc <vos_dummies.c &cpu& -O4
+!&compiler& <vos_dummies.c &cpu& -O4 -o vos_dummies&s&
 &if (command_status) ^= 0 &then &return
 &end
 &
+&if &compiler& = gcc
+&then &do
+ !delete_file perl.a
+ !ar rc perl.a av.o deb.o doio.o doop.o dump.o globals.o gv.o hv.o mg.o &+
+ op.o perl.o perlapi.o perlio.o perly.o pp.o pp_ctl.o pp_hot.o pp_sys.o &+
+ regcomp.o regexec.o run.o scope.o sv.o taint.o toke.o universal.o utf8.o &+
+ util.o xsutils.o
+&end
+&else &do
+ !&compiler& <<miniperlmain.c &diag& &cpu& &cflags& -o miniperlmain&s&
+ &if (command_status) ^= 0 &then &return
+&end
+&
 & If requested, bind the executable program module.
 &
 &label CHECK_REBIND
      &posix_objlib&>bsd &+
      &posix_objlib& &+
      &c_objlib& &objlib&
-&if &version& = alpha
-&then !bind -control <perl.bind vos_dummies &+
+&if &compiler& = gcc
+&then &do
+ &set_string cflags (before &$cflags& -c)
+ !&compiler& <<miniperlmain.c perl.a &diag& &cpu& &cflags& -o perl.pm
+ &if (command_status) ^= 0 &then &return
+ !delete_file perl.a
+&end
+&else &do
+ &if &version& = alpha
+ &then !bind -control <perl.bind vos_dummies &+
      &tcp_objlib&>tcp_runtime &tcp_objlib&>tcp_gethost &+
      &cpu& -target_module &tgt_mod& -map
-&else !bind -control <perl.bind &cpu& -target_module &tgt_mod& -map
-&if (command_status) ^= 0 &then &return
-!delete_file *.obj -no_ask -brief
-!unlink *.obj -no_ask -brief
+ &else !bind -control <perl.bind &cpu& -target_module &tgt_mod& -map
+ &if (command_status) ^= 0 &then &return
+&end
+!delete_file *&s& -no_ask -brief
+!unlink *&s& -no_ask -brief