3 $! I've taken the original build_vms.com, supplied by Nico Baggus, if
4 $! memory serves me correctly, and made some modifications.
6 $! SSL support is controlled by logical names. If SSL$INCLUDE is
7 $! defined, then it is assumed that HP's SSL product has been installed.
8 $! If OPENSSL is defined, but SSL$INCLUDE is not, then OpenSSL will be
9 $! used. If neither logical name is defined, then SSL support will not
10 $! be compiled/linked in. Command-line options NOHPSSL and NOSSL can be
11 $! specified to override the automatic SSL selection.
13 $! Command-line Options:
15 $! CLEAN Delete product files for this host architecture. (No
17 $! CLEAN_ALL Delete product files for all host architectures. (No
20 $! 64 Compile with 64-bit pointers.
21 $! Note, you must match the pointer size that the OpenSSL
22 $! shared image expects.
23 $! Currently curl is not building properly with 64 bit pointers
24 $! on VMS because it is trying to cast pointers to 32 bit
25 $! integers and some OpenVMS library routines called by curl
26 $! do not yet support 64 bit pointers.
27 $! CCQUAL=x Add "x" to the C compiler qualifiers.
28 $! Default qualifiers are:
30 $! /names=(as_is, shortened)
31 $! /repository=[.'arch']
32 $! /nested_include_directory=none
33 $! /define=(_LARGEFILE=1,_USE_STD_STAT=1) (non-vax)
34 $! /float=ieee/ieee_mode=denorm_results (non-vax)
35 $! DEBUG Compile debug and nooptimize
36 $! Alpha/IA64 always compiles /debug.
37 $! Always link a debug image.
38 $! NOIEEE Do not use IEEE floating point. (Alpha/I64)
39 $! VAX must always use DFLOAT
40 $! NOLARGE Disable large-file support if large file support available.
41 $! (Non-VAX, VMS >= V7.2.)
42 $! NOLDAP Disable LDAP support if LDAP is available.
43 $! NOKERBEROS Disable Kerberos support if Kerberos is available.
44 $! LIST Create C compiler listings and linker maps.
45 $! /list/show=(expan,includ)/machine
46 $! FULLLIST Full detailed listing.
47 $! /list/show=(all, nomessages)/machine
48 $! NOHPSSL Don't use HP SSL, even if available.
49 $! Note, you must match the pointer size that the OpenSSL
50 $! shared image expects. This procedure will select the
51 $! correct HP OpenSSL image.
52 $! NOSSL Don't use any SSL, even if available.
53 $! OSSLOLB Use OpenSSL object libraries (.OLB), even if shared
54 $! images (.EXE) are available.
55 $! NOZLIB Don't use GNV$ZLIB shared image even if available.
56 $! REALCLEAN Delete product files for all host architectures. (No
57 $! build done.) Alias for CLEAN_ALL
61 $! CURL_CCDEFS="c_macro_1=value1 [, c_macro_2=value2 [...]]"
62 $! Compile with these additional C macros defined.
66 $! 2-DEC-2003, MSK, the "original" version.
67 $! It works for me. Your mileage may vary.
68 $! 13-JAN-2004, MSK, moved this procedure to the [.packages.vms] directory
69 $! and updated it to do hardware dependent builds.
70 $! 29-JAN-2004, MSK, moved logical defines into defines.com
71 $! 6-FEB-2004, MSK, put in various SSL support bits
72 $! 9-MAR-2004, MSK, the config-vms.h* files are now copied to the lib and
73 $! src directories as curl_config.h.
74 $! 15-MAR-2004, MSK, All of the curlmsg*.* files have also been moved to
75 $! this build directory. They will be copied to the src
76 $! directory before build. The .msg file will be compiled
77 $! to get the .obj for messages, but the .h and .sdl files
78 $! are not automatically created since they partly rely on
79 $! the freeware SDL tool.
80 $! 8-FEB-2005, MSK, merged the two config-vms.h* files into one that uses
81 $! USE_SSLEAY to define if the target has SSL support built
82 $! in. Changed the cc/define parameter accordingly.
83 $! 11-FEB-2005, MSK, If [--.LIB]AMIGAOS.C and NWLIB.C are there, rename them
84 $! 23-MAR-2005, MSK, relocated cc_qual define so that DEBUG option would work
85 $! 25-APR-2007, STL, allow compilation in 64-bit mode.
86 $! 13-DEC-2009. SMS, Changed to skip unwanted source files without
87 $! renaming the original files.
88 $! Eliminated needless, persistent logical names.
89 $! Added CURL_CCDEFS DCL symbol for user-specified C
91 $! Added CLEAN and CLEAN_ALL options.
92 $! Added CCQUAL option for user-specified C compiler
94 $! Added IEEE option for IEEE floating point (Alpha).
95 $! Added LARGE option for large-file support.
96 $! Added OSSLOLB option, and support for OpenSSL
98 $! Changed to put listing and map files into lisdir:.
99 $! Changed to avoid case confusion on ODS5 disks.
100 $! Added more default dev:[dir] save+restore.
101 $! Moved remaining "defines.com" code (back) into
102 $! here, eliminating the hard-coded OpenSSL nonsense.
103 $! Changed to use F$GETSYI("ARCH_NAME") (or
104 $! equivalent) to name architecture-specific product
105 $! file destination directory, and to create the
106 $! directory if needed (obviating inclusion of these
107 $! directories and dummy files in the distribution
109 $! Changed the "compile" subroutine to break the CC
110 $! command across multiple lines to avoid DCL
111 $! line-too-long problems.
112 $! Changed "vo_c" messages to show the CC qualifiers
113 $! once, not with every compile command.
114 $! 01-Jan-2013 J. Malmberg
115 $! VMS build procedures need to be able to work with
116 $! the default set to a search list, with created or
117 $! modified files only in the first member of the search
119 $! Whitespace change to be more compatible with current
121 $! One pass option parsing instead of loop.
122 $! GNV ZLIB shared image support.
123 $! KERBEROS support where available.
124 $! LDAP default to on where available
125 $! LARGEFILE default to on where available
126 $! IEEE float default to on where available.
127 $! Generate the curl_config.h file from system inspection.
128 $! Linker finds ldap with out option file.
129 $! 13-Mar-2013, Tom Grace
130 $! Added missing slash in cc_full_list.
131 $! Removed unwanted extra quotes inside symbol tool_main
132 $! for non-VAX architectures that triggered link failure.
133 $! Replaced curl_sys_inc with sys_inc.
134 $! 19-Mar-2013, John Malmberg
135 $! symbol tool_main needs to be quoted when parse style is
136 $! set to exended in versions of VMS greater than 7.3-1.
137 $! Remove curlbuild.h generation as it should be pre-built
138 $! in the curl release or daily tarball.
139 $! 12-Jul-2013, John Malmberg
140 $! Adjust to find and use ZLIB from the Jean-Francois
141 $! Pieronne shared image and newer GNV ZLIB kit that
142 $! is upward compatible with Jean-Francois's kit.
143 $! Remove tabs from file.
144 $! Fixed DCL formatting as follows:
145 $! * Labels have no space after leading $.
146 $! * 1 space after $ for first level.
147 $! * 3 spaces after $ for second level. Line start + 4.
148 $! * 7 spaces after $ for third level. Line start + 8.
149 $! * Each level after that indents 4 characters.
150 $! * then/else/endif same indentation as if statement.
152 $!===========================================================================
155 $! Save the original default dev:[dir], and arrange for its restoration
157 $!------------------------------------------------------------------------
159 $ orig_def = f$environment("DEFAULT")
160 $ on error then goto Common_Exit
161 $ on control_y then goto Common_Exit
164 $ proc = f$environment("PROCEDURE")
165 $ proc_fid = f$file_attributes(proc, "FID")
166 $ proc_dev = f$parse(proc, , , "DEVICE")
167 $ proc_dir = f$parse(proc, , , "DIRECTORY")
168 $ proc_name = f$parse(proc, , , "NAME")
169 $ proc_type = f$parse(proc, , , "TYPE")
170 $ proc_dev_dir = proc_dev + proc_dir
172 $! Have to manually parse the device for a search list.
173 $! Can not use the f$parse() as it will return the first name
174 $! in the search list.
176 $ orig_def_dev = f$element(0, ":", orig_def) + ":"
177 $ if orig_def_dev .eqs. "::" then orig_def_dev = "sys$disk:"
178 $ test_proc = orig_def_dev + proc_dir + proc_name + proc_type
180 $! If we can find this file using the default directory
181 $! then we know that we should use the original device from the
182 $! default directory which could be a search list.
184 $ test_proc_fid = f$file_attributes(test_proc, "FID")
186 $ if (test_proc_fid .eq. proc_fid)
188 $ proc_dev_dir = orig_def_dev + proc_dir
192 $! Verbose output message stuff. Define symbol to "write sys$output" or "!".
193 $! vo_c - verbose output for compile
195 $! vo_o - object check
197 $ vo_c := "write sys$output"
198 $ vo_l := "write sys$output"
201 $! Determine the main distribution directory ("[--]") in an
202 $! ODS5-tolerant (case-insensitive) way. (We do assume that the only
203 $! "]" or ">" is the one at the end.)
205 $! Some non-US VMS installations report ">" for the directory delimiter
206 $! so do not assume that it is "]".
208 $ orig_def_len = f$length(orig_def)
209 $ delim = f$extract(orig_def_len - 1, 1, orig_def)
211 $ set default 'proc_dev_dir'
213 $ base_dev_dir = f$environment("default")
214 $ top_dev_dir = base_dev_dir - delim
218 $! Define the architecture-specific product file destination directory
221 $ parse_style = "TRADITIONAL"
222 $ if (f$getsyi("HW_MODEL") .lt. 1024)
227 $ arch_name = arch_name + f$edit(f$getsyi("ARCH_NAME"), "UPCASE")
228 $ if (arch_name .eqs. "") then arch_name = "UNK"
230 $! Extended parsing option starts with VMS 7.3-1.
231 $! There is no 7.4, so that simplifies the parse a bit.
233 $ node_swvers = f$getsyi("node_swvers")
234 $ version_patch = f$extract(1, f$length(node_swvers), node_swvers)
235 $ maj_ver = f$element(0, ".", version_patch)
236 $ min_ver_patch = f$element(1, ".", version_patch)
237 $ min_ver = f$element(0, "-", min_ver_patch)
238 $ patch = f$element(1, "-", min_ver_patch)
239 $ if patch .eqs. "-" then patch = ""
241 $ if maj_ver .ges. "8"
245 $ if maj_ver .eqs. "7" .and. min_ver .ges. "3" .and. patch .nes. ""
252 $ parse_style = f$getjpi("", "parse_style_perm")
256 $ exedir = proc_dev_dir - delim + ".''arch_name'" + delim
260 $! When building on a search list, need to do a create to make sure that
261 $! the output directory exists, since the clean procedure tries to delete
263 $ create/dir 'exedir'/prot=o:rwed
265 $! Interpret command-line options.
277 $ cc_names = "/names=(shortened, as_is)/repository='exedir'
278 $ cc_defs = "HAVE_CONFIG_H=1"
279 $ cc_list = "/list='objdir'/show=(expan, includ)/machine
280 $ cc_full_list = "/list='objdir'/show=(all, nomessages)/machine
282 $ if arch_name .eqs. "VAX"
284 $ cc_debug = "/nodebug/optimize"
285 $ !cc_defs = cc_defs + ""
289 $ cc_debug = "/debug/optimize"
290 $ cc_defs = cc_defs + ",_USE_STD_STAT"
291 $ cc_float = "/float=ieee/ieee_mode=denorm_results"
292 $ cc_large = ",_LARGEFILE"
296 $ if (f$type(CURL_CCDEFS) .nes. "")
298 $ CURL_CCDEFS = f$edit(CURL_CCDEFS, "TRIM")
299 $ cc_defs = cc_defs + ", " + CURL_CCDEFS
301 $ msg_qual = "/object = ''objdir'"
304 $! Allow arguments to be grouped together with comma or separated by spaces
305 $! Do no know if we will need more than 8.
306 $ args = "," + p1 + "," + p2 + "," + p3 + "," + p4 + ","
307 $ args = args + p5 + "," + p6 + "," + p7 + "," + p8 + ","
309 $! Provide lower case version to simplify parsing.
310 $ args_lower = f$edit(args, "LOWERCASE,COLLAPSE")
312 $ args_len = f$length(args)
313 $ args_lower_len = f$length(args_lower)
316 $ if f$locate(",clean,", args_lower) .lt. args_lower_len
321 $ if f$locate(",clean_all,", args_lower) .lt. args_lower_len
326 $ if f$locate(",realclean,", args_lower) .lt. args_lower_len
334 $ prods = "''exedir'*.*;*"
335 $ if (f$search(prods) .nes. "") then delete /log 'prods'
336 $ prods = proc_dev_dir + arch_name + ".DIR;1"
337 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
338 $ if (f$search(prods) .nes. "") then delete /log 'prods'
339 $ file = "[]config_vms.h"
340 $ if f$search(file) .nes. "" then delete/log 'file';*
341 $ file = "[]config.h"
342 $ if f$search(file) .nes. "" then delete/log 'file';*
343 $ file = "[]curl-config."
344 $ if f$search(file) .nes. "" then delete/log 'file';*
345 $ file = "[]libcurl.pc"
346 $ if f$search(file) .nes. "" then delete/log 'file';*
347 $ file = "[.lib.cxx_repository]cxx$demangler_db."
348 $ if f$search(file) .nes. "" then delete/log 'file';*
349 $ file = "[.src.cxx_repository]cxx$demangler_db."
350 $ if f$search(file) .nes. "" then delete/log 'file';*
351 $ file = "[.lib]config_vms.h"
352 $ if f$search(file) .nes. "" then delete/log 'file';*
353 $ file = "[...]curl_crtl_init"
354 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
355 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
356 $ file = "[...]gnv$curlmsg"
357 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
358 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
359 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
360 $ file = "[...]curlmsg"
361 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
362 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
363 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
364 $ file = "[...]report_openssl_version"
365 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
366 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
367 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
368 $ file = "[...]hp_ssl_release_info.txt"
369 $ if f$search(file) .nes. "" then delete/log 'file';*
370 $ file = "[...]gnv_libcurl_xfer.mar_exact"
371 $ if f$search(file) .nes. "" then delete/log 'file';*
372 $ file = "[...]gnv_libcurl_xfer"
373 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
374 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
375 $ if f$search("''file'.opt") .nes. "" then delete/log 'file'.opt;*
376 $ file = "[...]curl-*_original_src.bck"
377 $ if f$search(file) .nes. "" then delete/log 'file';*
378 $ file = "[...]curl-*_vms_src.bck"
379 $ if f$search(file) .nes. "" then delete/log 'file';*
380 $ file = "[...]curl-*.release_notes"
381 $ if f$search(file) .nes. "" then delete/log 'file';*
382 $ file = "[...]*curl*.pcsi$desc"
383 $ if f$search(file) .nes. "" then delete/log 'file';*
384 $ file = "[...]*curl*.pcsi$text"
385 $ if f$search(file) .nes. "" then delete/log 'file';*
387 $ if clean_all .eq. 0 then goto Common_Exit
391 $ if clean_all .ne. 0
393 $ file = "[...]gnv$libcurl"
394 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
395 $ if f$search("''file'.map") .nes. "" then delete/log 'file'.map;*
396 $ if f$search("''file'.dsf") .nes. "" then delete/log 'file'.dsf;*
397 $ file = "[.src]curl"
398 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
399 $ if f$search("''file'.map") .nes. "" then delete/log 'file'.map;*
400 $ if f$search("''file'.dsf") .nes. "" then delete/log 'file'.dsf;*
401 $ prods = proc_dev_dir - delim + ".ALPHA" + delim + "*.*;*"
402 $ if (f$search(prods) .nes. "") then delete /log 'prods'
403 $ prods = proc_dev_dir + "ALPHA" + ".DIR;1"
404 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
405 $ if (f$search(prods) .nes. "") then delete /log 'prods'
406 $ prods = proc_dev_dir - delim + ".IA64" + delim + "*.*;*"
407 $ if (f$search(prods) .nes. "") then delete /log 'prods'
408 $ prods = proc_dev_dir + "IA64" + ".DIR;1"
409 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
410 $ if (f$search(prods) .nes. "") then delete /log 'prods'
411 $ prods = proc_dev_dir - delim + ".VAX" + delim + "*.*;*"
412 $ if (f$search(prods) .nes. "") then delete /log 'prods'
413 $ prods = proc_dev_dir + "VAX"+ ".DIR;1"
414 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
415 $ if (f$search(prods) .nes. "") then delete /log 'prods'
416 $ file = "[...]macro32_exactcase"
417 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
418 $ if f$search("''file'.jnl") .nes. "" then delete/log 'file'.jnl;*
423 $ if f$locate(",64,", args_lower) .lt. args_lower_len
425 $ cc_qual1 = cc_qual1 + " /POINTER = 64"
429 $ args_loc = f$locate(",ccqual=", args_lower)
430 $ if args_loc .lt. args_lower_len
432 $ arg = f$extract(args_loc + 1, args_lower_len, args_lower)
433 $ arg_val = f$element(0, ",", arg)
434 $ cc_qual2 = f$element(1, "=", arg_val);
437 $! On Alpha/IA64 no size penalty for compiling /debug/optimize
439 $ if f$locate(",debug,", args_lower) .lt. args_lower_len
441 $ cc_debug = "/debug/nooptimize"
444 $! We normally want IEEE float if it is available. Programs that are
445 $! calling libcurl will typically prefer IEEE behavior, unless on the
446 $! VAX where we have no choice.
448 $ if f$locate(",noieee,", args_lower) .lt. args_lower_len
453 $! Normally we want large file if it is available.
454 $ if f$locate(",nolarge,", args_lower) .lt. args_lower_len
456 $ write sys$output "Handling of large files disabled."
459 $ if cc_large .nes. ""
461 $ cc_defs = cc_defs + cc_large
464 $ if f$locate(",noldap,", args_lower) .lt. args_lower_len
469 $ if f$locate(",list,", args_lower) .lt. args_lower_len
473 $ if f$locate(",fulllist,", args_lower) .lt. args_lower_len
479 $ if f$locate(",nohpssl,", args_lower) .lt. args_lower_len
484 $ if f$locate(",nossl,", args_lower) .lt. args_lower_len
489 $ if f$locate(",osslolb,", args_lower) .lt. args_lower_len
494 $ if f$locate(",nozlib,", args_lower) .lt. args_lower_len
499 $ if f$locate(",nokerberos,", args_lower) .lt. args_lower_len
505 $! CC /LIST, LINK /MAP, and MESSAGE /LIST are defaults in batch mode,
506 $! so be explicit when they're not desired.
511 $ cc_qual1 = cc_qual1 + "/nolist"
512 $ msg_qual = msg_qual + "/nolist"
514 $ msg_qual = msg_qual + "/list='objdir'"
515 $ if (full_list .ne. 0)
517 $ cc_qual1 = cc_qual1 + cc_full_list
519 $ cc_qual1 = cc_qual1 + cc_list
522 $ cc_qual1 = cc_qual1 + cc_names + cc_float + cc_debug
524 $! Create product directory, if needed.
526 $ if (f$search(proc_dev_dir + arch_name + ".DIR;1") .eqs. "")
528 $ create /directory 'exedir'
531 $! Detect available (but not prohibited) SSL software.
533 $ libsslshr_line = ""
534 $ libcryptoshr_line = ""
537 $ if (f$trnlnm("OPENSSL") .nes. "")
539 $! cc_defs = cc_defs + ", USE_SSLEAY=1"
540 $ if ((f$trnlnm("SSL$INCLUDE") .nes. "") .and. (.not. nohpssl))
545 $! Older SSL only has lib*_shr32 images
546 $!-----------------------------------------------
547 $ libsslshr = "sys$share:ssl$libssl_shr"
548 $ if (f$search("''libsslshr'.exe") .eqs. "") .or. (.not. build_64)
550 $ libsslshr = libsslshr + "32"
552 $ libcryptoshr = "sys$share:ssl$libcrypto_shr"
553 $ if (f$search("''libcryptoshr'.exe") .eqs. "") .or. (.not. build_64)
555 $ libcryptoshr = libcryptoshr + "32"
557 $ libsslshr_line = "''libsslshr'.exe/share"
558 $ libcryptoshr_line = "''libcryptoshr'.exe/share"
560 $! Use OpenSSL. Assume object libraries, unless shared images
561 $! are found (and not prohibited).
562 $! TODO: We do not know how to automatically choose based on the
566 $ libsslshr_line = "ssllib:libssl.olb/lib"
567 $ libcryptoshr_line = "ssllib:libcrypto.olb/lib"
568 $ ssl_opt = ", ssllib:libssl.olb /library" + -
569 ", ssllib:libcrypto.olb /library"
570 $ if (osslolb .eq. 0)
572 if ((f$search("ssllib:ssl_libcrypto.exe") .nes. "") .and. -
573 (f$search("ssllib:ssl_libssl.exe") .nes. ""))
575 $! OpenSSL shared images with "SSL_xxx.EXE names.
577 $ libsslshr_line = "ssllib:ssl_libssl_shr.exe/share"
578 $ libcryptoshr_line = "ssllib:ssl_libcrypto_shr.exe/share"
580 $ if ((f$search("ssllib:libcrypto.exe") .nes. "") .and. -
581 (f$search("ssllib:libssl.exe") .nes. ""))
583 $! OpenSSL shared images with "xxx.EXE names.
585 $ libsslshr_line = "ssllib:libssl_shr.exe/share"
586 $ libcryptoshr_line = "ssllib:libcrypto_shr.exe/share"
596 $ if f$search("SYS$SHARE:LDAP$SHR.EXE") .eqs. ""
602 $! cc_defs = cc_defs + ", CURL_DISABLE_LDAP=1"
604 $ 'vo_c' "%CURL-I-BLDHPLDAP, building with HP LDAP support"
608 $ gssrtlshr_line = ""
609 $ try_shr = "sys$share:gss$rtl"
610 $ if f$search("''try_shr'.exe") .eqs. ""
614 $ curl_sys_krbinc = ""
615 $ if nokerberos .eq. 0
617 $ 'vo_c' "%CURL-I-BLDHPKERBEROS, building with HP KERBEROS support"
618 $ curl_sys_krbinc = "sys$sysroot:[kerberos.include]"
619 $ gssrtlshr_line = "''try_shr'/share"
625 $ try_shr = "gnv$libzshr"
628 $! First look for 64 bit
629 $ if f$search("''try_shr'64") .eqs. ""
631 $! Second look for the J.F. Pieronne 64 bit shared image
632 $ try_shr = "LIBZ_SHR64"
633 $ if f$search(try_shr) .eqs. "" then nozlib = 1
636 $! First look for 32 bit
637 $ if f$search("''try_shr'32") .eqs. ""
639 $! Second look for old 32 bit image
640 $ if f$search(try_shr) .eqs. ""
642 $! Third look for the J.F. Pieronne 32 bit shared image
643 $ try_shr = "LIBZ_SHR32"
644 $ if f$search(try_shr) .eqs. "" then nozlib = 1
648 $ if f$search(try_shr) .eqs. ""
652 $ curl_sys_zlibinc = ""
655 $ libzshr_line = "''try_shr'/share"
656 $ if f$locate("LIBZ", try_shr) .eq. 0
658 $ 'vo_c' "%CURL-I-BLDJFPLIBZ, building with JFP LIBZ support"
659 $ curl_sys_zlibinc = "LIBZ:"
661 $ 'vo_c' "%CURL-I-BLDGNVLIBZ, building with GNV LIBZ support"
662 $ curl_sys_zlibinc = "GNV$ZLIB_INCLUDE:"
666 $! Form CC qualifiers.
668 $ cc_defs = "/define = (''cc_defs')"
669 $ cc_qual2 = cc_qual2 + " /object = ''objdir'"
670 $ cc_qual2 = cc_qual2 + " /include = ([-.lib], [-.src],"
671 $ cc_qual2 = cc_qual2 + " [-.packages.vms], [-.packages.vms.''arch_name'])"
672 $ cc_qual2 = cc_qual2 + "/nested_include_directory=none"
674 $ 'vo_c' "CC opts:", -
679 $! Inform the victim of our plans.
683 $ 'vo_c' "%CURL-I-BLDHPSSL, building with HP SSL support"
685 $ if (openssl .ne. 0)
687 $ if (openssl .eq. 1)
690 "%CURL-I-BLDOSSL_OLB, building with OpenSSL (object library) support"
693 "%CURL-I-BLDOSSL_EXE, building with OpenSSL (shared image) support"
696 $ 'vo_c' "%CURL-I-BLDNOSSL, building with NO SSL support"
700 $! Announce destination and SSL directories.
702 $ 'vo_c' " OBJDIR = ''objdir'"
703 $ 'vo_c' " EXEDIR = ''exedir'"
705 $ if (openssl .ne. 0)
707 $ ssllib = f$trnlnm("ssllib")
708 $ if (ssllib .eqs. "")
710 $ ssllib = "(undefined)"
712 $ 'vo_c' " SSLLIB = ''ssllib'"
714 $! TODO: Why are we translating the logical name?
715 $! The logical aname used to find the shared image should just be used
716 $! as translating it could result in the wrong location at run time.
717 $ if (openssl .eq. 1)
719 $ ossl_lib1 = f$trnlnm("ssllib")+ "LIBSSL.OLB"
720 $ ossl_lib2 = f$trnlnm("ssllib")+ "LIBCRYPTO.OLB"
721 $ msg = "object libraries"
723 $ if (openssl .eq. 2)
725 $ ossl_lib1 = f$trnlnm("ssllib")+ "SSL_LIBSSL.EXE"
726 $ ossl_lib2 = f$trnlnm("ssllib")+ "SSL_LIBCRYPTO.EXE"
728 $ ossl_lib1 = f$trnlnm("ssllib")+ "LIBSSL.EXE"
729 $ ossl_lib2 = f$trnlnm("ssllib")+ "LIBCRYPTO.EXE"
731 $ msg = "shared images"
733 $ if ((f$search(ossl_lib1) .eqs. "") .or. -
734 (f$search(ossl_lib2) .eqs. ""))
736 $ write sys$output "Can't find OpenSSL ''msg':"
737 $ write sys$output " ''ossl_lib1'"
738 $ write sys$output " ''ossl_lib2'"
743 $! Define the "curl" (process) logical name for "#include <curl/xxx.h>".
745 $ curl = f$trnlnm("curl", "LNM$PROCESS")
748 $ write sys$output ""
750 "Process logical name ""curl"" is already defined, but this procedure"
752 "would override that definition. Use a command like"
754 " deassign /process curl"
756 "to cancel that logical name definition, and then and re-run this procedure."
757 $ write sys$output ""
760 $ curl_logical = top_dev_dir + ".include.curl" + delim
761 $ curl_sys_inc2 = curl_logical
762 $ curl_sys_inc1 = top_dev_dir + ".include" + delim
763 $! define curl 'top_dev_dir'.include.curl'delim'
765 $! Generate config file into the product directory.
767 $! call MoveIfDiff [.lib]config-vms.h 'objdir'curl_config.h
770 $ if nossl .ne. 0 then conf_params = conf_params + ",nossl"
771 $ if nohpssl .ne. 0 then conf_params = conf_params + ",nohpssl,"
772 $ if ldap .eq. 0 then conf_params = conf_params + ",noldap,"
773 $ if nozlib .ne. 0 then conf_params = conf_params + ",nozlib,"
774 $ if nokerberos .ne. 0 then conf_params = conf_params + ",nokerberos"
775 $ conf_params = conf_params - ","
778 $ new_conf = f$search("''objdir'curl_config.h")
779 $ if new_conf .eqs. ""
782 $ write sys$output "Generating curl custom config_vms.h"
783 $ @'proc_dev_dir'generate_config_vms_h_curl.com ''conf_params'
785 $ write sys$output "Generating curl_config.h"
786 $ conf_in = f$search("[.lib]curl_config*.*in")
787 $ if conf_in .eqs. ""
789 $ write sys$output "Can not find [.lib]curl_config*.*in file!"
792 $ @'proc_dev_dir'config_h.com 'conf_in'
793 $ copy config.h 'objdir'curl_config.h
800 $ on control_y then goto Common_Exit
802 $ set default 'proc_dev_dir'
803 $ sys_inc = "''curl_sys_inc1', ''curl_sys_inc2', ''curl_logical'"
804 $ if curl_sys_krbinc .nes. ""
806 $ sys_inc = sys_inc + ",''curl_sys_krbinc'"
808 $ if curl_sys_zlibinc .nes. ""
810 $ sys_inc = sys_inc + ",''curl_sys_zlibinc'"
812 $ call build "[--.lib]" "*.c" "''objdir'CURLLIB.OLB" "amigaos, nwlib, nwos"
813 $ if ($status .eq. ctrl_y) then goto Common_Exit
814 $ call build "[--.src]" "*.c" "''objdir'CURLSRC.OLB"
815 $ if ($status .eq. ctrl_y) then goto Common_Exit
816 $ call build "[]" "*.msg" "''objdir'CURLSRC.OLB"
817 $ if ($status .eq. ctrl_y) then goto Common_Exit
820 $ if (openssl .ne. 0)
822 $ if (openssl .eq. 1)
824 $ 'vo_l' "%CURL-I-LINK_OSSL, linking with OpenSSL (object library)"
826 $ 'vo_l' "%CURL-I-LINK_HPSSL, linking with OpenSSL (shared image)"
831 $ 'vo_l' "%CURL-I-LINK_HPSSL, linking with HP SSL"
833 $ 'vo_l' "%CURL-I-LINK_NOSSL, linking with NO SSL support"
838 $! GNV helper files for building the test curl binary.
839 $!-----------------------------------------------
840 $ create 'exedir'gnv$curl.opt
841 $ open/append opt 'exedir'gnv$curl.opt
842 $ if libzshr_line .nes. "" then write opt libzshr_line
843 $ if gssrtlshr_line .nes. "" then write opt gssrtlshr_line
844 $ if libcryptoshr_line .nes. "" then write opt libcryptoshr_line
845 $ if libsslshr_line .nes. "" then write opt libsslshr_line
849 $! Create the libcurl
850 $!------------------------------------------------------
851 $ create 'exedir'gnv_libcurl_linker.opt
852 $ open/append opt 'exedir'gnv_libcurl_linker.opt
853 $ if libzshr_line .nes. "" then write opt libzshr_line
854 $ if gssrtlshr_line .nes. "" then write opt gssrtlshr_line
855 $ if libcryptoshr_line .nes. "" then write opt libcryptoshr_line
856 $ if libsslshr_line .nes. "" then write opt libsslshr_line
860 $! If we are not on VAX, then we want the debug symbol table in
862 $! VAX needs the tool_main unquoted in uppercase,
863 $! Alpha and IA64 need tool_main quoted in exact case when parse style is
867 $ tool_main = "tool_main"
868 $ if arch_name .nes. "VAX"
870 $ if parse_style .eqs. "EXTENDED"
872 $ tool_main = """tool_main"""
874 $ link_dsf1 = "/dsf=" + exedir + "CURL.DSF"
875 $ link_dsf2 = "/dsf=" + exedir + "CURL_DEBUG.DSF"
879 $ link_map1 = "/nomap"
880 $ link_map2 = "/nomap"
882 $ link_map1 = "/map=" + exedir + "CURL.MAP"
883 $ link_map2 = "/map=" + exedir + "CURL_DEBUG.MAP"
887 $! Make a normal image.
889 $ link 'link_map1' 'link_dsf1' /executable = 'exedir'CURL.EXE -
890 'objdir'curlsrc.olb /library /include = ('tool_main', curlmsg), -
891 'objdir'curllib.olb /library, -
892 'exedir'gnv$curl.opt/opt
894 $! Also make a debug copy.
895 $ link/debug 'link_map2' 'link_dsf2' /executable = 'exedir'CURL_DEBUG.EXE -
896 'objdir'curlsrc.olb /library /include = ('tool_main', curlmsg), -
897 'objdir'curllib.olb /library, -
898 'exedir'gnv$curl.opt/opt
903 $! Subroutine to build everything with a filetype passed in via P2 in
904 $! the directory passed in via P1 and put it in the object library named
905 $! via P3. Exclude items in P4.
908 $ build_def = f$environment("default")
909 $ on control_y then goto EndLoop ! SS$_CONTROLY
910 $ sts = 1 ! SS$_NORMAL.
914 $ reset = f$search("reset")
915 $ if f$search( p3) .eqs. ""
917 $ librarian /create /object 'p3'
919 $ reject_list__ = "," + f$edit(p4, "COLLAPSE, UPCASE") + ","
920 $ reject_list___len = f$length(reject_list__)
921 $ reset = f$search( "reset", 1)
923 $ file = f$search( search, 1)
924 $ if file .eqs. "" then goto EndLoop
925 $! Skip a name if it's in the P4 exclusion list.
929 f$edit(f$parse(file, , , "NAME", "SYNTAX_ONLY"), "UPCASE") + -
931 $ if (f$locate(name__, reject_list__) .lt. reject_list___len)
936 $ objfile = f$parse("''objdir'.OBJ;", file)
937 $ obj = f$search(objfile, 2)
940 $ if (f$cvtime(f$file(file,"rdt")) .gts. f$cvtime(f$file(obj,"rdt")))
942 $ call compile 'file'
948 $ librarian /object 'p3' 'objfile'
950 $ 'vo_o' "%CURL-I-OBJUTD, ", objfile, " is up to date"
953 $ 'vo_o' "%CURL-I-OBJDNE, ", file, " does not exist"
954 $ call compile 'file'
960 $ librarian /object 'p3' 'objfile'
965 $ set default 'build_def'
967 $ endsubroutine ! Build
969 $! Based on the file TYPE, do the right compile command.
970 $! Only C and MSG supported.
973 $ on control_y then return ctrl_y ! SS$_CONTROLY
976 $ qual = p2+ p3+ p4+ p5+ p6+ p7+ p8
977 $ typ = f$edit(f$parse(file, , , "TYPE"), "UPCASE") - "."
980 $ 'vo_c' "CC (opts) ", file
981 $ define/user curl 'curl_logical'
982 $ if curl_sys_krbinc .nes. "" then define/user gssapi 'curl_sys_krbinc'
983 $ define/user decc$system_include 'sys_inc'
989 $ cmd_msg = "MESSAGE " + msg_qual
991 $ 'vo_c' x, " ", file
994 $ ENDSUBROUTINE ! Compile
996 $! Do a diff of the file specified in P1 with that in P2. If different
997 $! copy P1 to P2. This also covers if P2 doesn't exist, but not if P2
998 $! is an invalid filespec.
1000 $MoveIfDiff: subroutine
1002 $ define /user_mode sys$error nl:
1003 $ define /user_mode sys$output nl:
1004 $ differences 'p1' 'p2'
1006 $ if (status .ne. %X006C8009) ! if status is not "no diff"
1011 $ on control_y then return ctrl_y ! SS$_CONTROLY
1012 $ ENDSUBROUTINE ! MoveIfDiff
1015 $ set default 'orig_def'