[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108]
[0109]
[0110]
[0111]
[0112]
[0113]
[0114]
[0115]
[0116]
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123]
[0124]
[0125]
[0126]
[0127]
[0128]
[0129]
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149]
[0150]
[0151]
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159]
[0160]
[0161]
[0162]
[0163]
[0164]
[0165]
[0166]
[0167]
[0168]
[0169]
[0170]
[0171]
[0172]
[0173]
[0174]
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181]
[0182]
[0183]
[0184]
[0185]
[0186]
[0187]
[0188]
[0189]
[0190]
[0191]
[0192]
[0193]
[0194]
[0195]
[0196]
[0197]
[0198]
[0199]
[0200]
[0201]
[0202]
[0203]
[0204]
[0205]
[0206]
[0207]
[0208]
[0209]
[0210]
[0211]
[0212]
[0213]
[0214]
[0215]
[0216]
[0217]
[0218]
[0219]
[0220]
[0221]
[0222]
[0223]
[0224]
[0225]
[0226]
[0227]
[0228]
[0229]
[0230]
[0231]
[0232]
[0233]
[0234]
[0235]
[0236]
[0237]
[0238]
[0239]
[0240]
[0241]
[0242]
[0243]
[0244]
[0245]
[0246]
[0247]
[0248]
[0249]
[0250]
[0251]
[0252]
[0253]
[0254]
[0255]
[0256]
[0257]
[0258]
[0259]
[0260]
[0261]
[0262]
[0263]
[0264]
[0265]
[0266]
[0267]
[0268]
[0269]
[0270]
[0271]
[0272]
[0273]
[0274]
[0275]
[0276]
[0277]
[0278]
[0279]
[0280]
[0281]
[0282]
[0283]
[0284]
[0285]
[0286]
[0287]
[0288]
[0289]
[0290]
[0291]
[0292]
[0293]
[0294]
[0295]
[0296]
[0297]
[0298]
[0299]
[0300]
[0301]
$!-----------------------------------------------------------------'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  *
                            ********************

$!
$!-----------------------------------------------------------------------------