From 5a45fb8a1b7f8f285104e37d9ddee3be1e73cbbb Mon Sep 17 00:00:00 2001 From: Richard Tucker Date: Wed, 28 Oct 1998 17:16:00 +0000 Subject: [PATCH] Move settings to new file (script:platform) Copied from Perforce Change: 20288 ServerID: perforce.ravenbrook.com --- mps/qa/test/script/compile | 130 +------------------------------------ 1 file changed, 1 insertion(+), 129 deletions(-) diff --git a/mps/qa/test/script/compile b/mps/qa/test/script/compile index faaff2b9d6c..bbfa370356f 100644 --- a/mps/qa/test/script/compile +++ b/mps/qa/test/script/compile @@ -1,5 +1,5 @@ #!/usr/local/perl -# $HopeName: MMQA_harness!script:compile(trunk.23) $ +# $HopeName: MMQA_harness!script:compile(trunk.24) $ # # provides subroutines to compile or compile and link # tests and test libraries. @@ -9,132 +9,6 @@ 1; -sub debug { - local ($text) = @_; - if ($DEBUG_INFO eq "on") { - print $text."\n"; - } -} - -sub compiler_settings { - if ($PLATFORM =~ "^nt_") { - &settings_nt(); - if ($PLATFORM =~ "^nt_x86_cap") { - &settings_nt_cap(); - } elsif ($PLATFORM =~ "^nt_x86_coff") { - &settings_nt_coff(); - } - } elsif ($PLATFORM =~ "^so|^linux") { - &settings_unix(); - if ($PLATFORM =~ "^sos8gp") { - &settings_gprof(); - } - } elsif ($PLATFORM =~ "::unix") { - &logcomment("I don't know anything specific about $PLATFORM --"); - &logcomment("using generic unix/gcc settings."); - &settings_unix(); - } else { - die "Sorry: I don't know how to use ".$PLATFORM."\n"; - } -} - -sub settings_nt { - $dirsep = "\\"; - $cc_command = "cl"; - $cc_opts = "/nologo /DWIN32 /D_WINDOWS /W3 /Zi /Oy- /DMMQA_VERS_$INTERFACE_VERSION"; - $cc_link = "$obj_dir/platform.obj"; - $cc_link_opts = "/link /NODEFAULTLIB:LIBCMT /debugtype:both /pdb:none /debug:full"; - $cc_include = "/I$testlib_dir /I$MPS_INCLUDE_DIR"; - $cc_def = "/D"; - $cc_defeq = "="; - $cc_conly = "/c"; - $cc_obj = "/Fo"; - $cc_exe = "/Fe"; - $cc_objandexe = 1; - $obj_suffix = ".obj"; - $try_command = ""; - $catcommand = "$script_dir/ntx86bin/cat.exe"; - $comwrap = "\""; - $comwrapend = "\""; - $stdout_red = ">"; - $err_red = "2>"; - $stdout_dup = "| $script_dir/ntx86bin/tee.exe"; - $stdin_red = "<"; - $platmailfile = \&nt_mailfile; -} - -sub settings_nt_cap { - $cc_opts = "$cc_opts /Gh"; - $cc_link = "$cc_link CAP.lib"; - $cc_link_opts = "/link /NODEFAULTLIB:LIBCMT /debugtype:coff /debug:mapped,partial"; -} - -sub settings_nt_coff { - $cc_link_opts = "/link /NODEFAULTLIB:LIBCMT /debugtype:coff /debug:full"; -} - -sub settings_unix { - $dirsep = "/"; - $cc_link = "$obj_dir/platform.o -lm"; - $cc_link_opts = "-z muldefs"; - $cc_command = "gcc"; - $cc_opts = "-ansi -pedantic -Wall -Wstrict-prototypes ". - "-Winline -Waggregate-return -Wnested-externs -Wcast-qual ". - "-Wshadow -Wmissing-prototypes -Wcast-align ". - "-O -g -ggdb3 -DMMQA_VERS_$INTERFACE_VERSION"; - $cc_include = "-I$testlib_dir -I$MPS_INCLUDE_DIR"; - $cc_def = "-D"; - $cc_defeq = "="; - $cc_conly = "-c"; - $cc_obj = "-o "; - $cc_exe = "-o "; - $cc_objandexe = 0; - $obj_suffix = ".o"; - $try_command = "sh -c "; - $catcommand = "cat"; - $comwrap = "sh -c \"ulimit -c 0; "; - $comwrapend = "\""; - $stdout_red = ">"; - $err_red = "2>"; - $stdout_dup = "| tee"; - $stdin_red = "<"; - $platmailfile = \&unix_mailfile; -} - -sub settings_gprof { - $cc_opts = "-pg ".$cc_opts; -} - -sub mysystem { - local ($command) = @_; - $command =~ s/(\S)\//$1$dirsep/g; - &debug("SYSTEM >>$command<<"); - system($command); -} - -sub mailfile { - local ($file, $subj) = @_; - - if ($MAIL_RESULTS eq "on") { - &$platmailfile($file, $MAIL_TO, $subj); - } -} - -sub nt_mailfile { - local ($file, $to, $subj) = @_; - - &mysystem( - "$script_dir/ntx86bin/blat.exe ". - "$file -server mailhost -f mm-qa -t $to -s \"$subj\" -q"); -} - -sub unix_mailfile { - local ($file, $to, $subj) = @_; - - &mysystem( - "{ echo \"To: $to\"; echo \"Subject: $subj\"; cat $file; } | mail -t"); -} - sub log_system { local ($command, $output, $logfile, $stdin, $time0, $time1) = @_; @@ -174,7 +48,6 @@ sub log_system { sub compile { local($srcfile, $objfile) = @_; - &compiler_settings; $command = "$cc_command $cc_conly $cc_opts $cc_obj$objfile ". "$srcfile $cc_include"; @@ -188,7 +61,6 @@ sub compile { sub compile_and_link { local($srcfile, $exefile, $linkfiles, $objfile, $hashdefs) = @_; - &compiler_settings; unless ($linkfiles) {$linkfiles =""}; $linkfiles = " ".$linkfiles; $linkfiles =~ s/ +(\S)/ $obj_dir\/$1/g;