$!----------------------------------------------------------------------------- $! BUILD_WCME.COM $! $! P1 == COMPILE, LINK or BUILD (empty cannot be used) $! P2 == root directory of SSL package; e.g. $! WASD_ROOT:[SRC.OPENSSL-1_0_2K] $! SYS$COMMON:[OPENSSL] $! SYS$COMMON:[SSL1] $! P3 == WCME, ACMEPORT or LIBTLS (optional, defaults to full package) $! $! 15-OCT-2017 MGD add test for logical name WCME_SOCKETPAIR $! 23-APR-2017 MGD initial $!----------------------------------------------------------------------------- $! $ on controly then exit 44 $ say = "write sys$output" $! $ arch_name = f$edit(f$getsyi("arch_name"),"upcase") $ if arch_name .eqs. "ALPHA" then arch_name = "AXP" $! $ p1 = f$edit(p1,"upcase") $ p2 = f$edit(p2,"upcase") $ p3 = f$edit(p3,"upcase") $! $! ******************* $! * P1 build type * $! ******************* $! $ if p1 .nes. "COMPILE" .and. p1 .nes. "LINK" .and. p1 .nes. "BUILD" $ then $ say "P1 must be one of ""COMPILE"", ""BUILD"" or ""LINK""!" $ exit 44 $ endif $! $! ******************** $! * P2 SSL package * $! ******************** $! $ if p2 .eqs. "" $ then $ say "P2 must be the root directory of the SSL package!" $ exit 44 $ endif $! $ ssl_root = f$parse(p2,,,"device","no_conceal") +- f$parse(p2,,,"directory","no_conceal") $ ssl_root = ssl_root - "][" - ".000000]" $ ssl_root = ssl_root - "]" + ".]" $ ssl_root = f$edit(ssl_root,"upcase") $! $ link_options = "" $ if f$locate("SSL1",ssl_root) .lt. f$length(ssl_root) $ then $ link_options = "ssl_1.opt" $ define /process /exec /nolog openssl 'ssl_root'[include] $ define /process /exec /nolog ssllib sys$share $ say "Using HP/VSI SSL1 package" $ endif $ if f$locate("OPENSSL.",ssl_root) .lt. f$length(ssl_root) $ then $ link_options = "ssl_open.opt" $ define /process /exec /nolog openssl 'ssl_root'[include.openssl] $ define /process /exec /nolog ssllib 'ssl_root'[lib.'arch'] $ say "Using OpenSSL (OSSL$..) package" $ endif $ if f$locate("WASD_ROOT.",ssl_root) .lt. f$length(ssl_root) $ then $ arch = f$edit(f$getsyi("arch_name"),"upcase") $ link_options = "ssl_wasd.opt" $ define /process /exec /nolog openssl 'ssl_root'[include.openssl] $ define /process /exec /nolog ssllib 'ssl_root'['arch'.exe.ssl] $ define /process /exec /nolog cryptolib 'ssl_root'['arch'.exe.crypto] $ say "Using WASD OpenSSL package" $ endif $ if link_options .eqs. "" $ then $ say "SSL package and link options could not be determined!" $ exit 44 $ endif $ if f$search("openssl:ssl.h") .eqs. "" $ then $ say "Error in SSL package root directory specification?" $ exit 44 $ endif $! $ define /process /nolog acmeport 'f$parse("[.acme-client-portable-0_1_15]",,,"directory")' $ define /process /nolog libtls 'f$parse("[.libtls-15_6]",,,"directory")' $! $! ****************** $! * P3 component * $! ****************** $! $ if p3 .eqs. "ACMEPORT" .or. (p1 .nes. "LINK" .and. p3 .eqs. "") $ then $ if p1 .eqs. "LINK" then exit $ set default 'f$trnlnm("acmeport")' $ @build_acmeport 'p1' $ set default [src.wcme] $ if p3 .nes. "" then exit $ endif $! $ if p3 .eqs. "LIBTLS" .or. (p1 .nes. "LINK" .and. p3 .eqs. "") $ then $ if p1 .eqs. "LINK" then exit $ set default 'f$trnlnm("libtls")' $ @build_libtls 'p1' $ set default [src.wcme] $ if p3 .nes. "" then exit $ endif $! $! ************* $! * compile * $! ************* $! $ say "" $ say "Building ""WCME"" for ""''f$getsyi("arch_name")'"" architecture" $! $ defines = "/define=(__VMS_VER=70000000,__CRTL_VER=70000000)" $ warnings= " /warning=(disable=(PREOPTW))" $ includes = "" $! $ cc_options = "/decc /optimize /float=ieee /ieee=denorm " +- "/stand=relaxed_ansi /prefix=all" +- includes + defines + warnings $! $ if f$search("obj_''arch_name'.dir") .eqs. "" - then create /dir [.obj_'arch_name'] $ object_dir = "[.obj_''arch_name']" $! $ if p1 .eqs. "" .or. p1 .eqs. "BUILD" .or. p1 .eqs. "COMPILE" $ then $ set noon $ set verify $ cc 'cc_options' /nodebug/object='object_dir' certman $ cc 'cc_options' /nodebug/object='object_dir' http01 $ cc 'cc_options' /nodebug/object='object_dir' overseer $ cc 'cc_options' /nodebug/object='object_dir' report $ cc 'cc_options' /nodebug/object='object_dir' script $ cc 'cc_options' /nodebug/object='object_dir' util $! 'f$verify(0) $ set on $ endif $! $! ********** $! * link * $! ********** $! $ if p1 .eqs. "" .or. p1 .eqs. "BUILD" .or. p1 .eqs. "LINK" $ then $ set noon $ set verify $ link /notrace/executable='object_dir'wcme.exe - [.obj_'arch_name']certman,http01,overseer,report,script,util,- [.acme-client-portable-0_1_15.obj_'arch_name']acctproc,- base64,certproc,chngproc,compat-setresgid,- compat-setresuid,dbg,dnsproc,fileproc,http,json,jsmn,keyproc,- main,netproc,revokeproc,rsa,sandbox-null,util,util-portable,- a_time_tm,arc4random,asprintf,getline,vms,- [.libtls-15_6.obj_'arch_name']tls,tls_bio_cb,tls_client,tls_config,- tls_conninfo,tls_header,tls_ocsp,tls_server,tls_util,tls_verify,- []'link_options'/options $! 'f$verify(0) $ set on $ endif $ purge /nolog 'object_dir' $! $ deassign /process /exec openssl $ deassign /process /exec ssllib $ if f$trnlnm("CRYPTOLIB","LNM$PROCESS") .nes. "" - then deassign /process /exec cryptolib $! $!-----------------------------------------------------------------------------