1 $! File: GENERATE_CONFIG_H_CURL.COM
5 $! Curl like most open source products uses a variant of a config.h file.
6 $! Depending on the curl version, this could be config.h or curl_config.h.
8 $! For GNV based builds, the configure script is run and that produces
9 $! a [curl_]config.h file. Configure scripts on VMS generally do not
10 $! know how to do everything, so there is also a [-.lib]config-vms.h file
11 $! that has VMS specific code that compensates for bugs in some of the
14 $! This generates a [curl_]config.h file and also a config_vms.h file,
15 $! which is used to supplement that file. Note that the config_vms.h file
16 $! and the [.lib]config-vms.h file do two different tasks and that the
17 $! filenames are slightly different.
20 $! Copyright 2013, John Malmberg
22 $! Permission to use, copy, modify, and/or distribute this software for any
23 $! purpose with or without fee is hereby granted, provided that the above
24 $! copyright notice and this permission notice appear in all copies.
26 $! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
27 $! WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
28 $! MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
29 $! ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
30 $! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
31 $! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
32 $! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
35 $! 06-Jan-2013 J. Malmberg
37 $!=========================================================================
39 $! Allow arguments to be grouped together with comma or separated by spaces
40 $! Do no know if we will need more than 8.
41 $args = "," + p1 + "," + p2 + "," + p3 + "," + p4 + ","
42 $args = args + p5 + "," + p6 + "," + p7 + "," + p8 + ","
44 $! Provide lower case version to simplify parsing.
45 $args_lower = f$edit(args, "LOWERCASE")
47 $args_len = f$length(args)
49 $if (f$getsyi("HW_MODEL") .lt. 1024)
54 $ arch_name = arch_name + f$edit(f$getsyi("ARCH_NAME"), "UPCASE")
55 $ if (arch_name .eqs. "") then arch_name = "UNK"
68 $! First check to see if SSL is disabled.
69 $!---------------------------------------
70 $if f$locate(",nossl,", args_lower) .lt. args_len then nossl = 1
74 $! ssl$* logicals means HP ssl is present
75 $!----------------------------------------
76 $ if f$trnlnm("ssl$root") .nes. ""
82 $! HP defines OPENSSL as SSL$INCLUDE as a convenience for linking.
83 $! As it is a violation of VMS standards for this to be provided,
84 $! some sites may have removed it, but if present, assume that
85 $! it indicates which OpenSSL to use.
86 $!------------------------------------
87 $ openssl_lnm = f$trnlnm("OPENSSL")
88 $ if (openssl_lnm .nes. "SYS$INCLUDE")
90 $! Non HP SSL is installed, default to use it.
95 $! Now check to see if hpssl has been specifically disabled
96 $!----------------------------------------------------------
97 $ if f$locate(",nohpssl,", args_lower) .lt. args_len
103 $! Finally check to see if hp ssl has been specifically included.
104 $!----------------------------------------------------------------
105 $ if f$locate(",nohpssl,", args_lower) .lt. args_len
112 $! Did someone port LIBIDN in the GNV compatible way?
113 $!------------------------------------------------------
114 $if f$trnlnm("GNV$LIBIDNSHR") .nes. ""
116 $ write sys$output "NOTICE: A LIBIDN port has been detected."
117 $ write sys$output " This port of curl for VMS has not been tested with it."
118 $ if f$locate(",libidn,", args_lower) .lt. args_len
124 $ write sys$output " LIBIDN support is not enabled."
125 $ write sys$output "Run with the ""libidn"" parameter to attempt to use."
127 $ write sys$output " Untested LIBIDN support requested."
131 $! Did someone port LIBSSH2 in the GNV compatible way?
132 $!------------------------------------------------------
133 $if f$trnlnm("GNV$LIBSSH2SHR") .nes. ""
135 $ write sys$output "NOTICE: A LIBSSH2 port has been detected."
136 $ write sys$output " This port of curl for VMS has not been tested with it."
137 $ if f$locate(",libssh2,", args_lower) .lt. args_len
143 $ write sys$output " LIBSSH2 support is not enabled."
144 $ write sys$output "Run with the ""libssh2"" parameter to attempt to use."
146 $ write sys$output " Untested LIBSSH2 support requested."
151 $if f$locate(",noldap,", args_lower) .lt. args_len
155 $if f$search("SYS$SHARE:LDAP$SHR.EXE") .eqs. ""
160 $if f$locate(",nokerberos,", args_lower) .lt. args_len then nokerberos = 1
163 $! If kerberos is installed: sys$share:gss$rtl.exe exists.
164 $ if f$search("sys$shsare:gss$rtl.exe") .eqs. ""
171 $! Is GNV compatible LIBZ present?
172 $!------------------------------------------------------
173 $if f$trnlnm("GNV$LIBZSHR") .nes. ""
175 $ if f$locate(",nozlib,", args_lower) .lt. args_len
181 $! write sys$output " GNV$LIBZSHR support is enabled."
183 $! write sys$output " GNV$LIBZSHR support is disabled by nozlib."
190 $! Start the configuration file.
191 $! Need to do a create and then an append to make the file have the
192 $! typical file attributes of a VMS text file.
193 $create sys$disk:[curl.lib]config_vms.h
194 $open/append cvh sys$disk:[curl.lib]config_vms.h
196 $! Write the defines to prevent multiple includes.
197 $! These are probably not needed in this case,
198 $! but are best practice to put on all header files.
199 $write cvh "#ifndef __CONFIG_VMS_H__"
200 $write cvh "#define __CONFIG_VMS_H__"
202 $write cvh "/* Define cpu-machine-OS */"
204 $! Curl uses an OS macro to set the build environment.
205 $!----------------------------------------------------
206 $! Now the DCL builds usually say xxx-HP-VMS and configure scripts
207 $! may put DEC or COMPAQ or HP for the middle part.
209 $write cvh "#if defined(__alpha)"
210 $write cvh "#define OS ""ALPHA-HP-VMS"""
211 $write cvh "#elif defined(__vax)"
212 $write cvh "#define OS ""VAX-HP-VMS"""
213 $write cvh "#elif defined(__ia64)"
214 $write cvh "#define OS ""IA64-HP-VMS""
216 $write cvh "#define OS ""UNKNOWN-HP-VMS""
220 $! We are now setting this on the GNV build, so also do this
221 $! for compatibility.
222 $write cvh "/* Location of default ca path */"
223 $write cvh "#define curl_ca_path ""gnv$curl_ca_path"""
225 $! NTLM_WB_ENABLED requires fork() but configure does not know this
226 $! We have to disble this in th configure command line.
227 $! config_h.com finds that configure defaults to it being enabled so
228 $! reports it. So we need to turn it off here.
230 $write cvh "#ifdef NTLM_WB_ENABLED"
231 $write cvh "#undef NTLM_WB_ENABLED"
234 $! The config_h.com finds a bunch of default disable commands in
235 $! configure and will incorrectly disable these options. The config_h.com
236 $! is a generic procedure and it would break more things to try to fix it
237 $! to special case it for curl. So we will fix it here.
239 $! We do them all here, even the ones that config_h.com currently gets correct.
241 $write cvh "#ifdef CURL_DISABLE_COOKIES"
242 $write cvh "#undef CURL_DISABLE_COOKIES"
244 $write cvh "#ifdef CURL_DISABLE_CRYPTO_AUTH"
245 $write cvh "#undef CURL_DISABLE_CRYPTO_AUTH"
247 $write cvh "#ifdef CURL_DISABLE_DICT"
248 $write cvh "#undef CURL_DISABLE_DICT"
250 $write cvh "#ifdef CURL_DISABLE_FILE"
251 $write cvh "#undef CURL_DISABLE_FILE"
253 $write cvh "#ifdef CURL_DISABLE_FTP"
254 $write cvh "#undef CURL_DISABLE_FTP"
256 $write cvh "#ifdef CURL_DISABLE_GOPHER"
257 $write cvh "#undef CURL_DISABLE_GOPHER"
259 $write cvh "#ifdef CURL_DISABLE_HTTP"
260 $write cvh "#undef CURL_DISABLE_HTTP"
262 $write cvh "#ifdef CURL_DISABLE_IMAP"
263 $write cvh "#undef CURL_DISABLE_IMAP"
267 $ write cvh "#ifdef CURL_DISABLE_LDAP"
268 $ write cvh "#undef CURL_DISABLE_LDAP"
272 $ write cvh "#ifdef CURL_DISABLE_LDAPS"
273 $ write cvh "#undef CURL_DISABLE_LDAPS"
277 $write cvh "#ifdef CURL_DISABLE_LIBCURL_OPTION"
278 $write cvh "#undef CURL_DISABLE_LIBCURL_OPTION"
280 $write cvh "#ifndef __VAX"
281 $write cvh "#ifdef CURL_DISABLE_NTLM"
282 $write cvh "#undef CURL_DISABLE_NTLM"
285 $! NTLM needs long long or int64 support, missing from DECC C.
286 $write cvh "#ifdef __DECC
287 $write cvh "#ifndef CURL_DISABLE_NTLM"
288 $write cvh "#define CURL_DISABLE_NTLM 1"
292 $write cvh "#ifdef CURL_DISABLE_POP3"
293 $write cvh "#undef CURL_DISABLE_POP3"
295 $write cvh "#ifdef CURL_DISABLE_PROXY"
296 $write cvh "#undef CURL_DISABLE_PROXY"
298 $write cvh "#ifdef CURL_DISABLE_RTSP"
299 $write cvh "#undef CURL_DISABLE_RTSP"
301 $write cvh "#ifdef CURL_DISABLE_SMTP"
302 $write cvh "#undef CURL_DISABLE_SMTP"
304 $write cvh "#ifdef CURL_DISABLE_TELNET"
305 $write cvh "#undef CURL_DISABLE_TELNET"
307 $write cvh "#ifdef CURL_DISABLE_TFTP"
308 $write cvh "#undef CURL_DISABLE_TFTP"
310 $write cvh "#ifdef CURL_DISABLE_POP3"
311 $write cvh "#undef CURL_DISABLE_POP3"
315 $ write cvh "#ifdef CURL_DISABLE_TLS_SRP"
316 $ write cvh "#undef CURL_DISABLE_TLS_SRP"
320 $write cvh "#ifdef CURL_DISABLE_VERBOSE_STRINGS"
321 $write cvh "#undef CURL_DISABLE_VERBOSE_STRINGS"
324 $! configure defaults to USE_*, a real configure on VMS chooses different.
325 $write cvh "#ifdef USE_ARES"
326 $write cvh "#undef USE_ARES"
328 $write cvh "#ifdef USE_AXTLS"
329 $write cvh "#undef USE_AXTLS"
331 $write cvh "#ifdef USE_CYASSL"
332 $write cvh "#undef USE_CYASSL"
334 $write cvh "#ifdef USE_DARWINSSL"
335 $write cvh "#undef USE_DARWINSSL"
337 $write cvh "#ifdef USE_GNUTLS"
338 $write cvh "#undef USE_GNUTLS"
340 $write cvh "#ifdef USE_GNUTLS_NETTLE"
341 $write cvh "#undef USE_GNUTLS_NETTLE"
343 $write cvh "#ifdef USE_LIBRTMP"
344 $write cvh "#undef USE_LIBRTMP"
346 $write cvh "#ifdef USE_MANUAL"
347 $write cvh "#undef USE_MANUAL"
349 $write cvh "#ifdef USE_NGHTTP2"
350 $write cvh "#undef USE_NGHTTP2"
352 $write cvh "#ifdef USE_NSS"
353 $write cvh "#undef USE_NSS"
355 $write cvh "#ifdef USE_OPENLDAP"
356 $write cvh "#undef USE_OPENLDAP"
358 $write cvh "#ifdef USE_POLARSSL"
359 $write cvh "#undef USE_POLARSSL"
361 $write cvh "#ifdef USE_SCHANNEL"
362 $write cvh "#undef USE_SCHANNEL"
364 $write cvh "#ifdef USE_THREADS_POSIX"
365 $write cvh "#undef USE_THREADS_POSIX"
367 $write cvh "#ifdef USE_TLS_SRP"
368 $write cvh "#undef USE_TLS_SRP"
370 $write cvh "#ifdef USE_UNIX_SOCKETS"
371 $write cvh "#undef USE_UNIX_SOCKETS"
373 $write cvh "#ifdef USE_WINDOWS_SSPI"
374 $write cvh "#undef USE_WINDOWS_SSPI"
377 $write cvh "#ifndef HAVE_OLD_GSSMIT"
378 $write cvh "#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE"
383 $! The CURL_EXTERN_SYMBOL is used for platforms that need the compiler
384 $! to know about universal symbols. VMS does not need this support so
385 $! we do not set it here.
388 $! I can not figure out where the C compiler is finding the ALLOCA.H file
389 $! in the text libraries, so CONFIG_H.COM can not find it either.
390 $! Usually the header file name is the module name in the text library.
391 $! It does not appear to hurt anything to not find header file, so we
392 $! are not overriding it here.
395 $! Check to see if OpenSSL is present.
396 $!----------------------------------
397 $ssl_include = f$trnlnm("OPENSSL")
398 $if ssl_include .eqs. ""
400 $ ssl_include = f$trnlnm("ssl$include")
402 $if ssl_include .eqs. "" then nossl = 1
407 $ write cvh "#ifndef USE_OPENSSL"
408 $ write cvh "#define USE_OPENSSL 1"
410 $ write cvh "#ifndef USE_SSLEAY"
411 $ write cvh "#define USE_SSLEAY 1"
413 $ if arch_name .eqs. "VAX"
415 $ old_mes = f$enviroment("message")
416 $ set message/notext/nofaci/noseve/noident
417 $ search/output=nla0: ssl$include:*.h CONF_MFLAGS_IGNORE_MISSING_FILE
419 $ set message'old_mes'
420 $ if status .nes. "1"
422 $ write cvh "#define VMS_OLD_SSL 1"
428 $! LibIDN not ported to VMS at this time.
429 $! This is for international domain name support.
430 $! Allow explicit experimentation.
433 $ write cvh "#define HAVE_IDNA_STRERROR 1"
434 $ write cvh "#define HAVE_IDNA_FREE 1"
435 $ write cvh "#define HAVE_IDNA_FREE_H 1"
436 $ write cvh "#define HAVE_LIBIDN 1"
438 $ write cvh "#ifdef HAVE_LIBIDN"
439 $ write cvh "#undef HAVE_LIBIDN"
444 $! LibSSH2 not ported to VMS at this time.
445 $! Allow explicit experimentation.
448 $ write cvh "#define HAVE_LIBSSH2_EXIT 1"
449 $ write cvh "#define HAVE_LIBSSH2_H 1"
450 $ write cvh "#define HAVE_LIBSSH2_INIT 1"
451 $ write cvh "#define HAVE_LIBSSH2_SCP_SEND64 1"
452 $ write cvh "#define HAVE_LIBSSH2_SESSION_HANDSHAKE 1"
453 $ write cvh "#define HAVE_LIBSSH2_VERSION 1
454 $ write cvh "#define HAVE_LIBSSH2 1
456 $ write cvh "#ifndef USE_LIBSSH2"
457 $ write cvh "#define USE_LIBSSH2 1"
460 $ write cvh "#ifdef USE_LIBSSH2"
461 $ write cvh "#undef USE_LIBSSH2"
469 $ write cvh "#define HAVE_LIBZ 1"
470 $ write cvh "#define HAVE_ZLIB_H 1"
474 $! Suppress a message in curl_gssapi.c compile.
475 $write cvh "#pragma message disable notconstqual"
477 $! Close out the file
480 $write cvh "#endif /* __CONFIG_VMS_H__ */"