$!-----------------------------------------------------------------'f$verify(0) $! BUILD.COM $! $! Copyright (C) 1996-2026 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 "SERVER" just build the server executable. $! This will automatically build an SSL version if it finds an SSL kit. $! $! 31-DEC-2025 MGD couple of "SERVER" bugfixes $! 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. "SERVER" $ then $ type sys$input ******************* * BUILD PACKAGE * ******************* $ endif $ if p1 .eqs. "SERVER" $ then $ p2 = p1 $ type sys$input ************************* * BUILD SERVER (ONLY) * ************************* $ 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. "B" .or. firstChar .eqs. "L" .or. - firstChar .eqs. "C" then goto selectBuildLoopEnd $ goto selecBuildLoop $ selectBuildLoopEnd: $! $ if number .eq. 0 then exit $! $ buildType = "" $ if firstChar .eqs. "1" .or. firstChar .eqs. "B" then buildType = "BUILD" $ if firstChar .eqs. "2" .or. firstChar .eqs. "L" then buildType = "LINK" $ if firstChar .eqs. "3" .or. firstChar .eqs. "C" then buildType = "COMPILE" $ if buildType .eqs. "" then exit ss$_bugcheck $! $ if buildType .eqs. "COMPILE" .or. buildType .eqs. "BUILD" $ then $ type sys$input ******************* * OPTIMIZATIONS * ******************* By default the server image is built with the VMS version set at a base level of V7.0 and generic compiler optimizations, using #define __VMS_VER 70000000 #define __CRTL_VER 70000000 This also the default build of the pre-compiled object modules. 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 VMS version and system optimizations? [YES]: " $ say "" $ if response .eqs. "" then response = "YES" $ 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. This may provide performance improvements and/or efficiencies on some CPUs. /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 $! $ @WASD_ROOT:[INSTALL]SSL_DETECT.COM $ wasd_sslroot = f$trnlnm("WASD_SSLROOT") $! $ if p1 .eqs. "SERVER" $ then $ if wasd_sslroot .eqs. "!" $ then $ type sys$input ********************** * SSL NOT SELECTED * ********************** $ exit 44 $ endif $ if wasd_sslroot .nes. "!" $ then $ type sys$input ************************* * BUILDING SSL SERVER * ************************* $ set default WASD_ROOT:[SRC.HTTPD] $ if buildType .eqs. "BUILD" .or. buildType .eqs. "COMPILE" $ 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" .or. buildType .eqs. "COMPILE" $ 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 logical name is created by SSL_DETECT.COM) $ if wasd_sslroot .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 * ******************** $! $!-----------------------------------------------------------------------------