aboutsummaryrefslogtreecommitdiff
path: root/packages/vms
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
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')
-rw-r--r--packages/vms/Makefile.am10
-rw-r--r--packages/vms/build_curlbuild_h.com327
-rw-r--r--packages/vms/build_vms.com585
-rw-r--r--packages/vms/config_h.com2184
-rw-r--r--packages/vms/generate_config_vms_h_curl.com445
-rw-r--r--packages/vms/hpssl_alpha.opt2
-rw-r--r--packages/vms/hpssl_ia64.opt2
-rw-r--r--packages/vms/hpssl_vax.opt2
-rw-r--r--packages/vms/ldap.opt1
-rw-r--r--packages/vms/openssl_alpha.opt2
-rw-r--r--packages/vms/openssl_ia64.opt2
-rw-r--r--packages/vms/openssl_ssl_alpha.opt2
-rw-r--r--packages/vms/openssl_ssl_ia64.opt2
-rw-r--r--packages/vms/openssl_ssl_vax.opt2
-rw-r--r--packages/vms/openssl_vax.opt2
15 files changed, 3394 insertions, 176 deletions
diff --git a/packages/vms/Makefile.am b/packages/vms/Makefile.am
index 848b62741..09f3f68c1 100644
--- a/packages/vms/Makefile.am
+++ b/packages/vms/Makefile.am
@@ -3,14 +3,4 @@ EXTRA_DIST = build_vms.com \
curlmsg.msg \
curlmsg.sdl \
curlmsg_vms.h \
- hpssl_alpha.opt \
- hpssl_ia64.opt \
- hpssl_vax.opt \
- ldap.opt \
- openssl_alpha.opt \
- openssl_ia64.opt \
- openssl_vax.opt \
- openssl_ssl_alpha.opt \
- openssl_ssl_ia64.opt \
- openssl_ssl_vax.opt \
readme
diff --git a/packages/vms/build_curlbuild_h.com b/packages/vms/build_curlbuild_h.com
new file mode 100644
index 000000000..cc74bb26c
--- /dev/null
+++ b/packages/vms/build_curlbuild_h.com
@@ -0,0 +1,327 @@
+$! File: config_h.com
+$!
+$! $Id: config_h.com,v 1.1.1.1 2012/12/02 19:25:21 wb8tyw Exp $
+$!
+$! This procedure attempts to figure out how to build a config.h file
+$! for the current project.
+$!
+$! P1 specifies the config.h.in file or equivalent. If it is not specified
+$! then this procedure will search for several common names of the file.
+$!
+$! The CONFIGURE shell script will be examined for hints and a few symbols
+$! but most of the tests will not produce valid results on OpenVMS. Some
+$! will produce false positives and some will produce false negatives.
+$!
+$! It is easier to just read the config.h_in file and make up tests based
+$! on what is in it!
+$!
+$! This file will create an empty config_vms.h file if one does not exist.
+$! The config_vms.h is intended for manual edits to handle things that
+$! this procedure can not.
+$!
+$! The config_vms.h will be invoked by the resulting config.h file.
+$!
+$! This procedure knows about the DEC C RTL on the system it is on.
+$! Future versions may be handle the GNV, the OpenVMS porting library,
+$! and others.
+$!
+$! This procedure may not guess the options correctly for all architectures,
+$! and is a work in progress.
+$!
+$! Copyright 2011, John Malmberg
+$!
+$! Permission to use, copy, modify, and/or distribute this software for any
+$! purpose with or without fee is hereby granted, provided that the above
+$! copyright notice and this permission notice appear in all copies.
+$!
+$! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+$! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+$! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+$! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+$! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+$! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+$! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+$!
+$! 15-Jan-2001 J. Malmberg Original
+$! 29-Apr-2001 J. Malmberg Also look for config.*in* in a [.include]
+$! subdirectory
+$! 30-Apr-2001 J. Malmberg Update for SAMBA checks
+$! 09-Apr-2005 J. Malmberg Update for RSYNC and large file.
+$! 29-Sep-2011 J. Malmberg Update for Bash 4.2
+$! 01-Mar-2012 J. Malmberg Warn about getcwd(0,0)
+$! 21-Dec-2012 J. Malmberg Update for gawk
+$! 29-Dec-2012 J. Malmberg Update for curl
+$!============================================================================
+$!
+$ss_normal = 1
+$ss_abort = 44
+$ss_control_y = 1556
+$status = ss_normal
+$on control_y then goto control_y
+$on warning then goto general_error
+$!
+$! Some information for writing timestamps to created files
+$!----------------------------------------------------------
+$my_proc = f$environment("PROCEDURE")
+$my_proc_file = f$parse(my_proc,,,"NAME") + f$parse(my_proc,,,"TYPE")
+$tab[0,8] = 9
+$datetime = f$element(0,".",f$cvtime(,"ABSOLUTE","DATETIME"))
+$username = f$edit(f$getjpi("","USERNAME"),"TRIM")
+$!
+$pid = f$getjpi("","PID")
+$tfile1 = "SYS$SCRATCH:config_h_temp1_''pid'.TEMP"
+$dchfile = "SYS$SCRATCH:config_h_decc_''pid'.TEMP"
+$configure_script = "SYS$SCRATCH:configure_script_''pid'.TEMP"
+$!
+$! Get the system type
+$!----------------------
+$arch_type = f$getsyi("arch_type")
+$!
+$!
+$! Write out the header
+$!----------------------
+$gosub write_curlbuild_h_header
+$!
+$!
+$! config.h.in could have at least five different names depending
+$! on how it was transferred to OpenVMS
+$!------------------------------------------------------------------
+$base_curlbuild = "sys$disk:[.include.curl]"
+$if p1 .nes. ""
+$then
+$ cfile = p1
+$else
+$ cfile = f$search("''base_curlbuild'curlbuild.h.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("''base_curlbuild'curlbuild.h_in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("''base_curlbuild'curlbuildh.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("''base_curlbuild'curlbuild__2eh.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("''base_curlbuild'curlbuild.h__2ein")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("''base_curlbuild'curlbuild.h$5nin")
+$ endif
+$ endif
+$ endif
+$ endif
+$ endif
+$endif
+$!
+$if cfile .eqs. ""
+$then
+$ write sys$output "Can not find ''base_curlbuild'curlbuild.h.in"
+$ line_out = "Looked for curlbuild.h.in, curlbuild.h_in, curlbuild.in, "
+$ line_out = line_out + "curlbuild__2eh.in, curlbuild.h__2ein, "
+$ line_out = line_out + "curlbuild.h$5nin"
+$ write/symbol sys$output line_out
+$ goto general_error
+$endif
+$!
+$open/read inf 'cfile'
+$do_comment = 0
+$if_block = 0
+$cfgh_in_loop1:
+$!set nover
+$ read/end=cfgh_in_loop1_end inf line_in
+$ xline = f$edit(line_in,"TRIM,COMPRESS")
+$!
+$! Blank line handling
+$!---------------------
+$ if xline .eqs. ""
+$ then
+$ write tf ""
+$ goto cfgh_in_loop1
+$ endif
+$ xlen = f$length(xline)
+$ key = f$extract(0,2,xline)
+$!
+$! deal with comments by copying exactly
+$!-----------------------------------------
+$ if (do_comment .eq. 1) .or. (key .eqs. "/*")
+$ then
+$ do_comment = 1
+$ write tf line_in
+$ key = f$extract(xlen - 2, 2, xline)
+$ if key .eqs. "*/" then do_comment = 0
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Some quick parsing
+$!----------------------
+$ keyif = f$extract(0,3,xline)
+$ key1 = f$element(0," ",xline)
+$ key2 = f$element(1," ",xline)
+$ key2a = f$element(0,"_",key2)
+$ key2b = f$element(1,"_",key2)
+$ key2_len = f$length(key2)
+$ key2_h = f$extract(key2_len - 2, 2, key2)
+$ key2_t = f$extract(key2_len - 5, 5, key2)
+$ if key2_t .eqs. "_TYPE" then key2_h = "_T"
+$ key64 = 0
+$ if f$locate("64", xline) .lt. xlen then key64 = 1
+$!
+$!write sys$output "xline = ''xline'"
+$!
+$ if key1 .nes. "#undef"
+$ then
+$ write tf line_in
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! All versions of VMS have sys/types.h
+$!----------------------------------------
+$ if (key2 .eqs. "CURL_PULL_SYS_TYPES_H")
+$ then
+$ write tf "#define ''key2' 1"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Most have sys/socket.h
+$!-------------------------
+$ if (key2 .eqs. "CURL_PULL_SYS_SOCKET_H")
+$ then
+$ write tf "#ifdef HAVE_SYS_SOCKET_H"
+$ write tf "#define ''key2' 1"
+$ write tf "#else"
+$ write tf "#undef ''key2'"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! VAX/VMS 7.3 does not have sys/poll.h
+$!----------------------------------------
+$ if (key2 .eqs. "CURL_PULL_SYS_POLL_H")
+$ then
+$ write tf "#ifdef HAVE_POLL_H"
+$ write tf "#define ''key2' 1"
+$ write tf "#else"
+$ write tf "#undef ''key2'"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_SIZEOF_LONG")
+$ then
+$ write tf "#define ''key2' SIZEOF_INT"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_SIZEOF_CURL_SOCKLEN_T")
+$ then
+$ write tf "#define ''key2' SIZEOF_INT"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_TYPEOF_CURL_SOCKLEN_T")
+$ then
+$ write tf "#define ''key2' size_t"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_TYPEOF_CURL_OFF_T")
+$ then
+$ write tf "#define ''key2' off_t"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_FORMAT_CURL_OFF_T")
+$ then
+$ write tf "#if (SIZEOF_OFF_T == 8)"
+$ write tf "#define ''key2' ""lld"""
+$ write tf "#else"
+$ write tf "#define ''key2' ""ld"""
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_FORMAT_CURL_OFF_TU")
+$ then
+$ write tf "#if (SIZEOF_OFF_T == 8)"
+$ write tf "#define ''key2' ""llu"""
+$ write tf "#else"
+$ write tf "#define ''key2' ""lu"""
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_FORMAT_OFF_T")
+$ then
+$ write tf "#if (SIZEOF_OFF_T == 8)"
+$ write tf "#define ''key2' ""%lld"""
+$ write tf "#else"
+$ write tf "#define ''key2' ""%ld"""
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_SIZEOF_CURL_OFF_T")
+$ then
+$ write tf "#define ''key2' SIZEOF_OFF_T"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_SUFFIX_CURL_OFF_T")
+$ then
+$ write tf "#if (SIZEOF_OFF_T == 8)"
+$ write tf "#define ''key2' LL"
+$ write tf "#else"
+$ write tf "#define ''key2' L"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2 .eqs. "CURL_SUFFIX_CURL_OFF_TU")
+$ then
+$ write tf "#if (SIZEOF_OFF_T == 8)"
+$ write tf "#define ''key2' ULL"
+$ write tf "#else"
+$ write tf "#define ''key2' UL"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$!
+$!
+$! If it falls through everything else, comment it out
+$!-----------------------------------------------------
+$ write tf "/* ", xline, " */"
+$ goto cfgh_in_loop1
+$cfgh_in_loop1_end:
+$close inf
+$close tf
+$!
+$! Exit and clean up
+$!--------------------
+$general_error:
+$status = '$status'
+$all_exit:
+$set noon
+$if f$trnlnm("tf","lnm$process",,"SUPERVISOR") .nes. "" then close tf
+$if f$trnlnm("inf","lnm$process",,"SUPERVISOR") .nes. "" then close inf
+$exit 'status'
+$!
+$!
+$control_y:
+$ status = ss_control_y
+$ goto all_exit
+$!
+$!
+$! gosub to write out a documentation header for config.h
+$!----------------------------------------------------------------
+$write_curlbuild_h_header:
+$outfile = "sys$disk:[.include.curl]curlbuild.h"
+$create 'outfile'
+$open/append tf 'outfile'
+$write tf -
+ "/* [.include.curl]curlbuild.h. Generated from curlbuild.h.in by */"
+$write tf -
+ "/* ", my_proc_file, tab, datetime, tab, username, tab, " */"
+$write tf ""
+$return
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
diff --git a/packages/vms/config_h.com b/packages/vms/config_h.com
new file mode 100644
index 000000000..6ec27ea99
--- /dev/null
+++ b/packages/vms/config_h.com
@@ -0,0 +1,2184 @@
+$! File: config_h.com
+$!
+$! $Id: config_h.com,v 1.1.1.1 2012/12/02 19:25:21 wb8tyw Exp $
+$!
+$! This procedure attempts to figure out how to build a config.h file
+$! for the current project.
+$!
+$! P1 specifies the config.h.in file or equivalent. If it is not specified
+$! then this procedure will search for several common names of the file.
+$!
+$! The CONFIGURE shell script will be examined for hints and a few symbols
+$! but most of the tests will not produce valid results on OpenVMS. Some
+$! will produce false positives and some will produce false negatives.
+$!
+$! It is easier to just read the config.h_in file and make up tests based
+$! on what is in it!
+$!
+$! This file will create an empty config_vms.h file if one does not exist.
+$! The config_vms.h is intended for manual edits to handle things that
+$! this procedure can not.
+$!
+$! The config_vms.h will be invoked by the resulting config.h file.
+$!
+$! This procedure knows about the DEC C RTL on the system it is on.
+$! Future versions may be handle the GNV, the OpenVMS porting library,
+$! and others.
+$!
+$! This procedure may not guess the options correctly for all architectures,
+$! and is a work in progress.
+$!
+$! Copyright 2011, John Malmberg
+$!
+$! Permission to use, copy, modify, and/or distribute this software for any
+$! purpose with or without fee is hereby granted, provided that the above
+$! copyright notice and this permission notice appear in all copies.
+$!
+$! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+$! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+$! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+$! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+$! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+$! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+$! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+$!
+$! 15-Jan-2001 J. Malmberg Original
+$! 29-Apr-2001 J. Malmberg Also look for config.*in* in a [.include]
+$! subdirectory
+$! 30-Apr-2001 J. Malmberg Update for SAMBA checks
+$! 09-Apr-2005 J. Malmberg Update for RSYNC and large file.
+$! 29-Sep-2011 J. Malmberg Update for Bash 4.2
+$! 01-Mar-2012 J. Malmberg Warn about getcwd(0,0)
+$! 21-Dec-2012 J. Malmberg Update for gawk
+$! 29-Dec-2012 J. Malmberg Update for curl
+$!============================================================================
+$!
+$ss_normal = 1
+$ss_abort = 44
+$ss_control_y = 1556
+$status = ss_normal
+$on control_y then goto control_y
+$on warning then goto general_error
+$!on warning then set ver
+$!
+$! Some information for writing timestamps to created files
+$!----------------------------------------------------------
+$my_proc = f$environment("PROCEDURE")
+$my_proc_file = f$parse(my_proc,,,"NAME") + f$parse(my_proc,,,"TYPE")
+$tab[0,8] = 9
+$datetime = f$element(0,".",f$cvtime(,"ABSOLUTE","DATETIME"))
+$username = f$edit(f$getjpi("","USERNAME"),"TRIM")
+$!
+$pid = f$getjpi("","PID")
+$tfile1 = "SYS$SCRATCH:config_h_temp1_''pid'.TEMP"
+$dchfile = "SYS$SCRATCH:config_h_decc_''pid'.TEMP"
+$starhfile = "SYS$SCRATCH:config_h_starlet_''pid'.TEMP"
+$configure_script = "SYS$SCRATCH:configure_script_''pid'.TEMP"
+$!
+$! Get the system type
+$!----------------------
+$arch_type = f$getsyi("arch_type")
+$!
+$! Does config_vms.h exist?
+$!-------------------------
+$update_config_vms = 0
+$file = f$search("sys$disk:[]config_vms.h")
+$if file .nes. ""
+$then
+$ write sys$output "Found existing custom file ''file'."
+$else
+$ update_config_vms = 1
+$ write sys$output "Creating new sys$disk:[]config_vms.h for you."
+$ gosub write_config_vms
+$endif
+$!
+$!
+$! On some platforms, DCL search has problems with searching a file
+$! on a NFS mounted volume. So copy it to sys$scratch:
+$!
+$if f$search(configure_script) .nes. "" then delete 'configure_script';*
+$copy sys$disk:[]configure 'configure_script'
+$!
+$ssl_header_dir = "OPENSSL:"
+$if f$trnlnm("OPENSSL") .eqs. ""
+$then
+$ ssl_header_dir = "SSL$INCLUDE:"
+$endif
+$!
+$!
+$! Write out the header
+$!----------------------
+$gosub write_config_h_header
+$!
+$!
+$!
+$! config.h.in could have at least five different names depending
+$! on how it was transferred to OpenVMS
+$!------------------------------------------------------------------
+$if p1 .nes. ""
+$then
+$ cfile = p1
+$else
+$ cfile = f$search("sys$disk:[]config.h.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("sys$disk:[]config.h_in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("sys$disk:[]configh.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("sys$disk:[]config__2eh.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("sys$disk:[]config.h__2ein")
+$ endif
+$ endif
+$ endif
+$ endif
+$endif
+$if f$trnlnm("PRJ_INCLUDE") .nes. ""
+$then
+$ cfile = f$search("PRJ_INCLUDE:config.h.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("PRJ_INCLUDE:config.h_in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("PRJ_INCLUDE:config__2eh.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("PRJ_INCLUDE:config__2eh.in")
+$ if cfile .eqs. ""
+$ then
+$ cfile = f$search("PRJ_INCLUDE:config.h__2ein")
+$ endif
+$ endif
+$ endif
+$ endif
+$endif
+$if cfile .eqs. ""
+$then
+$ write sys$output "Can not find sys$disk:config.h.in"
+$ line_out = "Looked for config.h.in, config.h_in, configh.in, "
+$ line_out = line_out + "config__2eh.in, config.h__2ein"
+$ write/symbol sys$output line_out
+$ if f$trnlnm("PRJ_INCLUDE") .nes. ""
+$ then
+$ write sys$output "Also looked in PRJ_INCLUDE: for these files."
+$ endif
+$!
+$ write tf ""
+$ write tf -
+ " /* Could not find sys$disk:config.h.in */"
+$ write tf -
+ " /* Looked also for config.h_in, configh.in, config__2eh.in, */"
+$ write tf -
+ " /* config.h__2ein */"
+$ if f$trnlnm("PRJ_INCLUDE") .nes. ""
+$ then
+$ write tf -
+ " /* Also looked in PRJ_INCLUDE: for these files. */"
+$ endif
+$ write tf -
+ "/*--------------------------------------------------------------*/
+$ write tf ""
+$ goto write_tail
+$endif
+$!
+$!
+$! Locate the DECC libraries in use
+$!-----------------------------------
+$decc_rtldef = f$parse("decc$rtldef","sys$library:.tlb;0")
+$decc_starletdef = f$parse("sys$starlet_c","sys$library:.tlb;0")
+$decc_shr = f$parse("decc$shr","sys$share:.exe;0")
+$!
+$! Dump the DECC header names into a file
+$!----------------------------------------
+$if f$search(dchfile) .nes. "" then delete 'dchfile';*
+$if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$define/user sys$output 'tfile1'
+$library/list 'decc_rtldef'
+$open/read/error=rtldef_loop1_end tf1 'tfile1'
+$open/write/error=rtldef_loop1_end tf2 'dchfile'
+$rtldef_loop1:
+$ read/end=rtldef_loop1_end tf1 line_in
+$ line_in = f$edit(line_in,"TRIM,COMPRESS")
+$ key1 = f$element(0," ",line_in)
+$ key2 = f$element(1," ",line_in)
+$ if key1 .eqs. " " .or. key1 .eqs. "" then goto rtldef_loop1
+$ if key2 .nes. " " .and. key2 .nes. "" then goto rtldef_loop1
+$ write tf2 "|",key1,"|"
+$ goto rtldef_loop1
+$rtldef_loop1_end:
+$if f$trnlnm("tf1","lnm$process",,"SUPERVISOR") .nes. "" then close tf1
+$if f$trnlnm("tf2","lnm$process",,"SUPERVISOR") .nes. "" then close tf2
+$if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$!
+$! Dump the STARLET header names into a file
+$!----------------------------------------
+$if f$search(starhfile) .nes. "" then delete 'starhfile';*
+$if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$define/user sys$output 'tfile1'
+$library/list 'decc_starletdef'
+$open/read/error=stardef_loop1_end tf1 'tfile1'
+$open/write/error=stardef_loop1_end tf2 'starhfile'
+$stardef_loop1:
+$ read/end=stardef_loop1_end tf1 line_in
+$ line_in = f$edit(line_in,"TRIM,COMPRESS")
+$ key1 = f$element(0," ",line_in)
+$ key2 = f$element(1," ",line_in)
+$ if key1 .eqs. " " .or. key1 .eqs. "" then goto stardef_loop1
+$ if key2 .nes. " " .and. key2 .nes. "" then goto stardef_loop1
+$ write tf2 "|",key1,"|"
+$ goto stardef_loop1
+$stardef_loop1_end:
+$if f$trnlnm("tf1","lnm$process",,"SUPERVISOR") .nes. "" then close tf1
+$if f$trnlnm("tf2","lnm$process",,"SUPERVISOR") .nes. "" then close tf2
+$if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$!
+$!
+$! Now calculate what should be in the file from reading
+$! config.h.in and CONFIGURE.
+$!---------------------------------------------------------------
+$open/read inf 'cfile'
+$do_comment = 0
+$if_block = 0
+$cfgh_in_loop1:
+$!set nover
+$ read/end=cfgh_in_loop1_end inf line_in
+$ xline = f$edit(line_in,"TRIM,COMPRESS")
+$!
+$! Blank line handling
+$!---------------------
+$ if xline .eqs. ""
+$ then
+$ write tf ""
+$ goto cfgh_in_loop1
+$ endif
+$ xlen = f$length(xline)
+$ key = f$extract(0,2,xline)
+$!
+$! deal with comments by copying exactly
+$!-----------------------------------------
+$ if (do_comment .eq. 1) .or. (key .eqs. "/*")
+$ then
+$ do_comment = 1
+$ write tf line_in
+$ key = f$extract(xlen - 2, 2, xline)
+$ if key .eqs. "*/" then do_comment = 0
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Some quick parsing
+$!----------------------
+$ keyif = f$extract(0,3,xline)
+$ key1 = f$element(0," ",xline)
+$ key2 = f$element(1," ",xline)
+$ key2a = f$element(0,"_",key2)
+$ key2b = f$element(1,"_",key2)
+$ key2_len = f$length(key2)
+$ key2_h = f$extract(key2_len - 2, 2, key2)
+$ key2_t = f$extract(key2_len - 5, 5, key2)
+$ if key2_t .eqs. "_TYPE" then key2_h = "_T"
+$ key64 = 0
+$ if f$locate("64", xline) .lt. xlen then key64 = 1
+$!
+$!write sys$output "xline = ''xline'"
+$!
+$! Comment out this section of the ifblock
+$!-----------------------------------------
+$ if if_block .ge. 3
+$ then
+$ write tf "/* ", xline, " */"
+$ if keyif .eqs. "#en" then if_block = 0
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Handle the end of an ifblock
+$!-------------------------------
+$ if keyif .eqs. "#en"
+$ then
+$ write tf xline
+$ if_block = 0
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key1 .eqs. "#ifndef"
+$ then
+$! Manual check for _ALL_SOURCE on AIX error
+$!-----------------------------------------------
+$ if key2 .eqs. "_ALL_SOURCE"
+$ then
+$ write tf "/* ", xline, " */"
+$!
+$! Ignore the rest of the block
+$!--------------------------------------
+$ if_block = 3
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$!
+$! Default action for an #if/#else/#endif
+$!------------------------------------------
+$ if keyif .eqs. "#if" .or. keyif .eqs. "#el"
+$ then
+$ if_block = 1
+$ write tf xline
+$ goto cfgh_in_loop1
+$ endif
+$!
+$!
+$! Process "normal?" stuff
+$!---------------------------
+$ if key1 .eqs. "#undef"
+$ then
+$ key2c = f$element(2, "_", key2)
+$ if (key2c .eqs. "_") .or. (key2c .eqs. "H") then key2c = ""
+$ key2d = f$element(3, "_", key2)
+$ if (key2d .eqs. "_") .or. (key2d .eqs. "H") then key2d = ""
+$ key2e = f$element(4, "_", key2)
+$ if (key2e .eqs. "_") .or. (key2e .eqs. "H") then key2e = ""
+$ if key2d .eqs. "T"
+$ then
+$ if key2e .eqs. "TYPE"
+$ then
+$ key2_h = "_T"
+$ key2d = ""
+$ endif
+$ endif
+$!
+$ double_under = 0
+$!
+$! Process FCNTL directives
+$!-------------------------------------
+$ if (key2b .eqs. "FCNTL") .and. (key2c .eqs. "O") .and. -
+ (key2d .eqs. "NONBLOCK")
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process GETADDRINFO directives
+$!-------------------------------------
+$ if key2 .eqs. "GETADDRINFO_THREADSAFE"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process IOCTL directives
+$!-------------------------------------
+$ if (key2b .eqs. "IOCTL") .and. (key2c .nes. "")
+$ then
+$ if (key2c .eqs. "FIONBIO") .or. (key2c .eqs. "SIOCGIFADDR")
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$!
+$! Manual check for LL on
+$!-----------------------------------------------
+$ if key2 .eqs. "LL"
+$ then
+$ write tf "#ifndef __VAX
+$ write tf "#define HAVE_''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "bool_t"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' short"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "bits16_t"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' short"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "u_bits16_t"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' unsigned short"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "bits32_t"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "u_bits32_t"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' unsigned int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "intmax_t"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#ifdef __VAX"
+$ write tf "#define ''key2' long"
+$ write tf "#else"
+$ write tf "#define ''key2' long long"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "uintmax_t"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#ifdef __VAX"
+$ write tf "#define ''key2' unsigned long"
+$ write tf "#else"
+$ write tf "#define ''key2' unsigned long long"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "socklen_t"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "GETGROUPS_T"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' gid_t"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_SYS_SIGLIST"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 0"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_SYS_ERRLIST"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_STRUCT_DIRENT_D_INO"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_STRUCT_TIMEVAL"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! ! The header files have this information, however
+$! ! The ioctl() call only works on sockets.
+$! if key2 .eqs. "FIONREAD_IN_SYS_IOCTL"
+$! then
+$! write tf "#ifndef ''key2'"
+$! write tf "#define ''key2' 1"
+$! write tf "#endif"
+$! goto cfgh_in_loop1
+$! endif
+$!
+$! ! The header files have this information, however
+$! ! The ioctl() call only works on sockets.
+$! if key2 .eqs. "GWINSZ_IN_SYS_IOCTL"
+$! then
+$! write tf "#ifndef ''key2'"
+$! write tf "#define ''key2' 1"
+$! write tf "#endif"
+$! goto cfgh_in_loop1
+$! endif
+$!
+$! ! The header files have this information, however
+$! ! The ioctl() call only works on sockets.
+$! if key2 .eqs. "STRUCT_WINSIZE_IN_SYS_IOCTL"
+$! then
+$! write tf "#ifndef ''key2'"
+$! write tf "#define ''key2' 0"
+$! write tf "#endif"
+$! goto cfgh_in_loop1
+$! endif
+$!
+$ if key2 .eqs. "HAVE_STRUCT_TM_TM_ZONE"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_TM_ZONE"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_TIMEVAL"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "WEXITSTATUS_OFFSET"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 2"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_GETPW_DECLS"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_CONFSTR"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_PRINTF"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_SBRK"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_STRSIGNAL"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 0"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2a .eqs. "HAVE_DECL_STRTOLD"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 0"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_STRTOIMAX"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 0"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_STRTOL"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_STRTOLL"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_STRTOUL"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_STRTOULL"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_STRTOUMAX"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 0"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "GETPGRP_VOID"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "NAMED_PIPES_MISSING"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "OPENDIR_NOT_ROBUST"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "PGRP_PIPE"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "CAN_REDEFINE_GETENV"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_PRINTF_A_FORMAT"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "CTYPE_NON_ASCII"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_LANGINFO_CODESET"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 0"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! This wants execve() to do this automagically to pass.
+$! if key2 .eqs. "HAVE_HASH_BANG_EXEC"
+$! then
+$! write tf "#ifndef ''key2'"
+$! write tf "#define ''key2' 1"
+$! write tf "#endif"
+$! goto cfgh_in_loop1
+$! endif
+$!
+$ if key2 .eqs. "ICONV_CONST"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2'"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "VOID_SIGHANDLER"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_POSIX_SIGNALS"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "UNUSABLE_RT_SIGNALS"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2a .eqs. "HAVE_DECL_FPURGE"
+$ then
+$ write tf "#ifndef ''key2a'"
+$ write tf "#define ''key2a' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_DECL_SETREGID"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_POSIX_SIGSETJMP"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_LIBDL"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_ENGINE_LOAD_BUILTIN_ENGINES"
+$ then
+$ if f$search("''ssl_header_dir'engine.h") .nes. ""
+$ then
+$ search_key = key2 - "HAVE_"
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$ search/output=nl: 'ssl_header_dir'engine.h 'search_key'
+$ if '$severity' .eq. 1
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ else
+$ write tf "/* #undef ''key2' */"
+$ endif
+$ else
+$ write tf "/* #undef ''key2' */"
+$ endif
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "HAVE_SSL_GET_SHUTDOWN"
+$ then
+$ if f$search("''ssl_header_dir'ssl.h") .nes. ""
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ else
+$ write tf "/* #undef ''key2' */"
+$ endif
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2b .eqs. "RAND" .and. key2c .nes. "" .and. key2d .eqs. ""
+$ then
+$ if (key2c .eqs. "EGD") .or. -
+ (key2c .eqs. "STATUS") .or. -
+ (key2c .eqs. "SCREEN")
+$ then
+$ if f$search("''ssl_header_dir'rand.h") .nes. ""
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ else
+$ write tf "/* #undef ''key2' */"
+$ endif
+$ endif
+$ endif
+$!
+$ if key2 .eqs. "STRCOLL_BROKEN"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2 .eqs. "DUP_BROKEN"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! This is for a test that getcwd(0,0) works.
+$! It does not on VMS.
+$!--------------------------
+$ if key2 .eqs. "GETCWD_BROKEN"
+$ then
+$ write sys$output ""
+$ write sys$output -
+ "%CONFIG_H-I-NONPORT, ''key2' being tested for!"
+$ write sys$output -
+ "-CONFIG_H-I-GETCWD, GETCWD(0,0) does not work on VMS."
+$ write sys$output -
+ "-CONFIG_H-I-GETCWD2, Work around hack probably required."
+$ write sys$output -
+ "-CONFIG_H-I-REVIEW, Manual Code review required!"
+$ if update_config_vms
+$ then
+$ open/append tfcv sys$disk:[]config_vms.h
+$ write tfcv ""
+$ write tfcv -
+ "/* Check config.h for use of ''key2' settings */"
+$ write tfcv ""
+$ close tfcv
+$ endif
+$
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if (key2a .eqs. "HAVE") .or. (key2a .eqs. "STAT") .or. -
+ (key2 .eqs. "ENABLE_IPV6") .or. (key2b .eqs. "LDAP")
+$ then
+$!
+$! Process extra underscores
+$!------------------------------------
+$ if f$locate("HAVE___", key2) .lt. key2_len
+$ then
+$ key2b = "__" + key2d
+$ key2d = ""
+$ double_under = 1
+$ else
+$ if f$locate("HAVE__", key2) .lt. key2_len
+$ then
+$ key2b = "_" + key2c
+$ key2c = ""
+$ double_under = 1
+$ endif
+$ endif
+$!
+$ if (key2_h .eqs. "_H") .or. (key2 .eqs. "ENABLE_IPV6") .or. -
+ (key2b .eqs. "LDAP")
+$ then
+$!
+$! Looking for a header file
+$!---------------------------------------
+$ headf = key2b
+$ if key2c .nes. "" then headf = headf + "_" + key2c
+$ if key2d .nes. "" then headf = headf + "_" + key2d
+$!
+$! (key2b .eqs. "READLINE")
+$!
+$! Some special parsing
+$!------------------------------------------
+$ if (key2b .eqs. "SYS") .or. (key2b .eqs. "ARPA") .or. -
+ (key2b .eqs. "NET") .or. (key2b .eqs. "NETINET")
+$ then
+$ if key2c .nes. ""
+$ then
+$ headf = key2c
+$ if key2d .nes. "" then headf = key2c + "_" + key2d
+$ endif
+$ endif
+$!
+$! And of course what's life with out some special cases
+$!--------------------------------------------------------------------
+$ if key2 .eqs. "ENABLE_IPV6"
+$ then
+$ headf = "in6"
+$ endif
+$!
+$ if key2b .eqs. "LDAP"
+$ then
+$ if (key2 .eqs. "HAVE_LDAP_SSL") .or. -
+ (key2 .eqs. "HAVE_LDAP_URL_PARSE")
+$ then
+$ headf = "ldap"
+$ endif
+$ endif
+$!
+$!
+$ if key2b .eqs. "FILE"
+$ then
+$ write sys$output ""
+$ write sys$output -
+ "%CONFIG_H-I-NONPORT, ''key2' being asked for!"
+$ write sys$output -
+ "-CONFIG_H-I-FILE_OLD, file.h will not be configured as is obsolete!"
+$ write sys$output -
+ "-CONFIG_H_I-FCNTL_NEW, "Expecting fcntl.h to be configured instead!"
+$ write sys$output -
+ "-CONFIG_H_I-FCNTL_CHK, "Unable to verify at this time!"
+$ write sys$output -
+ "-CONFIG_H-I-REVIEW, Manual Code review required!"
+$!
+$ if update_config_vms
+$ then
+$ open/append tfcv sys$disk:[]config_vms.h
+$ write tfcv ""
+$ write tfcv -
+ "/* Check config.h for use of fcntl.h instead of file.h */"
+$ write tfcv ""
+$ close tfcv
+$ endif
+$ endif
+$!
+$! Now look it up in the DEC C RTL
+$!---------------------------------------------
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$ search/output=nl: 'dchfile' |'headf'|/exact
+$ if '$severity' .eq. 1
+$ then
+$ if key64 then write tf "#ifndef __VAX"
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$if p2 .nes. "" then write sys$output "''dchfile' - #define ''key2' 1"
+$ write tf "#endif"
+$ if key64 then write tf "#endif"
+$set nover
+$ goto cfgh_in_loop1
+$ endif
+$!
+$!
+$! Now look it up in the DEC C STARLET_C
+$!---------------------------------------------
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$ search/output=nl: 'starhfile' |'headf'|/exact
+$ if '$severity' .eq. 1
+$ then
+$ if key64 then write tf "#ifndef __VAX"
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$if p2 .nes. "" then write sys$output "''starfile' - #define ''key2' 1"
+$ write tf "#endif"
+$ if key64 then write tf "#endif"
+$set nover
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Now look for OPENSSL headers
+$!---------------------------------------------------------
+$ if key2b .eqs. "OPENSSL"
+$ then
+$ headf = headf - "OPENSSL_"
+$ header = f$search("''ssl_header_dir'''headf'.h")
+$ if header .nes. ""
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$set nover
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$! Now look for Kerberos
+$!------------------------------------------------------------
+$ if key2b .eqs. "GSSAPI"
+$ then
+$ header_dir = "sys$sysroot:[kerberos.include]"
+$ headf = headf - "GSSAPI_"
+$ header = f$search("''header_dir'''headf'.h")
+$ if header .nes. ""
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$set nover
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$set nover
+$ else
+$!
+$! Looking for a routine or a symbol
+$!------------------------------------------------
+$ if key2c .eqs. "MACRO"
+$ then
+$ if (key2b .eqs. "FILE") .or. (key2b .eqs. "DATE") -
+ .or. (key2b .eqs. "LINE") .or. (key2b .eqs. "TIME")
+$ then
+$ write tf "#ifndef HAVE_''key2b'"
+$ write tf "#define HAVE_''key2b' 1"
+$ write tf "#endif"
+$ endif
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Special false tests
+$!-------------------------------------
+$ if double_under
+$ then
+$ if key2b .eqs. "_FCNTL" .or. key2b .eqs. "__FCNTL"
+$ then
+$ write tf "/* #undef HAVE_''key2b' */"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2b .eqs. "_STAT" .or. key2b .eqs. "__STAT"
+$ then
+$ write tf "/* #undef HAVE_''key2b' */"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if key2b .eqs. "_READ" .or. key2b .eqs. "__READ"
+$ then
+$ write tf "/* #undef HAVE_''key2b' */"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$ keysym = key2b
+$ if key2c .nes. "" then keysym = keysym + "_" + key2c
+$ if key2d .nes. "" then keysym = keysym + "_" + key2d
+$ if key2e .nes. "" then keysym = keysym + "_" + key2e
+$!
+$!
+$! Stat structure members
+$!-------------------------------------
+$ if key2b .eqs. "STRUCT"
+$ then
+$ if key2c .eqs. "STAT" .and (key2d .nes. "")
+$ then
+$ key2b = key2b + "_" + key2c + "_" + key2d
+$ key2c = key2e
+$ key2d = ""
+$ key2e = ""
+$ endif
+$ endif
+$ if (key2b .eqs. "ST") .or. (key2b .eqs. "STRUCT_STAT_ST")
+$ then
+$ keysym = "ST" + "_" + key2c
+$ keysym = f$edit(keysym,"LOWERCASE")
+$ endif
+$ if key2a .eqs. "STAT"
+$ then
+$ if (f$locate("STATVFS", key2b) .eq. 0) .and. key2c .eqs. ""
+$ then
+$ keysym = f$edit(key2b, "LOWERCASE")
+$ endif
+$!$ if (key2b .eqs. "STATVFS" .or. key2b .eqs. "STATFS2" -
+$! .or. key2b .eqs. "STATFS3") .and. key2c .nes. ""
+$!
+$ if (key2b .eqs. "STATVFS") .and. key2c .nes. ""
+$ then
+$! Should really verify that the structure
+$! named by key2b actually exists first.
+$!------------------------------------------------------------
+$!
+$! Statvfs structure members
+$!-------------------------------------------------
+$ keysym = "f_" + f$edit(key2c,"LOWERCASE")
+$ endif
+$ endif
+$!
+$! UTMPX structure members
+$!--------------------------------------
+$ if key2b .eqs. "UT" .and. key2c .eqs. "UT"
+$ then
+$ keysym = "ut_" + f$edit(key2d,"LOWERCASE")
+$ endif
+$!
+$ if f$locate("MMAP",key2) .lt. key2_len
+$ then
+$ write sys$output ""
+$ write sys$output -
+ "%CONFIG_H-I-NONPORT, ''key2' being asked for!"
+$ write sys$output -
+ "-CONFIG_H-I-MMAP, MMAP operations only work on STREAM and BINARY files!"
+$ write sys$output -
+ "-CONFIG_H-I-REVIEW, Manual Code review required!"
+$ if update_config_vms
+$ then
+$ open/append tfcv sys$disk:[]config_vms.h
+$ write tfcv ""
+$ write tfcv -
+ "/* Check config.h for use of ''key2' settings */"
+$ write tfcv ""
+$ close tfcv
+$ endif
+$ endif
+$!
+$!
+$ if keysym .eqs. "CRYPT"
+$ then
+$ write sys$output ""
+$ write sys$output -
+ "%CONFIG_H-I-NONPORT, ''key2' being asked for!"
+$ write sys$output -
+ "-CONFIG_H-I-CRYPT, CRYPT operations on the VMS SYSUAF may not work!"
+$ write sys$output -
+ "-CONFIG_H-I-REVIEW, Manual Code review required!"
+$ if update_config_vms
+$ then
+$ open/append tfcv sys$disk:[]config_vms.h
+$ write tfcv ""
+$ write tfcv -
+ "/* Check config.h for use of ''keysym' */"
+$ write tfcv ""
+$ close tfcv
+$ endif
+$ endif
+$!
+$!
+$ if keysym .eqs. "EXECL"
+$ then
+$ write sys$output ""
+$ write sys$output -
+ "%CONFIG_H-I-NONPORT, ''key2' being asked for!"
+$ write sys$output -
+ "-CONFIG_H-I-EXCEL, EXECL configured, Will probably not work."
+$ write sys$output -
+ "-CONFIG_H-I-REVIEW, Manual Code review required!"
+$ if update_config_vms
+$ then
+$ open/append tfcv sys$disk:[]config_vms.h
+$ write tfcv ""
+$ write tfcv -
+ "/* Check config.h for use of ''keysym' */"
+$ write tfcv ""
+$ close tfcv
+$ endif
+$ endif
+$!
+$!
+$! Process if cpp supports ANSI-C stringizing '#' operator
+$!-----------------------------------------------------------------------
+$ if keysym .eqs. "STRINGIZE"
+$ then
+$ write tf "#ifndef HAVE_STRINGIZE"
+$ write tf "#define HAVE_STRINGSIZE 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if keysym .eqs. "VOLATILE"
+$ then
+$ write tf "#ifndef HAVE_VOLATILE"
+$ write tf "#define HAVE_VOLATILE 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if keysym .eqs. "ALLOCA"
+$ then
+$ write tf "#ifndef HAVE_ALLOCA"
+$ write tf "#define HAVE_ALLOCA 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if keysym .eqs. "ERRNO_DECL"
+$ then
+$ write tf "#ifndef HAVE_ERRNO_DECL"
+$ write tf "#define HAVE_ERRNO_DECL 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if keysym .eqs. "LONGLONG"
+$ then
+$ write tf "#ifndef __VAX"
+$ write tf "#pragma message disable longlongtype"
+$ write tf "#ifndef HAVE_LONGLONG"
+$ write tf "#define HAVE_LONGLONG 1"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! May need to test compiler version
+$!-----------------------------------------------
+$ if keysym .eqs. "LONG_LONG"
+$ then
+$ write tf "#ifndef __VAX"
+$ write tf "#pragma message disable longlongtype"
+$ write tf "#ifndef HAVE_LONG_LONG"
+$ write tf "#define HAVE_LONG_LONG 1"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! May need to test compiler version
+$!-----------------------------------------------
+$ if keysym .eqs. "UNSIGNED_LONG_LONG"
+$ then
+$ write tf "#ifndef __VAX"
+$ write tf "#pragma message disable longlongtype"
+$ write tf "#ifndef HAVE_UNSIGNED_LONG_LONG"
+$ write tf "#define HAVE_UNSIGNED_LONG_LONG 1"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! May need to test compiler version
+$!-----------------------------------------------
+$ if keysym .eqs. "UNSIGNED_LONG_LONG_INT"
+$ then
+$ write tf "#ifndef __VAX"
+$ write tf "#pragma message disable longlongtype"
+$ write tf "#ifndef HAVE_UNSIGNED_LONG_LONG_INT"
+$ write tf "#define HAVE_UNSIGNED_LONG_LONG_INT 1"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! May need to test compiler version
+$!-----------------------------------------------
+$ if keysym .eqs. "LONG_DOUBLE"
+$ then
+$ write tf "#ifndef __VAX"
+$ write tf "#pragma message disable longlongtype"
+$ write tf "#ifndef HAVE_LONG_DOUBLE"
+$ write tf "#define HAVE_LONG_DOUBLE 1"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if keysym .eqs. "FCNTL_LOCK"
+$ then
+$ write sys$output -
+ "%CONFIG_H-I-NONPORT, ''key2' being asked for!
+$ write sys$output -
+ "-CONFIG_H-I-REVIEW, Manual Code review required!"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$!
+$! These libraries are provided by the DEC C RTL
+$!-------------------------------------------------------------
+$ if keysym .eqs. "LIBINET" .or. keysym .eqs. "LIBSOCKET"
+$ then
+$ write tf "#ifndef HAVE_''keysym'"
+$ write tf "#define HAVE_''keysym' 1"
+$if p2 .nes. "" then write sys$output "''decc_shr' #define ''keysym' 1"
+$ write tf "#endif
+$ goto cfgh_in_loop1
+$ endif
+$!
+$ if keysym .eqs. "HERRNO" then keysym = "h_errno"
+$ if keysym .eqs. "UTIMBUF" then keysym = "utimbuf"
+$ if key2c .eqs. "STRUCT"
+$ then
+$ keysym = f$edit(key2d,"LOWERCASE")
+$ else
+$ if key2_h .eqs. "_T"
+$ then
+$ if key2_t .eqs. "_TYPE"
+$ then
+$ keysym = f$extract(0, key2_len - 5, key2) - "HAVE_"
+$ endif
+$ keysym = f$edit(keysym,"LOWERCASE")
+$ endif
+$ endif
+$!
+$! Check the DEC C RTL shared image first
+$!------------------------------------------------------
+$ if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$ search/format=nonull/out='tfile1' 'decc_shr' 'keysym'
+$ if '$severity' .eq. 1
+$ then
+$!
+$! Not documented, but from observation
+$!------------------------------------------------------
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$ if arch_type .eq. 3
+$ then
+$ keyterm = "''keysym'<SOH>"
+$ else
+$ if arch_type .eq. 2
+$ then
+$ keyterm = "''keysym'<BS>"
+$ else
+$ keyterm = "''keysym'<STX>"
+$ endif
+$ endif
+$ search/out=nl: 'tfile1' -
+ "$''keyterm'","$g''keyterm'","$__utc_''keyterm'",-
+ "$__utctz_''keyterm'","$__bsd44_''keyterm'","$bsd_''keyterm'",-
+ "$''keysym'decc$","$G''keysym'decc$","$GX''keyterm'"
+$ severity = '$severity'
+$!
+$!
+$! Of course the 64 bit stuff is different
+$!---------------------------------------------------------
+$ if severity .ne. 1 .and. key64
+$ then
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$ search/out=nl: 'tfile1' "$_''keyterm'"
+$! search/out 'tfile1' "$_''keyterm'"
+$ severity = '$severity'
+$ endif
+$!
+$! UNIX compatability routines
+$!---------------------------------------------
+$ if severity .ne. 1
+$ then
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$ search/out=nl: 'tfile1' -
+ "$__unix_''keyterm'","$__vms_''keyterm'","$_posix_''keyterm'"
+$ severity = '$severity'
+$ endif
+$!
+$! Show the result of the search
+$!------------------------------------------------
+$ if 'severity' .eq. 1
+$ then
+$ if key64 then write tf "#ifndef __VAX"
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$if p2 .nes. "" then write sys$output "''decc_shr' #define ''key2' 1"
+$ write tf "#endif"
+$ if key64 then write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$ if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$!
+$! Check the DECC Header files next
+$!----------------------------------------------
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$ search/out=nl: 'decc_rtldef' -
+ "''keysym';", "''keysym'[", "struct ''keysym'"/exact
+$ severity = '$severity'
+$ if severity .eq. 1
+$ then
+$ if key64 then write tf "#ifndef __VAX"
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$if p2 .nes. "" then write sys$output "''decc_rtldef' #define ''key2' 1"
+$ write tf "#endif"
+$ if key64 then write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Check kerberos
+$!--------------------------------------------
+$ if f$search("SYS$SYSROOT:[kerberos]include.dir") .nes. ""
+$ then
+$ test_mit = "SYS$SYSROOT:[kerberos.include]gssapi_krb5.h"
+$ if (key2 .eqs. "HAVE_GSSAPI")
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! This is really do we have the newer MIT Kerberos
+$!----------------------------------------------------------------------
+$ if (key2 .eqs. "HAVE_GSSMIT")
+$ then
+$ if f$search(test_mit) .nes. ""
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ else
+$ write tf "#ifdef ''key2'"
+$ write tf "#undef ''key2'"
+$ endif
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Older MIT looks like Heimdal
+$!------------------------------------------------
+$ if (key2 .eqs. "HAVE_HEIMDAL")
+$ then
+$ if f$search(test_mit) .eqs. ""
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' 1"
+$ else
+$ write tf "#ifdef ''key2'"
+$ write tf "#undef ''key2'"
+$ endif
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$ endif
+$ write tf "/* ", xline, " */"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$!
+$! Process SIZEOF directives found in SAMBA and others
+$!----------------------------------------------------------
+$ if key2a .eqs. "SIZEOF"
+$ then
+$ if key2b .eqs. "INO" .and. key2_h .eqs. "_T"
+$ then
+$ write tf "#ifndef SIZEOF_INO_T"
+$ write tf "#if !__USING_STD_STAT
+$ write tf "#define SIZEOF_INO_T 6"
+$ write tf "#else
+$ write tf "#define SIZEOF_INO_T 8"
+$ write tf "#endif
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "INTMAX" .and. key2_h .eqs. "_T"
+$ then
+$ write tf "#ifndef SIZEOF_INTMAX_T"
+$ write tf "#ifdef __VAX"
+$ write tf "#define SIZEOF_INTMAX_T 4"
+$ write tf "#else"
+$ write tf "#define SIZEOF_INTMAX_T 8"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "OFF" .and. key2_h .eqs. "_T"
+$ then
+$ write tf "#ifndef SIZEOF_OFF_T"
+$ write tf "#if __USE_OFF64_T"
+$ write tf "#define SIZEOF_OFF_T 8"
+$ write tf "#else"
+$ write tf "#define SIZEOF_OFF_T 4"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "CHAR" .and. key2_h .eqs. "_P"
+$ then
+$ write tf "#ifndef SIZEOF_CHAR_P"
+$ write tf "#if __INITIAL_POINTER_SIZE == 64"
+$ write tf "#define SIZEOF_CHAR_P 8"
+$ write tf "#else"
+$ write tf "#define SIZEOF_CHAR_P 4"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "VOIDP"
+$ then
+$ write tf "#ifndef SIZEOF_VOIDP"
+$ write tf "#if __INITIAL_POINTER_SIZE == 64"
+$ write tf "#define SIZEOF_VOIDP 8"
+$ write tf "#else"
+$ write tf "#define SIZEOF_VOIDP 4"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "INT"
+$ then
+$ write tf "#ifndef SIZEOF_INT"
+$ write tf "#define SIZEOF_INT 4"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "SIZE" .and. key2_h .eqs. "_T"
+$ then
+$ write tf "#ifndef SIZEOF_SIZE_T"
+$ write tf "#define SIZEOF_SIZE_T 4"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "TIME" .and. key2_h .eqs. "_T"
+$ then
+$ write tf "#ifndef SIZEOF_TIME_T"
+$ write tf "#define SIZEOF_TIME_T 4"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "DOUBLE"
+$ then
+$ write tf "#ifndef SIZEOF_DOUBLE"
+$ write tf "#define SIZEOF_DOUBLE 8"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "LONG"
+$ then
+$ if key2c .eqs. ""
+$ then
+$ write tf "#ifndef SIZEOF_LONG"
+$ write tf "#define SIZEOF_LONG 4"
+$ write tf "#endif"
+$ else
+$ write tf "#ifndef SIZEOF_LONG_LONG"
+$ write tf "#ifndef __VAX"
+$ write tf "#define SIZEOF_LONG_LONG 8"
+$ write tf "#endif"
+$ write tf "#endif"
+$ endif
+$ goto cfgh_in_loop1
+$ endif
+$ if key2b .eqs. "SHORT"
+$ then
+$ write tf "#ifndef SIZEOF_SHORT"
+$ write tf "#define SIZEOF_SHORT 2"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ write tf "/* ", xline, " */"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process NEED directives
+$!-------------------------------
+$ if key2a .eqs. "NEED"
+$ then
+$ if key2b .eqs. "STRINGS" .and. key2_h .eqs. "_H"
+$ then
+$ write tf "#ifndef NEED_STRINGS_H"
+$ write tf "#define NEED_STRINGS_H 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ write tf "/* ", xline, " */"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process GETHOSTNAME directives
+$!-------------------------------------
+$ if key2 .eqs. "GETHOSTNAME_TYPE_ARG2"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#ifdef _DECC_V4_SOURCE"
+$ write tf "#define ''key2' int"
+$ write tf "#else"
+$ write tf "#define ''key2' size_t"
+$ write tf "#endif"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process GETNAMEINFO directives
+$!-------------------------------------
+$ if key2a .eqs. "GETNAMEINFO"
+$ then
+$ if key2 .eqs. "GETNAMEINFO_QUAL_ARG1"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' const"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG1"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' struct sockaddr *"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG2"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' size_t"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG46"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' size_t"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "GETNAMEINFO_TYPE_ARG7"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$! Process RECV directives
+$!-------------------------------------
+$ if key2a .eqs. "RECV"
+$ then
+$ if key2 .eqs. "RECV_TYPE_ARG1"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECV_TYPE_ARG2"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' void *"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECV_TYPE_ARG3"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' size_t"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECV_TYPE_ARG4"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECV_TYPE_RETV"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$!
+$! Process RECVFROM directives
+$!-------------------------------------
+$ if key2a .eqs. "RECVFROM"
+$ then
+$ if key2 .eqs. "RECVFROM_QUAL_ARG5"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2'"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECVFROM_TYPE_ARG1"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECVFROM_TYPE_ARG2"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' void *"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECVFROM_TYPE_ARG3"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' size_t"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECVFROM_TYPE_ARG4"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECVFROM_TYPE_ARG5"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' struct sockaddr"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECVFROM_TYPE_ARG6"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' unsigned int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "RECVFROM_TYPE_RETV"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$! Process SELECT directives
+$!-------------------------------------
+$ if key2a .eqs. "SELECT"
+$ then
+$ if key2 .eqs. "SELECT_QUAL_ARG5"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' const"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SELECT_TYPE_ARG1"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SELECT_TYPE_ARG2"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' void *"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SELECT_TYPE_ARG234"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' fd_set *"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SELECT_TYPE_ARG5"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' struct timeval *"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SELECT_TYPE_RETV"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$! Process SEND directives
+$!-------------------------------------
+$ if key2a .eqs. "SEND"
+$ then
+$ if key2 .eqs. "SEND_QUAL_ARG2"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' const"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SEND_TYPE_ARG1"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SEND_TYPE_ARG2"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' void *"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SEND_TYPE_ARG3"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' size_t"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SEND_TYPE_ARG4"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ if key2 .eqs. "SEND_TYPE_RETV"
+$ then
+$ write tf "#ifndef ''key2'"
+$ write tf "#define ''key2' int"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$!
+$! Process STATFS directives
+$!-------------------------------
+$! if key2a .eqs. "STATFS"
+$! then
+$! write tf "/* ", xline, " */"
+$! goto cfgh_in_loop1
+$! endif
+$!
+$! Process inline directive
+$!------------------------------
+$ if key2 .eqs. "inline"
+$ then
+$ write tf "#ifndef inline"
+$ write tf "#define inline __inline"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process restrict directive
+$!--------------------------------
+$ if key2 .eqs. "restrict"
+$ then
+$ write tf "#ifndef restrict"
+$ write tf "#define restrict __restrict"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process RETSIGTYPE directive
+$!----------------------------------
+$ if key2 .eqs. "RETSIGTYPE"
+$ then
+$ write tf "#ifndef RETSIGTYPE"
+$ write tf "#define RETSIGTYPE void"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process STDC_HEADERS (SAMBA!)
+$!---------------------------
+$ if key2 .eqs. "STDC_HEADERS"
+$ then
+$ write tf "#ifndef STDC_HEADERS"
+$ write tf "#define STDC_HEADERS 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Process PROTOTYPES directive
+$!-------------------------------------
+$ if key2 .eqs. "PROTOTYPES"
+$ then
+$ write tf "#ifndef PROTOTYPES"
+$ write tf "#define PROTOTYPES 1"
+$ write tf "#endif"
+$ goto cfgh_in_loop1
+$ endif
+$!
+$! Special for SEEKDIR_RETURNS_VOID
+$!---------------------------------------
+$ if key2 .eqs. "SEEKDIR_RETURNS_VOID"
+$ then
+$ write tf "#ifndef SEEKDIR_RETURNS_VOID"
+$ write tf "#define SEEKDIR_RETURNS_VOID 1"
+$ write tf "#endif"
+$ endif
+$!
+$! Unknown - See if CONFIGURE can give a clue for this
+$!----------------------------------------------------------
+$ pflag = 0
+$ set_flag = 0
+$! gproj_name = proj_name - "_VMS" - "-VMS"
+$ if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$ define/user sys$output nl:
+$ define/user sys$error nl:
+$! if f$locate("FILE", key2) .lt. key2_len then pflag = 1
+$! if f$locate("DIR", key2) .eq. key2_len - 3 then pflag = 1
+$! if f$locate("PATH", key2) .eq. key2_len - 4 then pflag = 1
+$!
+$ search/out='tfile1' 'configure_script' "''key2'="/exact
+$ search_sev = '$severity'
+$ if 'search_sev' .eq. 1
+$ then
+$ open/read/err=unknown_cf_rd_error sf 'tfile1'
+$search_file_rd_loop:
+$ read/end=unknown_cf_rd_err sf line_in
+$ line_in = f$edit(line_in, "TRIM")
+$ skey1 = f$element(0,"=",line_in)
+$ if skey1 .eqs. key2
+$ then
+$ skey2 = f$element(1,"=",line_in)
+$ skey2a = f$extract(0,2,skey2)
+$!
+$!
+$! We can not handle assignment to shell symbols.
+$! For now skip them.
+$!------------------------------------------------------------
+$ if f$locate("$", skey2) .lt. f$length(skey2)
+$ then
+$ write tf "/* ", xline, " */"
+$ set_flag = 1
+$ goto found_in_configure
+$ endif
+$!
+$! Keep these two cases separate to make it easier to add
+$! more future intelligence to this routine
+$!----------------------------------------------------------------------
+$ if skey2a .eqs. """`"
+$ then
+$! if pflag .eq. 1
+$! then
+$! write tf "#ifndef ''key2'"
+$! write tf "#define ",key2," """,gproj_name,"_",key2,""""
+$! write tf "#endif"
+$! else
+$! Ignore this for now
+$!------------------------------------------
+$ write tf "/* ", xline, " */"
+$! endif
+$ set_flag = 1
+$ goto found_in_configure
+$ endif
+$ if skey2a .eqs. """$"
+$ then
+$! if pflag .eq. 1
+$! then
+$! write tf "#ifndef ''key2'"
+$! write tf "#define ",key2," """,gproj_name,"_",key2,""""
+$! write tf "#endif"
+$! else
+$! Ignore this for now
+$!-------------------------------------------
+$ write tf "/* ", xline, " */"
+$! endif
+$ set_flag = 1
+$ goto found_in_configure
+$ endif
+$!
+$! Remove multiple layers of quotes if present
+$!----------------------------------------------------------
+$ if f$extract(0, 1, skey2) .eqs. "'"
+$ then
+$ skey2 = skey2 - "'" - "'" - "'" - "'"
+$ endif
+$ if f$extract(0, 1, skey2) .eqs. """"
+$ then
+$ skey2 = skey2 - """" - """" - """" - """"
+$ endif
+$ write tf "#ifndef ''key2'"
+$ if skey2 .eqs. ""
+$ then
+$ write tf "#define ",key2
+$ else
+$! Only quote non-numbers
+$!----------------------------------------
+$ if f$string(skey2+0) .eqs. skey2
+$ then
+$ write tf "#define ",key2," ",skey2
+$ else
+$ write tf "#define ",key2," """,skey2,""""
+$ endif
+$ endif
+$ write tf "#endif"
+$ set_flag = 1
+$ else
+$ goto search_file_rd_loop
+$! if pflag .eq. 1
+$! then
+$! write tf "#ifndef ''key2'"
+$! write tf "#define ",key2," """,gproj_name,"_",key2,""""
+$! write tf "#endif"
+$! set_flag = 1
+$! endif
+$ endif
+$found_in_configure:
+$unknown_cf_rd_err:
+$ if f$trnlnm("sf","lnm$process",,"SUPERVISOR") .nes. ""
+$ then
+$ close sf
+$ endif
+$ if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$ if set_flag .eq. 1 then goto cfgh_in_loop1
+$ endif
+$ endif
+$!
+$!
+$!
+$! If it falls through everything else, comment it out
+$!-----------------------------------------------------
+$ write tf "/* ", xline, " */"
+$ goto cfgh_in_loop1
+$cfgh_in_loop1_end:
+$close inf
+$!
+$!
+$! Write out the tail
+$!--------------------
+$write_tail:
+$gosub write_config_h_tail
+$!
+$! Exit and clean up
+$!--------------------
+$general_error:
+$status = '$status'
+$all_exit:
+$set noon
+$if f$trnlnm("sf","lnm$process",,"SUPERVISOR") .nes. "" then close sf
+$if f$trnlnm("tf","lnm$process",,"SUPERVISOR") .nes. "" then close tf
+$if f$trnlnm("inf","lnm$process",,"SUPERVISOR") .nes. "" then close inf
+$if f$trnlnm("tf1","lnm$process",,"SUPERVISOR") .nes. "" then close tf1
+$if f$trnlnm("tf2","lnm$process",,"SUPERVISOR") .nes. "" then close tf2
+$if f$trnlnm("tfcv","lnm$process",,"SUPERVISOR") .nes. "" then close tfcv
+$if f$type(tfile1) .eqs. "STRING"
+$then
+$ if f$search(tfile1) .nes. "" then delete 'tfile1';*
+$endif
+$if f$type(dchfile) .eqs. "STRING"
+$then
+$ if f$search(dchfile) .nes. "" then delete 'dchfile';*
+$endif
+$if f$type(starhfile) .eqs. "STRING"
+$then
+$ if f$search(starhfile) .nes. "" then delete 'starhfile';*
+$endif
+$if f$type(configure_script) .eqs. "STRING"
+$then
+$ if f$search(configure_script) .nes. "" then delete 'configure_script';*
+$endif
+$exit 'status'
+$!
+$!
+$control_y:
+$ status = ss_control_y
+$ goto all_exit
+$!
+$!
+$!
+$! Gosub to write a new config_vms.h
+$!-----------------------------------
+$write_config_vms:
+$outfile = "sys$disk:[]config_vms.h"
+$create 'outfile'
+$open/append tf 'outfile'
+$write tf "/* File: config_vms.h"
+$write tf "**"
+$write tf "** This file contains the manual edits needed for porting"
+$!write tf "** the ''proj_name' package to OpenVMS.
+$write tf "**"
+$write tf "** Edit this file as needed. The procedure that automatically"
+$write tf "** generated this header stub will not overwrite or make any"
+$write tf "** changes to this file."
+$write tf "**"
+$write tf -
+ "** ", datetime, tab, username, tab, "Generated by ''my_proc_file'"
+$write tf "**"
+$write tf -
+ "**========================================================================*/"
+$write tf ""
+$close tf
+$return
+$!
+$! gosub to write out a documentation header for config.h
+$!----------------------------------------------------------------
+$write_config_h_header:
+$outfile = "sys$disk:[]config.h"
+$create 'outfile'
+$open/append tf 'outfile'
+$write tf "#ifndef CONFIG_H"
+$write tf "#define CONFIG_H"
+$write tf "/* File: config.h"
+$write tf "**"
+$write tf -
+ "** This file contains the options needed for porting "
+$write tf "** the project on a VMS system."
+$write tf "**"
+$write tf "** Try not to make any edits to this file, as it is"
+$write tf "** automagically generated."
+$write tf "**"
+$write tf "** Manual edits should be made to the config_vms.h file."
+$write tf "**"
+$write tf -
+ "** ", datetime, tab, username, tab, "Generated by ''my_proc_file'"
+$write tf "**"
+$write tf -
+ "**========================================================================*/"
+$write tf ""
+$write tf "#if (__CRTL_VER >= 70200000) && !defined (__VAX)"
+$write tf "#define _LARGEFILE 1"
+$write tf "#endif"
+$write tf ""
+$write tf "#ifndef __VAX"
+$write tf "#ifdef __CRTL_VER"
+$write tf "#if __CRTL_VER >= 80200000"
+$write tf "#define _USE_STD_STAT 1"
+$write tf "#endif"
+$write tf "#endif"
+$write tf "#endif"
+$write tf ""
+$!
+$write tf " /* Allow compiler builtins */"
+$write tf "/*-------------------------*/"
+$write tf "#ifdef __DECC_VER"
+$write tf "#include <non_existant_dir:builtins.h>"
+$write tf "#endif"
+$!
+$write tf ""
+$return
+$!
+$! gosub to write out the tail for config.h and close it
+$!---------------------------------------------------------
+$write_config_h_tail:
+$write tf ""
+$write tf " /* Include the hand customized settings */"
+$write tf "/*--------------------------------------*/"
+$write tf "#include ""config_vms.h"""
+$write tf ""
+$write tf "#endif /* CONFIG_H */"
+$close tf
+$return
+$!
diff --git a/packages/vms/generate_config_vms_h_curl.com b/packages/vms/generate_config_vms_h_curl.com
new file mode 100644
index 000000000..8024a92da
--- /dev/null
+++ b/packages/vms/generate_config_vms_h_curl.com
@@ -0,0 +1,445 @@
+$! File: GENERATE_CONFIG_H_CURL.COM
+$!
+$! $Id$
+$!
+$! Curl like most open source products uses a variant of a config.h file.
+$! Depending on the curl version, this could be config.h or curl_config.h.
+$!
+$! For GNV based builds, the configure script is run and that produces
+$! a [curl_]config.h file. Configure scripts on VMS generally do not
+$! know how to do everything, so there is also a [-.lib]config-vms.h file
+$! that has VMS specific code that compensates for bugs in some of the
+$! VMS shared images.
+$!
+$! This generates a [curl_]config.h file and also a config_vms.h file,
+$! which is used to supplement that file. Note that the config_vms.h file
+$! and the [.lib]config-vms.h file do two different tasks and that the
+$! filenames are slightly different.
+$!
+$!
+$! Copyright 2013, John Malmberg
+$!
+$! Permission to use, copy, modify, and/or distribute this software for any
+$! purpose with or without fee is hereby granted, provided that the above
+$! copyright notice and this permission notice appear in all copies.
+$!
+$! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+$! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+$! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+$! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+$! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+$! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+$! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+$!
+$!
+$! 06-Jan-2013 J. Malmberg
+$!
+$!=========================================================================
+$!
+$! 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")
+$!
+$args_len = f$length(args)
+$!
+$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")
+$ if (arch_name .eqs. "") then arch_name = "UNK"
+$endif
+$!
+$!
+$nossl = 0
+$nohpssl = 1
+$hpssl = 0
+$libidn = 0
+$libssh2 = 0
+$noldap = 0
+$nozlib = 0
+$nokerberos = 0
+$!
+$! First check to see if SSL is disabled.
+$!---------------------------------------
+$if f$locate(",nossl,", args_lower) .lt. args_len then nossl = 1
+$if .not. nossl
+$then
+$!
+$! ssl$* logicals means HP ssl is present
+$!----------------------------------------
+$ if f$trnlnm("ssl$root") .nes. ""
+$ then
+$ nohpssl = 0
+$ hpssl = 1
+$ endif
+$!
+$! HP defines OPENSSL as SSL$INCLUDE as a convenience for linking.
+$! As it is a violation of VMS standards for this to be provided,
+$! some sites may have removed it, but if present, assume that
+$! it indicates which OpenSSL to use.
+$!------------------------------------
+$ openssl_lnm = f$trnlnm("OPENSSL")
+$ if (openssl_lnm .nes. "SYS$INCLUDE")
+$ then
+$! Non HP SSL is installed, default to use it.
+$ nohpssl = 1
+$ hpssl = 0
+$ endif
+$!
+$! Now check to see if hpssl has been specifically disabled
+$!----------------------------------------------------------
+$ if f$locate(",nohpssl,", args_lower) .lt. args_len
+$ then
+$ nohpssl = 1
+$ hpssl = 0
+$ endif
+$!
+$! Finally check to see if hp ssl has been specifically included.
+$!----------------------------------------------------------------
+$ if f$locate(",nohpssl,", args_lower) .lt. args_len
+$ then
+$ nohpssl = 1
+$ hpssl = 0
+$ endif
+$endif
+$!
+$! Did someone port LIBIDN in the GNV compatible way?
+$!------------------------------------------------------
+$if f$trnlnm("GNV$LIBIDNSHR") .nes. ""
+$then
+$ write sys$output "NOTICE: A LIBIDN port has been detected."
+$ write sys$output " This port of curl for VMS has not been tested with it."
+$ if f$locate(",libidn,", args_lower) .lt. args_len
+$ then
+$ libidn = 1
+$ endif
+$ if .not. libidn
+$ then
+$ write sys$output " LIBIDN support is not enabled."
+$ write sys$output "Run with the ""libidn"" parameter to attempt to use."
+$ else
+$ write sys$output " Untested LIBIDN support requested."
+$ endif
+$endif
+$!
+$! Did someone port LIBSSH2 in the GNV compatible way?
+$!------------------------------------------------------
+$if f$trnlnm("GNV$LIBSSH2SHR") .nes. ""
+$then
+$ write sys$output "NOTICE: A LIBSSH2 port has been detected."
+$ write sys$output " This port of curl for VMS has not been tested with it."
+$ if f$locate(",libssh2,", args_lower) .lt. args_len
+$ then
+$ libssh2 = 1
+$ endif
+$ if .not. libssh2
+$ then
+$ write sys$output " LIBSSH2 support is not enabled."
+$ write sys$output "Run with the ""libssh2"" parameter to attempt to use."
+$ else
+$ write sys$output " Untested LIBSSH2 support requested."
+$ endif
+$endif
+$!
+$! LDAP suppressed?
+$if f$locate(",noldap,", args_lower) .lt. args_len
+$then
+$ noldap = 1
+$endif
+$if f$search("SYS$SHARE:LDAP$SHR.EXE") .eqs. ""
+$then
+$ noldap = 1
+$endif
+$!
+$if f$locate(",nokerberos,", args_lower) .lt. args_len then nokerberos = 1
+$if .not. nokerberos
+$then
+$! If kerberos is installed: sys$share:gss$rtl.exe exists.
+$ if f$search("sys$shsare:gss$rtl.exe") .eqs. ""
+$ then
+$ nokerberos = 1
+$ endif
+$endif
+$!
+$!
+$! Is GNV compatible LIBZ present?
+$!------------------------------------------------------
+$if f$trnlnm("GNV$LIBZSHR") .nes. ""
+$then
+$ if f$locate(",nozlib,", args_lower) .lt. args_len
+$ then
+$ nozlib = 1
+$ endif
+$! if .not. nozlib
+$! then
+$! write sys$output " GNV$LIBZSHR support is enabled."
+$! else
+$! write sys$output " GNV$LIBZSHR support is disabled by nozlib."
+$! endif
+$else
+$ nozlib = 1
+$endif
+$!
+$!
+$! Start the configuration file.
+$! Need to do a create and then an append to make the file have the
+$! typical file attributes of a VMS text file.
+$create sys$disk:[curl.lib]config_vms.h
+$open/append cvh sys$disk:[curl.lib]config_vms.h
+$!
+$! Write the defines to prevent multiple includes.
+$! These are probably not needed in this case,
+$! but are best practice to put on all header files.
+$write cvh "#ifndef __CONFIG_VMS_H__"
+$write cvh "#define __CONFIG_VMS_H__"
+$write cvh ""
+$write cvh "/* Define cpu-machine-OS */"
+$!
+$! Curl uses an OS macro to set the build environment.
+$!----------------------------------------------------
+$! Now the DCL builds usually say xxx-HP-VMS and configure scripts
+$! may put DEC or COMPAQ or HP for the middle part.
+$!
+$write cvh "#if defined(__alpha)"
+$write cvh "#define OS ""ALPHA-HP-VMS"""
+$write cvh "#elif defined(__vax)"
+$write cvh "#define OS ""VAX-HP-VMS"""
+$write cvh "#elif defined(__ia64)"
+$write cvh "#define OS ""IA64-HP-VMS""
+$write cvh "#else"
+$write cvh "#define OS ""UNKNOWN-HP-VMS""
+$write cvh "#endif"
+$write cvh ""
+$!
+$! We are now setting this on the GNV build, so also do this
+$! for compatibility.
+$write cvh "/* Location of default ca path */"
+$write cvh "#define curl_ca_path ""gnv$curl_ca_path"""
+$!
+$! NTLM_WB_ENABLED requires fork() but configure does not know this
+$! We have to disble this in th configure command line.
+$! config_h.com finds that configure defaults to it being enabled so
+$! reports it. So we need to turn it off here.
+$!
+$write cvh "#ifdef NTLM_WB_ENABLED"
+$write cvh "#undef NTLM_WB_ENABLED"
+$write cvh "#endif"
+$!
+$! The config_h.com finds a bunch of default disable commands in
+$! configure and will incorrectly disable these options. The config_h.com
+$! is a generic procedure and it would break more things to try to fix it
+$! to special case it for curl. So we will fix it here.
+$!
+$! We do them all here, even the ones that config_h.com currently gets correct.
+$!
+$write cvh "#ifdef CURL_DISABLE_COOKIES"
+$write cvh "#undef CURL_DISABLE_COOKIES"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_CRYPTO_AUTH"
+$write cvh "#undef CURL_DISABLE_CRYPTO_AUTH"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_DICT"
+$write cvh "#undef CURL_DISABLE_DICT"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_FILE"
+$write cvh "#undef CURL_DISABLE_FILE"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_FTP"
+$write cvh "#undef CURL_DISABLE_FTP"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_GOPHER"
+$write cvh "#undef CURL_DISABLE_GOPHER"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_HTTP"
+$write cvh "#undef CURL_DISABLE_HTTP"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_IMAP"
+$write cvh "#undef CURL_DISABLE_IMAP"
+$write cvh "#endif"
+$if .not. noldap
+$then
+$ write cvh "#ifdef CURL_DISABLE_LDAP"
+$ write cvh "#undef CURL_DISABLE_LDAP"
+$ write cvh "#endif"
+$ if .not. nossl
+$ then
+$ write cvh "#ifdef CURL_DISABLE_LDAPS"
+$ write cvh "#undef CURL_DISABLE_LDAPS"
+$ write cvh "#endif"
+$ endif
+$endif
+$write cvh "#ifdef CURL_DISABLE_LIBCURL_OPTION"
+$write cvh "#undef CURL_DISABLE_LIBCURL_OPTION"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_POP3"
+$write cvh "#undef CURL_DISABLE_POP3"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_PROXY"
+$write cvh "#undef CURL_DISABLE_PROXY"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_RTSP"
+$write cvh "#undef CURL_DISABLE_RTSP"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_SMTP"
+$write cvh "#undef CURL_DISABLE_SMTP"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_TELNET"
+$write cvh "#undef CURL_DISABLE_TELNET"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_TFTP"
+$write cvh "#undef CURL_DISABLE_TFTP"
+$write cvh "#endif"
+$write cvh "#ifdef CURL_DISABLE_POP3"
+$write cvh "#undef CURL_DISABLE_POP3"
+$write cvh "#endif"
+$if .not. nossl
+$then
+$ write cvh "#ifdef CURL_DISABLE_TLS_SRP"
+$ write cvh "#undef CURL_DISABLE_TLS_SRP"
+$ write cvh "#endif"
+$!
+$endif
+$write cvh "#ifdef CURL_DISABLE_VERBOSE_STRINGS"
+$write cvh "#undef CURL_DISABLE_VERBOSE_STRINGS"
+$write cvh "#endif"
+$!
+$! configure defaults to USE_*, a real configure on VMS chooses different.
+$write cvh "#ifdef USE_ARES"
+$write cvh "#undef USE_ARES"
+$write cvh "#endif"
+$write cvh "#ifdef USE_AXTLS"
+$write cvh "#undef USE_AXTLS"
+$write cvh "#endif"
+$write cvh "#ifdef USE_CYASSL"
+$write cvh "#undef USE_CYASSL"
+$write cvh "#endif"
+$write cvh "#ifdef USE_DARWINSSL"
+$write cvh "#undef USE_DARWINSSL"
+$write cvh "#endif"
+$write cvh "#ifdef USE_GNUTLS"
+$write cvh "#undef USE_GNUTLS"
+$write cvh "#endif"
+$write cvh "#ifdef USE_GNUTLS_NETTLE"
+$write cvh "#undef USE_GNUTLS_NETTLE"
+$write cvh "#endif"
+$write cvh "#ifdef USE_LIBRTMP"
+$write cvh "#undef USE_LIBRTMP"
+$write cvh "#endif"
+$write cvh "#ifdef USE_MANUAL"
+$write cvh "#undef USE_MANUAL"
+$write cvh "#endif"
+$write cvh "#ifdef USE_NSS"
+$write cvh "#undef USE_NSS"
+$write cvh "#endif"
+$write cvh "#ifdef USE_OPENLDAP"
+$write cvh "#undef USE_OPENLDAP"
+$write cvh "#endif"
+$write cvh "#ifdef USE_POLARSSL"
+$write cvh "#undef USE_POLARSSL"
+$write cvh "#endif"
+$write cvh "#ifdef USE_SCHANNEL"
+$write cvh "#undef USE_SCHANNEL"
+$write cvh "#endif"
+$write cvh "#ifdef USE_THREADS_POSIX"
+$write cvh "#undef USE_THREADS_POSIX"
+$write cvh "#endif"
+$write cvh "#ifdef USE_TLS_SRP"
+$write cvh "#undef USE_TLS_SRP"
+$write cvh "#endif"
+$write cvh "#ifdef USE_WINDOWS_SSPI"
+$write cvh "#undef USE_WINDOWS_SSPI"
+$write cvh "#endif"
+$!
+$!
+$! Note:
+$! The CURL_EXTERN_SYMBOL is used for platforms that need the compiler
+$! to know about universal symbols. VMS does not need this support so
+$! we do not set it here.
+$!
+$!
+$! I can not figure out where the C compiler is finding the ALLOCA.H file
+$! in the text libraries, so CONFIG_H.COM can not find it either.
+$! Usually the header file name is the module name in the text library.
+$! It does not appear to hurt anything to not find header file, so we
+$! are not overriding it here.
+$!
+$!
+$! Check to see if OpenSSL is present.
+$!----------------------------------
+$ssl_include = f$trnlnm("OPENSSL")
+$if ssl_include .eqs. ""
+$then
+$ ssl_include = f$trnlnm("ssl$include")
+$endif
+$if ssl_include .eqs. "" then nossl = 1
+$!
+$if .not. nossl
+$then
+$!
+$ write cvh "#ifndef USE_OPENSSL"
+$ write cvh "#define USE_OPENSSL 1"
+$ write cvh "#endif"
+$ write cvh "#ifndef USE_SSLEAY"
+$ write cvh "#define USE_SSLEAY 1"
+$ write cvh "#endif"
+$endif
+$!
+$!
+$! LibIDN not ported to VMS at this time.
+$! This is for international domain name support.
+$! Allow explicit experimentation.
+$if libidn
+$then
+$ write cvh "#define HAVE_IDNA_STRERROR 1"
+$ write cvh "#define HAVE_IDNA_FREE 1"
+$ write cvh "#define HAVE_IDNA_FREE_H 1"
+$ write cvh "#define HAVE_LIBIDN 1"
+$else
+$ write cvh "#ifdef HAVE_LIBIDN"
+$ write cvh "#undef HAVE_LIBIDN"
+$ write cvh "#endif"
+$endif
+$!
+$! LibSSH2 not ported to VMS at this time.
+$! Allow explicit experimentation.
+$if libssh2
+$then
+$ write cvh "#define HAVE_LIBSSH2_EXIT 1"
+$ write cvh "#define HAVE_LIBSSH2_H 1"
+$ write cvh "#define HAVE_LIBSSH2_INIT 1"
+$ write cvh "#define HAVE_LIBSSH2_SCP_SEND64 1"
+$ write cvh "#define HAVE_LIBSSH2_SESSION_HANDSHAKE 1"
+$ write cvh "#define HAVE_LIBSSH2_VERSION 1
+$ write cvh "#define HAVE_LIBSSH2 1
+$!
+$ write cvh "#ifndef USE_LIBSSH2"
+$ write cvh "#define USE_LIBSSH2 1"
+$ write cvh "#endif"
+$else
+$ write cvh "#ifdef USE_LIBSSH2"
+$ write cvh "#undef USE_LIBSSH2"
+$ write cvh "#endif"
+$endif
+$!
+$!
+$if .not. nozlib
+$then
+$ write cvh "#define HAVE_LIBZ 1"
+$ write cvh "#define HAVE_ZLIB_H 1"
+$endif
+$!
+$!
+$! Close out the file
+$!
+$write cvh ""
+$write cvh "#endif /* __CONFIG_VMS_H__ */"
+$close cvh
+$!
+$all_exit:
+$exit
diff --git a/packages/vms/hpssl_alpha.opt b/packages/vms/hpssl_alpha.opt
deleted file mode 100644
index 3ad9fbdb2..000000000
--- a/packages/vms/hpssl_alpha.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SYS$LIBRARY:SSL$LIBCRYPTO_SHR32.EXE/SHARE
-SYS$LIBRARY:SSL$LIBSSL_SHR32.EXE/SHARE
diff --git a/packages/vms/hpssl_ia64.opt b/packages/vms/hpssl_ia64.opt
deleted file mode 100644
index 9b2201480..000000000
--- a/packages/vms/hpssl_ia64.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SYS$LIBRARY:SSL$LIBCRYPTO_SHR.EXE/SHARE
-SYS$LIBRARY:SSL$LIBSSL_SHR.EXE/SHARE
diff --git a/packages/vms/hpssl_vax.opt b/packages/vms/hpssl_vax.opt
deleted file mode 100644
index 3ad9fbdb2..000000000
--- a/packages/vms/hpssl_vax.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SYS$LIBRARY:SSL$LIBCRYPTO_SHR32.EXE/SHARE
-SYS$LIBRARY:SSL$LIBSSL_SHR32.EXE/SHARE
diff --git a/packages/vms/ldap.opt b/packages/vms/ldap.opt
deleted file mode 100644
index 23f1ee40d..000000000
--- a/packages/vms/ldap.opt
+++ /dev/null
@@ -1 +0,0 @@
-SYS$SHARE:LDAP$SHR.EXE /SHARE
diff --git a/packages/vms/openssl_alpha.opt b/packages/vms/openssl_alpha.opt
deleted file mode 100644
index b445119a2..000000000
--- a/packages/vms/openssl_alpha.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SSLLIB:LIBCRYPTO.EXE /SHARE
-SSLLIB:LIBSSL.EXE /SHARE
diff --git a/packages/vms/openssl_ia64.opt b/packages/vms/openssl_ia64.opt
deleted file mode 100644
index b445119a2..000000000
--- a/packages/vms/openssl_ia64.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SSLLIB:LIBCRYPTO.EXE /SHARE
-SSLLIB:LIBSSL.EXE /SHARE
diff --git a/packages/vms/openssl_ssl_alpha.opt b/packages/vms/openssl_ssl_alpha.opt
deleted file mode 100644
index c726c2fa4..000000000
--- a/packages/vms/openssl_ssl_alpha.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SSLLIB:SSL_LIBCRYPTO.EXE /SHARE
-SSLLIB:SSL_LIBSSL.EXE /SHARE
diff --git a/packages/vms/openssl_ssl_ia64.opt b/packages/vms/openssl_ssl_ia64.opt
deleted file mode 100644
index c726c2fa4..000000000
--- a/packages/vms/openssl_ssl_ia64.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SSLLIB:SSL_LIBCRYPTO.EXE /SHARE
-SSLLIB:SSL_LIBSSL.EXE /SHARE
diff --git a/packages/vms/openssl_ssl_vax.opt b/packages/vms/openssl_ssl_vax.opt
deleted file mode 100644
index c726c2fa4..000000000
--- a/packages/vms/openssl_ssl_vax.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SSLLIB:SSL_LIBCRYPTO.EXE /SHARE
-SSLLIB:SSL_LIBSSL.EXE /SHARE
diff --git a/packages/vms/openssl_vax.opt b/packages/vms/openssl_vax.opt
deleted file mode 100644
index b445119a2..000000000
--- a/packages/vms/openssl_vax.opt
+++ /dev/null
@@ -1,2 +0,0 @@
-SSLLIB:LIBCRYPTO.EXE /SHARE
-SSLLIB:LIBSSL.EXE /SHARE