$!-----------------------------------------------------------------'f$verify(0) $! BUILD.COM $! $! Copyright (C) 1996-2021 Mark G.Daniel. $! $! Licensed under the Apache License, Version 2.0 (the "License"); $! you may not use this file except in compliance with the License. $! You may obtain a copy of the License at $! $! http://www.apache.org/licenses/LICENSE-2.0 $! $! Unless required by applicable law or agreed to in writing, software $! distributed under the License is distributed on an "AS IS" BASIS, $! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. $! See the License for the specific language governing permissions and $! limitations under the License. $! $! Prompt for build type and then build the WASD Web Services Package. $! $! If P1 is "SSL" then go into backward-compatibility (pre-8.1) mode just $! building the SSL components of WASD (as @UPDATE SSL used to behave). $! $! If P1 is "SERVER" just build the server executable. $! This will automatically build an SSL version if it finds an SSL kit. $! $! 18-DEC-2020 MGD 3. only compile $! 03-AUG-2017 MGD bugfix; previous build $! 07-FEB-2014 MGD add "SERVER" build $! 07-NOV-2009 MGD v10.0.0, logical naming schema $! 29-DEC-2008 MGD add optional deletion of previous server build $! 30-MAR-2005 MGD add 'host' build option (extension to 'local') $! 03-NOV-2004 MGD add 'local' build option $! 07-DEC-2002 MGD initial (for v8.1) $!----------------------------------------------------------------------------- $! $ IF f$getsyi("ARCH_NAME") .eqs. "VAX" $ then $ write sys$output "VAX no longer supported - it did have a 26 year run!" $ exit 44 $ endif $! $ if f$trnlnm("INSTALL$DBUG") .nes. "" then set verify $! $ ss$_abort = 44 $ ss$_bugcheck = 676 $ say = "write sys$command" $! $ if f$environment("depth") .le. 1 $ then $ type sys$input ***************************** * CANNOT BE USED DIRECTLY * ***************************** This procedure cannot be used directly. Use @[INSTALL]INSTALL.COM or @[INSTALL]UPDATE.COM to build the package. $ exit ss$_abort $ endif $! $ vms_version = f$integer(f$extract(1,1,f$getsyi("version"))) * 10 +- f$integer(f$extract(3,1,f$getsyi("version"))) $ if vms_version .ge. 72 then set process /parse=traditional $ archName = f$edit(f$getsyi("ARCH_NAME"),"UPCASE") $ if archName .eqs. "ALPHA" then archName = "AXP" $ set control=Y $ on controly then exit ss$_abort $! $ if p1 .nes. "SSL" .and. p1 .nes. "SERVER" $ then $ type sys$input ******************* * BUILD PACKAGE * ******************* $ endif $ if p1 .eqs. "SERVER" $ then $ p2 = p1 $ type sys$input ************************* * BUILD SERVER (ONLY) * ************************* $ endif $ if p1 .eqs. "SSL" $ then $! (backward-compatibility in the way SSL used to be built) $ type sys$input *************************** * BUILD SSL EXECUTABLES * *************************** $ endif $ type sys$input Package executables must be built. $ selectBuildLoop: $ type sys$input 0. skip this step 1. compiling from source, then linking 2. linking (separate package) object modules 3. only compile $ response = "" $ read sys$command response /prompt="Select build method [0]: " $ say "" $ number = f$integer(response) $ firstChar = f$edit(f$extract(0,1,response),"upcase") $ if number .ge. 0 .and. number .le. 3 then goto selectBuildLoopEnd $ if firstChar .eqs. "C" .or. firstChar .eqs. "L" .or. - firstChar .eqs. "O" then goto selectBuildLoopEnd $ goto selecBuildLoop $ selectBuildLoopEnd: $! $ if number .eq. 0 then exit $! $ buildType = "" $ if firstChar .eqs. "1" .or. firstChar .eqs. "C" then buildType = "BUILD" $ if firstChar .eqs. "2" .or. firstChar .eqs. "L" then buildType = "LINK" $ if firstChar .eqs. "3" .or. firstChar .eqs. "O" then buildType = "COMPILE" $ if buildType .eqs. "" then exit ss$_bugcheck $! $ if buildType .eqs. "BUILD" .and. archName .nes. "VAX" $ then $ type sys$input ******************* * OPTIMIZATIONS * ******************* By default the server image is built with the VMS version set at a base level of V6.0 and generic compiler optimizations. It is also possible to build it against the currently installed VMS version and with local optimizations. This may provide some performance improvements and/or efficiencies. /OPTIMIZE=(INLINE=AUTO,LEVEL=4,UNROLL=0,TUNE=HOST) In a cluster with a common WASD installation, mixed systems and CPU levels this might result in a functional but less-than-optimal build for some. $ response = "" $ read sys$command response /prompt="Build using local system optimizations? [NO]: " $ say "" $ if response .eqs. "" then response = "NO" $ if f$type(BUILD_HTTPD_LOCAL) .nes. "" - then delete/symbol/global BUILD_HTTPD_LOCAL $ if response then BUILD_HTTPD_LOCAL == 1 $! $ type sys$input Further optimization can be made by the compiler based on the CPU family (i.e. EV4, EV5, EV56, EV6, EV67, etc.). This may provide significant performance improvements and/or efficiencies on later families of CPU. /OPTIMIZE=(INLINE=AUTO,LEVEL=4,UNROLL=0,TUNE=HOST) /ARCHTECTURE=HOST CAUTION: In a cluster with a common WASD installation this might result in a non-functional build for systems with different family or older CPUs. $ response = "" $ read sys$command response /prompt="Build using local host optimizations? [NO]: " $ say "" $ if response .eqs. "" then response = "NO" $ if f$type(BUILD_HTTPD_HOST) .nes. "" - then delete/symbol/global BUILD_HTTPD_HOST $ if response then BUILD_HTTPD_HOST == 1 $! $ endif $! $ if archName .eqs. "VAX" .and. vms_version .lt. 62 $ then $ type sys$input VAX VMS 6.0 and 6.1 do not support the $PERSONA system services. This imposes a restriction on non-server account scripting. A kernel-mode MACRO module can provide sufficient functionality to support non-server account scripting. This module makes a momentary modification to the username in kernel process data structures. Although this approach has been used by a number of tools and applications and has proved quite reliable it is still a mechanism unsupported by the operating system proper and so may have a (potentially) undesirable impact on system integrity. If unsure about the need for non-server account scripting or this topic in general please consult the WASD documentation before proceding. $ response = "" $ read sys$command response /prompt="Build using the PERSONA_MACRO option? [YES]: " $ say "" $ if response .eqs. "" then response = "YES" $ if f$type(BUILD_HTTPD_PERSONA_MACRO) .nes. "" - then delete/symbol/global BUILD_HTTPD_PERSONA_MACRO $ if response then BUILD_HTTPD_PERSONA_MACRO == 1 $ endif $! $!(check for an SSL toolkit, parameter one is only intended to be "SSL") $ @WASD_ROOT:[INSTALL]SSL_DETECT.COM 'p1' $! $ if p1 .eqs. "SSL" .or. p1 .eqs. "SERVER" $ then $ !(this symbol is created by SSL_DETECT.COM) $ if f$type(BUILD_HTTPD_SSL) .nes. "" $ then $ type sys$input ************************* * BUILDING SSL SERVER * ************************* $ set default WASD_ROOT:[SRC.HTTPD] $ if buildType .eqs. "BUILD" $ then $ if p2 .eqs. "SERVER" $ then $ @BUILD_HTTPD COMPILE $ else $ @BUILD_HTTPD COMPILE just:SSL $ @BUILD_HTTPD COMPILE just:VERSION $ endif $ say "" $ endif $ @BUILD_HTTPD LINK $! 'f$verify(0) $ say "" $ else $ type sys$input ********************* * BUILDING SERVER * ********************* $ set default WASD_ROOT:[SRC.HTTPD] $ if buildType .eqs. "BUILD" $ then $ @BUILD_HTTPD COMPILE $ say "" $ endif $ @BUILD_HTTPD LINK $! 'f$verify(0) $ say "" $ endif $ else $ type sys$input ************************** * BUILDING EXECUTABLES * ************************** $ set default WASD_ROOT:[SRC] $ @BUILD_ALL 'buildType' $! 'f$verify(0) $ endif $ set default 'currentDefault' $! $ !(this symbol is created by SSL_DETECT.COM) $ if f$type(BUILD_HTTPD_SSL) .nes. "" $ then p1 = "SSL" $ else p1 = p2 $ endif $ $!(build the WASD OpenSSL applications if necessary) $ if p1 .eqs. "SSL" then @WASD_ROOT:[INSTALL]SSL_FINISH.COM LINK $! $!(when building SSL check for non-SSL, when non-SSL check for SSL) $ if p1 .eqs. "SSL" $ then other_image = f$search("WASD_EXE:HTTPD.EXE") $ else other_image = f$search("WASD_EXE:HTTPD_SSL.EXE") $ endif $ if other_image .nes. "" $ then $ type sys$input ********************************* * PREVIOUS SERVER BUILD FOUND * ********************************* $ dirdate = "directory/date" $ if P1 .eqs. "SSL" $ then $ say "When building the SSL server a previous non-SSL build was found." $ other_image = "WASD_EXE:HTTPD.EXE;*" $ dirdate 'other_image' $ else $ say "When building the non-SSL server a previous SSL build was found." $ other_image = "WASD_EXE:HTTPD_SSL.EXE;*" $ dirdate 'other_image' $ endif $ say "" $ say "There is potential confusion in having the two types of server build." $ say "" $ response = "" $ read sys$command response /prompt="Delete previous build? [YES]: " $ say "" $ if response .eqs. "" then response = "YES" $ if response $ then $ delog = "delete/log/noconfirm" $ delog 'other_image' $ say "" $ endif $ endif $! $ type sys$input ******************** * BUILD FINISHED * ******************** $! $!-----------------------------------------------------------------------------