$! $! This command procedure can be used to compile some or all $! of the code needed to run Hercules and it's associated $! utilities on VMS (Alpha or later). $! $! Peter Coghlan November 2020 $! $! The first argument specifies the file or set of files to $! be compiled as per the examples below. $! $! The second to eighth arguments specify optional additional $! qualifiers passed to the compiler. Take care if using $! qualifiers such as /DEFINE or /INCLUDE which are already $! specified on the cc command in the "compile" subroutine $! below as the values already specified will be overridden $! which may cause difficulties. $! $! To compile enough to build just HERCULES.EXE: $! $! @COMPILE HERCULES $! @COMPILE FLOATING $! @COMPILE VMS $! $! To compile just the additional utilities; e.g. DASDINIT; $! (after compiling HERCULES): $! $! @COMPILE UTILITIES $! $! To compile everything required for Hercules and the utilities: $! $! @COMPILE ALL $! $! To compile a single file, e.g. general1.c: $! $! @COMPILE GENERAL1 $! $! To get listings for the utilities without generating object files: $! $! @COMPILE UTILITIES /NOOBJECT /LIST $! $! To compile just the DECNUMBER and SOFTFLOAT floating point packages: $! $! @COMPILE FLOATING $! $! To compile just Hercules with 64 bit pointers: $! $! @COMPILE HERCULES /POINTER_SIZE=64 $! $! (Be careful not end up with some files compiled with 64 bit $! pointers and others compiled with 32 bit pointers....) $! $! To compile everything with 64 bit pointers, debugging and listings: $! $! @COMPILE ALL /POINTER_SIZE=64 /DEBUG /NOOPT /LIST $! $! Compiles of files in subdirectories may be performed while set $! default to the subdirectory containing the file in question or $! while set default to it's parent directory. However, do not attempt $! to compile files located in one subdirectory while set default to $! a different subdirectory, for example, do not attempt to compile $! the FLOATING file set while set default to the [.DECNUMBER] $! subdirectory or the VMS file while set default to [.SOFTFLOAT]. $! $! $! Peter Coghlan November 2020 $! $! The first argument specifies the file or set of files to $! be linked as per the examples below. $! $! The second to eighth arguments specify optional additional $! qualifiers passed to the compiler. Take care if using $! qualifiers such as /THREADS_ENABLE which are already $! specified on the link command in the "link" subroutine $! below as the values already specified will be overridden $! which may cause difficulties. $! $! To link just HERCULES.EXE: $! $! @LINK HERCULES $! $! To link just the additional utilities; e.g. DASDINIT; $! $! @LINK UTILITIES $! $! To link just one of the utilities, e.g. dasdcat: $! $! @LINK DASDCAT $! $! To link Hercules in debug mode with a link map: $! $! @LINK HERCULES /DEBUG /MAP $! $! To link Hercules and the associated utilities: $! $! @LINK ALL $! $ If p1 .Eqs. "" .Or. p1 .Eqs. "?" .Or. p1 .Eqs. "HELP" $ Then $ Write Sys$Output "" $ Write Sys$Output "Use this procedure to compile Hercules and/or the associated utilities" $ Write Sys$Output "" $ Write Sys$Output "Usage:" $ Write Sys$Output " @Compile [...]" $ Write Sys$Output " @Compile [...]" $ Write Sys$Output " @Compile ALL [...]" $ Write Sys$Output "" $ Write Sys$Output "For example:" $ Write Sys$Output "" $ Write Sys$Output " @Compile Hercules" $ Write Sys$Output " @Compile Floating" $ Write Sys$Output " @Compile Vms" $ Write Sys$Output " @Compile Utilities" $ Write Sys$Output " @Compile General1" $ Write Sys$Output " @Compile Dasdinit" $ Write Sys$Output " @Compile All" $ Write Sys$Output " @Compile Hercules /Debug/NoOptimise/List" $ Write Sys$Output "" $ Exit 1 $ Endif $! $ Call Compile HERCULES HOSTINFO 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES IMPL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CONFIG 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES PANEL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES VERSION 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES IPL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES ASSIST 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES DAT 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES STACK 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CPU 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES VSTORE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES GENERAL1 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES GENERAL2 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES PLO 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CONTROL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES IO 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES DECIMAL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES SERVICE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES OPCODE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES DIAGNOSE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES DIAGMSSF 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES VM 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES VMIUCV 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES VMTCPIP 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CHANNEL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CKDDASD 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES FBADASD 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES TAPEDEV 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CARDRDR 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CARDPCH 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES PRINTER 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CONSOLE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES EXTERNAL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES FLOAT 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CTCADPT 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES TRACE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES MACHCHK 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES VECTOR 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES XSTORE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CMPSC 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES SIE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES TIMER 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES ESAME 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CCKDDASD 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CCKDUTIL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES DASDTAB 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES PARSER 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HETLIB 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES IEEE 'p1' /Include=([.vms],[.softfloat])/define=(have_config_h,"__thread"="") 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $ Call Compile HERCULES HTTPSERV 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CGIBIN 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CODEPAGE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HSCCMD 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HSCMISC 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $! $ Call Compile HERCULES CACHE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES ECPSVM 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES LOGMSG 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES PTTRACE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HISTORY 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HDL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HDLMAIN 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES LOGGER 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES COMMADPT 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES TCPNJE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CLOCK 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES BLDCFG 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES SHARED 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES BOOTSTRAP 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES LOADPARM 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HSCUTL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES SR 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES QDIO 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HCONSOLE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES SOCKDEV 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CHSC 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CRYPTO 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HSYS 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES MEMRCHR 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $! $ Call Compile HERCULES DFP 'p1' /include=([.vms],[.decnumber],[]) 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $ Call Compile HERCULES HSOCKET 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES LOSC 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES SCEDASD 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES AWSTAPE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES FAKETAPE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES HETTAPE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES OMATAPE 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES TAPECCWS 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES CMDTAB 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES VMD250 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES GENERAL3 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES FILLFNAM 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile HERCULES PFPO 'p1' /Include=([.Vms],[.DecNumber],[]) 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $! $ Call Compile UTILITIES DASDUTIL 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES SLLIB 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES CCKDCDSK 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES CCKDCOMP 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES CCKDSWAP 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES DASDCAT 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES DASDCOPY 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES DASDISUP 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES DASDLOAD 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES DASDLS 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES DASDPDSU 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES DMAP2HRC 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES DMAP2HRC 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES HETGET 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES HETINIT 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES HETMAP 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES HETUPD 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES TAPECOPY 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES TAPEMAP 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call Compile UTILITIES TAPESPLT 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $! $ Call SetDefault "[.DECNUMBER]" $! $ Call Compile FLOATING DECNUMBER 'p1' /include=([-.vms],[-]) 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $ Call Compile FLOATING DECCONTEXT 'p1' /include=([-.vms],[-]) 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $ Call Compile FLOATING DECPACKED 'p1' /include=([-.vms],[-]) 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $ Call Compile FLOATING DECIMAL32 'p1' /include=([-.vms],[-]) 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $ Call Compile FLOATING DECIMAL64 'p1' /include=([-.vms],[-]) 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $ Call Compile FLOATING DECIMAL128 'p1' /include=([-.vms],[-]) 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $! $ Call ResetDefault "[.DECNUMBER]" $! $! $ Call SetDefault "[.SOFTFLOAT]" $ Define /User Softfloat-macros Softfloat-macros. $ Define /User Softfloat-specialize Softfloat-specialize. $ Call Compile FLOATING SOFTFLOAT 'p1' - /Define=(Have_Config_H,"__thread"="__declspec(thread)") 'p2' 'p3' 'p4' 'p5''p6''p7''p8' $ Call ResetDefault "[.SOFTFLOAT]" $! $! $ Call SetDefault "[.VMS]" $ Call Compile VMS VMS 'p1' 'p2' 'p3' 'p4' 'p5' 'p6''p7''p8' $ Call ResetDefault "[.VMS]" $ $ Exit $Status $ $ Compile: Subroutine $ $ If P3 .Nes. P1 .And. P3 .Nes. P2 .And. P3 .Nes. "ALL" Then Exit 1 $ $ File = F$Search("''P2'.C") $ $ If File .Eqs. "" $ Then $ Write Sys$Output "No source present for ''P2' - generating dummy object file." $ cc NLA0: /NoWarn /Object='P2' $ Else $ Write Sys$Output "Compiling ''P2' ..." $ $ If F$GetSYI("Arch_Type") .Gt. 1 Then - Arch_Specific = "/Reentrancy=Multithread" $ Define /User Sys [.Vms] $ $ Cc - /Define=Have_Config_H - ! hack to include #defines etc. /Include=[.Vms] - ! where to find missing .h files /Names=Shortened - ! avoid problems with long identifiers /Member_Alignment - ! pthread routines need aligned args /Accept=NoVAXC_Keywords - ! avoid problems with "readonly" keyword 'Arch_Specific' - ! >= Alpha, run time library locking 'P2' 'P4' 'P5' 'P6''P7''P8' 'P9' $ Endif $ $ Exit $Status $ EndSubroutine $! $ SetDefault: Subroutine $ $ Original == F$Edit(F$Environment("Default"), "Upcase") $ OrigLength = F$Length(Original) $ Target = F$Extract(1, F$Length(p1) - 1, p1) $ TarLength = F$Length(Target) $ If F$Extract(Origlength - Tarlength, Tarlength, Original) .Nes. Target $ Then $ Set Default 'p1' $ Set NoOn $ Endif $ Exit $ EndSubroutine $! $ ResetDefault: Subroutine $ $ Current = F$Edit(F$Environment("Default"), "Upcase") $ If Current .Eqs. Original Then Exit $ CurLength = F$Length(Current) $ Target = F$Extract(1, F$Length(p1) - 1, p1) $ TarLength = F$Length(Target) $ If F$Extract(Curlength - Tarlength, Tarlength, Current) .Eqs. Target $ Then $ Set Default [-] $ Set On $ Endif $ Exit $ EndSubroutine