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.
151 $! 17-Nov-2014, Michael Steve
152 $! Modified build to handle new location of the VTLS lib
153 $! source within zip archive. Not a pretty fix.
155 $!===========================================================================
158 $! Save the original default dev:[dir], and arrange for its restoration
160 $!------------------------------------------------------------------------
162 $ orig_def = f$environment("DEFAULT")
163 $ on error then goto Common_Exit
164 $ on control_y then goto Common_Exit
167 $ proc = f$environment("PROCEDURE")
168 $ proc_fid = f$file_attributes(proc, "FID")
169 $ proc_dev = f$parse(proc, , , "DEVICE")
170 $ proc_dir = f$parse(proc, , , "DIRECTORY")
171 $ proc_name = f$parse(proc, , , "NAME")
172 $ proc_type = f$parse(proc, , , "TYPE")
173 $ proc_dev_dir = proc_dev + proc_dir
175 $! Have to manually parse the device for a search list.
176 $! Can not use the f$parse() as it will return the first name
177 $! in the search list.
179 $ orig_def_dev = f$element(0, ":", orig_def) + ":"
180 $ if orig_def_dev .eqs. "::" then orig_def_dev = "sys$disk:"
181 $ test_proc = orig_def_dev + proc_dir + proc_name + proc_type
183 $! If we can find this file using the default directory
184 $! then we know that we should use the original device from the
185 $! default directory which could be a search list.
187 $ test_proc_fid = f$file_attributes(test_proc, "FID")
189 $ if (test_proc_fid .eq. proc_fid)
191 $ proc_dev_dir = orig_def_dev + proc_dir
195 $! Verbose output message stuff. Define symbol to "write sys$output" or "!".
196 $! vo_c - verbose output for compile
198 $! vo_o - object check
200 $ vo_c := "write sys$output"
201 $ vo_l := "write sys$output"
204 $! Determine the main distribution directory ("[--]") in an
205 $! ODS5-tolerant (case-insensitive) way. (We do assume that the only
206 $! "]" or ">" is the one at the end.)
208 $! Some non-US VMS installations report ">" for the directory delimiter
209 $! so do not assume that it is "]".
211 $ orig_def_len = f$length(orig_def)
212 $ delim = f$extract(orig_def_len - 1, 1, orig_def)
214 $ set default 'proc_dev_dir'
216 $ base_dev_dir = f$environment("default")
217 $ top_dev_dir = base_dev_dir - delim
221 $! Define the architecture-specific product file destination directory
224 $ parse_style = "TRADITIONAL"
225 $ if (f$getsyi("HW_MODEL") .lt. 1024)
230 $ arch_name = arch_name + f$edit(f$getsyi("ARCH_NAME"), "UPCASE")
231 $ if (arch_name .eqs. "") then arch_name = "UNK"
233 $! Extended parsing option starts with VMS 7.3-1.
234 $! There is no 7.4, so that simplifies the parse a bit.
236 $ node_swvers = f$getsyi("node_swvers")
237 $ version_patch = f$extract(1, f$length(node_swvers), node_swvers)
238 $ maj_ver = f$element(0, ".", version_patch)
239 $ min_ver_patch = f$element(1, ".", version_patch)
240 $ min_ver = f$element(0, "-", min_ver_patch)
241 $ patch = f$element(1, "-", min_ver_patch)
242 $ if patch .eqs. "-" then patch = ""
244 $ if maj_ver .ges. "8"
248 $ if maj_ver .eqs. "7" .and. min_ver .ges. "3" .and. patch .nes. ""
255 $ parse_style = f$getjpi("", "parse_style_perm")
259 $ exedir = proc_dev_dir - delim + ".''arch_name'" + delim
263 $! When building on a search list, need to do a create to make sure that
264 $! the output directory exists, since the clean procedure tries to delete
266 $ create/dir 'exedir'/prot=o:rwed
268 $! Interpret command-line options.
280 $ cc_names = "/names=(shortened, as_is)/repository='exedir'
281 $ cc_defs = "HAVE_CONFIG_H=1"
282 $ cc_list = "/list='objdir'/show=(expan, includ)/machine
283 $ cc_full_list = "/list='objdir'/show=(all, nomessages)/machine
285 $ if arch_name .eqs. "VAX"
287 $ cc_debug = "/nodebug/optimize"
288 $ !cc_defs = cc_defs + ""
292 $ cc_debug = "/debug/optimize"
293 $ cc_defs = cc_defs + ",_USE_STD_STAT"
294 $ cc_float = "/float=ieee/ieee_mode=denorm_results"
295 $ cc_large = ",_LARGEFILE"
299 $ if (f$type(CURL_CCDEFS) .nes. "")
301 $ CURL_CCDEFS = f$edit(CURL_CCDEFS, "TRIM")
302 $ cc_defs = cc_defs + ", " + CURL_CCDEFS
304 $ msg_qual = "/object = ''objdir'"
307 $! Allow arguments to be grouped together with comma or separated by spaces
308 $! Do no know if we will need more than 8.
309 $ args = "," + p1 + "," + p2 + "," + p3 + "," + p4 + ","
310 $ args = args + p5 + "," + p6 + "," + p7 + "," + p8 + ","
312 $! Provide lower case version to simplify parsing.
313 $ args_lower = f$edit(args, "LOWERCASE,COLLAPSE")
315 $ args_len = f$length(args)
316 $ args_lower_len = f$length(args_lower)
319 $ if f$locate(",clean,", args_lower) .lt. args_lower_len
324 $ if f$locate(",clean_all,", args_lower) .lt. args_lower_len
329 $ if f$locate(",realclean,", args_lower) .lt. args_lower_len
337 $ prods = "''exedir'*.*;*"
338 $ if (f$search(prods) .nes. "") then delete /log 'prods'
339 $ prods = proc_dev_dir + arch_name + ".DIR;1"
340 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
341 $ if (f$search(prods) .nes. "") then delete /log 'prods'
342 $ file = "[]config_vms.h"
343 $ if f$search(file) .nes. "" then delete/log 'file';*
344 $ file = "[]config.h"
345 $ if f$search(file) .nes. "" then delete/log 'file';*
346 $ file = "[]curl-config."
347 $ if f$search(file) .nes. "" then delete/log 'file';*
348 $ file = "[]libcurl.pc"
349 $ if f$search(file) .nes. "" then delete/log 'file';*
350 $ file = "[.lib.cxx_repository]cxx$demangler_db."
351 $ if f$search(file) .nes. "" then delete/log 'file';*
352 $ file = "[.src.cxx_repository]cxx$demangler_db."
353 $ if f$search(file) .nes. "" then delete/log 'file';*
354 $ file = "[.lib]config_vms.h"
355 $ if f$search(file) .nes. "" then delete/log 'file';*
356 $ file = "[...]curl_crtl_init"
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 $ file = "[...]gnv$curlmsg"
360 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
361 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
362 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
363 $ file = "[...]curlmsg"
364 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
365 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
366 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
367 $ file = "[...]report_openssl_version"
368 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
369 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
370 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
371 $ file = "[...]hp_ssl_release_info.txt"
372 $ if f$search(file) .nes. "" then delete/log 'file';*
373 $ file = "[...]gnv_libcurl_xfer.mar_exact"
374 $ if f$search(file) .nes. "" then delete/log 'file';*
375 $ file = "[...]gnv_libcurl_xfer"
376 $ if f$search("''file'.lis") .nes. "" then delete/log 'file'.lis;*
377 $ if f$search("''file'.obj") .nes. "" then delete/log 'file'.obj;*
378 $ if f$search("''file'.opt") .nes. "" then delete/log 'file'.opt;*
379 $ file = "[...]curl-*_original_src.bck"
380 $ if f$search(file) .nes. "" then delete/log 'file';*
381 $ file = "[...]curl_d-*_original_src.bck"
382 $ if f$search(file) .nes. "" then delete/log 'file';*
383 $ file = "[...]curl-*_vms_src.bck"
384 $ if f$search(file) .nes. "" then delete/log 'file';*
385 $ file = "[...]curl_d-*_vms_src.bck"
386 $ if f$search(file) .nes. "" then delete/log 'file';*
387 $ file = "[...]curl-*.release_notes"
388 $ if f$search(file) .nes. "" then delete/log 'file';*
389 $ file = "[...]curl_d-*.release_notes"
390 $ if f$search(file) .nes. "" then delete/log 'file';*
391 $ file = "[...]*curl*.pcsi$desc"
392 $ if f$search(file) .nes. "" then delete/log 'file';*
393 $ file = "[...]*curl_d*.pcsi$desc"
394 $ if f$search(file) .nes. "" then delete/log 'file';*
395 $ file = "[...]*curl*.pcsi$text"
396 $ if f$search(file) .nes. "" then delete/log 'file';*
397 $ file = "[...]*curl_d*.pcsi$text"
398 $ if f$search(file) .nes. "" then delete/log 'file';*
400 $ if clean_all .eq. 0 then goto Common_Exit
404 $ if clean_all .ne. 0
406 $ file = "[...]gnv$libcurl"
407 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
408 $ if f$search("''file'.map") .nes. "" then delete/log 'file'.map;*
409 $ if f$search("''file'.dsf") .nes. "" then delete/log 'file'.dsf;*
410 $ file = "[.src]curl"
411 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
412 $ if f$search("''file'.map") .nes. "" then delete/log 'file'.map;*
413 $ if f$search("''file'.dsf") .nes. "" then delete/log 'file'.dsf;*
414 $ prods = proc_dev_dir - delim + ".ALPHA" + delim + "*.*;*"
415 $ if (f$search(prods) .nes. "") then delete /log 'prods'
416 $ prods = proc_dev_dir + "ALPHA" + ".DIR;1"
417 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
418 $ if (f$search(prods) .nes. "") then delete /log 'prods'
419 $ prods = proc_dev_dir - delim + ".IA64" + delim + "*.*;*"
420 $ if (f$search(prods) .nes. "") then delete /log 'prods'
421 $ prods = proc_dev_dir + "IA64" + ".DIR;1"
422 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
423 $ if (f$search(prods) .nes. "") then delete /log 'prods'
424 $ prods = proc_dev_dir - delim + ".VAX" + delim + "*.*;*"
425 $ if (f$search(prods) .nes. "") then delete /log 'prods'
426 $ prods = proc_dev_dir + "VAX"+ ".DIR;1"
427 $ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
428 $ if (f$search(prods) .nes. "") then delete /log 'prods'
429 $ file = "[...]macro32_exactcase"
430 $ if f$search("''file'.exe") .nes. "" then delete/log 'file'.exe;*
431 $ if f$search("''file'.jnl") .nes. "" then delete/log 'file'.jnl;*
436 $ if f$locate(",64,", args_lower) .lt. args_lower_len
438 $ cc_qual1 = cc_qual1 + " /POINTER = 64"
442 $ args_loc = f$locate(",ccqual=", args_lower)
443 $ if args_loc .lt. args_lower_len
445 $ arg = f$extract(args_loc + 1, args_lower_len, args_lower)
446 $ arg_val = f$element(0, ",", arg)
447 $ cc_qual2 = f$element(1, "=", arg_val);
450 $! On Alpha/IA64 no size penalty for compiling /debug/optimize
452 $ if f$locate(",debug,", args_lower) .lt. args_lower_len
454 $ cc_debug = "/debug/nooptimize"
457 $! We normally want IEEE float if it is available. Programs that are
458 $! calling libcurl will typically prefer IEEE behavior, unless on the
459 $! VAX where we have no choice.
461 $ if f$locate(",noieee,", args_lower) .lt. args_lower_len
466 $! Normally we want large file if it is available.
467 $ if f$locate(",nolarge,", args_lower) .lt. args_lower_len
469 $ write sys$output "Handling of large files disabled."
472 $ if cc_large .nes. ""
474 $ cc_defs = cc_defs + cc_large
477 $ if f$locate(",noldap,", args_lower) .lt. args_lower_len
482 $ if f$locate(",list,", args_lower) .lt. args_lower_len
486 $ if f$locate(",fulllist,", args_lower) .lt. args_lower_len
492 $ if f$locate(",nohpssl,", args_lower) .lt. args_lower_len
497 $ if f$locate(",nossl,", args_lower) .lt. args_lower_len
502 $ if f$locate(",osslolb,", args_lower) .lt. args_lower_len
507 $ if f$locate(",nozlib,", args_lower) .lt. args_lower_len
512 $ if f$locate(",nokerberos,", args_lower) .lt. args_lower_len
518 $! CC /LIST, LINK /MAP, and MESSAGE /LIST are defaults in batch mode,
519 $! so be explicit when they're not desired.
524 $ cc_qual1 = cc_qual1 + "/nolist"
525 $ msg_qual = msg_qual + "/nolist"
527 $ msg_qual = msg_qual + "/list='objdir'"
528 $ if (full_list .ne. 0)
530 $ cc_qual1 = cc_qual1 + cc_full_list
532 $ cc_qual1 = cc_qual1 + cc_list
535 $ cc_qual1 = cc_qual1 + cc_names + cc_float + cc_debug
537 $! Create product directory, if needed.
539 $ if (f$search(proc_dev_dir + arch_name + ".DIR;1") .eqs. "")
541 $ create /directory 'exedir'
544 $! Detect available (but not prohibited) SSL software.
546 $ libsslshr_line = ""
547 $ libcryptoshr_line = ""
550 $ if (f$trnlnm("OPENSSL") .nes. "")
552 $! cc_defs = cc_defs + ", USE_SSLEAY=1"
553 $ if ((f$trnlnm("SSL$INCLUDE") .nes. "") .and. (.not. nohpssl))
558 $! Older SSL only has lib*_shr32 images
559 $!-----------------------------------------------
560 $ libsslshr = "sys$share:ssl$libssl_shr"
561 $ if (f$search("''libsslshr'.exe") .eqs. "") .or. (.not. build_64)
563 $ libsslshr = libsslshr + "32"
565 $ libcryptoshr = "sys$share:ssl$libcrypto_shr"
566 $ if (f$search("''libcryptoshr'.exe") .eqs. "") .or. (.not. build_64)
568 $ libcryptoshr = libcryptoshr + "32"
570 $ libsslshr_line = "''libsslshr'.exe/share"
571 $ libcryptoshr_line = "''libcryptoshr'.exe/share"
573 $! Use OpenSSL. Assume object libraries, unless shared images
574 $! are found (and not prohibited).
575 $! TODO: We do not know how to automatically choose based on the
579 $ libsslshr_line = "ssllib:libssl.olb/lib"
580 $ libcryptoshr_line = "ssllib:libcrypto.olb/lib"
581 $ ssl_opt = ", ssllib:libssl.olb /library" + -
582 ", ssllib:libcrypto.olb /library"
583 $ if (osslolb .eq. 0)
585 if ((f$search("ssllib:ssl_libcrypto.exe") .nes. "") .and. -
586 (f$search("ssllib:ssl_libssl.exe") .nes. ""))
588 $! OpenSSL shared images with "SSL_xxx.EXE names.
590 $ libsslshr_line = "ssllib:ssl_libssl_shr.exe/share"
591 $ libcryptoshr_line = "ssllib:ssl_libcrypto_shr.exe/share"
593 $ if ((f$search("ssllib:libcrypto.exe") .nes. "") .and. -
594 (f$search("ssllib:libssl.exe") .nes. ""))
596 $! OpenSSL shared images with "xxx.EXE names.
598 $ libsslshr_line = "ssllib:libssl_shr.exe/share"
599 $ libcryptoshr_line = "ssllib:libcrypto_shr.exe/share"
609 $ if f$search("SYS$SHARE:LDAP$SHR.EXE") .eqs. ""
615 $! cc_defs = cc_defs + ", CURL_DISABLE_LDAP=1"
617 $ 'vo_c' "%CURL-I-BLDHPLDAP, building with HP LDAP support"
621 $ gssrtlshr_line = ""
622 $ try_shr = "sys$share:gss$rtl"
623 $ if f$search("''try_shr'.exe") .eqs. ""
627 $ curl_sys_krbinc = ""
628 $ if nokerberos .eq. 0
630 $ 'vo_c' "%CURL-I-BLDHPKERBEROS, building with HP KERBEROS support"
631 $ curl_sys_krbinc = "sys$sysroot:[kerberos.include]"
632 $ gssrtlshr_line = "''try_shr'/share"
638 $ try_shr = "gnv$libzshr"
641 $! First look for 64 bit
642 $ if f$search("''try_shr'64") .eqs. ""
644 $! Second look for the J.F. Pieronne 64 bit shared image
645 $ try_shr = "LIBZ_SHR64"
646 $ if f$search(try_shr) .eqs. "" then nozlib = 1
649 $! First look for 32 bit
650 $ if f$search("''try_shr'32") .eqs. ""
652 $! Second look for old 32 bit image
653 $ if f$search(try_shr) .eqs. ""
655 $! Third look for the J.F. Pieronne 32 bit shared image
656 $ try_shr = "LIBZ_SHR32"
657 $ if f$search(try_shr) .eqs. "" then nozlib = 1
661 $ if f$search(try_shr) .eqs. ""
665 $ curl_sys_zlibinc = ""
668 $ libzshr_line = "''try_shr'/share"
669 $ if f$locate("LIBZ", try_shr) .eq. 0
671 $ 'vo_c' "%CURL-I-BLDJFPLIBZ, building with JFP LIBZ support"
672 $ curl_sys_zlibinc = "LIBZ:"
674 $ 'vo_c' "%CURL-I-BLDGNVLIBZ, building with GNV LIBZ support"
675 $ curl_sys_zlibinc = "GNV$ZLIB_INCLUDE:"
679 $! Form CC qualifiers.
681 $ cc_defs = "/define = (''cc_defs')"
682 $ cc_qual2 = cc_qual2 + " /object = ''objdir'"
683 $ cc_qual2 = cc_qual2 + "/nested_include_directory=none"
685 $ 'vo_c' "CC opts:", -
690 $! Inform the victim of our plans.
694 $ 'vo_c' "%CURL-I-BLDHPSSL, building with HP SSL support"
696 $ if (openssl .ne. 0)
698 $ if (openssl .eq. 1)
701 "%CURL-I-BLDOSSL_OLB, building with OpenSSL (object library) support"
704 "%CURL-I-BLDOSSL_EXE, building with OpenSSL (shared image) support"
707 $ 'vo_c' "%CURL-I-BLDNOSSL, building with NO SSL support"
711 $! Announce destination and SSL directories.
713 $ 'vo_c' " OBJDIR = ''objdir'"
714 $ 'vo_c' " EXEDIR = ''exedir'"
716 $ if (openssl .ne. 0)
718 $ ssllib = f$trnlnm("ssllib")
719 $ if (ssllib .eqs. "")
721 $ ssllib = "(undefined)"
723 $ 'vo_c' " SSLLIB = ''ssllib'"
725 $! TODO: Why are we translating the logical name?
726 $! The logical aname used to find the shared image should just be used
727 $! as translating it could result in the wrong location at run time.
728 $ if (openssl .eq. 1)
730 $ ossl_lib1 = f$trnlnm("ssllib")+ "LIBSSL.OLB"
731 $ ossl_lib2 = f$trnlnm("ssllib")+ "LIBCRYPTO.OLB"
732 $ msg = "object libraries"
734 $ if (openssl .eq. 2)
736 $ ossl_lib1 = f$trnlnm("ssllib")+ "SSL_LIBSSL.EXE"
737 $ ossl_lib2 = f$trnlnm("ssllib")+ "SSL_LIBCRYPTO.EXE"
739 $ ossl_lib1 = f$trnlnm("ssllib")+ "LIBSSL.EXE"
740 $ ossl_lib2 = f$trnlnm("ssllib")+ "LIBCRYPTO.EXE"
742 $ msg = "shared images"
744 $ if ((f$search(ossl_lib1) .eqs. "") .or. -
745 (f$search(ossl_lib2) .eqs. ""))
747 $ write sys$output "Can't find OpenSSL ''msg':"
748 $ write sys$output " ''ossl_lib1'"
749 $ write sys$output " ''ossl_lib2'"
754 $! Define the "curl" (process) logical name for "#include <curl/xxx.h>".
756 $ curl = f$trnlnm("curl", "LNM$PROCESS")
759 $ write sys$output ""
761 "Process logical name ""curl"" is already defined, but this procedure"
763 "would override that definition. Use a command like"
765 " deassign /process curl"
767 "to cancel that logical name definition, and then and re-run this procedure."
768 $ write sys$output ""
771 $ curl_logical = top_dev_dir + ".include.curl" + delim
772 $ curl_sys_inc2 = curl_logical
773 $ curl_sys_inc1 = top_dev_dir + ".include" + delim
774 $! define curl 'top_dev_dir'.include.curl'delim'
776 $! Generate config file into the product directory.
778 $! call MoveIfDiff [.lib]config-vms.h 'objdir'curl_config.h
781 $ if nossl .ne. 0 then conf_params = conf_params + ",nossl"
782 $ if nohpssl .ne. 0 then conf_params = conf_params + ",nohpssl,"
783 $ if ldap .eq. 0 then conf_params = conf_params + ",noldap,"
784 $ if nozlib .ne. 0 then conf_params = conf_params + ",nozlib,"
785 $ if nokerberos .ne. 0 then conf_params = conf_params + ",nokerberos"
786 $ conf_params = conf_params - ","
789 $ new_conf = f$search("''objdir'curl_config.h")
790 $ if new_conf .eqs. ""
793 $ write sys$output "Generating curl custom config_vms.h"
794 $ @'proc_dev_dir'generate_config_vms_h_curl.com ''conf_params'
796 $ write sys$output "Generating curl_config.h"
797 $ conf_in = f$search("[.lib]curl_config*.*in")
798 $ if conf_in .eqs. ""
800 $ write sys$output "Can not find [.lib]curl_config*.*in file!"
803 $ @'proc_dev_dir'config_h.com 'conf_in'
804 $ 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'"
823 $ cc_include = "/include=([-.lib],[-.lib.vtls],[-.packages.vms]"
824 $ cc_include = cc_include + ",[-.packages.vms.''arch_name'])"
825 $ call build "[--.lib]" "*.c" "''objdir'CURLLIB.OLB" "amigaos, nwlib, nwos"
826 $ if ($status .eq. ctrl_y) then goto Common_Exit
828 $ cc_include = "/include=([--.lib.vtls],[--.lib],[--.src]"
829 $ cc_include = cc_include + ",[--.packages.vms],[--.packages.vms.''arch_name'])"
830 $ call build "[--.lib.vtls]" "*.c" "''objdir'CURLLIB.OLB" "amigaos, nwlib, nwos"
832 $ cc_include = "/include=([-.src],[-.lib],[-.lib.vtls]"
833 $ cc_include = cc_include + ",[-.packages.vms],[-.packages.vms.''arch_name'])"
834 $ call build "[--.src]" "*.c" "''objdir'CURLSRC.OLB"
835 $ if ($status .eq. ctrl_y) then goto Common_Exit
837 $ call build "[]" "*.msg" "''objdir'CURLSRC.OLB"
838 $ if ($status .eq. ctrl_y) then goto Common_Exit
841 $ if (openssl .ne. 0)
843 $ if (openssl .eq. 1)
845 $ 'vo_l' "%CURL-I-LINK_OSSL, linking with OpenSSL (object library)"
847 $ 'vo_l' "%CURL-I-LINK_HPSSL, linking with OpenSSL (shared image)"
852 $ 'vo_l' "%CURL-I-LINK_HPSSL, linking with HP SSL"
854 $ 'vo_l' "%CURL-I-LINK_NOSSL, linking with NO SSL support"
859 $! GNV helper files for building the test curl binary.
860 $!-----------------------------------------------
861 $ create 'exedir'gnv$curl.opt
862 $ open/append opt 'exedir'gnv$curl.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 $! Create the libcurl
871 $!------------------------------------------------------
872 $ create 'exedir'gnv_libcurl_linker.opt
873 $ open/append opt 'exedir'gnv_libcurl_linker.opt
874 $ if libzshr_line .nes. "" then write opt libzshr_line
875 $ if gssrtlshr_line .nes. "" then write opt gssrtlshr_line
876 $ if libcryptoshr_line .nes. "" then write opt libcryptoshr_line
877 $ if libsslshr_line .nes. "" then write opt libsslshr_line
881 $! If we are not on VAX, then we want the debug symbol table in
883 $! VAX needs the tool_main unquoted in uppercase,
884 $! Alpha and IA64 need tool_main quoted in exact case when parse style is
888 $ tool_main = "tool_main"
889 $ if arch_name .nes. "VAX"
891 $ if parse_style .eqs. "EXTENDED"
893 $ tool_main = """tool_main"""
895 $ link_dsf1 = "/dsf=" + exedir + "CURL.DSF"
896 $ link_dsf2 = "/dsf=" + exedir + "CURL_DEBUG.DSF"
900 $ link_map1 = "/nomap"
901 $ link_map2 = "/nomap"
903 $ link_map1 = "/map=" + exedir + "CURL.MAP"
904 $ link_map2 = "/map=" + exedir + "CURL_DEBUG.MAP"
908 $! Make a normal image.
910 $ link 'link_map1' 'link_dsf1' /executable = 'exedir'CURL.EXE -
911 'objdir'curlsrc.olb /library /include = ('tool_main', curlmsg), -
912 'objdir'curllib.olb /library, -
913 'exedir'gnv$curl.opt/opt
915 $! Also make a debug copy.
916 $ link/debug 'link_map2' 'link_dsf2' /executable = 'exedir'CURL_DEBUG.EXE -
917 'objdir'curlsrc.olb /library /include = ('tool_main', curlmsg), -
918 'objdir'curllib.olb /library, -
919 'exedir'gnv$curl.opt/opt
924 $! Subroutine to build everything with a filetype passed in via P2 in
925 $! the directory passed in via P1 and put it in the object library named
926 $! via P3. Exclude items in P4.
929 $ build_def = f$environment("default")
930 $ on control_y then goto EndLoop ! SS$_CONTROLY
931 $ sts = 1 ! SS$_NORMAL.
934 $ search = "sys$disk:" + p2
935 $ reset = f$search("reset")
936 $ if f$search( p3) .eqs. ""
938 $ librarian /create /object 'p3'
940 $ reject_list__ = "," + f$edit(p4, "COLLAPSE, UPCASE") + ","
941 $ reject_list___len = f$length(reject_list__)
942 $ reset = f$search( "reset", 1)
944 $ file = f$search( search, 1)
945 $ if file .eqs. "" then goto EndLoop
946 $! Skip a name if it's in the P4 exclusion list.
950 f$edit(f$parse(file, , , "NAME", "SYNTAX_ONLY"), "UPCASE") + -
952 $ if (f$locate(name__, reject_list__) .lt. reject_list___len)
957 $ objfile = f$parse("''objdir'.OBJ;", file)
958 $ obj = f$search(objfile, 2)
961 $ if (f$cvtime(f$file(file,"rdt")) .gts. f$cvtime(f$file(obj,"rdt")))
963 $ call compile 'file'
969 $ librarian /object 'p3' 'objfile'
971 $ 'vo_o' "%CURL-I-OBJUTD, ", objfile, " is up to date"
974 $ 'vo_o' "%CURL-I-OBJDNE, ", file, " does not exist"
975 $ call compile 'file'
981 $ librarian /object 'p3' 'objfile'
986 $ set default 'build_def'
988 $ endsubroutine ! Build
990 $! Based on the file TYPE, do the right compile command.
991 $! Only C and MSG supported.
994 $ on control_y then return ctrl_y ! SS$_CONTROLY
997 $ qual = p2+ p3+ p4+ p5+ p6+ p7+ p8
998 $ typ = f$edit(f$parse(file, , , "TYPE"), "UPCASE") - "."
1001 $ 'vo_c' "CC (opts) ", file
1002 $ define/user curl 'curl_logical'
1003 $ if curl_sys_krbinc .nes. "" then define/user gssapi 'curl_sys_krbinc'
1004 $ define/user decc$system_include 'sys_inc'
1011 $ cmd_msg = "MESSAGE " + msg_qual
1013 $ 'vo_c' x, " ", file
1016 $ ENDSUBROUTINE ! Compile
1018 $! Do a diff of the file specified in P1 with that in P2. If different
1019 $! copy P1 to P2. This also covers if P2 doesn't exist, but not if P2
1020 $! is an invalid filespec.
1022 $MoveIfDiff: subroutine
1024 $ define /user_mode sys$error nl:
1025 $ define /user_mode sys$output nl:
1026 $ differences 'p1' 'p2'
1028 $ if (status .ne. %X006C8009) ! if status is not "no diff"
1033 $ on control_y then return ctrl_y ! SS$_CONTROLY
1034 $ ENDSUBROUTINE ! MoveIfDiff
1037 $ set default 'orig_def'