OpenVMS Source-Code Demos

BUILD_CALC_CPP

$!===================================================================================
$! title  : build_calc_cpp.com
$! author : Neil Rieck
$! created: 2013-05-27
$! notes  : derived from build.com (for calcclient.c and calcserver by Brett Cameron)
$! target : HP C++ V7.3-009 for OpenVMS Alpha V8.4
$!===================================================================================
$	say :== write sys$output			!
$	soapcpp2 :== $gsoap$root:[bin]soapcpp2.exe	!
$!	set verify					!
$!
$	if P1 .eqs. "" then P1 = "BLANK"
$	if P1 .eqs. "LINK" then goto skip_compile
$!--------------------------------------------------------------
$!	prep with gSOAP tools
$!--------------------------------------------------------------
$	say "-i- PHASE #1 (gsoap tools) ====="
$	say "-i- running tool: soapcpp2 to generate files"
$!	soapcpp2 "-x" "-c" calc.h			! do this for c
$	soapcpp2 "-x" "-i" calc.h			! do this for c++
$! these files should have been just created:
$!		CALC.NSMAP
$!		CALC.WSDL
$!		NS.XSD
$!		SOAPC.CPP
$!		SOAPCALCPROXY.CPP
$!		SOAPCALCPROXY.H
$!		SOAPCALCSERVICE.CPP
$!		SOAPCALCSERVICE.H
$!		SOAPH.H
$!		SOAPSTUB.H
$!--------------------------------------------------------------
$!	complile
$!--------------------------------------------------------------
$	say "-i- PHASE #2 (c++ compiles) ====="
$	fs = "calcclient.cpp"
$	gosub compile
$	fs = "calcserver.cpp"
$	gosub compile
$	fs = "soapc.cpp"
$	gosub compile
$	fs = "soapcalcproxy.cpp"
$	gosub compile
$	fs = "soapcalcservice.cpp"
$	gosub compile
$skip_compile:
$!--------------------------------------------------------------
$!	link
$!--------------------------------------------------------------
$	say "-i- PHASE #3 (linking client modules) ====="
$	say "-i- linking client files"
$!~~~	cxxlink/log/map calcclient,soapc,soapcalcproxy,sys$input/opt
$	cxxlink         calcclient,soapc,soapcalcproxy,sys$input/opt
		gsoap$root:[lib]gsoapxx.olb/lib
		case_sensitive=YES
$!--------------------------------------------------------------
$	say "-i- PHASE #4 (linking server modules) ====="
$	say "-i- linking server files"
$!~~~	cxxlink/log/map calcserver,soapc,soapcalcservice,sys$input/opt
$	cxxlink         calcserver,soapc,soapcalcservice,sys$input/opt
		gsoap$root:[lib]gsoapxx.olb/lib
		case_sensitive=YES
$!--------------------------------------------------------------
$!	DCL symbols
$!--------------------------------------------------------------
$	say "-i- PHASE #5 (DCL symbols) ====="
$       path == f$environment("DEFAULT")
$	say "-i- creating DCL symbol 'CALCC' for easy client testing"
$       calcc*lient == "$" + path +"calcclient.exe"
$	say "-i- creating DCL symbol 'CALCS' for easy server testing"
$       calcs*erve == "$" + path +"calcserver.exe"
$	exit
$!=============================================================
$!	a common routine for compiling modules
$!=============================================================
$compile:
$	say "-i- compiling: ",fs
$	cxx/names=(as_is,shortened)/prefix=all/float=ieee/ieee=denorm	-
		/using_std/define=(__USE_STD_IOSTREAM)			-
		/include=gsoap$root:[include] 'fs'
$	return