]> sjero.net Git - wget/blob - vms/VMS-WGET.COM
[mq]: cfg-mk
[wget] / vms / VMS-WGET.COM
1 $!                                              16 November 2006.  SMS.
2 $!
3 $!    Attempt to build Wget 1.10 automatically, using MMK or MMS.
4 $!
5 $!    Usage:
6 $!
7 $!       @ wget_kit_device:[wget_kit_dir.VMS]VMS-WGET.COM -
8 $!          [DASHD] [DBG] [HPSSL|NOSSL] [LARGE] [LIST] [MMS] -
9 $!          [CLEAN] [CLEAN_ALL] [CLEAN_EXE] [HELP] [MULTINET]
10 $!
11 $!    To enable the "-d" (diagnostics) Wget command-line option, add
12 $! "DASHD" to the command line.
13 $!
14 $!    To enable large-file (>2GB) support (non-VAX systems), add "LARGE"
15 $! to the command line.
16 $!
17 $!    To build a debug executable, add "DBG" to the command line.
18 $!
19 $!    To get compiler listing files, add "LIST" to the command line.
20 $!
21 $!    This procedure prefers MMK to MMS.
22 $! To use MMS when both work, add "MMS" to the command line.
23 $!
24 $!    To prevent automatic detection and use of OpenSSL, add "NOSSL"
25 $! to the command line.  This procedure prefers a generic SSL kit to HP
26 $! SSL.  If the generic logical names OPENSSL and SSLLIB are defined,
27 $! they will be used instead of the HP SSL logical names SSL$INCLUDE
28 $! and SYS$SHARE.  To use HP SSL when these generic logical names are
29 $! defined, add "HPSSL" to the command line.
30 $!
31 $!    To build the "CLEAN" target (which deletes all object and
32 $! executable files for the current CPU type, add "CLEAN" to the command
33 $! line.  Similarly, the "CLEAN_ALL", "CLEAN_EXE" or "HELP" target may be
34 $! specified.  For details, see [.VMS]DESCRIP.MMS.
35 $!
36 $!    The source code contains some old Multinet-specific code which may
37 $! be useful for building the program with Multinet on old VMS versions
38 $! (probably VMS before V7.x).  With more modern VMS and Multinet, there
39 $! should be no need to use any of the old Multinet-specific code.  If
40 $! Multinet build problems occur, try adding "MULTINET" to the command
41 $! line.  The source code contains no special code for PathWay or
42 $! TCPware IP software (or for the DEC/Compaq/HP UCX or TCPIP software).
43 $!
44 $!
45 $!    Special usage for automatic dependency generation (MMS only):
46 $!
47 $!       @ wget_kit_device:[wget_kit_dir.VMS]VMS-WGET.COM -
48 $!          DEPS [DASHD] [HPSSL|NOSSL] [NOSKIP] [CLEAN|PURGE]
49 $!
50 $!    See the [.VMS]DESCRIP_MKDEPS.MMS description file for more
51 $! details.  Specifying the CLEAN target here deletes the dependency
52 $! files, not the usual objects and executables.
53 $!
54 $!    Note that by default, DESCRIP_MKDEPS.MMS will delete the
55 $! intermediate *.MMSD dependency files, leaving only the comprehensive
56 $! dependency file, DESCRIP_DEPS.MMS.  To preserve the intermediate
57 $! files, specify "NOSKIP".
58 $!
59 $!    Specifying the PURGE target here deletes the intermediate *.MMSD
60 $! dependency files, and purges the comprehensive dependency file,
61 $! DESCRIP_DEPS.MMS.
62 $!
63 $!----------------------------------------------------------------------
64 $!
65 $! Sense the current default directory.
66 $!
67 $ def_orig = f$environment( "DEFAULT")
68 $!
69 $! Arrange for clean-up.
70 $!
71 $ on error then goto clean_up
72 $ on control_y then goto clean_up
73 $!
74 $! Set default to the kit [.SRC] directory.
75 $!
76 $ proc = f$environment( "PROCEDURE")
77 $ proc_dev_dir = -
78    f$parse( proc, , , "DEVICE")+ f$parse( proc, , , "DIRECTORY")
79 $ set default 'proc_dev_dir'
80 $ set default [-.src]
81 $!
82 $! Sense the VMS version.
83 $!
84 $ VMS_VERS = f$edit( f$getsyi( "version"), "trim")
85 $!
86 $!
87 $! Analyze the command-line parameters.
88 $!
89 $ CMD = ""
90 $ DASHD = ""
91 $ DBG = ""
92 $ DEPS = ""
93 $ HPSSL = ""
94 $ IP = ""
95 $ LARGE = ""
96 $ LIST = ""
97 $ NOSKIP = ""
98 $ NOSSL = ""
99 $ TARGET = ""
100 $!
101 $ I = 0
102 $ p_loop_top:
103 $!
104 $    I = I+ 1
105 $    P = P'I'
106 $    P = f$edit( P, "TRIM, UPCASE")
107 $!
108 $    if (P .eqs. "DASHD")
109 $    then
110 $       DASHD = "DASHD"
111 $    else
112 $       if (P .eqs. "DBG")
113 $       then
114 $          DBG = "DBG"
115 $       else
116 $          if (P .eqs. "DEPS")
117 $          then
118 $             DEPS = "DEPS"
119 $          else
120 $             if (P .eqs. "MMS")
121 $             then
122 $                CMD = "MMS"
123 $             else
124 $                if (P .eqs. "LARGE")
125 $                then
126 $                   LARGE = "LARGE"
127 $                else
128 $                   if (P .eqs. "LIST")
129 $                   then
130 $                      LIST = "LIST"
131 $                   else
132 $                      if (P .eqs. "MULTINET")
133 $                      then
134 $                         IP = "MULTINET"
135 $                      else
136 $                         if (P .eqs. "NOSKIP")
137 $                         then
138 $                            NOSKIP = "NOSKIP"
139 $                         else
140 $                            if (P .eqs. "NOSSL")
141 $                            then
142 $                               NOSSL = "NOSSL"
143 $                            else
144 $                               if (P .eqs. "HPSSL")
145 $                               then
146 $                                  HPSSL = "HPSSL"
147 $                               else
148 $                                  if (P .nes. "")
149 $                                  then
150 $                                     TARGET = P
151 $                                  else
152 $                                     goto p_loop_bottom
153 $                                  endif
154 $                               endif
155 $                            endif
156 $                         endif
157 $                      endif
158 $                   endif
159 $                endif
160 $             endif
161 $          endif
162 $       endif
163 $    endif
164 $!
165 $ goto p_loop_top
166 $ p_loop_bottom:
167 $!
168 $! Verify MMK, if not intending to use MMS.  DEPS rquires MMS.
169 $! Accept a (non-blank) foreign command symbol "MMK", or the presence of
170 $! MMK.EXE on DCL$PATH.
171 $!
172 $ if (DEPS .eqs. "")
173 $ then
174 $    if ((CMD .eqs. "") .and. (DEPS .eqs. ""))
175 $    then
176 $       CMD = "MMS"
177 $       M_ = f$type( MMK)
178 $       if (M_ .eqs. "")
179 $       then
180 $          if (f$search( "DCL$PATH:MMK.EXE") .nes. "") then CMD = "MMK"
181 $       else
182 $          if (f$edit( MMK, "TRIM") .nes. "") then CMD = "MMK"
183 $       endif
184 $    endif
185 $ endif
186 $!
187 $! Set MMK or MMS macros.
188 $!
189 $ MACROS = """""VMS_VERS=''VMS_VERS'"""""
190 $!
191 $ if (DASHD .nes. "")
192 $ then
193 $    MACROS = MACROS+ ", """"''DASHD'=1"""""
194 $ endif
195 $!
196 $ if (DBG .nes. "")
197 $ then
198 $    MACROS = MACROS+ ", """"''DBG'=1"""""
199 $ endif
200 $!
201 $ if (LARGE .nes. "")
202 $ then
203 $    MACROS = MACROS+ ", """"''LARGE'=1"""""
204 $ endif
205 $!
206 $ if (LIST .nes. "")
207 $ then
208 $    MACROS = MACROS+ ", """"''LIST'=1"""""
209 $ endif
210 $!
211 $ if (IP .nes. "")
212 $ then
213 $    MACROS = MACROS+ ", """"''IP'=1"""""
214 $ endif
215 $!
216 $ if (NOSKIP .nes. "")
217 $ then
218 $    MACROS = MACROS+ ", """"''NOSKIP'=1"""""
219 $ endif
220 $!
221 $ NEED_HP_OPENSSL = 0
222 $ if (NOSSL .eqs. "")
223 $ then
224 $    if (HPSSL .nes. "")
225 $    then
226 $       if (f$search( "ssl$include:ssl.h") .nes. "")
227 $       then
228 $          MACROS = MACROS+ ", """"HPSSL=1"""""
229 $       endif
230 $    else
231 $       if (f$search( "openssl:ssl.h") .nes. "")
232 $       then
233 $          if (f$trnlnm( "OPENSSL") .eqs. "SSL$INCLUDE:")
234 $          then
235 $             MACROS = MACROS+ ", """"HPSSL=1"""""
236 $          else
237 $             MACROS = MACROS+ ", """"SSL=1"""""
238 $          endif
239 $       else
240 $          if (f$search( "ssl$include:ssl.h") .nes. "")
241 $          then
242 $             NEED_HP_OPENSSL = 1
243 $             MACROS = MACROS+ ", """"HPSSL=1"""""
244 $          endif
245 $       endif
246 $    endif
247 $ endif
248 $!
249 $ if (MACROS .nes. "")
250 $ then
251 $    MACROS = "/MACRO = (''MACROS')"
252 $ endif
253 $!
254 $! Compose the MMK or MMS command with the appropriate options.
255 $!
256 $ if (DEPS .eqs. "")
257 $ then
258 $    X := 'CMD' /DESCRIPTION = [-.vms]descrip.mms 'MACROS' 'TARGET'
259 $ else
260 $    CMD = "MMS"
261 $    if (NOSKIP .eqs. "")
262 $    then
263 $       CMD = CMD+ " /SKIP_INTERMEDIATE"
264 $    endif
265 $    X := 'CMD' /EXTENDED_SYNTAX -
266       /DESCRIPTION = [-.vms]descrip_mkdeps.mms 'MACROS' 'TARGET'
267 $ endif
268 $!
269 $! If using HP SSL, define the logical name OPENSSL.
270 $!
271 $ if (NEED_HP_OPENSSL)
272 $ then
273 $    define openssl ssl$include
274 $ endif
275 $!
276 $! If using any SSL, show the openssl definition.
277 $!
278 $ if (NOSSL .eqs. "")
279 $ then
280 $    lnm = f$trnlnm( "OPENSSL")
281 $    if (lnm .eqs. "")
282 $    then
283 $       lnm = "(none)"
284 $    endif
285 $    write sys$output "OPENSSL = "+ lnm
286 $ endif
287 $!
288 $! Show the MMK or MMS command.
289 $!
290 $ write sys$output X
291 $!
292 $! Run MMK or MMS with the appropriate options.
293 $!
294 $ 'X'
295 $!
296 $ clean_up:
297 $!
298 $! If using HP SSL, deassign the logical name OPENSSL.
299 $!
300 $ if (NEED_HP_OPENSSL)
301 $ then
302 $    deassign openssl
303 $ endif
304 $!
305 $! Restore the original default directory.
306 $!
307 $ set default 'def_orig'
308 $!