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 "#ifdef CURL_DISABLE_POP3"
281 $write cvh "#undef CURL_DISABLE_POP3"
283 $write cvh "#ifdef CURL_DISABLE_PROXY"
284 $write cvh "#undef CURL_DISABLE_PROXY"
286 $write cvh "#ifdef CURL_DISABLE_RTSP"
287 $write cvh "#undef CURL_DISABLE_RTSP"
289 $write cvh "#ifdef CURL_DISABLE_SMTP"
290 $write cvh "#undef CURL_DISABLE_SMTP"
292 $write cvh "#ifdef CURL_DISABLE_TELNET"
293 $write cvh "#undef CURL_DISABLE_TELNET"
295 $write cvh "#ifdef CURL_DISABLE_TFTP"
296 $write cvh "#undef CURL_DISABLE_TFTP"
298 $write cvh "#ifdef CURL_DISABLE_POP3"
299 $write cvh "#undef CURL_DISABLE_POP3"
303 $ write cvh "#ifdef CURL_DISABLE_TLS_SRP"
304 $ write cvh "#undef CURL_DISABLE_TLS_SRP"
308 $write cvh "#ifdef CURL_DISABLE_VERBOSE_STRINGS"
309 $write cvh "#undef CURL_DISABLE_VERBOSE_STRINGS"
312 $! configure defaults to USE_*, a real configure on VMS chooses different.
313 $write cvh "#ifdef USE_ARES"
314 $write cvh "#undef USE_ARES"
316 $write cvh "#ifdef USE_AXTLS"
317 $write cvh "#undef USE_AXTLS"
319 $write cvh "#ifdef USE_CYASSL"
320 $write cvh "#undef USE_CYASSL"
322 $write cvh "#ifdef USE_DARWINSSL"
323 $write cvh "#undef USE_DARWINSSL"
325 $write cvh "#ifdef USE_GNUTLS"
326 $write cvh "#undef USE_GNUTLS"
328 $write cvh "#ifdef USE_GNUTLS_NETTLE"
329 $write cvh "#undef USE_GNUTLS_NETTLE"
331 $write cvh "#ifdef USE_LIBRTMP"
332 $write cvh "#undef USE_LIBRTMP"
334 $write cvh "#ifdef USE_MANUAL"
335 $write cvh "#undef USE_MANUAL"
337 $write cvh "#ifdef USE_NSS"
338 $write cvh "#undef USE_NSS"
340 $write cvh "#ifdef USE_OPENLDAP"
341 $write cvh "#undef USE_OPENLDAP"
343 $write cvh "#ifdef USE_POLARSSL"
344 $write cvh "#undef USE_POLARSSL"
346 $write cvh "#ifdef USE_SCHANNEL"
347 $write cvh "#undef USE_SCHANNEL"
349 $write cvh "#ifdef USE_THREADS_POSIX"
350 $write cvh "#undef USE_THREADS_POSIX"
352 $write cvh "#ifdef USE_TLS_SRP"
353 $write cvh "#undef USE_TLS_SRP"
355 $write cvh "#ifdef USE_WINDOWS_SSPI"
356 $write cvh "#undef USE_WINDOWS_SSPI"
361 $! The CURL_EXTERN_SYMBOL is used for platforms that need the compiler
362 $! to know about universal symbols. VMS does not need this support so
363 $! we do not set it here.
366 $! I can not figure out where the C compiler is finding the ALLOCA.H file
367 $! in the text libraries, so CONFIG_H.COM can not find it either.
368 $! Usually the header file name is the module name in the text library.
369 $! It does not appear to hurt anything to not find header file, so we
370 $! are not overriding it here.
373 $! Check to see if OpenSSL is present.
374 $!----------------------------------
375 $ssl_include = f$trnlnm("OPENSSL")
376 $if ssl_include .eqs. ""
378 $ ssl_include = f$trnlnm("ssl$include")
380 $if ssl_include .eqs. "" then nossl = 1
385 $ write cvh "#ifndef USE_OPENSSL"
386 $ write cvh "#define USE_OPENSSL 1"
388 $ write cvh "#ifndef USE_SSLEAY"
389 $ write cvh "#define USE_SSLEAY 1"
394 $! LibIDN not ported to VMS at this time.
395 $! This is for international domain name support.
396 $! Allow explicit experimentation.
399 $ write cvh "#define HAVE_IDNA_STRERROR 1"
400 $ write cvh "#define HAVE_IDNA_FREE 1"
401 $ write cvh "#define HAVE_IDNA_FREE_H 1"
402 $ write cvh "#define HAVE_LIBIDN 1"
404 $ write cvh "#ifdef HAVE_LIBIDN"
405 $ write cvh "#undef HAVE_LIBIDN"
409 $! LibSSH2 not ported to VMS at this time.
410 $! Allow explicit experimentation.
413 $ write cvh "#define HAVE_LIBSSH2_EXIT 1"
414 $ write cvh "#define HAVE_LIBSSH2_H 1"
415 $ write cvh "#define HAVE_LIBSSH2_INIT 1"
416 $ write cvh "#define HAVE_LIBSSH2_SCP_SEND64 1"
417 $ write cvh "#define HAVE_LIBSSH2_SESSION_HANDSHAKE 1"
418 $ write cvh "#define HAVE_LIBSSH2_VERSION 1
419 $ write cvh "#define HAVE_LIBSSH2 1
421 $ write cvh "#ifndef USE_LIBSSH2"
422 $ write cvh "#define USE_LIBSSH2 1"
425 $ write cvh "#ifdef USE_LIBSSH2"
426 $ write cvh "#undef USE_LIBSSH2"
433 $ write cvh "#define HAVE_LIBZ 1"
434 $ write cvh "#define HAVE_ZLIB_H 1"
438 $! Close out the file
441 $write cvh "#endif /* __CONFIG_VMS_H__ */"