mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-28 17:20:22 +00:00
DCL examples
This commit is contained in:
443
samples/DIGITAL Command Language/fis_gtm_kitinstal.com
Normal file
443
samples/DIGITAL Command Language/fis_gtm_kitinstal.com
Normal file
@@ -0,0 +1,443 @@
|
||||
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
$! !
|
||||
$! Copyright 2001, 2011 Fidelity Information Services, Inc !
|
||||
$! !
|
||||
$! This source code contains the intellectual property !
|
||||
$! of its copyright holder(s), and is made available !
|
||||
$! under a license. If you do not know the terms of !
|
||||
$! the license, please stop and do not read further. !
|
||||
$! !
|
||||
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
$!
|
||||
$!
|
||||
$! KITINSTAL.COM PROCEDURE FOR THE GT.M PRODUCT
|
||||
$!
|
||||
$ ON CONTROL_Y THEN VMI$CALLBACK CONTROL_Y
|
||||
$! ON WARNING THEN EXIT $STATUS !! allow warning errors for INSTALL REPLACE
|
||||
$ IF P1 .EQS. "VMI$_INSTALL" THEN GOTO INSTALL
|
||||
$ IF P1 .EQS. "VMI$_POSTINSTALL" THEN GOTO POSTINSTALL
|
||||
$ IF P1 .EQS. "VMI$_IVP" THEN GOTO IVP
|
||||
$ EXIT VMI$_UNSUPPORTED
|
||||
$!
|
||||
$INSTALL:
|
||||
$ TYPE SYS$INPUT
|
||||
|
||||
GT.M (c) COPYRIGHT 1985 - 2000 by Sanchez Computer Associates
|
||||
ALL RIGHTS RESERVED
|
||||
|
||||
$! the following 2 lines must be maintained
|
||||
$ GTM$VMS_VERSION :== 072 ! Minimum VMS version required
|
||||
$ ALPHA = (f$getsyi("arch_name") .eqs. "Alpha")
|
||||
$ IF ALPHA
|
||||
$ THEN
|
||||
$ GTM$DISK_SPACE == 28000 ! Minumum disk space on system disk required
|
||||
$ ELSE
|
||||
$ GTM$DISK_SPACE == 16000 ! Minumum disk space on system disk required
|
||||
$ ENDIF
|
||||
$ IF F$ELEMENT(0,",",VMI$VMS_VERSION) .EQS. "RELEASED"
|
||||
$ THEN
|
||||
$ GTM$VMS_IS == F$ELEMENT(1,",",VMI$VMS_VERSION)
|
||||
$ IF GTM$VMS_IS .LTS. GTM$VMS_VERSION
|
||||
$ THEN
|
||||
$ VMI$CALLBACK MESSAGE E VMSMISMATCH "This GT.M kit requires an existing VMS''GTM$VMS_VERSION' system."
|
||||
$ EXIT VMI$_FAILURE
|
||||
$ ENDIF
|
||||
$ ELSE
|
||||
$ GTM$VMS_IS :==
|
||||
$ WRITE SYS$OUTPUT " No VMS version checking performed for field test versions."
|
||||
$ ENDIF
|
||||
$ IF (GTM$VMS_IS .GES. "052") THEN T1 = F$VERIFY(VMI$KIT_DEBUG)
|
||||
$ VMI$CALLBACK CHECK_NET_UTILIZATION GTM$ROOM 'GTM$DISK_SPACE'
|
||||
$ IF .NOT. GTM$ROOM
|
||||
$ THEN
|
||||
$ VMI$CALLBACK MESSAGE E NOSPACE "There is not enough disk space -- GT.M needs ''GTM$DISK_SPACE' blocks."
|
||||
$ EXIT VMI$_FAILURE
|
||||
$ ENDIF
|
||||
$! setup default answers
|
||||
$ GTM$DOPURGE :== YES
|
||||
$ GTM$RUN_IVP :== YES
|
||||
$ GTM$STD_CNF :== YES
|
||||
$ GTM$DST_OWN :== SYSTEM
|
||||
$ IF F$IDENTIFIER(GTM$DST_OWN,"NAME_TO_NUMBER") .EQ. 0 THEN GTM$DST_OWN :== 1,4
|
||||
$ GTM$SYS_DST :== YES
|
||||
$ GTM$DST_DIR :== GTM_DIST
|
||||
$ GTM$DST_CRE == GTM$DST_DIR
|
||||
$ GTM$DST_DEV :==
|
||||
$ GTM$STARTDB :== YES
|
||||
$ GTM$MGR_COM :== YES
|
||||
$ GTM$HLP_DIR :== NO
|
||||
$ GTM$DEF_DCL :== YES
|
||||
$ GTM$DEF_SYS :== YES
|
||||
$ GTM$LNK_LOG :== YES
|
||||
$ GTM$INSTALL :== YES
|
||||
$ GTM$DEF_GLD :== YES
|
||||
$ GTM$GBL_DIR :== MUMPS.GLD
|
||||
$ GTM$DEF_RTN :== YES
|
||||
$ GTM$RTN_DIR :== [],GTM$DIST:
|
||||
$ GTM$PCT_RTN :== YES
|
||||
$ VMI$CALLBACK ASK GTM$DOPURGE "Do you want to purge files replaced by this installation" 'GTM$DOPURGE' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_PURGE"
|
||||
$ IF .NOT. GTM$DOPURGE THEN VMI$CALLBACK SET PURGE NO
|
||||
$ VMI$CALLBACK ASK GTM$STD_CNF "Do you want the standard GT.M configuration (performs INSTALL)" 'GTM$STD_CNF' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_STD_CNF"
|
||||
$ IF GTM$STD_CNF
|
||||
$ THEN
|
||||
$ GTM$SYS_DST == 1
|
||||
$ GTM$STARTDB == 1
|
||||
$ GTM$MGR_COM == 1
|
||||
$ GTM$HLP_DIR == 0
|
||||
$ GTM$DEF_DCL == 1
|
||||
$ GTM$DEF_SYS == 1
|
||||
$ GTM$INSTALL == 1
|
||||
$ GTM$LNK_LOG == 1
|
||||
$ GTM$INSTALL == 1
|
||||
$ GTM$DEF_GLD == 1
|
||||
$ GTM$DEF_RTN == 1
|
||||
$ GTM$PCT_RTN == 1
|
||||
$ GTM$DST_LOG :== SYS$COMMON:['GTM$DST_DIR']
|
||||
$ GTM$DIR_TYPE :== COMMON
|
||||
$ ELSE ! Not standard configuration
|
||||
$ VMI$CALLBACK ASK GTM$DST_OWN "What UIC should own the GT.M distribution" 'GTM$DST_OWN' S "@VMI$KWD:GTMKITHLP HELP_DST_OWN"
|
||||
$ GTM$DST_OWN == GTM$DST_OWN - "[" - "]"
|
||||
$ VMI$CALLBACK ASK GTM$SYS_DST "Do you want the GT.M distribution to go into a System Directory" 'GTM$SYS_DST' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_SYS_DST"
|
||||
$ IF GTM$SYS_DST
|
||||
$ THEN
|
||||
$ VMI$CALLBACK ASK GTM$DST_DIR "In what System Directory do you want to place GT.M" 'GTM$DST_DIR' S -
|
||||
"@VMI$KWD:GTMKITHLP HELP_SYS_DIR"
|
||||
$ GTM$DST_DIR == GTM$DST_DIR - "[" - "]"
|
||||
$ GTM$DST_CRE == GTM$DST_DIR
|
||||
$ GTM$DST_LOG :== SYS$COMMON:['GTM$DST_DIR']
|
||||
$ GTM$DIR_TYPE :== COMMON
|
||||
$ ELSE ! Not system disk
|
||||
$ VMI$CALLBACK ASK GTM$DST_DEV "On which device do you want to place GT.M" "''GTM$DST_DEV'" S "@VMI$KWD:GTMKITHLP HELP_DST_DEV"
|
||||
$ VMI$CALLBACK ASK GTM$DST_DIR "In what directory on that device do you want to place GT.M" 'GTM$DST_DIR' S -
|
||||
"@VMI$KWD:GTMKITHLP HELP_DST_DIR"
|
||||
$ GTM$DST_DEV == GTM$DST_DEV - ":"
|
||||
$ GTM$DST_DIR == GTM$DST_DIR - "[" - "]"
|
||||
$ GTM$DST_LOG :== 'GTM$DST_DEV':['GTM$DST_DIR']
|
||||
$ GTM$DST_CRE == GTM$DST_LOG
|
||||
$ GTM$DIR_TYPE :== USER
|
||||
$ ENDIF ! system disk
|
||||
$ VMI$CALLBACK ASK GTM$STARTDB "Do you want GTMSTART.COM in the startup database" 'GTM$STARTDB' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_STARTDB"
|
||||
$ IF .NOT. GTM$STARTDB
|
||||
$ THEN
|
||||
$ VMI$CALLBACK ASK GTM$MGR_COM "Do you want the GT.M .COM files in SYS$MANAGER" 'GTM$MGR_COM' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_MGR_COM"
|
||||
$ ENDIF
|
||||
$ VMI$CALLBACK ASK GTM$HLP_DIR "Do you want the GT.M help files in SYS$HELP" 'GTM$HLP_DIR' B "@VMI$KWD:GTMKITHLP HELP_HLP_DIR"
|
||||
$ VMI$CALLBACK ASK GTM$DEF_DCL "Do you want to define GT.M commands to the system" 'GTM$DEF_DCL' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_DEF_DCL"
|
||||
$ VMI$CALLBACK ASK GTM$DEF_SYS "Do you want to define GT.M logical names in the System Table" 'GTM$DEF_SYS' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_DEF_SYS"
|
||||
$ VMI$CALLBACK ASK GTM$LNK_LOG "Do you want to define the LNK$LIBRARY logical names" 'GTM$LNK_LOG' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_LNK_LOG"
|
||||
$ VMI$CALLBACK ASK GTM$RUN_IVP "Do you want to run the IVP (performs INSTALL)" 'GTM$RUN_IVP' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_RUN_IVP"
|
||||
$ IF GTM$RUN_IVP
|
||||
$ THEN
|
||||
$ GTM$PCT_RTN == 1
|
||||
$ ELSE
|
||||
$ VMI$CALLBACK ASK GTM$PCT_RTN "Do you want to compile the GT.M percent routines (performs INSTALL)" 'GTM$PCT_RTN' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_PCT_RTN"
|
||||
$ ENDIF
|
||||
$ IF (GTM$RUN_IVP .OR. GTM$PCT_RTN)
|
||||
$ THEN
|
||||
$ GTM$INSTALL == 1
|
||||
$ ELSE
|
||||
$ VMI$CALLBACK ASK GTM$INSTALL "Do you want to INSTALL the GT.M shareable images now" 'GTM$INSTALL' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_INSTALL"
|
||||
$ ENDIF
|
||||
$ VMI$CALLBACK ASK GTM$DEF_RTN "Do you want to have a default definition for GTM$ROUTINES" 'GTM$DEF_RTN' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_DEF_RTN"
|
||||
$ IF GTM$DEF_RTN
|
||||
$ THEN
|
||||
$ VMI$CALLBACK ASK GTM$RTN_DIR "What is the search specification for GTM$ROUTINES" 'GTM$RTN_DIR' S -
|
||||
"@VMI$KWD:GTMKITHLP HELP_RTN_DIR"
|
||||
$ ENDIF
|
||||
$ VMI$CALLBACK ASK GTM$DEF_GLD "Do you want to have a default definition for GTM$GBLDIR" 'GTM$DEF_GLD' B -
|
||||
"@VMI$KWD:GTMKITHLP HELP_DEF_GLD"
|
||||
$ IF GTM$DEF_GLD
|
||||
$ THEN
|
||||
$ VMI$CALLBACK ASK GTM$GBL_DIR "What is the file specification for GTM$GBLDIR" 'GTM$GBL_DIR' S -
|
||||
"@VMI$KWD:GTMKITHLP HELP_GBL_DIR"
|
||||
$ ENDIF
|
||||
$ ENDIF ! standard configuration
|
||||
$! tell them what's happening
|
||||
$ IF GTM$MGR_COM
|
||||
$ THEN
|
||||
$ WRITE SYS$OUTPUT " The following command files are created and copied to SYS$MANAGER:"
|
||||
$ ELSE
|
||||
$ WRITE SYS$OUTPUT " The following command files are created:"
|
||||
$ ENDIF
|
||||
$ TYPE SYS$INPUT
|
||||
|
||||
GTMINSTALL.COM
|
||||
GTMLOGICALS.COM
|
||||
GTMLOGIN.COM
|
||||
GTMSTART.COM
|
||||
GTMSTOP.COM
|
||||
|
||||
Each file contains its own user documentation.
|
||||
|
||||
All the questions have been asked. Installation now proceeds without your
|
||||
manual intervention for about 10-15 minutes.
|
||||
$ IF GTM$RUN_IVP THEN WRITE SYS$OUTPUT " Finally the Installation Verification Procedure tests the installation."
|
||||
$ WRITE SYS$OUTPUT ""
|
||||
$ VMI$CALLBACK CREATE_DIRECTORY 'GTM$DIR_TYPE' 'GTM$DST_CRE' "/OWNER_UIC=[''GTM$DST_OWN'] /PROTECTION=(WO:RE)"
|
||||
$ VMI$CALLBACK RESTORE_SAVESET B
|
||||
$ VMI$CALLBACK RESTORE_SAVESET C
|
||||
$ WRITE SYS$OUTPUT ""
|
||||
$ VMI$CALLBACK MESSAGE I CRECOM "Creating command files."
|
||||
$! Create GTMINSTALL.COM
|
||||
$ OPEN /WRITE OUFILE VMI$KWD:GTMINSTALL.COM
|
||||
$ WRITE OUFILE "$!"
|
||||
$ WRITE OUFILE "$! GTMINSTALL.COM installs GTMSECSHR and other GT.M images."
|
||||
$ WRITE OUFILE "$! GTMSECSHR is a small protected image and must be installed."
|
||||
$ WRITE OUFILE "$! GTMSHR is the run-time library and is installed for performance."
|
||||
$ WRITE OUFILE "$! GTM$DMOD and MCOMPILE are small images frequently used in development."
|
||||
$ WRITE OUFILE "$!"
|
||||
$ WRITE OUFILE "$ INSTALL"
|
||||
$ WRITE OUFILE "REPLACE /OPEN/SHARED/HEADER/PROTECTED GTMSECSHR"
|
||||
$ WRITE OUFILE "REPLACE /OPEN/SHARED/HEADER GTMSHR"
|
||||
$ WRITE OUFILE "REPLACE /OPEN/SHARED/HEADER GTM$DMOD"
|
||||
$ WRITE OUFILE "REPLACE /OPEN/SHARED/HEADER MCOMPILE"
|
||||
$ WRITE OUFILE "$ EXIT"
|
||||
$ CLOSE OUFILE
|
||||
$! Create GTMLOGICALS.COM
|
||||
$ GTM$HLP_LOG :== GTM$DIST
|
||||
$ IF GTM$HLP_DIR THEN GTM$HLP_LOG :== SYS$HELP
|
||||
$ OPEN /WRITE OUFILE VMI$KWD:GTMLOGICALS.COM
|
||||
$ WRITE OUFILE "$!"
|
||||
$ WRITE OUFILE "$! GTMLOGICALS.COM defines the logical names required to use GT.M."
|
||||
$ WRITE OUFILE "$! By default the definitions are placed in the PROCESS table."
|
||||
$ WRITE OUFILE "$! Parameter 1, if supplied should be the name of a logical name table"
|
||||
$ WRITE OUFILE "$! and/or the mode of definition."
|
||||
$ WRITE OUFILE "$! Assignments in a ""permanent"" table reduce GT.M activation time."
|
||||
$ WRITE OUFILE "$!"
|
||||
$ IF GTM$LNK_LOG THEN WRITE OUFILE "$! The LNK$LIBRARY names many require adjustment to your environment."
|
||||
$ IF GTM$DEF_GLD THEN WRITE OUFILE "$! GTM$GBLDIR is defined to provide default access to a global directory."
|
||||
$ IF GTM$DEF_RTN THEN WRITE OUFILE "$! GTM$ROUTINES is defined to provide access to the GT.M utilities."
|
||||
$ IF GTM$DEF_RTN THEN WRITE OUFILE "$! You may wish to define a different structure for $ZROUTINES."
|
||||
$ WRITE OUFILE "$!"
|
||||
$ WRITE OUFILE "$ IF (P1 .NES. """") .AND. (F$EXTRACT(0,1,P1) .NES. ""/"") THEN P1 := /'P1"
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' GTM$DIST ''GTM$DST_LOG'"
|
||||
$ IF GTM$DEF_GLD THEN WRITE OUFILE "$ DEFINE 'P1' GTM$GBLDIR ''GTM$GBL_DIR'"
|
||||
$ IF GTM$DEF_RTN THEN WRITE OUFILE "$ DEFINE 'P1' GTM$ROUTINES ""''GTM$RTN_DIR'"""
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' GTM$HELP ''GTM$HLP_LOG'"
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' GTMSHR GTM$DIST:GTMSHR.EXE"
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' GTMSECSHR GTM$DIST:GTMSECSHR.EXE"
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' GTM$DMOD GTM$DIST:GTM$DMOD.EXE"
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' MCOMPILE GTM$DIST:MCOMPILE.EXE"
|
||||
$ IF GTM$LNK_LOG
|
||||
$ THEN
|
||||
$ N1 = 0
|
||||
$ DN = 0
|
||||
$ T1 = F$TRNLNM("LNK$LIBRARY")
|
||||
$ IF (T1 .EQS. "") .OR. (F$LOCATE("GTMLIB",T1) .NE. F$LENGTH(T1)) .OR. (F$LOCATE("GTMSHR",T1) .NE. F$LENGTH(T1))
|
||||
$ THEN
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' LNK$LIBRARY GTM$DIST:GTMLIB.OLB"
|
||||
$ DN = 1
|
||||
$ ELSE ! lnk$library is in use
|
||||
$LNK_LOOP:
|
||||
$ N1 = N1 + 1
|
||||
$ T1 = F$TRNLNM("LNK$LIBRARY_''N1'")
|
||||
$ IF (T1 .EQS. "") .OR. (F$LOCATE("GTMLIB",T1) .NE. F$LENGTH(T1)) .OR. (F$LOCATE("GTMSHR",T1) .NE. F$LENGTH(T1))
|
||||
$ THEN
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' LNK$LIBRARY_''N1' GTM$DIST:GTMLIB.OLB"
|
||||
$ DN = 1
|
||||
$ ENDIF
|
||||
$ IF (.NOT. DN) .AND. (N1 .LT. 998) THEN GOTO LNK_LOOP
|
||||
$ ENDIF ! gtmlib handling
|
||||
$ IF DN ! placed gtmlib
|
||||
$ THEN
|
||||
$ N1 = N1 + 1
|
||||
$ WRITE OUFILE "$ DEFINE 'P1' LNK$LIBRARY_''N1' GTM$DIST:GTMSHR.OLB"
|
||||
$ ELSE
|
||||
$ VMI$CALLBACK MESSAGE I NOLNKLOG "No LNK$LIBRARY logical names available"
|
||||
$ ENDIF
|
||||
$ ENDIF ! setting up LNK$LIBRARYs
|
||||
$ WRITE OUFILE "$ EXIT"
|
||||
$ CLOSE OUFILE
|
||||
$! Create GTMLOGIN.COM
|
||||
$ OPEN /WRITE OUFILE VMI$KWD:GTMLOGIN.COM
|
||||
$ WRITE OUFILE "$!"
|
||||
$ WRITE OUFILE "$! GTMLOGIN.COM performs process specific setup for GT.M."
|
||||
$ WRITE OUFILE "$! It calls GTMLOGICALS.COM if the logical names are not"
|
||||
$ WRITE OUFILE "$! in the SYSTEM table."
|
||||
$ WRITE OUFILE "$! It defines symbols to access GT.M images."
|
||||
$ WRITE OUFILE "$! It defines GT.M commands locally if they are not defined to the system."
|
||||
$ WRITE OUFILE "$! When the command and logical names are not defined on a process level,"
|
||||
$ WRITE OUFILE "$! a production user may save start-up time by not using GTMLOGIN."
|
||||
$ WRITE OUFILE "$! CCE is infrequently used, but may be defined as a foreign command."
|
||||
$ WRITE OUFILE "$!"
|
||||
$ IF .NOT. GTM$DEF_SYS
|
||||
$ THEN
|
||||
$ WRITE OUFILE "$ dir = F$ENVIRONMENT(""PROCEDURE"")"
|
||||
$ WRITE OUFILE "$ dir = F$PARSE(dir,,,""DEVICE"") + F$PARSE(dir,,,""DIRECTORY"")"
|
||||
$ WRITE OUFILE "$ @'dir'GTMLOGICALS.COM"
|
||||
$ ENDIF
|
||||
$ IF .NOT. GTM$DEF_DCL THEN WRITE OUFILE "$ SET COMMAND GTM$DIST:GTMCOMMANDS.CLD"
|
||||
$ WRITE OUFILE "$ DSE :== $GTM$DIST:DSE.EXE ! Database System Editor"
|
||||
$ WRITE OUFILE "$ GDE :== $GTM$DIST:GDE.EXE ! Global Directory Editor"
|
||||
$ WRITE OUFILE "$ GTM :== MUMPS/DIRECT ! Direct Mode MUMPS"
|
||||
$ WRITE OUFILE "$ LKE :== $GTM$DIST:LKE.EXE ! Lock Editor"
|
||||
$ WRITE OUFILE "$ MUPI*P :== $GTM$DIST:MUPIP.EXE ! MUMPS Peripheral Interchange Program"
|
||||
$ WRITE OUFILE "$ EXIT"
|
||||
$ WRITE OUFILE "$ CCE :== $GTM$DIST:CCE.EXE ! GT.CX Operator Interface Program"
|
||||
$ WRITE OUFILE "$ EXIT"
|
||||
$ CLOSE OUFILE
|
||||
$! Create GTMSTART.COM
|
||||
$ OPEN /WRITE OUFILE VMI$KWD:GTMSTART.COM
|
||||
$ WRITE OUFILE "$!"
|
||||
$ WRITE OUFILE "$! GTMSTART.COM should be placed in the VMS startup database."
|
||||
$ WRITE OUFILE "$! It invokes GTMLOGICALS.COM and GTMINSTALL.COM."
|
||||
$ WRITE OUFILE "$!"
|
||||
$ WRITE OUFILE "$ dir = F$ENVIRONMENT(""PROCEDURE"")"
|
||||
$ WRITE OUFILE "$ dir = F$PARSE(dir,,,""DEVICE"") + F$PARSE(dir,,,""DIRECTORY"")"
|
||||
$ IF GTM$DEF_SYS THEN WRITE OUFILE "$ IF P1 .EQS. """" .OR. (P1 .EQS. ""FULL"") THEN P1 := SYSTEM/EXEC"
|
||||
$ WRITE OUFILE "$ @'dir'GTMLOGICALS 'P1'"
|
||||
$ WRITE OUFILE "$ @'dir'GTMINSTALL"
|
||||
$ WRITE OUFILE "$ EXIT"
|
||||
$ CLOSE OUFILE
|
||||
$! Create GTMSTOP.COM
|
||||
$ OPEN /WRITE OUFILE VMI$KWD:GTMSTOP.COM
|
||||
$ WRITE OUFILE "$!"
|
||||
$ WRITE OUFILE "$! GTMSTOP.COM stops all the active GT.M processes and does a RUNDOWN."
|
||||
$ WRITE OUFILE "$! Place an invocation or copy of this procedure in the site specific"
|
||||
$ WRITE OUFILE "$! shutdown: SYS$MANAGER:SYSHUTDWN to ensure all GT.M databases are"
|
||||
$ WRITE OUFILE "$! properly closed before VMS terminates. GTMSTOP should follow"
|
||||
$ WRITE OUFILE "$! GTCMSTOP and precede GTCXSTOP, if they are used."
|
||||
$ WRITE OUFILE "$! If GTMSTOP is not intended to disable subsequent use of GT.M,"
|
||||
$ WRITE OUFILE "$! add a comment (!) before the INSTALL REMOVE GTMSECSHR."
|
||||
$ WRITE OUFILE "$!"
|
||||
$ IF .NOT. GTM$DEF_SYS
|
||||
$ THEN
|
||||
$ WRITE OUFILE "$ dir = F$ENVIRONMENT(""PROCEDURE"")"
|
||||
$ WRITE OUFILE "$ dir = F$PARSE(dir,,,""DEVICE"") + F$PARSE(dir,,,""DIRECTORY"")"
|
||||
$ WRITE OUFILE "$ @'dir'GTMLOGICALS.COM"
|
||||
$ ENDIF
|
||||
$ WRITE OUFILE "$ MUPIP := $GTM$DIST:MUPIP.EXE"
|
||||
$ WRITE OUFILE "$ STOP := $GTM$DIST:GTM$STOP"
|
||||
$ WRITE OUFILE "$ STOP 'P1'"
|
||||
$ WRITE OUFILE "$ MUPIP RUNDOWN"
|
||||
$ WRITE OUFILE "$ INSTALL REMOVE GTMSECSHR"
|
||||
$ WRITE OUFILE "$ EXIT"
|
||||
$ IF GTM$DEF_SYS THEN WRITE OUFILE "$ IF P2 .EQS. """" THEN P2 := /SYSTEM/EXEC"
|
||||
$ WRITE OUFILE "$ DEASSIGN 'P2' GTMSECSHR"
|
||||
$ CLOSE OUFILE
|
||||
$ VMI$CALLBACK MESSAGE I PREINS "Preparing files for installation."
|
||||
$! GTMFILES.KIT must be maintained as kit contents change
|
||||
$ GTM$HLP_LOG == GTM$DST_LOG
|
||||
$ IF GTM$HLP_DIR THEN GTM$HLP_LOG :== VMI$ROOT:[SYSHLP]
|
||||
$ OPEN /WRITE OUFILE VMI$KWD:GTMFILES.KIT
|
||||
$ IF GTM$MGR_COM
|
||||
$ THEN
|
||||
$ WRITE OUFILE "GTM$ GTMINSTALL.COM VMI$ROOT:[SYSMGR] C"
|
||||
$ WRITE OUFILE "GTM$ GTMLOGICALS.COM VMI$ROOT:[SYSMGR] C"
|
||||
$ WRITE OUFILE "GTM$ GTMLOGIN.COM VMI$ROOT:[SYSMGR] C"
|
||||
$ WRITE OUFILE "GTM$ GTMSTART.COM VMI$ROOT:[SYSMGR] C"
|
||||
$ WRITE OUFILE "GTM$ GTMSTOP.COM VMI$ROOT:[SYSMGR] C"
|
||||
$ ENDIF
|
||||
$ WRITE OUFILE "GTM$ GTMINSTALL.COM ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMLOGICALS.COM ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMLOGIN.COM ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMSTART.COM ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMSTOP.COM ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ DSE.HLB ''GTM$HLP_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GDE.HLB ''GTM$HLP_LOG'"
|
||||
$ WRITE OUFILE "GTM$ LKE.HLB ''GTM$HLP_LOG'"
|
||||
$ WRITE OUFILE "GTM$ MUMPS.HLB ''GTM$HLP_LOG'"
|
||||
$ WRITE OUFILE "GTM$ MUPIP.HLB ''GTM$HLP_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMLIB.OLB ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMSHR.OLB ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMZCALL.MLB ''GTM$DST_LOG'"
|
||||
$ IF ALPHA
|
||||
$ THEN
|
||||
$ WRITE OUFILE "GTM$ GTM$DEFAULTS.M64 ''GTM$DST_LOG'"
|
||||
$ ELSE
|
||||
$ WRITE OUFILE "GTM$ GTM$DEFAULTS.MAR ''GTM$DST_LOG'"
|
||||
$ ENDIF
|
||||
$ WRITE OUFILE "GTM$ GTM$CE.H ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMCOLLECT.OPT ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMCOMMANDS.CLD ''GTM$DST_LOG' C"
|
||||
$ WRITE OUFILE "GTM$ *.M ''GTM$DST_LOG'"
|
||||
$ CLOSE OUFILE
|
||||
$! GTMIMAGES.KIT must be maintained as kit contents change
|
||||
$ OPEN /WRITE OUFILE VMI$KWD:GTMIMAGES.KIT
|
||||
$ WRITE OUFILE "GTM$ GTMSECSHR.EXE ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTMSHR.EXE ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ DSE.EXE ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GDE.EXE ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTM$DMOD.EXE ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ LKE.EXE ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ MCOMPILE.EXE ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ MUPIP.EXE ''GTM$DST_LOG'"
|
||||
$ WRITE OUFILE "GTM$ GTM$STOP.EXE ''GTM$DST_LOG'"
|
||||
$ CLOSE OUFILE
|
||||
$! Provide with file.KITs
|
||||
$ VMI$CALLBACK PROVIDE_FILE "" VMI$KWD:GTMFILES.KIT "" T
|
||||
$ VMI$CALLBACK PROVIDE_IMAGE "" VMI$KWD:GTMIMAGES.KIT "" T
|
||||
$ VMI$CALLBACK MESSAGE I FININS "Finalizing the installation."
|
||||
$ IF GTM$DEF_DCL THEN VMI$CALLBACK PROVIDE_DCL_COMMAND GTMCOMMANDS.CLD
|
||||
$ IF GTM$STARTDB THEN VMI$CALLBACK MODIFY_STARTUP_DB ADD GTMSTART.COM LPMAIN
|
||||
$! GTM$INSTALL is TRUE if GTM$RUN_IVP or GTM$PCT_RTN
|
||||
$ IF GTM$INSTALL THEN VMI$CALLBACK SET POSTINSTALL YES
|
||||
$ IF GTM$RUN_IVP THEN VMI$CALLBACK SET IVP YES
|
||||
$ EXIT VMI$_SUCCESS
|
||||
$!
|
||||
$POSTINSTALL:
|
||||
$ ON CONTROL_Y THEN EXIT VMI$_FAILURE
|
||||
$! remove MUPIP from command tables for change from V2.4 to V2.5
|
||||
$ SET NOON
|
||||
$ DEFINE /USER_MODE SYS$OUTPUT NL:
|
||||
$ DEFINE /USER_MODE SYS$ERROR NL:
|
||||
$ SET COMMAND /TABLE=SYS$COMMON:[SYSLIB]DCLTABLES /OUTPUT=SYS$COMMON:[SYSLIB]DCLTABLES /DELETE=MUPIP
|
||||
$ DEFINE /USER_MODE SYS$OUTPUT NL:
|
||||
$ DEFINE /USER_MODE SYS$ERROR NL:
|
||||
$ SET COMMAND /DELETE=MUPIP
|
||||
$ SET ON
|
||||
$ IF GTM$MGR_COM
|
||||
$ THEN
|
||||
$ T1 := SYS$MANAGER:
|
||||
$ ELSE
|
||||
$ T1 = GTM$DST_LOG
|
||||
$ ENDIF
|
||||
$ @'T1'GTMSTART
|
||||
$ @'T1'GTMLOGIN
|
||||
$ ON CONTROL_Y THEN EXIT VMI$_FAILURE
|
||||
$ SET DEFAULT GTM$DIST
|
||||
$ T2 = F$ENVIRONMENT("PROTECTION")
|
||||
$ SET PROTECTION=(S=REWD,O=REWD,G=REWD,W=RE)/DEFAULT
|
||||
$ MUMPS GTM$DMOD.M
|
||||
$ IF GTM$LNK_LOG
|
||||
$ THEN
|
||||
$ T1 :=
|
||||
$ ELSE
|
||||
$ T1 :=,GTMLIB.OLB/LIB,GTMSHR.OLB/LIB
|
||||
$ ENDIF
|
||||
$ LINK GTM$DMOD.OBJ/NOTRACE'T1
|
||||
$ IF GTM$PCT_RTN
|
||||
$ THEN
|
||||
$ TYPE SYS$INPUT
|
||||
|
||||
Compiling the GT.M percent (%) routines.
|
||||
$ MUMPS *
|
||||
$ IF GTM$DOPURGE THEN PURGE *.*
|
||||
$ SET DEFAULT VMI$KWD
|
||||
$ ENDIF ! percent routines
|
||||
$ SET PROTECTION=('T2')/DEFAULT
|
||||
$ EXIT VMI$_SUCCESS
|
||||
$!
|
||||
$IVP:
|
||||
$! The real Installation Verification Procedure.
|
||||
$ TYPE SYS$INPUT
|
||||
|
||||
GT.M Installation Verification Procedure
|
||||
|
||||
$! Extract the IVP .COM file from the text library.
|
||||
$ LIBRARIAN /EXTRACT=GTM$IVP /OUTPUT=GTM$IVP.COM GTM$IVP.TLB
|
||||
$ @GTM$IVP
|
||||
$ EXIT $STATUS
|
||||
$!
|
||||
867
samples/DIGITAL Command Language/ghostpdl_zlib_make_vms.com
Normal file
867
samples/DIGITAL Command Language/ghostpdl_zlib_make_vms.com
Normal file
@@ -0,0 +1,867 @@
|
||||
$! make libz under VMS written by
|
||||
$! Martin P.J. Zinser
|
||||
$!
|
||||
$! In case of problems with the install you might contact me at
|
||||
$! zinser@zinser.no-ip.info(preferred) or
|
||||
$! martin.zinser@eurexchange.com (work)
|
||||
$!
|
||||
$! Make procedure history for Zlib
|
||||
$!
|
||||
$!------------------------------------------------------------------------------
|
||||
$! Version history
|
||||
$! 0.01 20060120 First version to receive a number
|
||||
$! 0.02 20061008 Adapt to new Makefile.in
|
||||
$! 0.03 20091224 Add support for large file check
|
||||
$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
|
||||
$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
|
||||
$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples
|
||||
$! subdir path, update module search in makefile.in
|
||||
$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned
|
||||
$! shared image creation
|
||||
$! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared
|
||||
$! image
|
||||
$! 0.09 20120305 SMS. P1 sets builder ("MMK", "MMS", " " (built-in)).
|
||||
$! "" -> automatic, preference: MMK, MMS, built-in.
|
||||
$!
|
||||
$ on error then goto err_exit
|
||||
$!
|
||||
$ true = 1
|
||||
$ false = 0
|
||||
$ tmpnam = "temp_" + f$getjpi("","pid")
|
||||
$ tt = tmpnam + ".txt"
|
||||
$ tc = tmpnam + ".c"
|
||||
$ th = tmpnam + ".h"
|
||||
$ define/nolog tconfig 'th'
|
||||
$ its_decc = false
|
||||
$ its_vaxc = false
|
||||
$ its_gnuc = false
|
||||
$ s_case = False
|
||||
$!
|
||||
$! Setup variables holding "config" information
|
||||
$!
|
||||
$ Make = "''p1'"
|
||||
$ name = "Zlib"
|
||||
$ version = "?.?.?"
|
||||
$ v_string = "ZLIB_VERSION"
|
||||
$ v_file = "zlib.h"
|
||||
$ ccopt = "/include = []"
|
||||
$ lopts = ""
|
||||
$ dnsrl = ""
|
||||
$ aconf_in_file = "zconf.h.in#zconf.h_in#zconf_h.in"
|
||||
$ conf_check_string = ""
|
||||
$ linkonly = false
|
||||
$ optfile = name + ".opt"
|
||||
$ mapfile = name + ".map"
|
||||
$ libdefs = ""
|
||||
$ vax = f$getsyi("HW_MODEL").lt.1024
|
||||
$ axp = f$getsyi("HW_MODEL").ge.1024 .and. f$getsyi("HW_MODEL").lt.4096
|
||||
$ ia64 = f$getsyi("HW_MODEL").ge.4096
|
||||
$!
|
||||
$! 2012-03-05 SMS.
|
||||
$! Why is this needed? And if it is needed, why not simply ".not. vax"?
|
||||
$!
|
||||
$!!! if axp .or. ia64 then set proc/parse=extended
|
||||
$!
|
||||
$ whoami = f$parse(f$environment("Procedure"),,,,"NO_CONCEAL")
|
||||
$ mydef = F$parse(whoami,,,"DEVICE")
|
||||
$ mydir = f$parse(whoami,,,"DIRECTORY") - "]["
|
||||
$ myproc = f$parse(whoami,,,"Name") + f$parse(whoami,,,"type")
|
||||
$!
|
||||
$! Check for MMK/MMS
|
||||
$!
|
||||
$ if (Make .eqs. "")
|
||||
$ then
|
||||
$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
|
||||
$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
|
||||
$ else
|
||||
$ Make = f$edit( Make, "trim")
|
||||
$ endif
|
||||
$!
|
||||
$ gosub find_version
|
||||
$!
|
||||
$ open/write topt tmp.opt
|
||||
$ open/write optf 'optfile'
|
||||
$!
|
||||
$ gosub check_opts
|
||||
$!
|
||||
$! Look for the compiler used
|
||||
$!
|
||||
$ gosub check_compiler
|
||||
$ close topt
|
||||
$ close optf
|
||||
$!
|
||||
$ if its_decc
|
||||
$ then
|
||||
$ ccopt = "/prefix=all" + ccopt
|
||||
$ if f$trnlnm("SYS") .eqs. ""
|
||||
$ then
|
||||
$ if axp
|
||||
$ then
|
||||
$ define sys sys$library:
|
||||
$ else
|
||||
$ ccopt = "/decc" + ccopt
|
||||
$ define sys decc$library_include:
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$! 2012-03-05 SMS.
|
||||
$! Why /NAMES = AS_IS? Why not simply ".not. vax"? And why not on VAX?
|
||||
$!
|
||||
$ if axp .or. ia64
|
||||
$ then
|
||||
$ ccopt = ccopt + "/name=as_is/opt=(inline=speed)"
|
||||
$ s_case = true
|
||||
$ endif
|
||||
$ endif
|
||||
$ if its_vaxc .or. its_gnuc
|
||||
$ then
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
||||
$ endif
|
||||
$!
|
||||
$! Build a fake configure input header
|
||||
$!
|
||||
$ open/write conf_hin config.hin
|
||||
$ write conf_hin "#undef _LARGEFILE64_SOURCE"
|
||||
$ close conf_hin
|
||||
$!
|
||||
$!
|
||||
$ i = 0
|
||||
$FIND_ACONF:
|
||||
$ fname = f$element(i,"#",aconf_in_file)
|
||||
$ if fname .eqs. "#" then goto AMISS_ERR
|
||||
$ if f$search(fname) .eqs. ""
|
||||
$ then
|
||||
$ i = i + 1
|
||||
$ goto find_aconf
|
||||
$ endif
|
||||
$ open/read/err=aconf_err aconf_in 'fname'
|
||||
$ open/write aconf zconf.h
|
||||
$ACONF_LOOP:
|
||||
$ read/end_of_file=aconf_exit aconf_in line
|
||||
$ work = f$edit(line, "compress,trim")
|
||||
$ if f$extract(0,6,work) .nes. "#undef"
|
||||
$ then
|
||||
$ if f$extract(0,12,work) .nes. "#cmakedefine"
|
||||
$ then
|
||||
$ write aconf line
|
||||
$ endif
|
||||
$ else
|
||||
$ cdef = f$element(1," ",work)
|
||||
$ gosub check_config
|
||||
$ endif
|
||||
$ goto aconf_loop
|
||||
$ACONF_EXIT:
|
||||
$ write aconf ""
|
||||
$ write aconf "/* VMS specifics added by make_vms.com: */"
|
||||
$ write aconf "#define VMS 1"
|
||||
$ write aconf "#include <unistd.h>"
|
||||
$ write aconf "#include <unixio.h>"
|
||||
$ write aconf "#ifdef _LARGEFILE"
|
||||
$ write aconf "# define off64_t __off64_t"
|
||||
$ write aconf "# define fopen64 fopen"
|
||||
$ write aconf "# define fseeko64 fseeko"
|
||||
$ write aconf "# define lseek64 lseek"
|
||||
$ write aconf "# define ftello64 ftell"
|
||||
$ write aconf "#endif"
|
||||
$ write aconf "#if !defined( __VAX) && (__CRTL_VER >= 70312000)"
|
||||
$ write aconf "# define HAVE_VSNPRINTF"
|
||||
$ write aconf "#endif"
|
||||
$ close aconf_in
|
||||
$ close aconf
|
||||
$ if f$search("''th'") .nes. "" then delete 'th';*
|
||||
$! Build the thing plain or with mms
|
||||
$!
|
||||
$ write sys$output "Compiling Zlib sources ..."
|
||||
$ if make.eqs.""
|
||||
$ then
|
||||
$ if (f$search( "example.obj;*") .nes. "") then delete example.obj;*
|
||||
$ if (f$search( "minigzip.obj;*") .nes. "") then delete minigzip.obj;*
|
||||
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
|
||||
adler32.c zlib.h zconf.h
|
||||
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
|
||||
compress.c zlib.h zconf.h
|
||||
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
|
||||
crc32.c zlib.h zconf.h
|
||||
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
|
||||
deflate.c deflate.h zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" -
|
||||
gzclose.c zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" -
|
||||
gzlib.c zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" -
|
||||
gzread.c zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" -
|
||||
gzwrite.c zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE infback.OBJ "CC ''CCOPT' infback" -
|
||||
infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
|
||||
$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
|
||||
inffast.c zutil.h zlib.h zconf.h inffast.h
|
||||
$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
|
||||
inflate.c zutil.h zlib.h zconf.h infblock.h
|
||||
$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
|
||||
inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
||||
$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
|
||||
trees.c deflate.h zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
|
||||
uncompr.c zlib.h zconf.h
|
||||
$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
|
||||
zutil.c zutil.h zlib.h zconf.h
|
||||
$ write sys$output "Building Zlib ..."
|
||||
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
|
||||
$ write sys$output "Building example..."
|
||||
$ CALL MAKE example.OBJ "CC ''CCOPT' [.test]example" -
|
||||
[.test]example.c zlib.h zconf.h
|
||||
$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
|
||||
$ write sys$output "Building minigzip..."
|
||||
$ CALL MAKE minigzip.OBJ "CC ''CCOPT' [.test]minigzip" -
|
||||
[.test]minigzip.c zlib.h zconf.h
|
||||
$ call make minigzip.exe -
|
||||
"LINK minigzip,libz.olb/lib" -
|
||||
minigzip.obj libz.olb
|
||||
$ else
|
||||
$ gosub crea_mms
|
||||
$ write sys$output "Make ''name' ''version' with ''Make' "
|
||||
$ 'make'
|
||||
$ endif
|
||||
$!
|
||||
$! Create shareable image
|
||||
$!
|
||||
$ gosub crea_olist
|
||||
$ write sys$output "Creating libzshr.exe"
|
||||
$ call map_2_shopt 'mapfile' 'optfile'
|
||||
$ LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,'optfile'/opt
|
||||
$ write sys$output "Zlib build completed"
|
||||
$ delete/nolog tmp.opt;*
|
||||
$ exit
|
||||
$AMISS_ERR:
|
||||
$ write sys$output "No source for config.hin found."
|
||||
$ write sys$output "Tried any of ''aconf_in_file'"
|
||||
$ goto err_exit
|
||||
$CC_ERR:
|
||||
$ write sys$output "C compiler required to build ''name'"
|
||||
$ goto err_exit
|
||||
$ERR_EXIT:
|
||||
$ set message/facil/ident/sever/text
|
||||
$ close/nolog optf
|
||||
$ close/nolog topt
|
||||
$ close/nolog aconf_in
|
||||
$ close/nolog aconf
|
||||
$ close/nolog out
|
||||
$ close/nolog min
|
||||
$ close/nolog mod
|
||||
$ close/nolog h_in
|
||||
$ write sys$output "Exiting..."
|
||||
$ exit 2
|
||||
$!
|
||||
$!
|
||||
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
|
||||
$ V = 'F$Verify(0)
|
||||
$! P1 = What we are trying to make
|
||||
$! P2 = Command to make it
|
||||
$! P3 - P8 What it depends on
|
||||
$
|
||||
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
|
||||
$ Time = F$CvTime(F$File(P1,"RDT"))
|
||||
$arg=3
|
||||
$Loop:
|
||||
$ Argument = P'arg
|
||||
$ If Argument .Eqs. "" Then Goto Exit
|
||||
$ El=0
|
||||
$Loop2:
|
||||
$ File = F$Element(El," ",Argument)
|
||||
$ If File .Eqs. " " Then Goto Endl
|
||||
$ AFile = ""
|
||||
$Loop3:
|
||||
$ OFile = AFile
|
||||
$ AFile = F$Search(File)
|
||||
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
|
||||
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
|
||||
$ Goto Loop3
|
||||
$NextEL:
|
||||
$ El = El + 1
|
||||
$ Goto Loop2
|
||||
$EndL:
|
||||
$ arg=arg+1
|
||||
$ If arg .Le. 8 Then Goto Loop
|
||||
$ Goto Exit
|
||||
$
|
||||
$Makeit:
|
||||
$ VV=F$VERIFY(0)
|
||||
$ write sys$output P2
|
||||
$ 'P2
|
||||
$ VV='F$Verify(VV)
|
||||
$Exit:
|
||||
$ If V Then Set Verify
|
||||
$ENDSUBROUTINE
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Check command line options and set symbols accordingly
|
||||
$!
|
||||
$!------------------------------------------------------------------------------
|
||||
$! Version history
|
||||
$! 0.01 20041206 First version to receive a number
|
||||
$! 0.02 20060126 Add new "HELP" target
|
||||
$ CHECK_OPTS:
|
||||
$ i = 1
|
||||
$ OPT_LOOP:
|
||||
$ if i .lt. 9
|
||||
$ then
|
||||
$ cparm = f$edit(p'i',"upcase")
|
||||
$!
|
||||
$! Check if parameter actually contains something
|
||||
$!
|
||||
$ if f$edit(cparm,"trim") .nes. ""
|
||||
$ then
|
||||
$ if cparm .eqs. "DEBUG"
|
||||
$ then
|
||||
$ ccopt = ccopt + "/noopt/deb"
|
||||
$ lopts = lopts + "/deb"
|
||||
$ endif
|
||||
$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
|
||||
$ then
|
||||
$ start = f$locate("=",cparm) + 1
|
||||
$ len = f$length(cparm) - start
|
||||
$ ccopt = ccopt + f$extract(start,len,cparm)
|
||||
$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) -
|
||||
then s_case = true
|
||||
$ endif
|
||||
$ if cparm .eqs. "LINK" then linkonly = true
|
||||
$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm)
|
||||
$ then
|
||||
$ start = f$locate("=",cparm) + 1
|
||||
$ len = f$length(cparm) - start
|
||||
$ lopts = lopts + f$extract(start,len,cparm)
|
||||
$ endif
|
||||
$ if f$locate("CC=",cparm) .lt. f$length(cparm)
|
||||
$ then
|
||||
$ start = f$locate("=",cparm) + 1
|
||||
$ len = f$length(cparm) - start
|
||||
$ cc_com = f$extract(start,len,cparm)
|
||||
if (cc_com .nes. "DECC") .and. -
|
||||
(cc_com .nes. "VAXC") .and. -
|
||||
(cc_com .nes. "GNUC")
|
||||
$ then
|
||||
$ write sys$output "Unsupported compiler choice ''cc_com' ignored"
|
||||
$ write sys$output "Use DECC, VAXC, or GNUC instead"
|
||||
$ else
|
||||
$ if cc_com .eqs. "DECC" then its_decc = true
|
||||
$ if cc_com .eqs. "VAXC" then its_vaxc = true
|
||||
$ if cc_com .eqs. "GNUC" then its_gnuc = true
|
||||
$ endif
|
||||
$ endif
|
||||
$ if f$locate("MAKE=",cparm) .lt. f$length(cparm)
|
||||
$ then
|
||||
$ start = f$locate("=",cparm) + 1
|
||||
$ len = f$length(cparm) - start
|
||||
$ mmks = f$extract(start,len,cparm)
|
||||
$ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS")
|
||||
$ then
|
||||
$ make = mmks
|
||||
$ else
|
||||
$ write sys$output "Unsupported make choice ''mmks' ignored"
|
||||
$ write sys$output "Use MMK or MMS instead"
|
||||
$ endif
|
||||
$ endif
|
||||
$ if cparm .eqs. "HELP" then gosub bhelp
|
||||
$ endif
|
||||
$ i = i + 1
|
||||
$ goto opt_loop
|
||||
$ endif
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Look for the compiler used
|
||||
$!
|
||||
$! Version history
|
||||
$! 0.01 20040223 First version to receive a number
|
||||
$! 0.02 20040229 Save/set value of decc$no_rooted_search_lists
|
||||
$! 0.03 20060202 Extend handling of GNU C
|
||||
$! 0.04 20090402 Compaq -> hp
|
||||
$CHECK_COMPILER:
|
||||
$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
|
||||
$ then
|
||||
$ its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "")
|
||||
$ its_vaxc = .not. its_decc .and. (F$Search("SYS$System:VAXC.Exe") .nes. "")
|
||||
$ its_gnuc = .not. (its_decc .or. its_vaxc) .and. (f$trnlnm("gnu_cc") .nes. "")
|
||||
$ endif
|
||||
$!
|
||||
$! Exit if no compiler available
|
||||
$!
|
||||
$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
|
||||
$ then goto CC_ERR
|
||||
$ else
|
||||
$ if its_decc
|
||||
$ then
|
||||
$ write sys$output "CC compiler check ... hp C"
|
||||
$ if f$trnlnm("decc$no_rooted_search_lists") .nes. ""
|
||||
$ then
|
||||
$ dnrsl = f$trnlnm("decc$no_rooted_search_lists")
|
||||
$ endif
|
||||
$ define/nolog decc$no_rooted_search_lists 1
|
||||
$ else
|
||||
$ if its_vaxc then write sys$output "CC compiler check ... VAX C"
|
||||
$ if its_gnuc
|
||||
$ then
|
||||
$ write sys$output "CC compiler check ... GNU C"
|
||||
$ if f$trnlnm(topt) then write topt "gnu_cc:[000000]gcclib.olb/lib"
|
||||
$ if f$trnlnm(optf) then write optf "gnu_cc:[000000]gcclib.olb/lib"
|
||||
$ cc = "gcc"
|
||||
$ endif
|
||||
$ if f$trnlnm(topt) then write topt "sys$share:vaxcrtl.exe/share"
|
||||
$ if f$trnlnm(optf) then write optf "sys$share:vaxcrtl.exe/share"
|
||||
$ endif
|
||||
$ endif
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! If MMS/MMK are available dump out the descrip.mms if required
|
||||
$!
|
||||
$CREA_MMS:
|
||||
$ write sys$output "Creating descrip.mms..."
|
||||
$ create descrip.mms
|
||||
$ open/append out descrip.mms
|
||||
$ copy sys$input: out
|
||||
$ deck
|
||||
# descrip.mms: MMS description file for building zlib on VMS
|
||||
# written by Martin P.J. Zinser
|
||||
# <zinser@zinser.no-ip.info or martin.zinser@eurexchange.com>
|
||||
|
||||
OBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzlib.obj\
|
||||
gzread.obj, gzwrite.obj, uncompr.obj, infback.obj\
|
||||
deflate.obj, trees.obj, zutil.obj, inflate.obj, \
|
||||
inftrees.obj, inffast.obj
|
||||
|
||||
$ eod
|
||||
$ write out "CFLAGS=", ccopt
|
||||
$ write out "LOPTS=", lopts
|
||||
$ write out "all : example.exe minigzip.exe libz.olb"
|
||||
$ copy sys$input: out
|
||||
$ deck
|
||||
@ write sys$output " Example applications available"
|
||||
|
||||
libz.olb : libz.olb($(OBJS))
|
||||
@ write sys$output " libz available"
|
||||
|
||||
example.exe : example.obj libz.olb
|
||||
link $(LOPTS) example,libz.olb/lib
|
||||
|
||||
minigzip.exe : minigzip.obj libz.olb
|
||||
link $(LOPTS) minigzip,libz.olb/lib
|
||||
|
||||
clean :
|
||||
delete *.obj;*,libz.olb;*,*.opt;*,*.exe;*
|
||||
|
||||
|
||||
# Other dependencies.
|
||||
adler32.obj : adler32.c zutil.h zlib.h zconf.h
|
||||
compress.obj : compress.c zlib.h zconf.h
|
||||
crc32.obj : crc32.c zutil.h zlib.h zconf.h
|
||||
deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h
|
||||
example.obj : [.test]example.c zlib.h zconf.h
|
||||
gzclose.obj : gzclose.c zutil.h zlib.h zconf.h
|
||||
gzlib.obj : gzlib.c zutil.h zlib.h zconf.h
|
||||
gzread.obj : gzread.c zutil.h zlib.h zconf.h
|
||||
gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h
|
||||
inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h
|
||||
inflate.obj : inflate.c zutil.h zlib.h zconf.h
|
||||
inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
||||
minigzip.obj : [.test]minigzip.c zlib.h zconf.h
|
||||
trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h
|
||||
uncompr.obj : uncompr.c zlib.h zconf.h
|
||||
zutil.obj : zutil.c zutil.h zlib.h zconf.h
|
||||
infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
|
||||
$ eod
|
||||
$ close out
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Read list of core library sources from makefile.in and create options
|
||||
$! needed to build shareable image
|
||||
$!
|
||||
$CREA_OLIST:
|
||||
$ open/read min makefile.in
|
||||
$ open/write mod modules.opt
|
||||
$ src_check_list = "OBJZ =#OBJG ="
|
||||
$MRLOOP:
|
||||
$ read/end=mrdone min rec
|
||||
$ i = 0
|
||||
$SRC_CHECK_LOOP:
|
||||
$ src_check = f$element(i, "#", src_check_list)
|
||||
$ i = i+1
|
||||
$ if src_check .eqs. "#" then goto mrloop
|
||||
$ if (f$extract(0,6,rec) .nes. src_check) then goto src_check_loop
|
||||
$ rec = rec - src_check
|
||||
$ gosub extra_filnam
|
||||
$ if (f$element(1,"\",rec) .eqs. "\") then goto mrloop
|
||||
$MRSLOOP:
|
||||
$ read/end=mrdone min rec
|
||||
$ gosub extra_filnam
|
||||
$ if (f$element(1,"\",rec) .nes. "\") then goto mrsloop
|
||||
$MRDONE:
|
||||
$ close min
|
||||
$ close mod
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Take record extracted in crea_olist and split it into single filenames
|
||||
$!
|
||||
$EXTRA_FILNAM:
|
||||
$ myrec = f$edit(rec - "\", "trim,compress")
|
||||
$ i = 0
|
||||
$FELOOP:
|
||||
$ srcfil = f$element(i," ", myrec)
|
||||
$ if (srcfil .nes. " ")
|
||||
$ then
|
||||
$ write mod f$parse(srcfil,,,"NAME"), ".obj"
|
||||
$ i = i + 1
|
||||
$ goto feloop
|
||||
$ endif
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Find current Zlib version number
|
||||
$!
|
||||
$FIND_VERSION:
|
||||
$ open/read h_in 'v_file'
|
||||
$hloop:
|
||||
$ read/end=hdone h_in rec
|
||||
$ rec = f$edit(rec,"TRIM")
|
||||
$ if (f$extract(0,1,rec) .nes. "#") then goto hloop
|
||||
$ rec = f$edit(rec - "#", "TRIM")
|
||||
$ if f$element(0," ",rec) .nes. "define" then goto hloop
|
||||
$ if f$element(1," ",rec) .eqs. v_string
|
||||
$ then
|
||||
$ version = 'f$element(2," ",rec)'
|
||||
$ goto hdone
|
||||
$ endif
|
||||
$ goto hloop
|
||||
$hdone:
|
||||
$ close h_in
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$CHECK_CONFIG:
|
||||
$!
|
||||
$ in_ldef = f$locate(cdef,libdefs)
|
||||
$ if (in_ldef .lt. f$length(libdefs))
|
||||
$ then
|
||||
$ write aconf "#define ''cdef' 1"
|
||||
$ libdefs = f$extract(0,in_ldef,libdefs) + -
|
||||
f$extract(in_ldef + f$length(cdef) + 1, -
|
||||
f$length(libdefs) - in_ldef - f$length(cdef) - 1, -
|
||||
libdefs)
|
||||
$ else
|
||||
$ if (f$type('cdef') .eqs. "INTEGER")
|
||||
$ then
|
||||
$ write aconf "#define ''cdef' ", 'cdef'
|
||||
$ else
|
||||
$ if (f$type('cdef') .eqs. "STRING")
|
||||
$ then
|
||||
$ write aconf "#define ''cdef' ", """", '''cdef'', """"
|
||||
$ else
|
||||
$ gosub check_cc_def
|
||||
$ endif
|
||||
$ endif
|
||||
$ endif
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Check if this is a define relating to the properties of the C/C++
|
||||
$! compiler
|
||||
$!
|
||||
$ CHECK_CC_DEF:
|
||||
$ if (cdef .eqs. "_LARGEFILE64_SOURCE")
|
||||
$ then
|
||||
$ copy sys$input: 'tc'
|
||||
$ deck
|
||||
#include "tconfig"
|
||||
#define _LARGEFILE
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
FILE *fp;
|
||||
fp = fopen("temp.txt","r");
|
||||
fseeko(fp,1,SEEK_SET);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
$ eod
|
||||
$ test_inv = false
|
||||
$ comm_h = false
|
||||
$ gosub cc_prop_check
|
||||
$ return
|
||||
$ endif
|
||||
$ write aconf "/* ", line, " */"
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Check for properties of C/C++ compiler
|
||||
$!
|
||||
$! Version history
|
||||
$! 0.01 20031020 First version to receive a number
|
||||
$! 0.02 20031022 Added logic for defines with value
|
||||
$! 0.03 20040309 Make sure local config file gets not deleted
|
||||
$! 0.04 20041230 Also write include for configure run
|
||||
$! 0.05 20050103 Add processing of "comment defines"
|
||||
$CC_PROP_CHECK:
|
||||
$ cc_prop = true
|
||||
$ is_need = false
|
||||
$ is_need = (f$extract(0,4,cdef) .eqs. "NEED") .or. (test_inv .eq. true)
|
||||
$ if f$search(th) .eqs. "" then create 'th'
|
||||
$ set message/nofac/noident/nosever/notext
|
||||
$ on error then continue
|
||||
$ cc 'tmpnam'
|
||||
$ if .not. ($status) then cc_prop = false
|
||||
$ on error then continue
|
||||
$! The headers might lie about the capabilities of the RTL
|
||||
$ link 'tmpnam',tmp.opt/opt
|
||||
$ if .not. ($status) then cc_prop = false
|
||||
$ set message/fac/ident/sever/text
|
||||
$ on error then goto err_exit
|
||||
$ delete/nolog 'tmpnam'.*;*/exclude='th'
|
||||
$ if (cc_prop .and. .not. is_need) .or. -
|
||||
(.not. cc_prop .and. is_need)
|
||||
$ then
|
||||
$ write sys$output "Checking for ''cdef'... yes"
|
||||
$ if f$type('cdef_val'_yes) .nes. ""
|
||||
$ then
|
||||
$ if f$type('cdef_val'_yes) .eqs. "INTEGER" -
|
||||
then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_yes)
|
||||
$ if f$type('cdef_val'_yes) .eqs. "STRING" -
|
||||
then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_yes)
|
||||
$ else
|
||||
$ call write_config f$fao("#define !AS 1",cdef)
|
||||
$ endif
|
||||
$ if (cdef .eqs. "HAVE_FSEEKO") .or. (cdef .eqs. "_LARGE_FILES") .or. -
|
||||
(cdef .eqs. "_LARGEFILE64_SOURCE") then -
|
||||
call write_config f$string("#define _LARGEFILE 1")
|
||||
$ else
|
||||
$ write sys$output "Checking for ''cdef'... no"
|
||||
$ if (comm_h)
|
||||
$ then
|
||||
call write_config f$fao("/* !AS */",line)
|
||||
$ else
|
||||
$ if f$type('cdef_val'_no) .nes. ""
|
||||
$ then
|
||||
$ if f$type('cdef_val'_no) .eqs. "INTEGER" -
|
||||
then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_no)
|
||||
$ if f$type('cdef_val'_no) .eqs. "STRING" -
|
||||
then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_no)
|
||||
$ else
|
||||
$ call write_config f$fao("#undef !AS",cdef)
|
||||
$ endif
|
||||
$ endif
|
||||
$ endif
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Check for properties of C/C++ compiler with multiple result values
|
||||
$!
|
||||
$! Version history
|
||||
$! 0.01 20040127 First version
|
||||
$! 0.02 20050103 Reconcile changes from cc_prop up to version 0.05
|
||||
$CC_MPROP_CHECK:
|
||||
$ cc_prop = true
|
||||
$ i = 1
|
||||
$ idel = 1
|
||||
$ MT_LOOP:
|
||||
$ if f$type(result_'i') .eqs. "STRING"
|
||||
$ then
|
||||
$ set message/nofac/noident/nosever/notext
|
||||
$ on error then continue
|
||||
$ cc 'tmpnam'_'i'
|
||||
$ if .not. ($status) then cc_prop = false
|
||||
$ on error then continue
|
||||
$! The headers might lie about the capabilities of the RTL
|
||||
$ link 'tmpnam'_'i',tmp.opt/opt
|
||||
$ if .not. ($status) then cc_prop = false
|
||||
$ set message/fac/ident/sever/text
|
||||
$ on error then goto err_exit
|
||||
$ delete/nolog 'tmpnam'_'i'.*;*
|
||||
$ if (cc_prop)
|
||||
$ then
|
||||
$ write sys$output "Checking for ''cdef'... ", mdef_'i'
|
||||
$ if f$type(mdef_'i') .eqs. "INTEGER" -
|
||||
then call write_config f$fao("#define !AS !UL",cdef,mdef_'i')
|
||||
$ if f$type('cdef_val'_yes) .eqs. "STRING" -
|
||||
then call write_config f$fao("#define !AS !AS",cdef,mdef_'i')
|
||||
$ goto msym_clean
|
||||
$ else
|
||||
$ i = i + 1
|
||||
$ goto mt_loop
|
||||
$ endif
|
||||
$ endif
|
||||
$ write sys$output "Checking for ''cdef'... no"
|
||||
$ call write_config f$fao("#undef !AS",cdef)
|
||||
$ MSYM_CLEAN:
|
||||
$ if (idel .le. msym_max)
|
||||
$ then
|
||||
$ delete/sym mdef_'idel'
|
||||
$ idel = idel + 1
|
||||
$ goto msym_clean
|
||||
$ endif
|
||||
$ return
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Write configuration to both permanent and temporary config file
|
||||
$!
|
||||
$! Version history
|
||||
$! 0.01 20031029 First version to receive a number
|
||||
$!
|
||||
$WRITE_CONFIG: SUBROUTINE
|
||||
$ write aconf 'p1'
|
||||
$ open/append confh 'th'
|
||||
$ write confh 'p1'
|
||||
$ close confh
|
||||
$ENDSUBROUTINE
|
||||
$!------------------------------------------------------------------------------
|
||||
$!
|
||||
$! Analyze the project map file and create the symbol vector for a shareable
|
||||
$! image from it
|
||||
$!
|
||||
$! Version history
|
||||
$! 0.01 20120128 First version
|
||||
$! 0.02 20120226 Add pre-load logic
|
||||
$!
|
||||
$ MAP_2_SHOPT: Subroutine
|
||||
$!
|
||||
$ SAY := "WRITE_ SYS$OUTPUT"
|
||||
$!
|
||||
$ IF F$SEARCH("''P1'") .EQS. ""
|
||||
$ THEN
|
||||
$ SAY "MAP_2_SHOPT-E-NOSUCHFILE: Error, inputfile ''p1' not available"
|
||||
$ goto exit_m2s
|
||||
$ ENDIF
|
||||
$ IF "''P2'" .EQS. ""
|
||||
$ THEN
|
||||
$ SAY "MAP_2_SHOPT: Error, no output file provided"
|
||||
$ goto exit_m2s
|
||||
$ ENDIF
|
||||
$!
|
||||
$ module1 = "deflate#deflateEnd#deflateInit_#deflateParams#deflateSetDictionary"
|
||||
$ module2 = "gzclose#gzerror#gzgetc#gzgets#gzopen#gzprintf#gzputc#gzputs#gzread"
|
||||
$ module3 = "gzseek#gztell#inflate#inflateEnd#inflateInit_#inflateSetDictionary"
|
||||
$ module4 = "inflateSync#uncompress#zlibVersion#compress"
|
||||
$ open/read map 'p1
|
||||
$ if axp .or. ia64
|
||||
$ then
|
||||
$ open/write aopt a.opt
|
||||
$ open/write bopt b.opt
|
||||
$ write aopt " CASE_SENSITIVE=YES"
|
||||
$ write bopt "SYMBOL_VECTOR= (-"
|
||||
$ mod_sym_num = 1
|
||||
$ MOD_SYM_LOOP:
|
||||
$ if f$type(module'mod_sym_num') .nes. ""
|
||||
$ then
|
||||
$ mod_in = 0
|
||||
$ MOD_SYM_IN:
|
||||
$ shared_proc = f$element(mod_in, "#", module'mod_sym_num')
|
||||
$ if shared_proc .nes. "#"
|
||||
$ then
|
||||
$ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",-
|
||||
f$edit(shared_proc,"upcase"),shared_proc)
|
||||
$ write bopt f$fao("!AS=PROCEDURE,-",shared_proc)
|
||||
$ mod_in = mod_in + 1
|
||||
$ goto mod_sym_in
|
||||
$ endif
|
||||
$ mod_sym_num = mod_sym_num + 1
|
||||
$ goto mod_sym_loop
|
||||
$ endif
|
||||
$MAP_LOOP:
|
||||
$ read/end=map_end map line
|
||||
$ if (f$locate("{",line).lt. f$length(line)) .or. -
|
||||
(f$locate("global:", line) .lt. f$length(line))
|
||||
$ then
|
||||
$ proc = true
|
||||
$ goto map_loop
|
||||
$ endif
|
||||
$ if f$locate("}",line).lt. f$length(line) then proc = false
|
||||
$ if f$locate("local:", line) .lt. f$length(line) then proc = false
|
||||
$ if proc
|
||||
$ then
|
||||
$ shared_proc = f$edit(line,"collapse")
|
||||
$ chop_semi = f$locate(";", shared_proc)
|
||||
$ if chop_semi .lt. f$length(shared_proc) then -
|
||||
shared_proc = f$extract(0, chop_semi, shared_proc)
|
||||
$ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",-
|
||||
f$edit(shared_proc,"upcase"),shared_proc)
|
||||
$ write bopt f$fao("!AS=PROCEDURE,-",shared_proc)
|
||||
$ endif
|
||||
$ goto map_loop
|
||||
$MAP_END:
|
||||
$ close/nolog aopt
|
||||
$ close/nolog bopt
|
||||
$ open/append libopt 'p2'
|
||||
$ open/read aopt a.opt
|
||||
$ open/read bopt b.opt
|
||||
$ALOOP:
|
||||
$ read/end=aloop_end aopt line
|
||||
$ write libopt line
|
||||
$ goto aloop
|
||||
$ALOOP_END:
|
||||
$ close/nolog aopt
|
||||
$ sv = ""
|
||||
$BLOOP:
|
||||
$ read/end=bloop_end bopt svn
|
||||
$ if (svn.nes."")
|
||||
$ then
|
||||
$ if (sv.nes."") then write libopt sv
|
||||
$ sv = svn
|
||||
$ endif
|
||||
$ goto bloop
|
||||
$BLOOP_END:
|
||||
$ write libopt f$extract(0,f$length(sv)-2,sv), "-"
|
||||
$ write libopt ")"
|
||||
$ close/nolog bopt
|
||||
$ delete/nolog/noconf a.opt;*,b.opt;*
|
||||
$ else
|
||||
$ if vax
|
||||
$ then
|
||||
$ open/append libopt 'p2'
|
||||
$ mod_sym_num = 1
|
||||
$ VMOD_SYM_LOOP:
|
||||
$ if f$type(module'mod_sym_num') .nes. ""
|
||||
$ then
|
||||
$ mod_in = 0
|
||||
$ VMOD_SYM_IN:
|
||||
$ shared_proc = f$element(mod_in, "#", module'mod_sym_num')
|
||||
$ if shared_proc .nes. "#"
|
||||
$ then
|
||||
$ write libopt f$fao("UNIVERSAL=!AS",-
|
||||
f$edit(shared_proc,"upcase"))
|
||||
$ mod_in = mod_in + 1
|
||||
$ goto vmod_sym_in
|
||||
$ endif
|
||||
$ mod_sym_num = mod_sym_num + 1
|
||||
$ goto vmod_sym_loop
|
||||
$ endif
|
||||
$VMAP_LOOP:
|
||||
$ read/end=vmap_end map line
|
||||
$ if (f$locate("{",line).lt. f$length(line)) .or. -
|
||||
(f$locate("global:", line) .lt. f$length(line))
|
||||
$ then
|
||||
$ proc = true
|
||||
$ goto vmap_loop
|
||||
$ endif
|
||||
$ if f$locate("}",line).lt. f$length(line) then proc = false
|
||||
$ if f$locate("local:", line) .lt. f$length(line) then proc = false
|
||||
$ if proc
|
||||
$ then
|
||||
$ shared_proc = f$edit(line,"collapse")
|
||||
$ chop_semi = f$locate(";", shared_proc)
|
||||
$ if chop_semi .lt. f$length(shared_proc) then -
|
||||
shared_proc = f$extract(0, chop_semi, shared_proc)
|
||||
$ write libopt f$fao("UNIVERSAL=!AS",-
|
||||
f$edit(shared_proc,"upcase"))
|
||||
$ endif
|
||||
$ goto vmap_loop
|
||||
$VMAP_END:
|
||||
$ else
|
||||
$ write sys$output "Unknown Architecture (Not VAX, AXP, or IA64)"
|
||||
$ write sys$output "No options file created"
|
||||
$ endif
|
||||
$ endif
|
||||
$ EXIT_M2S:
|
||||
$ close/nolog map
|
||||
$ close/nolog libopt
|
||||
$ endsubroutine
|
||||
342
samples/DIGITAL Command Language/libxslt_build.com
Normal file
342
samples/DIGITAL Command Language/libxslt_build.com
Normal file
@@ -0,0 +1,342 @@
|
||||
$! BUILD_XSLT.COM
|
||||
$!
|
||||
$! Build the XSLT library
|
||||
$!
|
||||
$! Arguments:
|
||||
$!
|
||||
$! p1 - "DEBUG" is you want to build with debug
|
||||
$!
|
||||
$! This package requires libxml to have already been installed. You need
|
||||
$! to ensure that the logical name LIBXML is defined and points to the
|
||||
$! directory containing libxml's .h files
|
||||
$!
|
||||
$! This procedure creates the object libraries
|
||||
$!
|
||||
$! XML_LIBDIR:LIBXSLT.OLB
|
||||
$! XML_LIBDIR:LIBEXSLT.OLB
|
||||
$!
|
||||
$! and the program
|
||||
$!
|
||||
$! XSLTPROC
|
||||
$!
|
||||
$! After the library is built, you can link these routines into
|
||||
$! your code with the command
|
||||
$!
|
||||
$! LINK your_modules,XML_LIBDIR:LIBEXSLT/LIB,LIBXSLT/LIBRARY,LIBXML/LIB
|
||||
$!
|
||||
$! Change History
|
||||
$! --------------
|
||||
$! Command file author : John A Fotheringham (jaf@jafsoft.com)
|
||||
$! Last update : 2 Nov 2001
|
||||
$!
|
||||
$!- configuration -------------------------------------------------------------
|
||||
$!
|
||||
$!- compile command.
|
||||
$!
|
||||
$ cc_opts = "/INCLUDE=([],XML_SRCDIR:,[-.libxslt])/NAMES=(SHORTENED)/FLOAT=IEEE/IEEE_MODE=DENORM_RESULTS"
|
||||
$!
|
||||
$ if p1.eqs."DEBUG"
|
||||
$ then
|
||||
$ debug = "Y"
|
||||
$ cc_command = "CC''cc_opts'/DEBUG/NOOPTIMIZE/LIST/SHOW=ALL"
|
||||
$ else
|
||||
$ debug = "N"
|
||||
$ cc_command = "CC''cc_opts'"
|
||||
$ endif
|
||||
$!
|
||||
$!- configure multiple build passes for each library. -------------------------
|
||||
$!
|
||||
$! For each pass:
|
||||
$!
|
||||
$! "libname" is the name of the library or module being created
|
||||
$!
|
||||
$! "progname" is the name of the program being created
|
||||
$!
|
||||
$! "src" is the list of sources to be built into the library or program
|
||||
$! - This should be compared to the definition of
|
||||
$! "<NAME>_la_SOURCES" in the MAKEFILE.IN file in
|
||||
$! corresponding directory.
|
||||
$!
|
||||
$ num_passes = 3 ! two libraries and a program
|
||||
$!
|
||||
$!- pass 1 - library LIBXSLT
|
||||
$!
|
||||
$ libname_1 = "LIBXSLT"
|
||||
$ h_file_1 = "xslt.h"
|
||||
$ progname_1 = ""
|
||||
$!
|
||||
$ ! see "libxslt_la_SOURCES" in [.libxslt]makefile.in
|
||||
$ src_1 = "xslt.c xsltutils.c pattern.c templates.c variables.c keys.c"
|
||||
$ src_1 = src_1 + " numbers.c extensions.c extra.c functions.c"
|
||||
$ src_1 = src_1 + " namespaces.c imports.c attributes.c documents.c"
|
||||
$ src_1 = src_1 + " preproc.c transform.c security.c"
|
||||
$!
|
||||
$!- pass 2 - library LIBEXSLT
|
||||
$!
|
||||
$ libname_2 = "LIBEXSLT"
|
||||
$ h_file_2 = "exslt.h"
|
||||
$ progname_2 = ""
|
||||
$!
|
||||
$ ! see "libexslt_la_SOURCES" in [.libexslt]makefile.in
|
||||
$ src_2 = "exslt.c common.c math.c sets.c functions.c strings.c date.c saxon.c dynamic.c"
|
||||
$!
|
||||
$!- pass 3 - program XSLTPROC
|
||||
$!
|
||||
$ libname_3 = ""
|
||||
$ h_file_3 = ""
|
||||
$ progname_3 = "XSLTPROC"
|
||||
$!
|
||||
$ ! see "xsltproc_SOURCES" in [.xsltproc]makefile.in
|
||||
$ src_3 = "xsltproc.c"
|
||||
$!
|
||||
$!- set up and check logicals -----------------------------------------------
|
||||
$!
|
||||
$! XML_LIBDIR - object library directory
|
||||
$! XML_SRCDIR - top-level build directory of libxml package -- needed for config.h and trio.h
|
||||
$! LIBXML - source directory containing .h files for libxml package
|
||||
$!
|
||||
$ if f$trnlnm("XML_LIBDIR").eqs.""
|
||||
$ then
|
||||
$ on error then continue
|
||||
$ globfile = f$search("[--...]libxml.olb")
|
||||
$ if globfile.eqs.""
|
||||
$ then
|
||||
$ write sys$output ""
|
||||
$ write sys$output " You need to define the XML_LIBDIR logical name to"
|
||||
$ write sys$output " point to the directory containing your object"
|
||||
$ write sys$output " libraries. This should already contain LIBXML.OLB"
|
||||
$ write sys$output " from the libxml package, and will be the directory"
|
||||
$ write sys$output " the new LIBXSLT.OLB library will be placed in"
|
||||
$ write sys$output ""
|
||||
$ exit
|
||||
$ else
|
||||
$ srcdir = f$parse(globfile,,,"DEVICE") + f$parse(globfile,,,"DIRECTORY")
|
||||
$ define/process XML_LIBDIR "''srcdir'"
|
||||
$ write sys$output "Defining XML_LIBDIR as ""''srcdir'"""
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$ if f$trnlnm("libxml").eqs.""
|
||||
$ then
|
||||
$ ! look for globals.h in a directory installed paralle to this one
|
||||
$ on error then continue
|
||||
$ globfile = f$search("[--...]globals.h")
|
||||
$ if globfile.eqs.""
|
||||
$ then
|
||||
$ write sys$output ""
|
||||
$ write sys$output " You need to define a LIBXML logical directory to"
|
||||
$ write sys$output " point to the directory containing the .h files"
|
||||
$ write sys$output " for the libxml package"
|
||||
$ write sys$output ""
|
||||
$ exit
|
||||
$ else
|
||||
$ srcdir = f$element(0,"]",globfile)+ "]"
|
||||
$ define/process LIBXML "''srcdir'"
|
||||
$ write sys$output "Defining LIBXML as ""''srcdir'"""
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$ if f$trnlnm("XML_SRCDIR").eqs.""
|
||||
$ then
|
||||
$ globfile = f$search("[--...]globals.c")
|
||||
$ if globfile.eqs.""
|
||||
$ then
|
||||
$ write sys$output "Can't locate globals.c. You need to manually define a XML_SRCDIR logical"
|
||||
$ exit
|
||||
$ else
|
||||
$ srcdir = f$parse(globfile,,,"DEVICE") + f$parse(globfile,,,"DIRECTORY")
|
||||
$ define/process XML_SRCDIR "''srcdir'"
|
||||
$ write sys$output "Defining XML_SRCDIR as ""''srcdir'"""
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$!- set up some working logicals -------------------
|
||||
$!
|
||||
$ pass_no = 1
|
||||
$ set_pass_logical:
|
||||
$!
|
||||
$ if pass_no.le.num_passes
|
||||
$ then
|
||||
$!
|
||||
$ Libname = libname_'pass_no'
|
||||
$ progname = progname_'pass_no'
|
||||
$ if libname.nes.""
|
||||
$ then
|
||||
$ logname = "''libname'_SRCDIR"
|
||||
$ else
|
||||
$ logname = "''progname'_SRCDIR"
|
||||
$ endif
|
||||
$ findfile = f$element(0," ",src_'pass_no')
|
||||
$!
|
||||
$!--- set up a source directory logical
|
||||
$!
|
||||
$ if f$trnlnm("''logname'").eqs.""
|
||||
$ then
|
||||
$ ! look for the target file in a parallel subdirectory
|
||||
$ globfile = f$search("[-...]''findfile'")
|
||||
$ if globfile.eqs.""
|
||||
$ then
|
||||
$ write sys$output "Can't locate ''findfile'. You need to manually define a ''logname' logical"
|
||||
$ exit
|
||||
$ else
|
||||
$ srcdir = f$element(0,"]",globfile)+ "]"
|
||||
$ define/process 'logname' "''srcdir'"
|
||||
$ write sys$output "Defining ''logname' as ""''srcdir'"""
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$!--- if it's a library, set up a logical pointing to the .h files
|
||||
$!
|
||||
$ if libname.nes.""
|
||||
$ then
|
||||
$ if f$trnlnm("''libname'").eqs.""
|
||||
$ then
|
||||
$ ! look for the target .h file in a parallel subdirectory
|
||||
$ h_file = h_file_'pass_no'
|
||||
$ globfile = f$search("[-...]''h_file'")
|
||||
$ if globfile.eqs.""
|
||||
$ then
|
||||
$ write sys$output "Can't locate ''h_file'. You need to manually define a ''libname' logical"
|
||||
$ exit
|
||||
$ else
|
||||
$ includedir = f$element(0,"]",globfile)+ "]"
|
||||
$ define/process 'libname' "''includedir'"
|
||||
$ write sys$output "Defining ''libname' as ""''includedir'"""
|
||||
$ endif
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$ pass_no = pass_no +1
|
||||
$ goto set_pass_logical
|
||||
$!
|
||||
$ endif ! for each pass
|
||||
$!
|
||||
$!- set up error handling (such as it is) -------------------------------------
|
||||
$!
|
||||
$ exit_status = 1
|
||||
$ saved_default = f$environment("default")
|
||||
$ on error then goto ERROR_OUT
|
||||
$ on control_y then goto ERROR_OUT
|
||||
$!
|
||||
$ goto start_here
|
||||
$ start_here: ! move this line to debug/rerun parts of this command file
|
||||
$!
|
||||
$!- compile modules into the library ------------------------------------------
|
||||
$!
|
||||
$!
|
||||
$ pass_no = 1 ! make three passes, one for each library, one for XSLTPROC
|
||||
$ pass_loop:
|
||||
$!
|
||||
$ if pass_no.le.num_passes
|
||||
$ then
|
||||
$ Libname = libname_'pass_no'
|
||||
$ progname = progname_'pass_no'
|
||||
$ if libname.nes.""
|
||||
$ then
|
||||
$ logname = "''libname'_SRCDIR"
|
||||
$ pass_description = "the XML_LIBDIR:''libname'.OLB object library"
|
||||
$ else
|
||||
$ logname = "''progname'_SRCDIR"
|
||||
$ pass_description = "the programs in ''progname'"
|
||||
$ endif
|
||||
$ src = src_'pass_no'
|
||||
$!
|
||||
$!- create the library if need
|
||||
$!
|
||||
$ if libname.nes.""
|
||||
$ then
|
||||
$ if f$search("XML_LIBDIR:''libname'.OLB").eqs.""
|
||||
$ then
|
||||
$ write sys$output "Creating new object library XML_LIBDIR:''libname'.OLB..."
|
||||
$ library/create XML_LIBDIR:'libname'.OLB
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$!- move to the source directory
|
||||
$!
|
||||
$ set def 'logname'
|
||||
$!
|
||||
$!- define the library and link commands (link command not used as is)
|
||||
$!
|
||||
$ if libname.nes.""
|
||||
$ then
|
||||
$ lib_command = "LIBRARY/REPLACE XML_LIBDIR:''libname'.OLB"
|
||||
$ link_command = ""
|
||||
$ else
|
||||
$ lib_command = ""
|
||||
$ link_command = "LINK"
|
||||
$ endif
|
||||
$!
|
||||
$ write sys$output ""
|
||||
$ write sys$output "Building ''pass_description'
|
||||
$ write sys$output ""
|
||||
$!
|
||||
$ s_no = 0
|
||||
$ src = f$edit(src,"COMPRESS")
|
||||
$!
|
||||
$ source_loop:
|
||||
$!
|
||||
$ next_source = f$element (S_no," ",src)
|
||||
$ if next_source.nes."" .and. next_source.nes." "
|
||||
$ then
|
||||
$ call build 'next_source'
|
||||
$ s_no = s_no + 1
|
||||
$ goto source_loop
|
||||
$ endif
|
||||
$!
|
||||
$ pass_no = pass_no + 1
|
||||
$ goto pass_loop
|
||||
$!
|
||||
$ endif ! for each pass
|
||||
$!
|
||||
$!- Th-th-th-th-th-that's all folks! ------------------------------------------
|
||||
$!
|
||||
$EXIT_OUT:
|
||||
$!
|
||||
$ set def 'saved_default
|
||||
$ exit 'exit_status
|
||||
$!
|
||||
$
|
||||
$ERROR_OUT:
|
||||
$ exit_status = $status
|
||||
$ write sys$output "''f$message(exit_status)'"
|
||||
$ goto EXIT_OUT
|
||||
$!
|
||||
$!- the BUILD subroutine. Compile then insert into library or link as required
|
||||
$!
|
||||
$BUILD: subroutine
|
||||
$ on warning then goto EXIT_BUILD
|
||||
$ source_file = p1
|
||||
$ name = f$element(0,".",source_file)
|
||||
$ object_file = f$fao("XML_LIBDIR:!AS.OBJ",name)
|
||||
$!
|
||||
$!- compile
|
||||
$ write sys$output "Compiling ",p1,p2,"..."
|
||||
$ cc_command /object='object_file 'source_file' 'p2'
|
||||
$!
|
||||
$!- insert into library if command defined
|
||||
$!
|
||||
$ if lib_command.nes.""
|
||||
$ then
|
||||
$ lib_command 'object_file'
|
||||
$ delete/nolog 'object_file';*
|
||||
$ endif
|
||||
$!
|
||||
$!- link module if command defined
|
||||
$!
|
||||
$ if link_command.nes.""
|
||||
$ then
|
||||
$ text = f$element(0,".",p1) ! lose the ".c"
|
||||
$ write sys$output "Linking ",text,"..."
|
||||
$ dbgopts = ""
|
||||
$ if debug then dbgopts = "/DEBUG"
|
||||
$ link_command'dbgopts' 'object_file',-
|
||||
XML_LIBDIR:libexslt/lib,-
|
||||
XML_LIBDIR:libxslt/lib,-
|
||||
XML_LIBDIR:libxml/library
|
||||
$ endif
|
||||
$!
|
||||
$EXIT_BUILD:
|
||||
$ exit $status
|
||||
$!
|
||||
$endsubroutine
|
||||
10
samples/DIGITAL Command Language/vmsbackup_build.com
Normal file
10
samples/DIGITAL Command Language/vmsbackup_build.com
Normal file
@@ -0,0 +1,10 @@
|
||||
$! Compiling with VAXC is said to work, but it requires the usual cruft
|
||||
$! (vaxcrtl and all), and to avoid hair we don't supply said cruft here.
|
||||
$ CC/DECC/PREFIX=all VMSBACKUP.C/DEFINE=(HAVE_MT_IOCTLS=0,HAVE_UNIXIO_H=1)
|
||||
$ CC/DECC/PREFIX=all DCLMAIN.C
|
||||
$! Probably we don't want match as it probably doesn't implement VMS-style
|
||||
$! matching, but I haven't looking into the issues yet.
|
||||
$ CC/DECC/PREFIX=all match
|
||||
$ LINK/exe=VMSBACKUP.EXE -
|
||||
vmsbackup.obj,dclmain.obj,match.obj,sys$input/opt
|
||||
identification="VMSBACKUP4.1.1"
|
||||
Reference in New Issue
Block a user