$!----------------------------------------------------------------------------- $! 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) $! $! 18-DEC-2018 MGD build against OpenSSL 1.1.n (1.1.1) as well as 1.0.2 $! update LIBTLS from 15.6 to 19.2 $! https://github.com/libressl-portable/openbsd/tree/master/src/lib/libtls $! 22-NOV-2018 MGD only allow building against OpenSSL 1.0.2 $! 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") $ if f$locate("OPENSSL-1_1",ssl_root) .lt. f$length(ssl_root) $ then $ link_options = "ssl_wasd_110.opt" $ define /process /exec /nolog openssl 'ssl_root'[include.openssl] $ define /process /exec /nolog ssllib 'ssl_root'[wasd.'arch'] $ define /process /exec /nolog cryptolib 'ssl_root'[wasd.'arch'] $ say "Using WASD OpenSSL 1.1.n package" $ else $ 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 1.0.n package" $ endif $ 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 $! $! if p1 .eqs. "COMPILE" .or. p1 .eqs. "BUILD" $ if 0 $ then $ define /user sys$error nl: $ define /user sys$output nl: $ search openssl:opensslv.h OPENSSL_VERSION_NUMBER,0x10002 /match=and $ if $status .nes. "%X00000001" $ then $ say "Only OpenSSL 1.0.2 can be used to build wCME" $ exit 44 $ endif $ endif $! $ define /process /nolog acmeport 'f$parse("[.acme-client]",,,"directory")' $ define /process /nolog libtls 'f$parse("[.libtls]",,,"directory")' $ show logical *ssl*,*lib* /process $! $! ****************** $! * P3 component * $! ****************** $! $ if p3 .eqs. "ACMECLIENT" .or. (p1 .nes. "LINK" .and. p3 .eqs. "") $ then $ if p1 .eqs. "LINK" then exit $ set default 'f$trnlnm("acmeport")' $ @build_acmeclient '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' asprintf $ cc 'cc_options' /nodebug/object='object_dir' base64 $ 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']asprintf,base64,certman,http01,overseer,report,- script,util,- [.acme-client.obj_'arch_name']acctproc,- base64,certproc,chngproc,dbg,dnsproc,fileproc,http,json,jsmn,- keyproc,main,netproc,revokeproc,rsa,util,a_time_tm,arc4random,- getline,vms,- [.libtls.obj_'arch_name']tls,tls_bio_cb,tls_client,tls_config,- tls_conninfo,tls_header,tls_keypair,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 $! $!-----------------------------------------------------------------------------