aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Makefile.inc5
-rw-r--r--lib/config-vms.h399
-rw-r--r--lib/curl_setup.h7
-rw-r--r--lib/curl_setup_once.h11
-rw-r--r--lib/getenv.c8
-rw-r--r--lib/netrc.c7
-rw-r--r--lib/post-config-vms.h398
-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
-rw-r--r--src/tool_homedir.c14
-rw-r--r--src/tool_main.c8
-rw-r--r--src/tool_operate.c3
-rw-r--r--src/tool_setup.h8
-rw-r--r--src/tool_vms.h2
27 files changed, 3816 insertions, 624 deletions
diff --git a/lib/Makefile.inc b/lib/Makefile.inc
index e970edd90..281678d8e 100644
--- a/lib/Makefile.inc
+++ b/lib/Makefile.inc
@@ -42,5 +42,6 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h \
gopher.h axtls.h cyassl.h http_proxy.h non-ascii.h asyn.h curl_ntlm.h \
curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h curl_ntlm_msgs.h \
- curl_sasl.h curl_schannel.h curl_multibyte.h curl_darwinssl.h \
- hostcheck.h bundles.h conncache.h curl_setup_once.h multihandle.h
+ curl_sasl.h curl_schannel.h curl_multibyte.h curl_darwinssl.h \
+ hostcheck.h bundles.h conncache.h curl_setup_once.h multihandle.h \
+ post-config-vms.h
diff --git a/lib/config-vms.h b/lib/config-vms.h
deleted file mode 100644
index e6e638e20..000000000
--- a/lib/config-vms.h
+++ /dev/null
@@ -1,399 +0,0 @@
-#ifndef HEADER_CURL_CONFIG_VMS_H
-#define HEADER_CURL_CONFIG_VMS_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-
-/* */
-/* MSK, 02/05/04, Hand edited for trail build on Alpha V7.3, DEC C 6.5-003 */
-/* MSK, 03/09/04, Seems to work for all platforms I've built on so far. */
-/* Added HAVE_SYS_IOCTL_H define */
-/* TES, 10/06/04, Added MAX_INITIAL_POST_SIZE, HAVE_BASENAME */
-/* MSK, 02/02/05, Changed HAVE_TERMIOS_H to an undef since the change in */
-/* getpass.c no longer undef'd it during compile. */
-/* MSK, 02/08/05, turned two config-vms files into one by using USE_SSLEAY */
-/* MPZ, 12/28/05, changed HAVE_STRTOK_R define to use CRTL_VER */
-/* MSK, 01/27/07, needed to add HAVE_STRUCT_TIMEVAL define */
-
-/* Define cpu-machine-OS */
-#if defined(__alpha)
-# define OS "ALPHA-HP-VMS"
-#elif defined(__vax)
-# define OS "VAX-HP-VMS"
-#elif defined(__ia64)
-# define OS "IA64-HP-VMS"
-#else
-# define OS "UNKNOWN-HP-VMS"
-#endif
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* The size of `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of `long double', as computed by sizeof. */
-#define SIZEOF_LONG_DOUBLE 8
-
-/* The size of `long long', as computed by sizeof. */
-#define SIZEOF_LONG_LONG 8
-
-/* The size of `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
-/* The size of `size_t', as computed by sizeof. */
-#define SIZEOF_SIZE_T 4
-
-/* Define if you have the alarm function. */
-#define HAVE_ALARM 1
-
-/* Define if you have the geteuid function. */
-#define HAVE_GETEUID 1
-
-/* Define if you have the basename function. */
-#define HAVE_BASENAME 1
-
-/* Define if you have the gethostbyaddr function. */
-#define HAVE_GETHOSTBYADDR 1
-
-/* Define if you have the gethostname function. */
-#define HAVE_GETHOSTNAME 1
-
-/* Define if you have the getpwuid function. */
-#define HAVE_GETPWUID 1
-
-/* Define if you have the getservbyname function. */
-#define HAVE_GETSERVBYNAME 1
-
-/* Define if you have the gettimeofday function. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define if you have the inet_addr function. */
-#define HAVE_INET_ADDR 1
-
-/* Define if you have the ioctl function. */
-#define HAVE_IOCTL 1
-
-/* Define if you have a working ioctl FIONBIO function. */
-#define HAVE_IOCTL_FIONBIO 1
-
-/* Define if you have a working ioctl SIOCGIFADDR function. */
-#define HAVE_IOCTL_SIOCGIFADDR 1
-
-/* Define if you have the perror function. */
-#define HAVE_PERROR 1
-
-/* Define if you have the select function. */
-#define HAVE_SELECT 1
-
-/* Define if you have the setvbuf function. */
-#define HAVE_SETVBUF 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the signal function. */
-#define HAVE_SIGNAL 1
-
-/* Define if you have the socket function. */
-#define HAVE_SOCKET 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strcmpi function. */
-/* #define HAVE_STRCMPI 1 */
-
-/* Define if you have the strdup function. */
-#define HAVE_STRDUP 1
-
-/* Define if you have the strftime function. */
-#define HAVE_STRFTIME 1
-
-/* Define if you have the stricmp function. */
-/* #define HAVE_STRICMP 1 */
-
-/* Define if you have the strstr function. */
-#define HAVE_STRSTR 1
-
-/* Define if you have the ftruncate function. */
-#define HAVE_FTRUNCATE 1
-
-/* Define if you have the uname function. */
-#define HAVE_UNAME 1
-
-/* Define if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define if you have the <err.h> header file. */
-#define HAVE_ERR_H 1
-
-/* Define if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define if you have the <getopt.h> header file. */
-#define HAVE_GETOPT_H 1
-
-/* Define if you have the <malloc.h> header file. */
-#define HAVE_MALLOC_H 1
-
-/* Define if you need the malloc.h header header file even with stdlib.h */
-/* #define NEED_MALLOC_H 1 */
-
-/* Define if you have the <net/if.h> header file. */
-#define HAVE_NET_IF_H 1
-
-/* Define if you have the <netdb.h> header file. */
-#define HAVE_NETDB_H 1
-
-/* Define if you have the <netinet/if_ether.h> header file. */
-#define HAVE_NETINET_IF_ETHER_H 1
-
-/* Define if you have the <netinet/in.h> header file. */
-#define HAVE_NETINET_IN_H 1
-
-/* OpenSSL section starts here */
-
-/* Define if you have a working OpenSSL installation */
-#ifdef USE_SSLEAY
-
-/* if OpenSSL is in use */
-#define USE_OPENSSL 1
-
-/* Define if you have the crypto library (-lcrypto). */
-#define HAVE_LIBCRYPTO 1
-
-/* Define if you have the ssl library (-lssl). */
-#define HAVE_LIBSSL 1
-
-/* Define if you have the <openssl/crypto.h> header file. */
-#define HAVE_OPENSSL_CRYPTO_H 1
-
-/* Define if you have the <openssl/err.h> header file. */
-#define HAVE_OPENSSL_ERR_H 1
-
-/* Define if you have the <openssl/pem.h> header file. */
-#define HAVE_OPENSSL_PEM_H 1
-
-/* Define if you have the <openssl/rsa.h> header file. */
-#define HAVE_OPENSSL_RSA_H 1
-
-/* Define if you have the <openssl/ssl.h> header file. */
-#define HAVE_OPENSSL_SSL_H 1
-
-/* Define if you have the <openssl/x509.h> header file. */
-#define HAVE_OPENSSL_X509_H 1
-
-/*
- * This needs to be defined for OpenSSL 0.9.7 and other versions that have the
- * ENGINE stuff supported. If an include of "openssl/engine.h" fails, then
- * undefine the define below.
-*/
-#define HAVE_OPENSSL_ENGINE_H 1
-
-#endif /* USE_SSLEAY */
-/* OpenSSL section ends here */
-
-/* Define if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Define if you have the <sgtty.h> header file. */
-#define HAVE_SGTTY_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H 1
-
-/* Define if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the resolv library (-lresolv). */
-#define HAVE_LIBRESOLV 1
-
-/* Define if you have the socket library (-lsocket). */
-#define HAVE_LIBSOCKET 1
-
-/* Define if getaddrinfo exists and works */
-#define HAVE_GETADDRINFO 1
-
-/* Define if you have the <timeval.h> header file. */
-#define HAVE_TIMEVAL_H 1
-
-/* Define if you have the timeval struct. */
-#define HAVE_STRUCT_TIMEVAL 1
-
-/* Name of this package! */
-#define PACKAGE "not-used"
-
-/* Version number of this archive. */
-#define VERSION "not-used"
-
-/* Define if you have the getpass function. */
-#undef HAVE_GETPASS
-
-/* Define if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the `strtok_r' function. */
-/* Condition lifted from <string.h> */
-#if __CRTL_VER >= 70301000
-# define HAVE_STRTOK_R 1
-#endif
-
-/* Define if you have the `strtoll' function. */
-#define HAVE_STRTOLL 1
-
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you need the memory.h header file even with stdlib.h */
-#define NEED_MEMORY_H 1
-
-/* Define if you have the `sigsetjmp' function. */
-#define HAVE_SIGSETJMP 1
-
-/* Define to 1 if you have the <setjmp.h> header file. */
-#define HAVE_SETJMP_H 1
-
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define to 1 if you have the <stropts.h> header file. */
-#define HAVE_STROPTS_H 1
-
-/* Define if you have the getnameinfo function. */
-#define HAVE_GETNAMEINFO 1
-
-/* Define to the type qualifier of arg 1 for getnameinfo. */
-#define GETNAMEINFO_QUAL_ARG1 const
-
-/* Define to the type of arg 1 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
-
-/* Define to the type of arg 2 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG2 size_t
-
-/* Define to the type of args 4 and 6 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG46 size_t
-
-/* Define to the type of arg 7 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG7 int
-
-/* Define if you have the recv function. */
-#define HAVE_RECV 1
-
-/* Define to the type of arg 1 for recv. */
-#define RECV_TYPE_ARG1 int
-
-/* Define to the type of arg 2 for recv. */
-#define RECV_TYPE_ARG2 void *
-
-/* Define to the type of arg 3 for recv. */
-#define RECV_TYPE_ARG3 int
-
-/* Define to the type of arg 4 for recv. */
-#define RECV_TYPE_ARG4 int
-
-/* Define to the function return type for recv. */
-#define RECV_TYPE_RETV int
-
-/* Define if you have the recvfrom function. */
-#define HAVE_RECVFROM 1
-
-/* Define to the type of arg 1 for recvfrom. */
-#define RECVFROM_TYPE_ARG1 int
-
-/* Define to the type pointed by arg 2 for recvfrom. */
-#define RECVFROM_TYPE_ARG2 void
-
-/* Define if the type pointed by arg 2 for recvfrom is void. */
-#define RECVFROM_TYPE_ARG2_IS_VOID 1
-
-/* Define to the type of arg 3 for recvfrom. */
-#define RECVFROM_TYPE_ARG3 int
-
-/* Define to the type of arg 4 for recvfrom. */
-#define RECVFROM_TYPE_ARG4 int
-
-/* Define to the type pointed by arg 5 for recvfrom. */
-#define RECVFROM_TYPE_ARG5 struct sockaddr
-
-/* Define to the type pointed by arg 6 for recvfrom. */
-#define RECVFROM_TYPE_ARG6 int
-
-/* Define to the function return type for recvfrom. */
-#define RECVFROM_TYPE_RETV int
-
-/* Define if you have the send function. */
-#define HAVE_SEND 1
-
-/* Define to the type of arg 1 for send. */
-#define SEND_TYPE_ARG1 int
-
-/* Define to the type qualifier of arg 2 for send. */
-#define SEND_QUAL_ARG2 const
-
-/* Define to the type of arg 2 for send. */
-#define SEND_TYPE_ARG2 void *
-
-/* Define to the type of arg 3 for send. */
-#define SEND_TYPE_ARG3 int
-
-/* Define to the type of arg 4 for send. */
-#define SEND_TYPE_ARG4 int
-
-/* Define to the function return type for send. */
-#define SEND_TYPE_RETV int
-
-/* Define to hide dollar sign from compilers in strict ansi mode. */
-#define decc_translate_vms(__s) decc$translate_vms(__s)
-
-#endif /* HEADER_CURL_CONFIG_VMS_H */
-
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index 37be5ae46..a6f9e0a83 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -40,6 +40,11 @@
#include "curl_config.h"
+/* VMS needs some helper routines/definitions */
+#ifdef __VMS
+# include "post-config-vms.h"
+#endif
+
#else /* HAVE_CONFIG_H */
#ifdef _WIN32_WCE
@@ -645,7 +650,9 @@ int netware_init(void);
* Include macros and defines that should only be processed once.
*/
+#ifndef HEADER_CURL_SETUP_ONCE_H
#include "curl_setup_once.h"
+#endif
/*
* Definition of our NOP statement Object-like macro
diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h
index 57d3ea945..8c7f41ff8 100644
--- a/lib/curl_setup_once.h
+++ b/lib/curl_setup_once.h
@@ -526,17 +526,6 @@ typedef int sig_atomic_t;
#define EREMOTE WSAEREMOTE
#endif
-
-/*
- * Actually use __32_getpwuid() on 64-bit VMS builds for getpwuid()
- */
-
-#if defined(__VMS) && \
- defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
-#define getpwuid __32_getpwuid
-#endif
-
-
/*
* Macro argv_item_t hides platform details to code using it.
*/
diff --git a/lib/getenv.c b/lib/getenv.c
index 19da29a2d..36215aab0 100644
--- a/lib/getenv.c
+++ b/lib/getenv.c
@@ -22,10 +22,6 @@
#include "curl_setup.h"
-#ifdef __VMS
-#include <unixlib.h>
-#endif
-
#include <curl/curl.h>
#include "curl_memory.h"
@@ -46,10 +42,6 @@ char *GetEnv(const char *variable)
return (env[0] != '\0')?strdup(env):NULL;
#else
char *env = getenv(variable);
-#ifdef __VMS
- if(env && strcmp("HOME",variable) == 0)
- env = decc_translate_vms(env);
-#endif
return (env && env[0])?strdup(env):NULL;
#endif
#endif
diff --git a/lib/netrc.c b/lib/netrc.c
index 1b834b821..2c5942afc 100644
--- a/lib/netrc.c
+++ b/lib/netrc.c
@@ -25,9 +25,6 @@
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
-#ifdef __VMS
-#include <unixlib.h>
-#endif
#include <curl/curl.h>
#include "netrc.h"
@@ -83,11 +80,7 @@ int Curl_parsenetrc(const char *host,
struct passwd *pw;
pw= getpwuid(geteuid());
if(pw) {
-#ifdef __VMS
- home = decc_translate_vms(pw->pw_dir);
-#else
home = pw->pw_dir;
-#endif
}
#endif
}
diff --git a/lib/post-config-vms.h b/lib/post-config-vms.h
new file mode 100644
index 000000000..4da5b9924
--- /dev/null
+++ b/lib/post-config-vms.h
@@ -0,0 +1,398 @@
+#ifndef HEADER_CONFIG_VMS_H
+#define HEADER_CONFIG_VMS_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+/* */
+/* JEM, 12/30/12, VMS now generates config.h, so only define wrappers for */
+/* getenv(), getpwuid() and provide is_vms_shell() */
+/* Also need upper case symbols for system services, and */
+/* OpenSSL, and some Kerberos image */
+
+#ifdef __DECC
+#pragma message save
+#pragma message disable dollarid
+#endif
+
+/* Hide the stuff we are overriding */
+#define getenv decc_getenv
+#ifdef __DECC
+# if __INITIAL_POINTER_SIZE != 64
+# define getpwuid decc_getpwuid
+# endif
+#endif
+#include <stdlib.h>
+ char * decc$getenv(const char * __name);
+#include <pwd.h>
+
+#include <string.h>
+#include <unixlib.h>
+
+#undef getenv
+#undef getpwuid
+#define getenv vms_getenv
+#define getpwuid vms_getpwuid
+
+/* VAX needs these in upper case when compiling exact case */
+#define sys$assign SYS$ASSIGN
+#define sys$dassgn SYS$DASSGN
+#define sys$qiow SYS$QIOW
+
+#ifdef __DECC
+# if __INITIAL_POINTER_SIZE
+# pragma __pointer_size __save
+# endif
+#endif
+
+#if __USE_LONG_GID_T
+# define decc_getpwuid DECC$__LONG_GID_GETPWUID
+#else
+# if __INITIAL_POINTER_SIZE
+# define decc_getpwuid decc$__32_getpwuid
+# else
+# define decc_getpwuid decc$getpwuid
+# endif
+#endif
+
+ struct passwd * decc_getpwuid(uid_t uid);
+
+#ifdef __DECC
+# if __INITIAL_POINTER_SIZE == 32
+/* Translate the path, but only if the path is a VMS file specification */
+/* The translation is usually only needed for older versions of VMS */
+static char * vms_translate_path(const char * path) {
+char * unix_path;
+char * test_str;
+
+ /* See if the result is in VMS format, if not, we are done */
+ /* Assume that this is a PATH, not just some data */
+ test_str = strpbrk(path, ":[<^");
+ if(test_str == NULL) {
+ return (char *)path;
+ }
+
+ unix_path = decc$translate_vms(path);
+
+ if((int)unix_path <= 0) {
+ /* We can not translate it, so return the original string */
+ return (char *)path;
+ }
+}
+# else
+ /* VMS translate path is actually not needed on the current 64 bit */
+ /* VMS platforms, so instead of figuring out the pointer settings */
+ /* Change it to a noop */
+# define vms_translate_path(__path) __path
+# endif
+#endif
+
+#ifdef __DECC
+# if __INITIAL_POINTER_SIZE
+# pragma __pointer_size __restore
+# endif
+#endif
+
+static char * vms_getenv(const char * envvar) {
+
+char * result;
+char * vms_path;
+
+ /* first use the DECC getenv() function */
+ result = decc$getenv(envvar);
+ if(result == NULL) {
+ return result;
+ }
+
+ vms_path = result;
+ result = vms_translate_path(vms_path);
+
+ /* note that if you backport this to use VAX C RTL, that the VAX C RTL */
+ /* may do a malloc(2048) for each call to getenv(), so you will need */
+ /* to add a free(vms_path) */
+ /* Do not do a free() for DEC C RTL builds, which should be used for */
+ /* VMS 5.5-2 and later, even if using GCC */
+
+ return result;
+}
+
+
+static struct passwd vms_passwd_cache;
+
+static struct passwd * vms_getpwuid(uid_t uid) {
+
+struct passwd * my_passwd;
+
+/* Hack needed to support 64 bit builds, decc_getpwnam is 32 bit only */
+#ifdef __DECC
+# if __INITIAL_POINTER_SIZE
+__char_ptr32 unix_path;
+# else
+char * unix_path;
+# endif
+#else
+char * unix_path;
+#endif
+
+ my_passwd = decc_getpwuid(uid);
+ if(my_passwd == NULL) {
+ return my_passwd;
+ }
+
+ unix_path = vms_translate_path(my_passwd->pw_dir);
+
+ if((long)unix_path <= 0) {
+ /* We can not translate it, so return the original string */
+ return my_passwd;
+ }
+
+ /* If no changes needed just return it */
+ if(unix_path == my_passwd->pw_dir) {
+ return my_passwd;
+ }
+
+ /* Need to copy the structure returned */
+ /* Since curl is only using pw_dir, no need to fix up *
+ /* the pw_shell when running under Bash */
+ vms_passwd_cache.pw_name = my_passwd->pw_name;
+ vms_passwd_cache.pw_uid = my_passwd->pw_uid;
+ vms_passwd_cache.pw_gid = my_passwd->pw_uid;
+ vms_passwd_cache.pw_dir = unix_path;
+ vms_passwd_cache.pw_shell = my_passwd->pw_shell;
+
+ return &vms_passwd_cache;
+}
+
+#ifdef __DECC
+#pragma message restore
+#endif
+
+/* Bug - VMS OpenSSL and Kerberos universal symbols are in uppercase only */
+/* VMS libraries should have universal symbols in exact and uppercase */
+
+#define ASN1_INTEGER_get ASN1_INTEGER_GET
+#define ASN1_STRING_data ASN1_STRING_DATA
+#define ASN1_STRING_length ASN1_STRING_LENGTH
+#define ASN1_STRING_print ASN1_STRING_PRINT
+#define ASN1_STRING_to_UTF8 ASN1_STRING_TO_UTF8
+#define ASN1_STRING_type ASN1_STRING_TYPE
+#define BIO_ctrl BIO_CTRL
+#define BIO_free BIO_FREE
+#define BIO_new BIO_NEW
+#define BIO_s_mem BIO_S_MEM
+#define BN_bn2bin BN_BN2BIN
+#define BN_num_bits BN_NUM_BITS
+#define CRYPTO_cleanup_all_ex_data CRYPTO_CLEANUP_ALL_EX_DATA
+#define CRYPTO_free CRYPTO_FREE
+#define CRYPTO_malloc CRYPTO_MALLOC
+#define DES_ecb_encrypt DES_ECB_ENCRYPT
+#define DES_set_key DES_SET_KEY
+#define DES_set_odd_parity DES_SET_ODD_PARITY
+#define ENGINE_ctrl ENGINE_CTRL
+#define ENGINE_ctrl_cmd ENGINE_CTRL_CMD
+#define ENGINE_finish ENGINE_FINISH
+#define ENGINE_free ENGINE_FREE
+#define ENGINE_get_first ENGINE_GET_FIRST
+#define ENGINE_get_id ENGINE_GET_ID
+#define ENGINE_get_next ENGINE_GET_NEXT
+#define ENGINE_init ENGINE_INIT
+#define ENGINE_load_builtin_engines ENGINE_LOAD_BUILTIN_ENGINES
+#define ENGINE_load_private_key ENGINE_LOAD_PRIVATE_KEY
+#define ENGINE_set_default ENGINE_SET_DEFAULT
+#define ERR_clear_error ERR_CLEAR_ERROR
+#define ERR_error_string ERR_ERROR_STRING
+#define ERR_error_string_n ERR_ERROR_STRING_N
+#define ERR_free_strings ERR_FREE_STRINGS
+#define ERR_get_error ERR_GET_ERROR
+#define ERR_peek_error ERR_PEEK_ERROR
+#define ERR_remove_state ERR_REMOVE_STATE
+#define EVP_PKEY_copy_parameters EVP_PKEY_COPY_PARAMETERS
+#define EVP_PKEY_free EVP_PKEY_FREE
+#define EVP_cleanup EVP_CLEANUP
+#define GENERAL_NAMES_free GENERAL_NAMES_FREE
+#define MD4_Final MD4_FINAL
+#define MD4_Init MD4_INIT
+#define MD4_Update MD4_UPDATE
+#define MD5_Final MD5_FINAL
+#define MD5_Init MD5_INIT
+#define MD5_Update MD5_UPDATE
+#define OPENSSL_add_all_algo_noconf OPENSSL_ADD_ALL_ALGO_NOCONF
+#define PEM_read_X509 PEM_READ_X509
+#define PEM_write_bio_X509 PEM_WRITE_BIO_X509
+#define PKCS12_PBE_add PKCS12_PBE_ADD
+#define PKCS12_free PKCS12_FREE
+#define PKCS12_parse PKCS12_PARSE
+#define RAND_add RAND_ADD
+#define RAND_bytes RAND_BYTES
+#define RAND_egd RAND_EGD
+#define RAND_file_name RAND_FILE_NAME
+#define RAND_load_file RAND_LOAD_FILE
+#define RAND_status RAND_STATUS
+#define SSL_CIPHER_get_name SSL_CIPHER_GET_NAME
+#define SSL_CTX_add_client_CA SSL_CTX_ADD_CLIENT_CA
+#define SSL_CTX_callback_ctrl SSL_CTX_CALLBACK_CTRL
+#define SSL_CTX_check_private_key SSL_CTX_CHECK_PRIVATE_KEY
+#define SSL_CTX_ctrl SSL_CTX_CTRL
+#define SSL_CTX_free SSL_CTX_FREE
+#define SSL_CTX_get_cert_store SSL_CTX_GET_CERT_STORE
+#define SSL_CTX_load_verify_locations SSL_CTX_LOAD_VERIFY_LOCATIONS
+#define SSL_CTX_new SSL_CTX_NEW
+#define SSL_CTX_set_cipher_list SSL_CTX_SET_CIPHER_LIST
+#define SSL_CTX_set_def_passwd_cb_ud SSL_CTX_SET_DEF_PASSWD_CB_UD
+#define SSL_CTX_set_default_passwd_cb SSL_CTX_SET_DEFAULT_PASSWD_CB
+#define SSL_CTX_set_verify SSL_CTX_SET_VERIFY
+#define SSL_CTX_use_PrivateKey SSL_CTX_USE_PRIVATEKEY
+#define SSL_CTX_use_PrivateKey_file SSL_CTX_USE_PRIVATEKEY_FILE
+#define SSL_CTX_use_cert_chain_file SSL_CTX_USE_CERT_CHAIN_FILE
+#define SSL_CTX_use_certificate SSL_CTX_USE_CERTIFICATE
+#define SSL_CTX_use_certificate_file SSL_CTX_USE_CERTIFICATE_FILE
+#define SSL_SESSION_free SSL_SESSION_FREE
+#define SSL_connect SSL_CONNECT
+#define SSL_free SSL_FREE
+#define SSL_get1_session SSL_GET1_SESSION
+#define SSL_get_certificate SSL_GET_CERTIFICATE
+#define SSL_get_current_cipher SSL_GET_CURRENT_CIPHER
+#define SSL_get_error SSL_GET_ERROR
+#define SSL_get_peer_cert_chain SSL_GET_PEER_CERT_CHAIN
+#define SSL_get_peer_certificate SSL_GET_PEER_CERTIFICATE
+#define SSL_get_privatekey SSL_GET_PRIVATEKEY
+#define SSL_get_shutdown SSL_GET_SHUTDOWN
+#define SSL_get_verify_result SSL_GET_VERIFY_RESULT
+#define SSL_library_init SSL_LIBRARY_INIT
+#define SSL_load_error_strings SSL_LOAD_ERROR_STRINGS
+#define SSL_new SSL_NEW
+#define SSL_peek SSL_PEEK
+#define SSL_pending SSL_PENDING
+#define SSL_read SSL_READ
+#define SSL_set_connect_state SSL_SET_CONNECT_STATE
+#define SSL_set_fd SSL_SET_FD
+#define SSL_set_session SSL_SET_SESSION
+#define SSL_shutdown SSL_SHUTDOWN
+#define SSL_write SSL_WRITE
+#define SSLeay SSLEAY
+#define SSLv23_client_method SSLV23_CLIENT_METHOD
+#define SSLv3_client_method SSLV3_CLIENT_METHOD
+#define TLSv1_client_method TLSV1_CLIENT_METHOD
+#define UI_OpenSSL UI_OPENSSL
+#define X509V3_EXT_print X509V3_EXT_PRINT
+#define X509_EXTENSION_get_critical X509_EXTENSION_GET_CRITICAL
+#define X509_EXTENSION_get_object X509_EXTENSION_GET_OBJECT
+#define X509_LOOKUP_file X509_LOOKUP_FILE
+#define X509_NAME_ENTRY_get_data X509_NAME_ENTRY_GET_DATA
+#define X509_NAME_get_entry X509_NAME_GET_ENTRY
+#define X509_NAME_get_index_by_NID X509_NAME_GET_INDEX_BY_NID
+#define X509_NAME_print_ex X509_NAME_PRINT_EX
+#define X509_STORE_CTX_get_current_cert X509_STORE_CTX_GET_CURRENT_CERT
+#define X509_STORE_add_lookup X509_STORE_ADD_LOOKUP
+#define X509_STORE_set_flags X509_STORE_SET_FLAGS
+#define X509_check_issued X509_CHECK_ISSUED
+#define X509_free X509_FREE
+#define X509_get_ext_d2i X509_GET_EXT_D2I
+#define X509_get_issuer_name X509_GET_ISSUER_NAME
+#define X509_get_pubkey X509_GET_PUBKEY
+#define X509_get_serialNumber X509_GET_SERIALNUMBER
+#define X509_get_subject_name X509_GET_SUBJECT_NAME
+#define X509_load_crl_file X509_LOAD_CRL_FILE
+#define X509_verify_cert_error_string X509_VERIFY_CERT_ERROR_STRING
+#define d2i_PKCS12_fp D2I_PKCS12_FP
+#define i2t_ASN1_OBJECT I2T_ASN1_OBJECT
+#define sk_num SK_NUM
+#define sk_pop_free SK_POP_FREE
+#define sk_value SK_VALUE
+
+#define USE_UPPERCASE_GSSAPI 1
+#define gss_seal GSS_SEAL
+#define gss_unseal GSS_UNSEAL
+
+#define USE_UPPERCASE_KRBAPI 1
+
+/* AI_NUMERICHOST needed for IP V6 support in Curl */
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#ifndef AI_NUMERICHOST
+#ifdef ENABLE_IPV6
+#undef ENABLE_IPV6
+#endif
+#endif
+#endif
+
+/* VAX symbols are always in uppercase */
+#ifdef __VAX
+#define inflate INFLATE
+#define inflateEnd INFLATEEND
+#define inflateInit2_ INFLATEINIT2_
+#define inflateInit_ INFLATEINIT_
+#define zlibVersion ZLIBVERSION
+#endif
+
+/* Older VAX OpenSSL port defines these as Macros */
+/* Need to include the headers first and then redefine */
+/* that way a newer port will also work if some one has one */
+#ifdef __VAX
+
+# if (OPENSSL_VERSION_NUMBER < 0x00907001L)
+# define des_set_odd_parity DES_SET_ODD_PARITY
+# define des_set_key DES_SET_KEY
+# define des_ecb_encrypt DES_ECB_ENCRYPT
+
+# endif
+# include <openssl/evp.h>
+# ifndef OpenSSL_add_all_algorithms
+# define OpenSSL_add_all_algorithms OPENSSL_ADD_ALL_ALGORITHMS
+ void OPENSSL_ADD_ALL_ALGORITHMS(void);
+# endif
+
+ /* Curl defines these to lower case and VAX needs them in upper case */
+ /* So we need static routines */
+# if (OPENSSL_VERSION_NUMBER < 0x00907001L)
+
+# undef des_set_odd_parity
+# undef DES_set_odd_parity
+# undef des_set_key
+# undef DES_set_key
+# undef des_ecb_encrypt
+# undef DES_ecb_encrypt
+
+ static void des_set_odd_parity(des_cblock *key) {
+ DES_SET_ODD_PARITY(key);
+ }
+
+ static int des_set_key(const_des_cblock *key,
+ des_key_schedule schedule) {
+ return DES_SET_KEY(key, schedule);
+ }
+
+ static void des_ecb_encrypt(const_des_cblock *input,
+ des_cblock *output,
+ des_key_schedule ks,int enc) {
+ DES_ECB_ENCRYPT(input, output, ks, enc);
+ }
+#endif
+/* Need this to stop a macro redefinition error */
+#if OPENSSL_VERSION_NUMBER < 0x00907000L
+# ifdef X509_STORE_set_flags
+# undef X509_STORE_set_flags
+# define X509_STORE_set_flags(x,y) Curl_nop_stmt
+# endif
+#endif
+#endif
+
+#endif /* HEADER_CONFIG_VMS_H */
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
diff --git a/src/tool_homedir.c b/src/tool_homedir.c
index cb90095e5..11bb4ef3d 100644
--- a/src/tool_homedir.c
+++ b/src/tool_homedir.c
@@ -24,9 +24,6 @@
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
-#ifdef __VMS
-# include <unixlib.h>
-#endif
#include "tool_homedir.h"
@@ -56,16 +53,9 @@ static char *GetEnv(const char *variable, char do_expand)
}
#else
(void)do_expand;
-#ifdef __VMS
- env = getenv(variable);
- if(env && strcmp("HOME",variable) == 0) {
- env = decc_translate_vms(env);
- }
-#else
/* no length control */
env = getenv(variable);
#endif
-#endif
return (env && env[0]) ? strdup(env) : NULL;
}
@@ -87,11 +77,7 @@ char *homedir(void)
struct passwd *pw = getpwuid(geteuid());
if(pw) {
-#ifdef __VMS
- home = decc_translate_vms(pw->pw_dir);
-#else
home = pw->pw_dir;
-#endif
if(home && home[0])
home = strdup(home);
else
diff --git a/src/tool_main.c b/src/tool_main.c
index cf2d862b2..cdf87ea3c 100644
--- a/src/tool_main.c
+++ b/src/tool_main.c
@@ -27,6 +27,10 @@
#include <signal.h>
#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
#define ENABLE_CURLX_PRINTF
/* use our own printf() functions */
#include "curlx.h"
@@ -45,10 +49,6 @@
*/
#include "memdebug.h" /* keep this as LAST include */
-#ifdef __VMS
-static int vms_show = 0;
-#endif
-
/*
* Ensure that file descriptors 0, 1 and 2 (stdin, stdout, stderr) are
* open before starting to run. Otherwise, the first three network
diff --git a/src/tool_operate.c b/src/tool_operate.c
index bcbce2000..1a168afcb 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -1537,6 +1537,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
show_error:
#ifdef __VMS
+ vms_show = 0;
if(is_vms_shell()) {
/* VMS DCL shell behavior */
if(!config->showerror)
diff --git a/src/tool_setup.h b/src/tool_setup.h
index 9ed726030..2065b6f27 100644
--- a/src/tool_setup.h
+++ b/src/tool_setup.h
@@ -25,12 +25,12 @@
#define CURL_NO_OLDIES
/*
- * setup.h may define preprocessor macros such as _FILE_OFFSET_BITS and
+ * curl_setup.h may define preprocessor macros such as _FILE_OFFSET_BITS and
* _LARGE_FILES in order to support files larger than 2 GB. On platforms
* where this happens it is mandatory that these macros are defined before
* any system header file is included, otherwise file handling function
* prototypes will be misdeclared and curl tool may not build properly;
- * therefore we must include setup.h before curl.h when building curl.
+ * therefore we must include curl_setup.h before curl.h when building curl.
*/
#include "curl_setup.h" /* from the lib directory */
@@ -49,6 +49,10 @@
# define main(x,y) curl_main(x,y)
#endif
+#ifdef __VMS
+# include "tool_vms.h"
+#endif
+
#ifdef TPF
# undef select
/* change which select is used for the curl command line tool */
diff --git a/src/tool_vms.h b/src/tool_vms.h
index 5bb262e2e..ad1339c03 100644
--- a/src/tool_vms.h
+++ b/src/tool_vms.h
@@ -25,6 +25,8 @@
#ifdef __VMS
+int vms_show; /* If VMS error code has been written */
+
int is_vms_shell(void);
void vms_special_exit(int code, int vms_show);