84
108
$! line-too-long problems.
85
109
$! Changed "vo_c" messages to show the CC qualifiers
86
110
$! once, not with every compile command.
111
$! 01-Jan-2013 J. Malmberg
112
$! VMS build procedures need to be able to work with
113
$! the default set to a search list, with created or
114
$! modified files only in the first member of the search
116
$! Whitespace change to be more compatible with current
118
$! One pass option parsing instead of loop.
119
$! GNV ZLIB shared image support.
120
$! KERBEROS support where available.
121
$! LDAP default to on where available
122
$! LARGEFILE default to on where available
123
$! IEEE float default to on where available.
124
$! Generate the curl_config.h file from system inspection.
125
$! Linker finds ldap with out option file.
127
$!===========================================================================
89
130
$! Save the original default dev:[dir], and arrange for its restoration
132
$!------------------------------------------------------------------------
93
$ orig_def = f$environment( "DEFAULT")
134
$ orig_def = f$environment("DEFAULT")
94
135
$ on error then goto Common_Exit
95
136
$ on control_y then goto Common_Exit
98
$ proc = f$environment( "PROCEDURE")
100
f$parse( proc, , , "DEVICE")+ f$parse( proc, , , "DIRECTORY")
139
$ proc = f$environment("PROCEDURE")
140
$ proc_fid = f$file_attributes(proc, "FID")
141
$ proc_dev = f$parse(proc, , , "DEVICE")
142
$ proc_dir = f$parse(proc, , , "DIRECTORY")
143
$ proc_name = f$parse(proc, , , "NAME")
144
$ proc_type = f$parse(proc, , , "TYPE")
145
$ proc_dev_dir = proc_dev + proc_dir
147
$! Have to manually parse the device for a search list.
148
$! Can not use the f$parse() as it will return the first name
149
$! in the search list.
151
$ orig_def_dev = f$element(0, ":", orig_def) + ":"
152
$ if orig_def_dev .eqs. "::" then orig_def_dev = "sys$disk:"
153
$ test_proc = orig_def_dev + proc_dir + proc_name + proc_type
155
$! If we can find this file using the default directory
156
$! then we know that we should use the original device from the
157
$! default directory which could be a search list.
159
$ test_proc_fid = f$file_attributes(test_proc, "FID")
161
$ if (test_proc_fid .eq. proc_fid)
163
$ proc_dev_dir = orig_def_dev + proc_dir
102
167
$! Verbose output message stuff. Define symbol to "write sys$output" or "!".
103
168
$! vo_c - verbose output for compile
105
170
$! vo_o - object check
107
$ vo_c = "write sys$output"
108
$ vo_l = "write sys$output"
172
$ vo_c := "write sys$output"
173
$ vo_l := "write sys$output"
111
176
$! Determine the main distribution directory ("[--]") in an
112
177
$! ODS5-tolerant (case-insensitive) way. (We do assume that the only
113
$! "]" is the one at the end.)
178
$! "]" or ">" is the one at the end.)
180
$! Some non-US VMS installations report ">" for the directory delimiter
181
$! so do not assume that it is "]".
183
$ orig_def_len = f$length(orig_def)
184
$ delim = f$extract(orig_def_len - 1, 1, orig_def)
115
186
$ set default 'proc_dev_dir'
116
187
$ set default [--]
117
$ top_dev_dir = f$environment( "DEFAULT")- "]"
188
$ base_dev_dir = f$environment("default")
189
$ top_dev_dir = base_dev_dir - delim
119
193
$! Define the architecture-specific product file destination directory
122
$ if (f$getsyi( "HW_MODEL") .lt. 1024)
196
$ if (f$getsyi("HW_MODEL") .lt. 1024)
124
198
$ arch_name = "VAX"
127
$ arch_name = arch_name+ f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
201
$ arch_name = arch_name + f$edit(f$getsyi("ARCH_NAME"), "UPCASE")
128
202
$ if (arch_name .eqs. "") then arch_name = "UNK"
131
$ exedir = proc_dev_dir- "]"+ ".''arch_name']"
205
$ exedir = proc_dev_dir - delim + ".''arch_name'" + delim
132
206
$ lisdir = exedir
133
207
$ objdir = exedir
209
$! When building on a search list, need to do a create to make sure that
210
$! the output directory exists, since the clean procedure tries to delete
212
$ create/dir 'exedir'/prot=o:rwed
135
214
$! Interpret command-line options.
226
$ cc_names = "/names=(shortened, as_is)/repository='exedir'
227
$ cc_defs = "HAVE_CONFIG_H=1"
228
$ cc_list = "/list='objdir'/show=(expan, includ)/machine
229
$ cc_full_list = "list='objdir'/show=(all, nomessages)/machine
231
$ if arch_name .eqs. "VAX"
233
$ cc_debug = "/nodebug/optimize"
234
$ !cc_defs = cc_defs + ""
238
$ cc_debug = "/debug/optimize"
239
$ cc_defs = cc_defs + ",_USE_STD_STAT"
240
$ cc_float = "/float=ieee/ieee_mode=denorm_results"
241
$ cc_large = ",_LARGEFILE"
146
$ cc_defs = "HAVE_CONFIG_H=1"
147
$ if (f$type( CURL_CCDEFS) .nes. "")
245
$ if (f$type(CURL_CCDEFS) .nes. "")
149
$ CURL_CCDEFS = f$edit( CURL_CCDEFS, "TRIM")
150
$ cc_defs = cc_defs+ ", "+ CURL_CCDEFS
247
$ CURL_CCDEFS = f$edit(CURL_CCDEFS, "TRIM")
248
$ cc_defs = cc_defs + ", " + CURL_CCDEFS
153
250
$ msg_qual = "/object = ''objdir'"
160
$ if (arg_val .eqs. "") then goto arg_loop_out
161
$ arg_val = f$edit( arg_val, "upcase")
163
$ if (arg_val .eqs. "CLEAN")
253
$! Allow arguments to be grouped together with comma or separated by spaces
254
$! Do no know if we will need more than 8.
255
$ args = "," + p1 + "," + p2 + "," + p3 + "," + p4 + ","
256
$ args = args + p5 + "," + p6 + "," + p7 + "," + p8 + ","
258
$! Provide lower case version to simplify parsing.
259
$ args_lower = f$edit(args, "LOWERCASE,COLLAPSE")
261
$ args_len = f$length(args)
262
$ args_lower_len = f$length(args_lower)
264
$ if f$locate(",clean,", args_lower) .lt. args_lower_len
165
266
$ prods = "''exedir'*.*;*"
166
$ if (f$search( prods) .nes. "") then delete /log 'prods'
167
$ prods = proc_dev_dir+ arch_name+ ".DIR;1"
168
$ if (f$search( prods) .nes. "") then delete /log 'prods'
172
$ if (arg_val .eqs. "CLEAN_ALL")
174
$ prods = proc_dev_dir- "]"+ ".ALPHA]*.*;*"
175
$ if (f$search( prods) .nes. "") then delete /log 'prods'
176
$ prods = proc_dev_dir+ "ALPHA"+ ".DIR;1"
177
$ if (f$search( prods) .nes. "") then delete /log 'prods'
178
$ prods = proc_dev_dir- "]"+ ".IA64]*.*;*"
179
$ if (f$search( prods) .nes. "") then delete /log 'prods'
180
$ prods = proc_dev_dir+ "IA64"+ ".DIR;1"
181
$ if (f$search( prods) .nes. "") then delete /log 'prods'
182
$ prods = proc_dev_dir- "]"+ ".VAX]*.*;*"
183
$ if (f$search( prods) .nes. "") then delete /log 'prods'
184
$ prods = proc_dev_dir+ "VAX"+ ".DIR;1"
185
$ if (f$search( prods) .nes. "") then delete /log 'prods'
189
$ if (arg_val .eqs. "64")
191
$ cc_qual1 = cc_qual1+ " /POINTER = 64"
195
$ if (f$extract( 0, 6, arg_val) .eqs. "CCQUAL")
197
$ opts = f$edit( arg_val, "COLLAPSE")
198
$ eq = f$locate( "=", opts)
199
$ cc_qual2 = f$extract( (eq+ 1), 1000, opts)
203
$ if (arg_val .eqs. "DEBUG")
205
$ cc_qual1 = cc_qual1+ " /debug /nooptimize"
206
$ link_qual = link_qual+ " /debug"
210
$ if (arg_val .eqs. "IEEE")
212
$ cc_qual1 = cc_qual1+ " /FLOAT = IEEE_FLOAT"
216
$ if (arg_val .eqs. "LARGE")
218
$ if (arch_name .eqs. "VAX")
220
$ write sys$output """LARGE"" is ignored on VAX."
222
$ cc_defs = cc_defs+ ", _LARGEFILE=1"
267
$ if (f$search(prods) .nes. "") then delete /log 'prods'
268
$ prods = proc_dev_dir + arch_name + ".DIR;1"
269
$ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
270
$ if (f$search(prods) .nes. "") then delete /log 'prods'
271
$ file = "[]config_vms.h"
272
$ if f$search(file) .nes. "" then delete/log 'file';*
273
$ file = "[.include.curl]curlbuild.h"
274
$ if f$search(file) .nes. "" then delete/log 'file';*
275
$ file = "[.lib]config_vms.h"
276
$ if f$search(file) .nes. "" then delete/log 'file';*
280
$ if f$locate(",clean_all,", args_lower) .lt. args_lower_len
282
$ prods = proc_dev_dir - delim + ".ALPHA" + delim + "*.*;*"
283
$ if (f$search(prods) .nes. "") then delete /log 'prods'
284
$ prods = proc_dev_dir + "ALPHA" + ".DIR;1"
285
$ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
286
$ if (f$search(prods) .nes. "") then delete /log 'prods'
287
$ prods = proc_dev_dir - delim + ".IA64" + delim + "*.*;*"
288
$ if (f$search(prods) .nes. "") then delete /log 'prods'
289
$ prods = proc_dev_dir + "IA64" + ".DIR;1"
290
$ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
291
$ if (f$search(prods) .nes. "") then delete /log 'prods'
292
$ prods = proc_dev_dir - delim + ".VAX" + delim + "*.*;*"
293
$ if (f$search(prods) .nes. "") then delete /log 'prods'
294
$ prods = proc_dev_dir + "VAX"+ ".DIR;1"
295
$ if (f$search(prods) .nes. "") then set prot=o:rwed 'prods'
296
$ if (f$search(prods) .nes. "") then delete /log 'prods'
301
$ if f$locate(",64,", args_lower) .lt. args_lower_len
303
$ cc_qual1 = cc_qual1 + " /POINTER = 64"
307
$ args_loc = f$locate(",ccqual=", args_lower)
308
$ if args_loc .lt. args_lower_len
310
$ arg = f$extract(args_loc + 1, args_lower_len, args_lower)
311
$ arg_val = f$element(0, ",", arg)
312
$ cc_qual2 = f$element(1, "=", arg_val);
315
$! On Alpha/IA64 no size penalty for compiling /debug/optimize
317
$ if f$locate(",debug,", args_lower) .lt. args_lower_len
319
$ cc_debug = "/debug/nooptimize"
323
$! We normally want IEEE float if it is available. Programs that are
324
$! calling libcurl will typically prefer IEEE behavior, unless on the
325
$! VAX where we have no choice.
327
$ if f$locate(",noieee,", args_lower) .lt. args_lower_len
333
$! Normally we want large file if it is available.
334
$ if f$locate(",nolarge,", args_lower) .lt. args_lower_len
336
$ write sys$output "Handling of large files disabled."
339
$ if cc_large .nes. ""
341
$ cc_defs = cc_defs + cc_large
227
$ if (arg_val .eqs. "LDAP")
344
$ if f$locate(",noldap,", args_lower) .lt. args_lower_len
233
$ if (f$extract( 0, 4, arg_val) .eqs. "LIST")
349
$ if f$locate(",list,", args_lower) .lt. args_lower_len
236
$ cc_qual1 = cc_qual1+ " /list = ''lisdir' /show = (all, nomessages)"
237
$ link_qual = link_qual+ " /map = ''lisdir'"
238
$ msg_qual = msg_qual+ " /list = ''lisdir'"
353
$ if f$locate(",fulllist,", args_lower) .lt. args_lower_len
242
$ if (arg_val .eqs. "NOHPSSL")
359
$ if f$locate(",nohpssl,", args_lower) .lt. args_lower_len
248
$ if (arg_val .eqs. "NOSSL")
364
$ if f$locate(",nossl,", args_lower) .lt. args_lower_len
254
$ if (arg_val .eqs. "OSSLOLB")
369
$ if f$locate(",osslolb,", args_lower) .lt. args_lower_len
260
$ write sys$output "Unrecognized command-line option: ''arg_val'"
374
$ if f$locate(",nozlib,", args_lower) .lt. args_lower_len
379
$ if f$locate(",nokerberos,", args_lower) .lt. args_lower_len
268
385
$! CC /LIST, LINK /MAP, and MESSAGE /LIST are defaults in batch mode,
269
386
$! so be explicit when they're not desired.
273
$ cc_qual1 = cc_qual1+ " /nolist"
274
$ link_qual = link_qual+ " /nomap"
275
$ msg_qual = msg_qual+ " /nolist"
391
$ cc_qual1 = cc_qual1 + "/nolist"
392
$ msg_qual = msg_qual + "/nolist"
394
$ msg_qual = msg_qual + "/list='objdir'"
395
$ if (full_list .ne. 0)
397
$ cc_qual1 = cc_qual1 + cc_full_list
399
$ cc_qual1 = cc_qual1 + cc_list
402
$ cc_qual1 = cc_qual1 + cc_names + cc_float + cc_debug
278
404
$! Create product directory, if needed.
280
$ if (f$search( proc_dev_dir+ arch_name+ ".DIR;1") .eqs. "")
406
$ if (f$search(proc_dev_dir + arch_name + ".DIR;1") .eqs. "")
282
408
$ create /directory 'exedir'
285
411
$! Detect available (but not prohibited) SSL software.
413
$ libsslshr_line = ""
414
$ libcryptoshr_line = ""
287
415
$ if (.not. nossl)
289
$ if (f$trnlnm( "OPENSSL") .nes. "")
417
$ if (f$trnlnm("OPENSSL") .nes. "")
291
$ cc_defs = cc_defs+ ", USE_SSLEAY=1"
292
$ if ((f$trnlnm( "SSL$INCLUDE") .nes. "") .and. (.not. nohpssl))
419
$! cc_defs = cc_defs + ", USE_SSLEAY=1"
420
$ if ((f$trnlnm("SSL$INCLUDE") .nes. "") .and. (.not. nohpssl))
296
$ ssl_opt = ", ''proc_dev_dir'hpssl_"+ -
297
f$getsyi("ARCH_NAME")+ ".opt /options"
425
$! Older SSL only has lib*_shr32 images
426
$!-----------------------------------------------
427
$ libsslshr = "sys$share:ssl$libssl_shr"
428
$ if (f$search("''libsslshr'.exe") .eqs. "") .or. (.not. build_64)
430
$ libsslshr = libsslshr + "32"
432
$ libcryptoshr = "sys$share:ssl$libcrypto_shr"
433
$ if (f$search("''libcryptoshr'.exe") .eqs. "") .or. (.not. build_64)
435
$ libcryptoshr = libcryptoshr + "32"
437
$ libsslshr_line = "''libsslshr'.exe/share"
438
$ libcryptoshr_line = "''libcryptoshr'.exe/share"
299
440
$! Use OpenSSL. Assume object libraries, unless shared images
300
441
$! are found (and not prohibited).
442
$! TODO: We do not know how to automatically choose based on the
302
$ ssl_opt = ", ssllib:libssl.olb /library"+ -
446
$ libsslshr_line = "ssllib:libssl.olb/lib"
447
$ libcryptoshr_line = "ssllib:libcrypto.olb/lib"
448
$ ssl_opt = ", ssllib:libssl.olb /library" + -
303
449
", ssllib:libcrypto.olb /library"
304
450
$ if (osslolb .eq. 0)
306
if ((f$search( "ssllib:ssl_libcrypto.exe") .nes. "") .and. -
307
(f$search( "ssllib:ssl_libssl.exe") .nes. ""))
452
if ((f$search("ssllib:ssl_libcrypto.exe") .nes. "") .and. -
453
(f$search("ssllib:ssl_libssl.exe") .nes. ""))
309
455
$! OpenSSL shared images with "SSL_xxx.EXE names.
311
$ ssl_opt = ", ''proc_dev_dir'openssl_ssl_"+ -
312
f$getsyi("ARCH_NAME")+ ".opt /options"
457
$ libsslshr_line = "ssllib:ssl_libssl_shr.exe/share"
458
$ libcryptoshr_line = "ssllib:ssl_libcrypto_shr.exe/share"
314
$ if ((f$search( "ssllib:libcrypto.exe") .nes. "") .and. -
315
(f$search( "ssllib:libssl.exe") .nes. ""))
460
$ if ((f$search("ssllib:libcrypto.exe") .nes. "") .and. -
461
(f$search("ssllib:libssl.exe") .nes. ""))
317
463
$! OpenSSL shared images with "xxx.EXE names.
319
$ ssl_opt = ", ''proc_dev_dir'openssl_"+ -
320
f$getsyi("ARCH_NAME")+ ".opt /options"
465
$ libsslshr_line = "ssllib:libssl_shr.exe/share"
466
$ libcryptoshr_line = "ssllib:libcrypto_shr.exe/share"