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_d-*_original_src.bck"
379 $ if f$search(file) .nes. "" then delete/log 'file';*
380 $ file = "[...]curl-*_vms_src.bck"
381 $ if f$search(file) .nes. "" then delete/log 'file';*
382 $ file = "[...]curl_d-*_vms_src.bck"
383 $ if f$search(file) .nes. "" then delete/log 'file';*
384 $ file = "[...]curl-*.release_notes"
385 $ if f$search(file) .nes. "" then delete/log 'file';*
386 $ file = "[...]curl_d-*.release_notes"
387 $ if f$search(file) .nes. "" then delete/log 'file';*
388 $ file = "[...]*curl*.pcsi$desc"
389 $ if f$search(file) .nes. "" then delete/log 'file';*
390 $ file = "[...]*curl_d*.pcsi$desc"
391 $ if f$search(file) .nes. "" then delete/log 'file';*
392 $ file = "[...]*curl*.pcsi$text"
393 $ if f$search(file) .nes. "" then delete/log 'file';*
394 $ file = "[...]*curl_d*.pcsi$text"
395 $ if f$search(file) .nes. "" then delete/log 'file';*
397 $ if clean_all .eq. 0 then goto Common_Exit
401 $ if clean_all .ne. 0
403 $ file = "[...]gnv$libcurl"
404 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
405 $ if f$search("''file'.map") .nes. "" then delete/log 'file'.map;*
406 $ if f$search("''file'.dsf") .nes. "" then delete/log 'file'.dsf;*
407 $ file = "[.src]curl"
408 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
409 $ if f$search("''file'.map") .nes. "" then delete/log 'file'.map;*
410 $ if f$search("''file'.dsf") .nes. "" then delete/log 'file'.dsf;*
411 $ prods = proc_dev_dir - delim + ".ALPHA" + delim + "*.*;*"
412 $ if (f$search(prods) .nes. "") then delete /log 'prods'
413 $ prods = proc_dev_dir + "ALPHA" + ".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 $ prods = proc_dev_dir - delim + ".IA64" + delim + "*.*;*"
417 $ if (f$search(prods) .nes. "") then delete /log 'prods'
418 $ prods = proc_dev_dir + "IA64" + ".DIR;1"
419 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
420 $ if (f$search(prods) .nes. "") then delete /log 'prods'
421 $ prods = proc_dev_dir - delim + ".VAX" + delim + "*.*;*"
422 $ if (f$search(prods) .nes. "") then delete /log 'prods'
423 $ prods = proc_dev_dir + "VAX"+ ".DIR;1"
424 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
425 $ if (f$search(prods) .nes. "") then delete /log 'prods'
426 $ file = "[...]macro32_exactcase"
427 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
428 $ if f$search("''file'.jnl") .nes. "" then delete/log 'file'.jnl;*
433 $ if f$locate(",64,", args_lower) .lt. args_lower_len
435 $ cc_qual1 = cc_qual1 + " /POINTER = 64"
439 $ args_loc = f$locate(",ccqual=", args_lower)
440 $ if args_loc .lt. args_lower_len
442 $ arg = f$extract(args_loc + 1, args_lower_len, args_lower)
443 $ arg_val = f$element(0, ",", arg)
444 $ cc_qual2 = f$element(1, "=", arg_val);
447 $! On Alpha/IA64 no size penalty for compiling /debug/optimize
449 $ if f$locate(",debug,", args_lower) .lt. args_lower_len
451 $ cc_debug = "/debug/nooptimize"
454 $! We normally want IEEE float if it is available. Programs that are
455 $! calling libcurl will typically prefer IEEE behavior, unless on the
456 $! VAX where we have no choice.
458 $ if f$locate(",noieee,", args_lower) .lt. args_lower_len
463 $! Normally we want large file if it is available.
464 $ if f$locate(",nolarge,", args_lower) .lt. args_lower_len
466 $ write sys$output "Handling of large files disabled."
469 $ if cc_large .nes. ""
471 $ cc_defs = cc_defs + cc_large
474 $ if f$locate(",noldap,", args_lower) .lt. args_lower_len
479 $ if f$locate(",list,", args_lower) .lt. args_lower_len
483 $ if f$locate(",fulllist,", args_lower) .lt. args_lower_len
489 $ if f$locate(",nohpssl,", args_lower) .lt. args_lower_len
494 $ if f$locate(",nossl,", args_lower) .lt. args_lower_len
499 $ if f$locate(",osslolb,", args_lower) .lt. args_lower_len
504 $ if f$locate(",nozlib,", args_lower) .lt. args_lower_len
509 $ if f$locate(",nokerberos,", args_lower) .lt. args_lower_len
515 $! CC /LIST, LINK /MAP, and MESSAGE /LIST are defaults in batch mode,
516 $! so be explicit when they're not desired.
521 $ cc_qual1 = cc_qual1 + "/nolist"
522 $ msg_qual = msg_qual + "/nolist"
524 $ msg_qual = msg_qual + "/list='objdir'"
525 $ if (full_list .ne. 0)
527 $ cc_qual1 = cc_qual1 + cc_full_list
529 $ cc_qual1 = cc_qual1 + cc_list
532 $ cc_qual1 = cc_qual1 + cc_names + cc_float + cc_debug
534 $! Create product directory, if needed.
536 $ if (f$search(proc_dev_dir + arch_name + ".DIR;1") .eqs. "")
538 $ create /directory 'exedir'
541 $! Detect available (but not prohibited) SSL software.
543 $ libsslshr_line = ""
544 $ libcryptoshr_line = ""
547 $ if (f$trnlnm("OPENSSL") .nes. "")
549 $! cc_defs = cc_defs + ", USE_SSLEAY=1"
550 $ if ((f$trnlnm("SSL$INCLUDE") .nes. "") .and. (.not. nohpssl))
555 $! Older SSL only has lib*_shr32 images
556 $!-----------------------------------------------
557 $ libsslshr = "sys$share:ssl$libssl_shr"
558 $ if (f$search("''libsslshr'.exe") .eqs. "") .or. (.not. build_64)
560 $ libsslshr = libsslshr + "32"
562 $ libcryptoshr = "sys$share:ssl$libcrypto_shr"
563 $ if (f$search("''libcryptoshr'.exe") .eqs. "") .or. (.not. build_64)
565 $ libcryptoshr = libcryptoshr + "32"
567 $ libsslshr_line = "''libsslshr'.exe/share"
568 $ libcryptoshr_line = "''libcryptoshr'.exe/share"
570 $! Use OpenSSL. Assume object libraries, unless shared images
571 $! are found (and not prohibited).
572 $! TODO: We do not know how to automatically choose based on the
576 $ libsslshr_line = "ssllib:libssl.olb/lib"
577 $ libcryptoshr_line = "ssllib:libcrypto.olb/lib"
578 $ ssl_opt = ", ssllib:libssl.olb /library" + -
579 ", ssllib:libcrypto.olb /library"
580 $ if (osslolb .eq. 0)
582 if ((f$search("ssllib:ssl_libcrypto.exe") .nes. "") .and. -
583 (f$search("ssllib:ssl_libssl.exe") .nes. ""))
585 $! OpenSSL shared images with "SSL_xxx.EXE names.
587 $ libsslshr_line = "ssllib:ssl_libssl_shr.exe/share"
588 $ libcryptoshr_line = "ssllib:ssl_libcrypto_shr.exe/share"
590 $ if ((f$search("ssllib:libcrypto.exe") .nes. "") .and. -
591 (f$search("ssllib:libssl.exe") .nes. ""))
593 $! OpenSSL shared images with "xxx.EXE names.
595 $ libsslshr_line = "ssllib:libssl_shr.exe/share"
596 $ libcryptoshr_line = "ssllib:libcrypto_shr.exe/share"
606 $ if f$search("SYS$SHARE:LDAP$SHR.EXE") .eqs. ""
612 $! cc_defs = cc_defs + ", CURL_DISABLE_LDAP=1"
614 $ 'vo_c' "%CURL-I-BLDHPLDAP, building with HP LDAP support"
618 $ gssrtlshr_line = ""
619 $ try_shr = "sys$share:gss$rtl"
620 $ if f$search("''try_shr'.exe") .eqs. ""
624 $ curl_sys_krbinc = ""
625 $ if nokerberos .eq. 0
627 $ 'vo_c' "%CURL-I-BLDHPKERBEROS, building with HP KERBEROS support"
628 $ curl_sys_krbinc = "sys$sysroot:[kerberos.include]"
629 $ gssrtlshr_line = "''try_shr'/share"
635 $ try_shr = "gnv$libzshr"
638 $! First look for 64 bit
639 $ if f$search("''try_shr'64") .eqs. ""
641 $! Second look for the J.F. Pieronne 64 bit shared image
642 $ try_shr = "LIBZ_SHR64"
643 $ if f$search(try_shr) .eqs. "" then nozlib = 1
646 $! First look for 32 bit
647 $ if f$search("''try_shr'32") .eqs. ""
649 $! Second look for old 32 bit image
650 $ if f$search(try_shr) .eqs. ""
652 $! Third look for the J.F. Pieronne 32 bit shared image
653 $ try_shr = "LIBZ_SHR32"
654 $ if f$search(try_shr) .eqs. "" then nozlib = 1
658 $ if f$search(try_shr) .eqs. ""
662 $ curl_sys_zlibinc = ""
665 $ libzshr_line = "''try_shr'/share"
666 $ if f$locate("LIBZ", try_shr) .eq. 0
668 $ 'vo_c' "%CURL-I-BLDJFPLIBZ, building with JFP LIBZ support"
669 $ curl_sys_zlibinc = "LIBZ:"
671 $ 'vo_c' "%CURL-I-BLDGNVLIBZ, building with GNV LIBZ support"
672 $ curl_sys_zlibinc = "GNV$ZLIB_INCLUDE:"
676 $! Form CC qualifiers.
678 $ cc_defs = "/define = (''cc_defs')"
679 $ cc_qual2 = cc_qual2 + " /object = ''objdir'"
680 $ cc_qual2 = cc_qual2 + " /include = ([-.lib], [-.src],"
681 $ cc_qual2 = cc_qual2 + " [-.packages.vms], [-.packages.vms.''arch_name'])"
682 $ cc_qual2 = cc_qual2 + "/nested_include_directory=none"
684 $ 'vo_c' "CC opts:", -
689 $! Inform the victim of our plans.
693 $ 'vo_c' "%CURL-I-BLDHPSSL, building with HP SSL support"
695 $ if (openssl .ne. 0)
697 $ if (openssl .eq. 1)
700 "%CURL-I-BLDOSSL_OLB, building with OpenSSL (object library) support"
703 "%CURL-I-BLDOSSL_EXE, building with OpenSSL (shared image) support"
706 $ 'vo_c' "%CURL-I-BLDNOSSL, building with NO SSL support"
710 $! Announce destination and SSL directories.
712 $ 'vo_c' " OBJDIR = ''objdir'"
713 $ 'vo_c' " EXEDIR = ''exedir'"
715 $ if (openssl .ne. 0)
717 $ ssllib = f$trnlnm("ssllib")
718 $ if (ssllib .eqs. "")
720 $ ssllib = "(undefined)"
722 $ 'vo_c' " SSLLIB = ''ssllib'"
724 $! TODO: Why are we translating the logical name?
725 $! The logical aname used to find the shared image should just be used
726 $! as translating it could result in the wrong location at run time.
727 $ if (openssl .eq. 1)
729 $ ossl_lib1 = f$trnlnm("ssllib")+ "LIBSSL.OLB"
730 $ ossl_lib2 = f$trnlnm("ssllib")+ "LIBCRYPTO.OLB"
731 $ msg = "object libraries"
733 $ if (openssl .eq. 2)
735 $ ossl_lib1 = f$trnlnm("ssllib")+ "SSL_LIBSSL.EXE"
736 $ ossl_lib2 = f$trnlnm("ssllib")+ "SSL_LIBCRYPTO.EXE"
738 $ ossl_lib1 = f$trnlnm("ssllib")+ "LIBSSL.EXE"
739 $ ossl_lib2 = f$trnlnm("ssllib")+ "LIBCRYPTO.EXE"
741 $ msg = "shared images"
743 $ if ((f$search(ossl_lib1) .eqs. "") .or. -
744 (f$search(ossl_lib2) .eqs. ""))
746 $ write sys$output "Can't find OpenSSL ''msg':"
747 $ write sys$output " ''ossl_lib1'"
748 $ write sys$output " ''ossl_lib2'"
753 $! Define the "curl" (process) logical name for "#include <curl/xxx.h>".
755 $ curl = f$trnlnm("curl", "LNM$PROCESS")
758 $ write sys$output ""
760 "Process logical name ""curl"" is already defined, but this procedure"
762 "would override that definition. Use a command like"
764 " deassign /process curl"
766 "to cancel that logical name definition, and then and re-run this procedure."
767 $ write sys$output ""
770 $ curl_logical = top_dev_dir + ".include.curl" + delim
771 $ curl_sys_inc2 = curl_logical
772 $ curl_sys_inc1 = top_dev_dir + ".include" + delim
773 $! define curl 'top_dev_dir'.include.curl'delim'
775 $! Generate config file into the product directory.
777 $! call MoveIfDiff [.lib]config-vms.h 'objdir'curl_config.h
780 $ if nossl .ne. 0 then conf_params = conf_params + ",nossl"
781 $ if nohpssl .ne. 0 then conf_params = conf_params + ",nohpssl,"
782 $ if ldap .eq. 0 then conf_params = conf_params + ",noldap,"
783 $ if nozlib .ne. 0 then conf_params = conf_params + ",nozlib,"
784 $ if nokerberos .ne. 0 then conf_params = conf_params + ",nokerberos"
785 $ conf_params = conf_params - ","
788 $ new_conf = f$search("''objdir'curl_config.h")
789 $ if new_conf .eqs. ""
792 $ write sys$output "Generating curl custom config_vms.h"
793 $ @'proc_dev_dir'generate_config_vms_h_curl.com ''conf_params'
795 $ write sys$output "Generating curl_config.h"
796 $ conf_in = f$search("[.lib]curl_config*.*in")
797 $ if conf_in .eqs. ""
799 $ write sys$output "Can not find [.lib]curl_config*.*in file!"
802 $ @'proc_dev_dir'config_h.com 'conf_in'
803 $ copy config.h 'objdir'curl_config.h
810 $ on control_y then goto Common_Exit
812 $ set default 'proc_dev_dir'
813 $ sys_inc = "''curl_sys_inc1', ''curl_sys_inc2', ''curl_logical'"
814 $ if curl_sys_krbinc .nes. ""
816 $ sys_inc = sys_inc + ",''curl_sys_krbinc'"
818 $ if curl_sys_zlibinc .nes. ""
820 $ sys_inc = sys_inc + ",''curl_sys_zlibinc'"
822 $ call build "[--.lib]" "*.c" "''objdir'CURLLIB.OLB" "amigaos, nwlib, nwos"
823 $ if ($status .eq. ctrl_y) then goto Common_Exit
824 $ call build "[--.src]" "*.c" "''objdir'CURLSRC.OLB"
825 $ if ($status .eq. ctrl_y) then goto Common_Exit
826 $ call build "[]" "*.msg" "''objdir'CURLSRC.OLB"
827 $ if ($status .eq. ctrl_y) then goto Common_Exit
830 $ if (openssl .ne. 0)
832 $ if (openssl .eq. 1)
834 $ 'vo_l' "%CURL-I-LINK_OSSL, linking with OpenSSL (object library)"
836 $ 'vo_l' "%CURL-I-LINK_HPSSL, linking with OpenSSL (shared image)"
841 $ 'vo_l' "%CURL-I-LINK_HPSSL, linking with HP SSL"
843 $ 'vo_l' "%CURL-I-LINK_NOSSL, linking with NO SSL support"
848 $! GNV helper files for building the test curl binary.
849 $!-----------------------------------------------
850 $ create 'exedir'gnv$curl.opt
851 $ open/append opt 'exedir'gnv$curl.opt
852 $ if libzshr_line .nes. "" then write opt libzshr_line
853 $ if gssrtlshr_line .nes. "" then write opt gssrtlshr_line
854 $ if libcryptoshr_line .nes. "" then write opt libcryptoshr_line
855 $ if libsslshr_line .nes. "" then write opt libsslshr_line
859 $! Create the libcurl
860 $!------------------------------------------------------
861 $ create 'exedir'gnv_libcurl_linker.opt
862 $ open/append opt 'exedir'gnv_libcurl_linker.opt
863 $ if libzshr_line .nes. "" then write opt libzshr_line
864 $ if gssrtlshr_line .nes. "" then write opt gssrtlshr_line
865 $ if libcryptoshr_line .nes. "" then write opt libcryptoshr_line
866 $ if libsslshr_line .nes. "" then write opt libsslshr_line
870 $! If we are not on VAX, then we want the debug symbol table in
872 $! VAX needs the tool_main unquoted in uppercase,
873 $! Alpha and IA64 need tool_main quoted in exact case when parse style is
877 $ tool_main = "tool_main"
878 $ if arch_name .nes. "VAX"
880 $ if parse_style .eqs. "EXTENDED"
882 $ tool_main = """tool_main"""
884 $ link_dsf1 = "/dsf=" + exedir + "CURL.DSF"
885 $ link_dsf2 = "/dsf=" + exedir + "CURL_DEBUG.DSF"
889 $ link_map1 = "/nomap"
890 $ link_map2 = "/nomap"
892 $ link_map1 = "/map=" + exedir + "CURL.MAP"
893 $ link_map2 = "/map=" + exedir + "CURL_DEBUG.MAP"
897 $! Make a normal image.
899 $ link 'link_map1' 'link_dsf1' /executable = 'exedir'CURL.EXE -
900 'objdir'curlsrc.olb /library /include = ('tool_main', curlmsg), -
901 'objdir'curllib.olb /library, -
902 'exedir'gnv$curl.opt/opt
904 $! Also make a debug copy.
905 $ link/debug 'link_map2' 'link_dsf2' /executable = 'exedir'CURL_DEBUG.EXE -
906 'objdir'curlsrc.olb /library /include = ('tool_main', curlmsg), -
907 'objdir'curllib.olb /library, -
908 'exedir'gnv$curl.opt/opt
913 $! Subroutine to build everything with a filetype passed in via P2 in
914 $! the directory passed in via P1 and put it in the object library named
915 $! via P3. Exclude items in P4.
918 $ build_def = f$environment("default")
919 $ on control_y then goto EndLoop ! SS$_CONTROLY
920 $ sts = 1 ! SS$_NORMAL.
924 $ reset = f$search("reset")
925 $ if f$search( p3) .eqs. ""
927 $ librarian /create /object 'p3'
929 $ reject_list__ = "," + f$edit(p4, "COLLAPSE, UPCASE") + ","
930 $ reject_list___len = f$length(reject_list__)
931 $ reset = f$search( "reset", 1)
933 $ file = f$search( search, 1)
934 $ if file .eqs. "" then goto EndLoop
935 $! Skip a name if it's in the P4 exclusion list.
939 f$edit(f$parse(file, , , "NAME", "SYNTAX_ONLY"), "UPCASE") + -
941 $ if (f$locate(name__, reject_list__) .lt. reject_list___len)
946 $ objfile = f$parse("''objdir'.OBJ;", file)
947 $ obj = f$search(objfile, 2)
950 $ if (f$cvtime(f$file(file,"rdt")) .gts. f$cvtime(f$file(obj,"rdt")))
952 $ call compile 'file'
958 $ librarian /object 'p3' 'objfile'
960 $ 'vo_o' "%CURL-I-OBJUTD, ", objfile, " is up to date"
963 $ 'vo_o' "%CURL-I-OBJDNE, ", file, " does not exist"
964 $ call compile 'file'
970 $ librarian /object 'p3' 'objfile'
975 $ set default 'build_def'
977 $ endsubroutine ! Build
979 $! Based on the file TYPE, do the right compile command.
980 $! Only C and MSG supported.
983 $ on control_y then return ctrl_y ! SS$_CONTROLY
986 $ qual = p2+ p3+ p4+ p5+ p6+ p7+ p8
987 $ typ = f$edit(f$parse(file, , , "TYPE"), "UPCASE") - "."
990 $ 'vo_c' "CC (opts) ", file
991 $ define/user curl 'curl_logical'
992 $ if curl_sys_krbinc .nes. "" then define/user gssapi 'curl_sys_krbinc'
993 $ define/user decc$system_include 'sys_inc'
999 $ cmd_msg = "MESSAGE " + msg_qual
1001 $ 'vo_c' x, " ", file
1004 $ ENDSUBROUTINE ! Compile
1006 $! Do a diff of the file specified in P1 with that in P2. If different
1007 $! copy P1 to P2. This also covers if P2 doesn't exist, but not if P2
1008 $! is an invalid filespec.
1010 $MoveIfDiff: subroutine
1012 $ define /user_mode sys$error nl:
1013 $ define /user_mode sys$output nl:
1014 $ differences 'p1' 'p2'
1016 $ if (status .ne. %X006C8009) ! if status is not "no diff"
1021 $ on control_y then return ctrl_y ! SS$_CONTROLY
1022 $ ENDSUBROUTINE ! MoveIfDiff
1025 $ set default 'orig_def'