$!
$! MAKEVMS.COM
$! Original Author: UNKNOWN
$! Rewritten By: Robert Byer
$! Vice-President
$! A-Com Computing, Inc.
$! byer@mail.all-net.net
$!
$! Changes by Richard Levitte <richard@levitte.org>
$! Zoltan Arpadffy <zoli@polarhome.com>
$!
$! This procedure creates the SSL libraries of "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB"
$! "[.xxx.EXE.SSL]LIBSSL.OLB"
$! The "xxx" denotes the machine architecture of ALPHA, IA64 or VAX.
$!
$! This procedures accepts two command line options listed below.
$!
$! Specify one of the following build options for P1.
$!
$! ALL Just build "everything".
$! CONFIG Just build the "[.CRYPTO._xxx]OPENSSLCONF.H" file.
$! BUILDINF Just build the "[.CRYPTO._xxx]BUILDINF.H" file.
$! SOFTLINKS Just fix the Unix soft links.
$! BUILDALL Same as ALL, except CONFIG, BUILDINF and SOFTILNKS aren't done.
$! CRYPTO Just build the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library.
$! CRYPTO/x Just build the x part of the
$! "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" library.
$! SSL Just build the "[.xxx.EXE.SSL]LIBSSL.OLB" library.
$! SSL_TASK Just build the "[.xxx.EXE.SSL]SSL_TASK.EXE" program.
$! TEST Just build the "[.xxx.EXE.TEST]" test programs for OpenSSL.
$! APPS Just build the "[.xxx.EXE.APPS]" application programs for OpenSSL.
$! ENGINES Just build the "[.xxx.EXE.ENGINES]" application programs for OpenSSL.
$!
$!
$! P2 is ignored (it was used to denote if RSAref should be used or not,
$! and is simply kept so surrounding scripts don't get confused)
$!
$! Specify DEBUG or NODEBUG as P3 to compile with or without debugging
$! information.
$!
$! Specify which compiler as P4 to try to compile under.
$!
$! VAXC For VAX C.
$! DECC For DEC C.
$! GNUC For GNU C.
$! LINK To only link the programs from existing object files.
$! (not yet implemented)
$!
$! If you don't specify a compiler, it will try to determine which
$! "C" compiler to use.
$!
$! P5, if defined, sets a TCP/IP library to use, through one of the following
$! keywords:
$!
$! UCX for UCX or UCX emulation
$! TCPIP for TCP/IP Services or TCP/IP Services emulation
$! (this is prefered over UCX)
$! SOCKETSHR for SOCKETSHR+NETLIB
$! NONE to avoid specifying which TCP/IP implementation to
$! use at build time (this works with DEC C). This is
$! the default.
$!
$! P6, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
$!
$!
$ DEF_ORIG = F$ENVIRONMENT( "DEFAULT")
$ ON ERROR THEN GOTO TIDY
$ ON CONTROL_C THEN GOTO TIDY
$!
$! Check if we're in a batch job, and make sure we get to
$! the directory this script is in
$!
$ IF F$MODE() .EQS. "BATCH"
$ THEN
$ COMNAME=F$ENVIRONMENT("PROCEDURE")
$ COMPATH=F$PARSE("A.;",COMNAME) - "A.;"
$ SET DEF 'COMPATH'
$ ENDIF
$!
$! Check What Architecture We Are Using.
$!
$ IF (F$GETSYI("CPU").LT.128)
$ THEN
$!
$! The Architecture Is VAX.
$!
$ ARCH = "VAX"
$!
$! Else...
$!
$ ELSE
$!
$! The Architecture Is Alpha, IA64 or whatever comes in the future.
$!
$ ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
$ IF (ARCH .EQS. "") THEN ARCH = "UNK"
$!
$! End The Architecture Check.
$!
$ ENDIF
$!
$! Get VMS version.
$!
$ VMS_VERSION = f$edit( f$getsyi( "VERSION"), "TRIM")
$!
$! Check To Make Sure We Have Valid Command Line Parameters.
$!
$ GOSUB CHECK_OPTIONS
$!
$! Check To See What We Are To Do.
$!
$ IF (BUILDCOMMAND.EQS."ALL")
$ THEN
$!
$! Start with building the OpenSSL configuration file.
$!
$ GOSUB CONFIG
$!
$! Create The "BUILDINF.H" Include File.
$!
$ GOSUB BUILDINF
$!
$! Fix The Unix Softlinks.
$!
$ GOSUB SOFTLINKS
$!
$ ENDIF
$!
$ IF (BUILDCOMMAND.EQS."ALL".OR.BUILDCOMMAND.EQS."BUILDALL")
$ THEN
$!
$! Build The [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
$!
$ GOSUB CRYPTO
$!
$! Build The [.xxx.EXE.SSL]LIBSSL.OLB Library.
$!
$ GOSUB SSL
$!
$! Build The [.xxx.EXE.SSL]SSL_TASK.EXE DECNet SSL Engine.
$!
$ GOSUB SSL_TASK
$!
$! Build The [.xxx.EXE.TEST] OpenSSL Test Utilities.
$!
$ GOSUB TEST
$!
$! Build The [.xxx.EXE.APPS] OpenSSL Application Utilities.
$!
$ GOSUB APPS
$!
$! Build The [.xxx.EXE.ENGINES] OpenSSL Shareable Engines.
$!
$ GOSUB ENGINES
$!
$! Else...
$!
$ ELSE
$!
$! Build Just What The User Wants Us To Build.
$!
$ GOSUB 'BUILDCOMMAND'
$!
$ ENDIF
$!
$! Time To EXIT.
$!
$ GOTO TIDY
$!
$! Rebuild The [.CRYPTO._xxx]OPENSSLCONF.H" file.
$!
$ CONFIG:
$!
$! Tell The User We Are Creating The [.CRYPTO._xxx]OPENSSLCONF.H File.
$!
$ WRITE SYS$OUTPUT "Creating [.CRYPTO._''ARCH']OPENSSLCONF.H Include File."
$!
$! First, make sure the directory exists.
$!
$ IF F$PARSE("SYS$DISK:[.CRYPTO._''ARCH']") .EQS. "" THEN -
CREATE/DIRECTORY SYS$DISK:[.CRYPTO._'ARCH']
$!
$! Different tar/UnZip versions/option may have named the file differently
$ IF F$SEARCH("[.crypto]opensslconf.h_in") .NES. ""
$ THEN
$ OPENSSLCONF_H_IN = "[.crypto]opensslconf.h_in"
$ ELSE
$ IF F$SEARCH( "[.crypto]opensslconf_h.in") .NES. ""
$ THEN
$ OPENSSLCONF_H_IN = "[.crypto]opensslconf_h.in"
$ ELSE
$ ! For ODS-5
$ IF F$SEARCH( "[.crypto]opensslconf.h.in") .NES. ""
$ THEN
$ OPENSSLCONF_H_IN = "[.crypto]opensslconf.h.in"
$ ELSE
$ WRITE SYS$ERROR "Couldn't find a [.crypto]opensslconf.h.in. Exiting!"
$ $STATUS = %X00018294 ! "%RMS-F-FNF, file not found".
$ GOTO TIDY
$ ENDIF
$ ENDIF
$ ENDIF
$!
$! Create The [.CRYPTO._xxx]OPENSSLCONF.H File.
$! Make sure it has the right format.
$!
$ OSCH_NAME = "SYS$DISK:[.CRYPTO._''ARCH']OPENSSLCONF.H"
$ CREATE /FDL=SYS$INPUT: 'OSCH_NAME'
RECORD
FORMAT stream_lf
$ OPEN /APPEND H_FILE 'OSCH_NAME'
$!
$! Write The [.CRYPTO._xxx]OPENSSLCONF.H File.
$!
$ WRITE H_FILE "/* This file was automatically built using makevms.com */"
$ WRITE H_FILE "/* and ''OPENSSLCONF_H_IN' */"
$!
$! Write a few macros that indicate how this system was built.
$!
$ WRITE H_FILE ""
$ WRITE H_FILE "#ifndef OPENSSL_SYS_VMS"
$ WRITE H_FILE "# define OPENSSL_SYS_VMS"
$ WRITE H_FILE "#endif"
$
$! One of the best way to figure out what the list should be is to do
$! the followin on a Unix system:
$! grep OPENSSL_NO_ crypto/*/*.h ssl/*.h engines/*.h engines/*/*.h|grep ':# *if'|sed -e 's/^.*def //'|sort|uniq
$! For that reason, the list will also always end up in alphabetical order
$ CONFIG_LOGICALS := AES,-
ASM,INLINE_ASM,-
BF,-
BIO,-
BUFFER,-
BUF_FREELISTS,-
CAMELLIA,-
CAST,-
CMS,-
COMP,-
DEPRECATED,-
DES,-
DGRAM,-
DH,-
DSA,-
EC,-
ECDH,-
ECDSA,-
ENGINE,-
ERR,-
EVP,-
FP_API,-
GMP,-
GOST,-
HASH_COMP,-
HMAC,-
IDEA,-
JPAKE,-
KRB5,-
LHASH,-
MD2,-
MD4,-
MD5,-
MDC2,-
OCSP,-
PSK,-
RC2,-
RC4,-
RC5,-
RFC3779,-
RIPEMD,-
RSA,-
SEED,-
SHA,-
SHA0,-
SHA1,-
SHA256,-
SHA512,-
SOCK,-
SSL2,-
STACK,-
STATIC_ENGINE,-
STDIO,-
STORE,-
TLSEXT,-
WHIRLPOOL,-
X509
$! Add a few that we know about
$ CONFIG_LOGICALS := 'CONFIG_LOGICALS',-
THREADS
$! The following rules, which dictate how some algorithm choices affect
$! others, are picked from Configure.
$! Quick syntax:
$! list = item[ ; list]
$! item = algos / dependents
$! algos = algo [, algos]
$! dependents = dependent [, dependents]
$! When a list of algos is specified in one item, it means that they must
$! all be disabled for the rule to apply.
$! When a list of dependents is specified in one item, it means that they
$! will all be di