aboutsummaryrefslogtreecommitdiff
path: root/packages/vms/build_vms.com
diff options
context:
space:
mode:
authorJohn E. Malmberg <wb8tyw@qsl.net>2013-02-04 22:56:44 +0100
committerDaniel Stenberg <daniel@haxx.se>2013-02-05 23:08:57 +0100
commit25f351424b353884bfe36f5e1c7a787b04b46932 (patch)
tree126049f1d76a67003d7fd51e1ad6e17a0b25ef9a /packages/vms/build_vms.com
parentcb3e6dfa3511e75334f70f53370ce3f1d711c904 (diff)
VMS: fix and generate the VMS build config
config_h.com is a new file that generates a config.h file based on the curl_config.h.in file and a quick scan of the configure script. This is actually a generic procedure that is shared with other VMS packages. The existing pre-built config-vms.h had over 100 entries that were not correct and in some cases conflicted with the build options available in the build_vms.com. generate_config_vms_h_curl.com is a helper procedure to the config_h.com. It covers the cases that the generic config_h.com is not able to figure out, and accepts input from the build_vms.com procedure. build_curlbuild_h.com is a new file to generate the curlbuild.h file that Curl is now using when it is using a curl_config.h file. post-config-vms.h is a new file that is needed to provide VMS specific definitions, and most of them need to be set before the system header files are included. The VMS build procedure is fixed: 1. Fixed to link in the correct HP ssl library. 2. Fixed to detect if HP Kerberos is installed. 3. Fixed to detect if HP LDAP is installed. 4. Fixed to detect if gnv$libzshr is installed. 5. Simplified the input parameter parsing to not use a loop. 6. Warn that 64 bit pointer option support is not complete in comments. 7. Default to IEEE floating if platform supports it so resulting libcurl will be compatible with other open source projects on VMS. 8. Default to LARGEFILE if platform supports it. 9. Default to enable SSL, LDAP, Kerberos, libz if the libraries are present. 10. Build with exact case global symbols for libcurl. 11. Generate linker option file needed. 12. Compiler list option only commonly needed items. 13. fulllist option for those who really want it. 14. Create debug symbol file on Alpha, IA64.
Diffstat (limited to 'packages/vms/build_vms.com')
-rw-r--r--packages/vms/build_vms.com585
1 files changed, 438 insertions, 147 deletions
diff --git a/packages/vms/build_vms.com b/packages/vms/build_vms.com
index 276e767d8..ef0ae51fb 100644
--- a/packages/vms/build_vms.com
+++ b/packages/vms/build_vms.com
@@ -18,16 +18,40 @@ $! CLEAN_ALL Delete product files for all host architectures. (No
$! build done.)
$!
$! 64 Compile with 64-bit pointers.
+$! Note, you must match the pointer size that the OpenSSL
+$! shared image expects.
+$! Currently curl is not building properly with 64 bit pointers
+$! on VMS because it is trying to cast pointers to 32 bit
+$! integers.
$! CCQUAL=x Add "x" to the C compiler qualifiers.
-$! DEBUG Compile and link with debug.
-$! IEEE Use IEEE floating point. (Alpha.)
-$! LARGE Enable large-file support. (Non-VAX, VMS >= V7.2.)
-$! LDAP Enable LDAP support.
+$! Default qualifiers are:
+$! /standard=relaxed
+$! /names=(as_is, shortened)
+$! /repository=[.'arch']
+$! /nested_include_directory=none
+$! /define=(_LARGEFILE=1,_USE_STD_STAT=1) (non-vax)
+$! /float=ieee/ieee_mode=denorm_results (non-vax)
+$! DEBUG Compile debug and nooptimize
+$! Alpha/IA64 always compiles /debug.
+$! Always link a debug image.
+$! NOIEEE Do not use IEEE floating point. (Alpha/I64)
+$! VAX must use DFLOAT
+$! NOLARGE Disable large-file support if large file support available.
+$! (Non-VAX, VMS >= V7.2.)
+$! NOLDAP Disable LDAP support if LDAP is available.
+$! NOKERBEROS Disable Kerberos support if Kerberos is available.
$! LIST Create C compiler listings and linker maps.
+$! /list/show=(expan,includ)/machine
+$! FULLLIST Full detailed listing.
+$! /list/show=(all, nomessages)/machine
$! NOHPSSL Don't use HP SSL, even if available.
+$! Note, you must match the pointer size that the OpenSSL
+$! shared image expects. This procedure will select the
+$! correct HP OpenSSL image.
$! NOSSL Don't use any SSL, even if available.
$! OSSLOLB Use OpenSSL object libraries (.OLB), even if shared
$! images (.EXE) are available.
+$! NOZLIB Don't use GNV$ZLIB shared image even if available.
$!
$! DCL Symbols:
$!
@@ -73,7 +97,7 @@ $! Changed to avoid case confusion on ODS5 disks.
$! Added more default dev:[dir] save+restore.
$! Moved remaining "defines.com" code (back) into
$! here, eliminating the hard-coded OpenSSL nonsense.
-$! Changed to use F$GETSYI( "ARCH_NAME") (or
+$! Changed to use F$GETSYI("ARCH_NAME") (or
$! equivalent) to name architecture-specific product
$! file destination directory, and to create the
$! directory if needed (obviating inclusion of these
@@ -84,240 +108,362 @@ $! command across multiple lines to avoid DCL
$! line-too-long problems.
$! Changed "vo_c" messages to show the CC qualifiers
$! once, not with every compile command.
+$! 01-Jan-2013 J. Malmberg
+$! VMS build procedures need to be able to work with
+$! the default set to a search list, with created or
+$! modified files only in the first member of the search
+$! list.
+$! Whitespace change to be more compatible with current
+$! practices.
+$! One pass option parsing instead of loop.
+$! GNV ZLIB shared image support.
+$! KERBEROS support where available.
+$! LDAP default to on where available
+$! LARGEFILE default to on where available
+$! IEEE float default to on where available.
+$! Generate the curl_config.h file from system inspection.
+$! Linker finds ldap with out option file.
+$!
+$!===========================================================================
$!
$!
$! Save the original default dev:[dir], and arrange for its restoration
$! at exit.
-$!
+$!------------------------------------------------------------------------
$ curl = ""
-$ orig_def = f$environment( "DEFAULT")
+$ orig_def = f$environment("DEFAULT")
$ on error then goto Common_Exit
$ on control_y then goto Common_Exit
$!
$ ctrl_y = 1556
-$ proc = f$environment( "PROCEDURE")
-$ proc_dev_dir = -
- f$parse( proc, , , "DEVICE")+ f$parse( proc, , , "DIRECTORY")
+$ proc = f$environment("PROCEDURE")
+$ proc_fid = f$file_attributes(proc, "FID")
+$ proc_dev = f$parse(proc, , , "DEVICE")
+$ proc_dir = f$parse(proc, , , "DIRECTORY")
+$ proc_name = f$parse(proc, , , "NAME")
+$ proc_type = f$parse(proc, , , "TYPE")
+$ proc_dev_dir = proc_dev + proc_dir
+$!
+$! Have to manually parse the device for a search list.
+$! Can not use the f$parse() as it will return the first name
+$! in the search list.
+$!
+$ orig_def_dev = f$element(0, ":", orig_def) + ":"
+$ if orig_def_dev .eqs. "::" then orig_def_dev = "sys$disk:"
+$ test_proc = orig_def_dev + proc_dir + proc_name + proc_type
+$!
+$! If we can find this file using the default directory
+$! then we know that we should use the original device from the
+$! default directory which could be a search list.
+$!
+$ test_proc_fid = f$file_attributes(test_proc, "FID")
+$!
+$ if (test_proc_fid .eq. proc_fid)
+$ then
+$ proc_dev_dir = orig_def_dev + proc_dir
+$ endif
+$!
$!
$! Verbose output message stuff. Define symbol to "write sys$output" or "!".
$! vo_c - verbose output for compile
$! vo_l - link
$! vo_o - object check
$!
-$ vo_c = "write sys$output"
-$ vo_l = "write sys$output"
-$ vo_o = "!"
+$ vo_c := "write sys$output"
+$ vo_l := "write sys$output"
+$ vo_o := "!"
$!
$! Determine the main distribution directory ("[--]") in an
$! ODS5-tolerant (case-insensitive) way. (We do assume that the only
-$! "]" is the one at the end.)
+$! "]" or ">" is the one at the end.)
+$!
+$! Some non-US VMS installations report ">" for the directory delimiter
+$! so do not assume that it is "]".
+$!
+$ orig_def_len = f$length(orig_def)
+$ delim = f$extract(orig_def_len - 1, 1, orig_def)
$!
$ set default 'proc_dev_dir'
$ set default [--]
-$ top_dev_dir = f$environment( "DEFAULT")- "]"
+$ base_dev_dir = f$environment("default")
+$ top_dev_dir = base_dev_dir - delim
+$!
+$!
$!
$! Define the architecture-specific product file destination directory
$! name(s).
$!
-$ if (f$getsyi( "HW_MODEL") .lt. 1024)
+$ if (f$getsyi("HW_MODEL") .lt. 1024)
$ then
$ arch_name = "VAX"
$ else
$ arch_name = ""
-$ arch_name = arch_name+ f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
+$ arch_name = arch_name + f$edit(f$getsyi("ARCH_NAME"), "UPCASE")
$ if (arch_name .eqs. "") then arch_name = "UNK"
$ endif
$!
-$ exedir = proc_dev_dir- "]"+ ".''arch_name']"
+$ exedir = proc_dev_dir - delim + ".''arch_name'" + delim
$ lisdir = exedir
$ objdir = exedir
$!
+$! When building on a search list, need to do a create to make sure that
+$! the output directory exists, since the clean procedure tries to delete
+$! it.
+$ create/dir 'exedir'/prot=o:rwed
+$!
$! Interpret command-line options.
$!
$ hpssl = 0
-$ ldap = 0
+$ ldap = 1
$ list = 0
+$ full_list = 0
$ nohpssl = 0
$ nossl = 0
$ openssl = 0
$ osslolb = 0
+$ nozlib = 0
+$ nokerberos = 0
+$ cc_names = "/names=(shortened, as_is)/repository='exedir'
+$ cc_defs = "HAVE_CONFIG_H=1"
+$ cc_list = "/list='objdir'/show=(expan, includ)/machine
+$ cc_full_list = "list='objdir'/show=(all, nomessages)/machine
+$ link_qual = ""
+$ if arch_name .eqs. "VAX"
+$ then
+$ cc_debug = "/nodebug/optimize"
+$ !cc_defs = cc_defs + ""
+$ cc_float = ""
+$ cc_large = ""
+$ else
+$ cc_debug = "/debug/optimize"
+$ cc_defs = cc_defs + ",_USE_STD_STAT"
+$ cc_float = "/float=ieee/ieee_mode=denorm_results"
+$ cc_large = ",_LARGEFILE"
+$ endif
$ cc_qual1 = ""
$ cc_qual2 = ""
-$ cc_defs = "HAVE_CONFIG_H=1"
-$ if (f$type( CURL_CCDEFS) .nes. "")
+$ if (f$type(CURL_CCDEFS) .nes. "")
$ then
-$ CURL_CCDEFS = f$edit( CURL_CCDEFS, "TRIM")
-$ cc_defs = cc_defs+ ", "+ CURL_CCDEFS
+$ CURL_CCDEFS = f$edit(CURL_CCDEFS, "TRIM")
+$ cc_defs = cc_defs + ", " + CURL_CCDEFS
$ endif
-$ link_qual = ""
$ msg_qual = "/object = ''objdir'"
$ ssl_opt = ""
$!
-$ arg = 1
-$arg_loop:
-$ p = "p''arg'"
-$ arg_val = 'p'
-$ if (arg_val .eqs. "") then goto arg_loop_out
-$ arg_val = f$edit( arg_val, "upcase")
+$! Allow arguments to be grouped together with comma or separated by spaces
+$! Do no know if we will need more than 8.
+$ args = "," + p1 + "," + p2 + "," + p3 + "," + p4 + ","
+$ args = args + p5 + "," + p6 + "," + p7 + "," + p8 + ","
+$!
+$! Provide lower case version to simplify parsing.
+$ args_lower = f$edit(args, "LOWERCASE,COLLAPSE")
+$!
+$ args_len = f$length(args)
+$ args_lower_len = f$length(args_lower)
$!
-$ if (arg_val .eqs. "CLEAN")
+$ if f$locate(",clean,", args_lower) .lt. args_lower_len
$ then
$ prods = "''exedir'*.*;*"
-$ if (f$search( prods) .nes. "") then delete /log 'prods'
-$ prods = proc_dev_dir+ arch_name+ ".DIR;1"
-$ if (f$search( prods) .nes. "") then delete /log 'prods'
+$ if (f$search(prods) .nes. "") then delete /log 'prods'
+$ prods = proc_dev_dir + arch_name + ".DIR;1"
+$ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
+$ if (f$search(prods) .nes. "") then delete /log 'prods'
+$ file = "[]config_vms.h"
+$ if f$search(file) .nes. "" then delete/log 'file';*
+$ file = "[.include.curl]curlbuild.h"
+$ if f$search(file) .nes. "" then delete/log 'file';*
+$ file = "[.lib]config_vms.h"
+$ if f$search(file) .nes. "" then delete/log 'file';*
$ goto Common_Exit
$ endif
$!
-$ if (arg_val .eqs. "CLEAN_ALL")
+$ if f$locate(",clean_all,", args_lower) .lt. args_lower_len
$ then
-$ prods = proc_dev_dir- "]"+ ".ALPHA]*.*;*"
-$ if (f$search( prods) .nes. "") then delete /log 'prods'
-$ prods = proc_dev_dir+ "ALPHA"+ ".DIR;1"
-$ if (f$search( prods) .nes. "") then delete /log 'prods'
-$ prods = proc_dev_dir- "]"+ ".IA64]*.*;*"
-$ if (f$search( prods) .nes. "") then delete /log 'prods'
-$ prods = proc_dev_dir+ "IA64"+ ".DIR;1"
-$ if (f$search( prods) .nes. "") then delete /log 'prods'
-$ prods = proc_dev_dir- "]"+ ".VAX]*.*;*"
-$ if (f$search( prods) .nes. "") then delete /log 'prods'
-$ prods = proc_dev_dir+ "VAX"+ ".DIR;1"
-$ if (f$search( prods) .nes. "") then delete /log 'prods'
+$ prods = proc_dev_dir - delim + ".ALPHA" + delim + "*.*;*"
+$ if (f$search(prods) .nes. "") then delete /log 'prods'
+$ prods = proc_dev_dir + "ALPHA" + ".DIR;1"
+$ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
+$ if (f$search(prods) .nes. "") then delete /log 'prods'
+$ prods = proc_dev_dir - delim + ".IA64" + delim + "*.*;*"
+$ if (f$search(prods) .nes. "") then delete /log 'prods'
+$ prods = proc_dev_dir + "IA64" + ".DIR;1"
+$ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
+$ if (f$search(prods) .nes. "") then delete /log 'prods'
+$ prods = proc_dev_dir - delim + ".VAX" + delim + "*.*;*"
+$ if (f$search(prods) .nes. "") then delete /log 'prods'
+$ prods = proc_dev_dir + "VAX"+ ".DIR;1"
+$ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
+$ if (f$search(prods) .nes. "") then delete /log 'prods'
$ goto Common_Exit
$ endif
$!
-$ if (arg_val .eqs. "64")
+$ build_64 = 0
+$ if f$locate(",64,", args_lower) .lt. args_lower_len
$ then
-$ cc_qual1 = cc_qual1+ " /POINTER = 64"
-$ goto arg_loop_end
+$ cc_qual1 = cc_qual1 + " /POINTER = 64"
+$ build_64 = 1
$ endif
$!
-$ if (f$extract( 0, 6, arg_val) .eqs. "CCQUAL")
+$ args_loc = f$locate(",ccqual=", args_lower)
+$ if args_loc .lt. args_lower_len
$ then
-$ opts = f$edit( arg_val, "COLLAPSE")
-$ eq = f$locate( "=", opts)
-$ cc_qual2 = f$extract( (eq+ 1), 1000, opts)
-$ goto arg_loop_end
+$ arg = f$extract(args_loc + 1, args_lower_len, args_lower)
+$ arg_val = f$element(0, ",", arg)
+$ cc_qual2 = f$element(1, "=", arg_val);
$ endif
$!
-$ if (arg_val .eqs. "DEBUG")
+$! On Alpha/IA64 no size penalty for compiling /debug/optimize
+$! by default.
+$ if f$locate(",debug,", args_lower) .lt. args_lower_len
$ then
-$ cc_qual1 = cc_qual1+ " /debug /nooptimize"
-$ link_qual = link_qual+ " /debug"
+$ cc_debug = "/debug/nooptimize"
$ goto arg_loop_end
$ endif
$!
-$ if (arg_val .eqs. "IEEE")
+$! We normally want IEEE float if it is available. Programs that are
+$! calling libcurl will typically prefer IEEE behavior, unless on the
+$! VAX where we have no choice.
+$!
+$ if f$locate(",noieee,", args_lower) .lt. args_lower_len
$ then
-$ cc_qual1 = cc_qual1+ " /FLOAT = IEEE_FLOAT"
+$ cc_float = ""
$ goto arg_loop_end
$ endif
$!
-$ if (arg_val .eqs. "LARGE")
+$! Normally we want large file if it is available.
+$ if f$locate(",nolarge,", args_lower) .lt. args_lower_len
$ then
-$ if (arch_name .eqs. "VAX")
-$ then
-$ write sys$output """LARGE"" is ignored on VAX."
-$ else
-$ cc_defs = cc_defs+ ", _LARGEFILE=1"
+$ write sys$output "Handling of large files disabled."
+$ cc_large = ""
$ endif
-$ goto arg_loop_end
+$ if cc_large .nes. ""
+$ then
+$ cc_defs = cc_defs + cc_large
$ endif
$!
-$ if (arg_val .eqs. "LDAP")
+$ if f$locate(",noldap,", args_lower) .lt. args_lower_len
$ then
-$ ldap = 1
-$ goto arg_loop_end
+$ ldap = 0
$ endif
$!
-$ if (f$extract( 0, 4, arg_val) .eqs. "LIST")
+$ if f$locate(",list,", args_lower) .lt. args_lower_len
$ then
$ list = 1
-$ cc_qual1 = cc_qual1+ " /list = ''lisdir' /show = (all, nomessages)"
-$ link_qual = link_qual+ " /map = ''lisdir'"
-$ msg_qual = msg_qual+ " /list = ''lisdir'"
-$ goto arg_loop_end
+$ endif
+$ if f$locate(",fulllist,", args_lower) .lt. args_lower_len
+$ then
+$ list = 1
+$ full_list = 1
$ endif
$!
-$ if (arg_val .eqs. "NOHPSSL")
+$ if f$locate(",nohpssl,", args_lower) .lt. args_lower_len
$ then
$ nohpssl = 1
-$ goto arg_loop_end
$ endif
$!
-$ if (arg_val .eqs. "NOSSL")
+$ if f$locate(",nossl,", args_lower) .lt. args_lower_len
$ then
$ nossl = 1
-$ goto arg_loop_end
$ endif
$!
-$ if (arg_val .eqs. "OSSLOLB")
+$ if f$locate(",osslolb,", args_lower) .lt. args_lower_len
$ then
$ osslolb = 1
-$ goto arg_loop_end
$ endif
$!
-$ write sys$output "Unrecognized command-line option: ''arg_val'"
-$ goto Common_Exit
+$ if f$locate(",nozlib,", args_lower) .lt. args_lower_len
+$ then
+$ nozlib = 1
+$ endif
+$!
+$ if f$locate(",nokerberos,", args_lower) .lt. args_lower_len
+$ then
+$ nokerberos = 1
+$ endif
$!
-$arg_loop_end:
-$ arg = arg+ 1
-$ goto arg_loop
-$arg_loop_out:
$!
$! CC /LIST, LINK /MAP, and MESSAGE /LIST are defaults in batch mode,
$! so be explicit when they're not desired.
$!
-$ if (list .eq. 0)
+$
+$ if list .eq. 0
+$ then
+$ cc_qual1 = cc_qual1 + "/nolist"
+$ msg_qual = msg_qual + "/nolist"
+$ else
+$ msg_qual = msg_qual + "/list='objdir'"
+$ if (full_list .ne. 0)
$ then
-$ cc_qual1 = cc_qual1+ " /nolist"
-$ link_qual = link_qual+ " /nomap"
-$ msg_qual = msg_qual+ " /nolist"
+$ cc_qual1 = cc_qual1 + cc_full_list
+$ else
+$ cc_qual1 = cc_qual1 + cc_list
+$ endif
$ endif
+$ cc_qual1 = cc_qual1 + cc_names + cc_float + cc_debug
$!
$! Create product directory, if needed.
$!
-$ if (f$search( proc_dev_dir+ arch_name+ ".DIR;1") .eqs. "")
+$ if (f$search(proc_dev_dir + arch_name + ".DIR;1") .eqs. "")
$ then
$ create /directory 'exedir'
$ endif
$!
$! Detect available (but not prohibited) SSL software.
$!
+$ libsslshr_line = ""
+$ libcryptoshr_line = ""
$ if (.not. nossl)
$ then
-$ if (f$trnlnm( "OPENSSL") .nes. "")
+$ if (f$trnlnm("OPENSSL") .nes. "")
$ then
-$ cc_defs = cc_defs+ ", USE_SSLEAY=1"
-$ if ((f$trnlnm( "SSL$INCLUDE") .nes. "") .and. (.not. nohpssl))
+$! cc_defs = cc_defs + ", USE_SSLEAY=1"
+$ if ((f$trnlnm("SSL$INCLUDE") .nes. "") .and. (.not. nohpssl))
$ then
$! Use HP SSL.
$ hpssl = 1
-$ ssl_opt = ", ''proc_dev_dir'hpssl_"+ -
- f$getsyi("ARCH_NAME")+ ".opt /options"
+$!
+$! Older SSL only has lib*_shr32 images
+$!-----------------------------------------------
+$ libsslshr = "sys$share:ssl$libssl_shr"
+$ if (f$search("''libsslshr'.exe") .eqs. "") .or. (.not. build_64)
+$ then
+$ libsslshr = libsslshr + "32"
+$ endif
+$ libcryptoshr = "sys$share:ssl$libcrypto_shr"
+$ if (f$search("''libcryptoshr'.exe") .eqs. "") .or. (.not. build_64)
+$ then
+$ libcryptoshr = libcryptoshr + "32"
+$ endif
+$ libsslshr_line = "''libsslshr'.exe/share"
+$ libcryptoshr_line = "''libcryptoshr'.exe/share"
$ else
$! Use OpenSSL. Assume object libraries, unless shared images
$! are found (and not prohibited).
+$! TODO: We do not know how to automatically choose based on the
+$! pointer size.
+$!
$ openssl = 1
-$ ssl_opt = ", ssllib:libssl.olb /library"+ -
+$ libsslshr_line = "ssllib:libssl.olb/lib"
+$ libcryptoshr_line = "ssllib:libcrypto.olb/lib"
+$ ssl_opt = ", ssllib:libssl.olb /library" + -
", ssllib:libcrypto.olb /library"
$ if (osslolb .eq. 0)
$ then
- if ((f$search( "ssllib:ssl_libcrypto.exe") .nes. "") .and. -
- (f$search( "ssllib:ssl_libssl.exe") .nes. ""))
+ if ((f$search("ssllib:ssl_libcrypto.exe") .nes. "") .and. -
+ (f$search("ssllib:ssl_libssl.exe") .nes. ""))
$ then
$! OpenSSL shared images with "SSL_xxx.EXE names.
$ openssl = 2
-$ ssl_opt = ", ''proc_dev_dir'openssl_ssl_"+ -
- f$getsyi("ARCH_NAME")+ ".opt /options"
+$ libsslshr_line = "ssllib:ssl_libssl_shr.exe/share"
+$ libcryptoshr_line = "ssllib:ssl_libcrypto_shr.exe/share"
$ else
-$ if ((f$search( "ssllib:libcrypto.exe") .nes. "") .and. -
- (f$search( "ssllib:libssl.exe") .nes. ""))
+$ if ((f$search("ssllib:libcrypto.exe") .nes. "") .and. -
+ (f$search("ssllib:libssl.exe") .nes. ""))
$ then
$! OpenSSL shared images with "xxx.EXE names.
$ openssl = 3
-$ ssl_opt = ", ''proc_dev_dir'openssl_"+ -
- f$getsyi("ARCH_NAME")+ ".opt /options"
+$ libsslshr_line = "ssllib:libssl_shr.exe/share"
+$ libcryptoshr_line = "ssllib:libcrypto_shr.exe/share"
$ endif
$ endif
$ endif
@@ -327,17 +473,56 @@ $ endif
$!
$! LDAP.
$!
+$ if f$search("SYS$SHARE:LDAP$SHR.EXE") .eqs. ""
+$ then
+$ ldap = 0
+$ endif
$ if (ldap .eq. 0)
$ then
-$ cc_defs = cc_defs+ ", CURL_DISABLE_LDAP=1"
+$! cc_defs = cc_defs + ", CURL_DISABLE_LDAP=1"
+$ else
+$ 'vo_c' "%CURL-I-BLDHPLDAP, building with HP LDAP support"
+$ endif
+$!
+$! KERBEROS
+$ gssrtlshr_line = ""
+$ try_shr = "sys$share:gss$rtl"
+$ if f$search("''try_shr'.exe") .eqs. ""
+$ then
+$ nokerberos = 1
+$ endif
+$ curl_sys_krbinc = ""
+$ if nokerberos .eq. 0
+$ then
+$ 'vo_c' "%CURL-I-BLDHPKERBEROS, building with HP KERBEROS support"
+$ curl_sys_krbinc = "sys$sysroot:[kerberos.include]"
+$ gssrtlshr_line = "''try_shr'/share"
+$ endif
+$!
+$!
+$! LIBZ
+$ libzshr_line = ""
+$ try_shr = "gnv$libzshr"
+$ if f$search(try_shr) .eqs. ""
+$ then
+$ nozlib = 1
$ endif
+$ curl_sys_zlibinc = ""
+$ if nozlib .eq. 0
+$ then
+$ 'vo_c' "%CURL-I-BLDGNVLIBZ, building with GNV LIBZ support"
+$ libzshr_line = "''try_shr'/share"
+$ curl_sys_zlibinc = "GNV$ZLIB_INCLUDE:"
+$ endif
+$!
$!
$! Form CC qualifiers.
$!
$ cc_defs = "/define = (''cc_defs')"
-$ cc_qual2 = cc_qual2+ " /object = ''objdir'"+ -
- " /include = ([-.lib], [-.src],"+ -
- " [-.packages.vms], [-.packages.vms.''arch_name'])"
+$ cc_qual2 = cc_qual2 + " /object = ''objdir'"
+$ cc_qual2 = cc_qual2 + " /include = ([-.lib], [-.src],"
+$ cc_qual2 = cc_qual2 + " [-.packages.vms], [-.packages.vms.''arch_name'])"
+$ cc_qual2 = cc_qual2 + "/nested_include_directory=none"
$!
$ 'vo_c' "CC opts:", -
" ''cc_defs'", -
@@ -372,31 +557,34 @@ $ 'vo_c' " EXEDIR = ''exedir'"
$!
$ if (openssl .ne. 0)
$ then
-$ ssllib = f$trnlnm( "ssllib")
+$ ssllib = f$trnlnm("ssllib")
$ if (ssllib .eqs. "")
$ then
$ ssllib = "(undefined)"
$ endif
$ 'vo_c' " SSLLIB = ''ssllib'"
$!
+$! TODO: Why are we translating the logical name?
+$! The logical aname used to find the shared image should just be used
+$! as translating it could result in the wrong location at run time.
$ if (openssl .eq. 1)
$ then
-$ ossl_lib1 = f$trnlnm( "ssllib")+ "LIBSSL.OLB"
-$ ossl_lib2 = f$trnlnm( "ssllib")+ "LIBCRYPTO.OLB"
+$ ossl_lib1 = f$trnlnm("ssllib")+ "LIBSSL.OLB"
+$ ossl_lib2 = f$trnlnm("ssllib")+ "LIBCRYPTO.OLB"
$ msg = "object libraries"
$ else
$ if (openssl .eq. 2)
$ then
-$ ossl_lib1 = f$trnlnm( "ssllib")+ "SSL_LIBSSL.EXE"
-$ ossl_lib2 = f$trnlnm( "ssllib")+ "SSL_LIBCRYPTO.EXE"
+$ ossl_lib1 = f$trnlnm("ssllib")+ "SSL_LIBSSL.EXE"
+$ ossl_lib2 = f$trnlnm("ssllib")+ "SSL_LIBCRYPTO.EXE"
$ else
-$ ossl_lib1 = f$trnlnm( "ssllib")+ "LIBSSL.EXE"
-$ ossl_lib2 = f$trnlnm( "ssllib")+ "LIBCRYPTO.EXE"
+$ ossl_lib1 = f$trnlnm("ssllib")+ "LIBSSL.EXE"
+$ ossl_lib2 = f$trnlnm("ssllib")+ "LIBCRYPTO.EXE"
$ endif
$ msg = "shared images"
$ endif
-$ if ((f$search( ossl_lib1) .eqs. "") .or. -
- (f$search( ossl_lib2) .eqs. ""))
+$ if ((f$search(ossl_lib1) .eqs. "") .or. -
+ (f$search(ossl_lib2) .eqs. ""))
$ then
$ write sys$output "Can't find OpenSSL ''msg':"
$ write sys$output " ''ossl_lib1'"
@@ -407,7 +595,7 @@ $ endif
$!
$! Define the "curl" (process) logical name for "#include <curl/xxx.h>".
$!
-$ curl = f$trnlnm( "curl", "LNM$PROCESS")
+$ curl = f$trnlnm("curl", "LNM$PROCESS")
$ if (curl .nes. "")
$ then
$ write sys$output ""
@@ -422,15 +610,67 @@ $ write sys$output -
$ write sys$output ""
$ goto Common_Exit
$ endif
-$ define curl 'top_dev_dir'.include.curl]
+$ curl_logical = top_dev_dir + ".include.curl" + delim
+$ curl_sys_inc2 = curl_logical
+$ curl_sys_inc1 = top_dev_dir + ".include" + delim
+$! define curl 'top_dev_dir'.include.curl'delim'
+$!
+$! Generate config file into the product directory.
+$!
+$! call MoveIfDiff [.lib]config-vms.h 'objdir'curl_config.h
+$!
+$conf_params = ""
+$if nossl .ne. 0 then conf_params = conf_params + ",nossl"
+$if nohpssl .ne. 0 then conf_params = conf_params + ",nohpssl,"
+$if ldap .eq. 0 then conf_params = conf_params + ",noldap,"
+$if nozlib .ne. 0 then conf_params = conf_params + ",nozlib,"
+$if nokerberos .ne. 0 then conf_params = conf_params + ",nokerberos"
+$conf_params = conf_params - ","
+$!
+$!
+$new_conf = f$search("''objdir'curl_config.h")
+$if new_conf .eqs. ""
+$then
+$! set ver
+$ write sys$output "Generating curl custom config_vms.h"
+$ @'proc_dev_dir'generate_config_vms_h_curl.com ''conf_params'
+$!
+$ write sys$output "Generating curl_config.h"
+$ conf_in = f$search("[.lib]curl_config*.*in")
+$ if conf_in .eqs. ""
+$ then
+$ write sys$output "Can not find [.lib]curl_config*.*in file!"
+$ goto common_exit
+$ endif
+$ @'proc_dev_dir'config_h.com 'conf_in'
+$ copy config.h 'objdir'curl_config.h
+$ delete config.h;
+$! set nover
+$endif
+$!
+$!
+$write sys$output "Creating the new curlbuild.h"
+$new_conf = f$search("[.include.curl]curlbuild.h")
+$if new_conf .eqs. ""
+$then
+$! set ver
+$ @'proc_dev_dir'build_curlbuild_h.com
+$! set nover
+$endif
$!
-$! Copy the VMS-specific config file into the product directory.
-$!
-$ call MoveIfDiff 'top_dev_dir'.lib]config-vms.h 'objdir'curl_config.h
$!
$ on control_y then goto Common_Exit
$!
$ set default 'proc_dev_dir'
+$ sys_inc = "''curl_sys_inc1', ''curl_sys_inc2', ''curl_logical'"
+$ if curl_sys_krbinc .nes. ""
+$ then
+$ sys_inc = sys_inc + ",''curl_sys_krbinc'"
+$ endif
+$ if curl_sys_zlibinc .nes. ""
+$ then
+$ curl_sys_inc = sys_inc + ",''curl_sys_zlibinc'"
+$ endif
$ call build "[--.lib]" "*.c" "''objdir'CURLLIB.OLB" "amigaos, nwlib, nwos"
$ if ($status .eq. ctrl_y) then goto Common_Exit
$ call build "[--.src]" "*.c" "''objdir'CURLSRC.OLB"
@@ -438,8 +678,6 @@ $ if ($status .eq. ctrl_y) then goto Common_Exit
$ call build "[]" "*.msg" "''objdir'CURLSRC.OLB"
$ if ($status .eq. ctrl_y) then goto Common_Exit
$!
-$ ldap_opt = ""
-$ if (ldap .ne. 0) then ldap_opt = ", ''proc_dev_dir'ldap.opt /options"
$!
$ if (openssl .ne. 0)
$ then
@@ -458,11 +696,65 @@ $ 'vo_l' "%CURL-I-LINK_NOSSL, linking with NO SSL support"
$ endif
$ endif
$!
-$ link 'link_qual' /executable = 'exedir'CURL.EXE -
- 'objdir'curlsrc.olb /library /include = (main, curlmsg), -
- 'objdir'curllib.olb /library -
- 'ssl_opt' -
- 'ldap_opt'
+$!
+$! GNV helper files for building the test curl binary.
+$!-----------------------------------------------
+$create 'exedir'gnv$curl.opt
+$open/append opt 'exedir'gnv$curl.opt
+$if libzshr_line .nes. "" then write opt libzshr_line
+$if gssrtlshr_line .nes. "" then write opt gssrtlshr_line
+$if libcryptoshr_line .nes. "" then write opt libcryptoshr_line
+$if libsslshr_line .nes. "" then write opt libsslshr_line
+$close opt
+$!
+$!
+$! Create the libcurl
+$!------------------------------------------------------
+$create 'exedir'gnv_libcurl_linker.opt
+$open/append opt 'exedir'gnv_libcurl_linker.opt
+$if libzshr_line .nes. "" then write opt libzshr_line
+$if gssrtlshr_line .nes. "" then write opt gssrtlshr_line
+$if libcryptoshr_line .nes. "" then write opt libcryptoshr_line
+$if libsslshr_line .nes. "" then write opt libsslshr_line
+$close opt
+$!
+$!
+$! If we are not on VAX, then we want the debug symbol table in
+$! a separate file.
+$! VAX needs the tool_main unquoted in uppercase,
+$! Alpha and IA64 need tool_main quoted in exact case.
+$ link_dsf1 = ""
+$ link_dsf2 = ""
+$ tool_main = "tool_main"
+$ if arch_name .nes. "VAX"
+$ then
+$ tool_main = """tool_main"""
+$ link_dsf1 = "/dsf=" + exedir + "CURL.DSF"
+$ link_dsf2 = "/dsf=" + exedir + "CURL_DEBUG.DSF"
+$ endif
+$ if (list .eq. 0)
+$ then
+$ link_map1 = "/nomap"
+$ link_map2 = "/nomap"
+$ else
+$ link_map1 = "/map=" + exedir + "CURL.MAP"
+$ link_map2 = "/map=" + exedir + "CURL_DEBUG.MAP"
+$ endif
+$!
+$!
+$! Make a normal image.
+$ set ver
+$ link 'link_map1' 'link_dsf1' /executable = 'exedir'CURL.EXE -
+ 'objdir'curlsrc.olb /library /include = ('tool_main', curlmsg), -
+ 'objdir'curllib.olb /library, -
+ 'exedir'gnv$curl.opt/opt
+$!
+$! Also make a debug copy.
+$ link/debug 'link_map2' 'link_dsf2' /executable = 'exedir'CURL_DEBUG.EXE -
+ 'objdir'curlsrc.olb /library /include = ('tool_main', curlmsg), -
+ 'objdir'curllib.olb /library, -
+ 'exedir'gnv$curl.opt/opt
+$set nover
$!
$ goto Common_Exit
$!
@@ -471,7 +763,7 @@ $! the directory passed in via P1 and put it in the object library named
$! via P3. Exclude items in P4.
$!
$build: subroutine
-$ build_def = f$environment( "default")
+$ build_def = f$environment("default")
$ on control_y then goto EndLoop ! SS$_CONTROLY
$ sts = 1 ! SS$_NORMAL.
$! set noon
@@ -482,8 +774,8 @@ $ if f$search( p3) .eqs. ""
$ then
$ librarian /create /object 'p3'
$ endif
-$ reject_list__ = ","+ f$edit( p4, "COLLAPSE, UPCASE")+ ","
-$ reject_list___len = f$length( reject_list__)
+$ reject_list__ = "," + f$edit(p4, "COLLAPSE, UPCASE") + ","
+$ reject_list___len = f$length(reject_list__)
$ reset = f$search( "reset", 1)
$Loop:
$ file = f$search( search, 1)
@@ -491,16 +783,16 @@ $ if file .eqs. "" then goto EndLoop
$! Skip a name if it's in the P4 exclusion list.
$ if (p4 .nes. "")
$ then
-$ name__ = ","+ -
- f$edit( f$parse( file, , , "NAME", "SYNTAX_ONLY"), "UPCASE")+ -
+$ name__ = "," + -
+ f$edit(f$parse(file, , , "NAME", "SYNTAX_ONLY"), "UPCASE") + -
","
-$ if (f$locate( name__, reject_list__) .lt. reject_list___len)
+$ if (f$locate(name__, reject_list__) .lt. reject_list___len)
$ then
$ goto Loop
$ endif
$ endif
-$ objfile = f$parse( "''objdir'.OBJ;", file)
-$ obj = f$search( objfile, 2)
+$ objfile = f$parse("''objdir'.OBJ;", file)
+$ obj = f$search(objfile, 2)
$ if (obj .nes. "")
$ then
$ if (f$cvtime(f$file(file,"rdt")) .gts. f$cvtime(f$file(obj,"rdt")))
@@ -540,18 +832,21 @@ $ on control_y then return ctrl_y ! SS$_CONTROLY
$! set noon
$ file = p1
$ qual = p2+ p3+ p4+ p5+ p6+ p7+ p8
-$ typ = f$edit( f$parse( file, , , "TYPE"), "UPCASE") - "."
+$ typ = f$edit(f$parse(file, , , "TYPE"), "UPCASE") - "."
$ if (typ .eqs. "C")
$ then
$ 'vo_c' "CC (opts) ", file
+$ define/user curl 'curl_logical'
+$ if curl_sys_krbinc .nes. "" then define/user gssapi 'curl_sys_krbinc'
+$ define/user decc$system_include 'curl_sys_inc'
$ CC 'cc_defs' -
'cc_qual1' -
'cc_qual2' -
'file'
$ else
-$ cmd_msg = "MESSAGE "+ msg_qual
+$ cmd_msg = "MESSAGE " + msg_qual
$ x = cmd_'typ'
-$ 'vo_c' x," ",file
+$ 'vo_c' x, " ", file
$ 'x' 'file'
$ endif
$ ENDSUBROUTINE ! Compile
@@ -566,7 +861,7 @@ $ define /user_mode sys$error nl:
$ define /user_mode sys$output nl:
$ differences 'p1' 'p2'
$ status = $status
-$ if ( status .ne. %X006C8009) ! if status is not "no diff"
+$ if (status .ne. %X006C8009) ! if status is not "no diff"
$ then
$ copy 'p1' 'p2'
$ purge /nolog 'p2'
@@ -576,8 +871,4 @@ $ ENDSUBROUTINE ! MoveIfDiff
$!
$Common_Exit:
$ set default 'orig_def'
-$ if ((curl .eqs. "") .and. (f$trnlnm( "curl", "LNM$PROCESS") .nes. ""))
-$ then
-$ deassign curl
-$ endif
$ exit