diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:26:58 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:26:58 -0700 |
commit | dc5a43ebfadb6b775f6e64bfeb5a461c66acb394 (patch) | |
tree | 00e122ba59ad883db198dc6adf24d020cac924d3 /make_vms.com | |
parent | d004b047838a7e803818b4973a2e39e0ff8c1fa2 (diff) | |
download | zlib-1.2.3.6.tar.gz zlib-1.2.3.6.tar.bz2 zlib-1.2.3.6.zip |
zlib 1.2.3.6v1.2.3.6
Diffstat (limited to 'make_vms.com')
-rw-r--r-- | make_vms.com | 385 |
1 files changed, 326 insertions, 59 deletions
diff --git a/make_vms.com b/make_vms.com index e3e8740..fc5fd0c 100644 --- a/make_vms.com +++ b/make_vms.com | |||
@@ -11,15 +11,18 @@ $!------------------------------------------------------------------------------ | |||
11 | $! Version history | 11 | $! Version history |
12 | $! 0.01 20060120 First version to receive a number | 12 | $! 0.01 20060120 First version to receive a number |
13 | $! 0.02 20061008 Adapt to new Makefile.in | 13 | $! 0.02 20061008 Adapt to new Makefile.in |
14 | $! 0.03 20091224 Add support for large file check | ||
15 | $! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite | ||
14 | $! | 16 | $! |
15 | $ on error then goto err_exit | 17 | $ on error then goto err_exit |
16 | $! | 18 | $! |
17 | $! | ||
18 | $! Just some general constants... | ||
19 | $! | ||
20 | $ true = 1 | 19 | $ true = 1 |
21 | $ false = 0 | 20 | $ false = 0 |
22 | $ tmpnam = "temp_" + f$getjpi("","pid") | 21 | $ tmpnam = "temp_" + f$getjpi("","pid") |
22 | $ tt = tmpnam + ".txt" | ||
23 | $ tc = tmpnam + ".c" | ||
24 | $ th = tmpnam + ".h" | ||
25 | $ define/nolog tconfig 'th' | ||
23 | $ its_decc = false | 26 | $ its_decc = false |
24 | $ its_vaxc = false | 27 | $ its_vaxc = false |
25 | $ its_gnuc = false | 28 | $ its_gnuc = false |
@@ -27,17 +30,25 @@ $ s_case = False | |||
27 | $! | 30 | $! |
28 | $! Setup variables holding "config" information | 31 | $! Setup variables holding "config" information |
29 | $! | 32 | $! |
30 | $ Make = "" | 33 | $ Make = "" |
31 | $ name = "Zlib" | 34 | $ name = "Zlib" |
32 | $ version = "?.?.?" | 35 | $ version = "?.?.?" |
33 | $ v_string = "ZLIB_VERSION" | 36 | $ v_string = "ZLIB_VERSION" |
34 | $ v_file = "zlib.h" | 37 | $ v_file = "zlib.h" |
35 | $ ccopt = "" | 38 | $ ccopt = "" |
36 | $ lopts = "" | 39 | $ lopts = "" |
37 | $ dnsrl = "" | 40 | $ dnsrl = "" |
41 | $ aconf_in_file = "config.hin" | ||
42 | $ conf_check_string = "" | ||
38 | $ linkonly = false | 43 | $ linkonly = false |
39 | $ optfile = name + ".opt" | 44 | $ optfile = name + ".opt" |
40 | $ axp = f$getsyi("HW_MODEL").ge.1024 | 45 | $ libdefs = "" |
46 | $ axp = f$getsyi("HW_MODEL").ge.1024 .and. f$getsyi("HW_MODEL").lt.4096 | ||
47 | $! | ||
48 | $ whoami = f$parse(f$enviornment("Procedure"),,,,"NO_CONCEAL") | ||
49 | $ mydef = F$parse(whoami,,,"DEVICE") | ||
50 | $ mydir = f$parse(whoami,,,"DIRECTORY") - "][" | ||
51 | $ myproc = f$parse(whoami,,,"Name") + f$parse(whoami,,,"type") | ||
41 | $! | 52 | $! |
42 | $! Check for MMK/MMS | 53 | $! Check for MMK/MMS |
43 | $! | 54 | $! |
@@ -47,11 +58,16 @@ $! | |||
47 | $! | 58 | $! |
48 | $ gosub find_version | 59 | $ gosub find_version |
49 | $! | 60 | $! |
61 | $ open/write topt tmp.opt | ||
62 | $ open/write optf 'optfile' | ||
63 | $! | ||
50 | $ gosub check_opts | 64 | $ gosub check_opts |
51 | $! | 65 | $! |
52 | $! Look for the compiler used | 66 | $! Look for the compiler used |
53 | $! | 67 | $! |
54 | $ gosub check_compiler | 68 | $ gosub check_compiler |
69 | $ close topt | ||
70 | $! | ||
55 | $ if its_decc | 71 | $ if its_decc |
56 | $ then | 72 | $ then |
57 | $ ccopt = "/prefix=all" + ccopt | 73 | $ ccopt = "/prefix=all" + ccopt |
@@ -71,6 +87,49 @@ $ then | |||
71 | $ if f$trnlnm("SYS").eqs."" then define sys sys$library: | 87 | $ if f$trnlnm("SYS").eqs."" then define sys sys$library: |
72 | $ endif | 88 | $ endif |
73 | $! | 89 | $! |
90 | $! Build a fake configure input header | ||
91 | $! | ||
92 | $ open/write conf_hin config.hin | ||
93 | $ write conf_hin "#undef _LARGEFILE64_SOURCE" | ||
94 | $ close conf_hin | ||
95 | $! | ||
96 | $! | ||
97 | $ i = 0 | ||
98 | $FIND_ACONF: | ||
99 | $ fname = f$element(i,"#",aconf_in_file) | ||
100 | $ if fname .eqs. "#" then goto AMISS_ERR | ||
101 | $ if f$search(fname) .eqs. "" | ||
102 | $ then | ||
103 | $ i = i + 1 | ||
104 | $ goto find_aconf | ||
105 | $ endif | ||
106 | $ open/read/err=aconf_err aconf_in 'fname' | ||
107 | $ open/write aconf zlibdefs.h | ||
108 | $ACONF_LOOP: | ||
109 | $ read/end_of_file=aconf_exit aconf_in line | ||
110 | $ work = f$edit(line, "compress,trim") | ||
111 | $ if f$extract(0,6,work) .nes. "#undef" | ||
112 | $ then | ||
113 | $ write aconf line | ||
114 | $ else | ||
115 | $ cdef = f$element(1," ",work) | ||
116 | $ gosub check_config | ||
117 | $ endif | ||
118 | $ goto aconf_loop | ||
119 | $ACONF_EXIT: | ||
120 | $ write aconf "#define VMS 1" | ||
121 | $ write aconf "#include <unistd.h>" | ||
122 | $ write aconf "#include <unixio.h>" | ||
123 | $ write aconf "#ifdef _LARGEFILE" | ||
124 | $ write aconf "#define off64_t __off64_t" | ||
125 | $ write aconf "#define fopen64 fopen" | ||
126 | $ write aconf "#define fseeko64 fseeko" | ||
127 | $ write aconf "#define lseek64 lseek" | ||
128 | $ write aconf "#define ftello64 ftell" | ||
129 | $ write aconf "#endif" | ||
130 | $ close aconf_in | ||
131 | $ close aconf | ||
132 | $ delete 'th';* | ||
74 | $! Build the thing plain or with mms | 133 | $! Build the thing plain or with mms |
75 | $! | 134 | $! |
76 | $ write sys$output "Compiling Zlib sources ..." | 135 | $ write sys$output "Compiling Zlib sources ..." |
@@ -86,15 +145,15 @@ $ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - | |||
86 | $ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - | 145 | $ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - |
87 | deflate.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h | 146 | deflate.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h |
88 | $ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" - | 147 | $ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" - |
89 | gzclose.c zlib.h zconf.h zlibdefs.h gzguts.h | 148 | gzclose.c zutil.h zlib.h zconf.h zlibdefs.h |
90 | $ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" - | 149 | $ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" - |
91 | gzio.c zutil.h zlib.h zconf.h zlibdefs.h | 150 | gzio.c zutil.h zlib.h zconf.h zlibdefs.h |
92 | $ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" - | 151 | $ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" - |
93 | gzlib.c zlib.h zconf.h zlibdefs.h gzguts.h | 152 | gzlib.c zutil.h zlib.h zconf.h zlibdefs.h |
94 | $ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" - | 153 | $ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" - |
95 | gzread.c zlib.h zconf.h zlibdefs.h gzguts.h | 154 | gzread.c zutil.h zlib.h zconf.h zlibdefs.h |
96 | $ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" - | 155 | $ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" - |
97 | gzwrite.c zlib.h zconf.h zlibdefs.h gzguts.h | 156 | gzwrite.c zutil.h zlib.h zconf.h zlibdefs.h |
98 | $ CALL MAKE infback.OBJ "CC ''CCOPT' infback" - | 157 | $ CALL MAKE infback.OBJ "CC ''CCOPT' infback" - |
99 | infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h | 158 | infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h |
100 | $ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - | 159 | $ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - |
@@ -153,6 +212,14 @@ $ goto err_exit | |||
153 | $ERR_EXIT: | 212 | $ERR_EXIT: |
154 | $ set message/facil/ident/sever/text | 213 | $ set message/facil/ident/sever/text |
155 | $ close/nolog optf | 214 | $ close/nolog optf |
215 | $ close/nolog topt | ||
216 | $ close/nolog conf_hin | ||
217 | $ close/nolog aconf_in | ||
218 | $ close/nolog aconf | ||
219 | $ close/nolog out | ||
220 | $ close/nolog min | ||
221 | $ close/nolog mod | ||
222 | $ close/nolog h_in | ||
156 | $ write sys$output "Exiting..." | 223 | $ write sys$output "Exiting..." |
157 | $ exit 2 | 224 | $ exit 2 |
158 | $! | 225 | $! |
@@ -200,61 +267,72 @@ $!------------------------------------------------------------------------------ | |||
200 | $! | 267 | $! |
201 | $! Check command line options and set symbols accordingly | 268 | $! Check command line options and set symbols accordingly |
202 | $! | 269 | $! |
270 | $!------------------------------------------------------------------------------ | ||
271 | $! Version history | ||
272 | $! 0.01 20041206 First version to receive a number | ||
273 | $! 0.02 20060126 Add new "HELP" target | ||
203 | $ CHECK_OPTS: | 274 | $ CHECK_OPTS: |
204 | $ i = 1 | 275 | $ i = 1 |
205 | $ OPT_LOOP: | 276 | $ OPT_LOOP: |
206 | $ if i .lt. 9 | 277 | $ if i .lt. 9 |
207 | $ then | 278 | $ then |
208 | $ cparm = f$edit(p'i',"upcase") | 279 | $ cparm = f$edit(p'i',"upcase") |
209 | $ if cparm .eqs. "DEBUG" | 280 | $! |
210 | $ then | 281 | $! Check if parameter actually contains something |
211 | $ ccopt = ccopt + "/noopt/deb" | 282 | $! |
212 | $ lopts = lopts + "/deb" | 283 | $ if f$edit(cparm,"trim") .nes. "" |
213 | $ endif | ||
214 | $ if f$locate("CCOPT=",cparm) .lt. f$length(cparm) | ||
215 | $ then | ||
216 | $ start = f$locate("=",cparm) + 1 | ||
217 | $ len = f$length(cparm) - start | ||
218 | $ ccopt = ccopt + f$extract(start,len,cparm) | ||
219 | $ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) - | ||
220 | then s_case = true | ||
221 | $ endif | ||
222 | $ if cparm .eqs. "LINK" then linkonly = true | ||
223 | $ if f$locate("LOPTS=",cparm) .lt. f$length(cparm) | ||
224 | $ then | ||
225 | $ start = f$locate("=",cparm) + 1 | ||
226 | $ len = f$length(cparm) - start | ||
227 | $ lopts = lopts + f$extract(start,len,cparm) | ||
228 | $ endif | ||
229 | $ if f$locate("CC=",cparm) .lt. f$length(cparm) | ||
230 | $ then | 284 | $ then |
231 | $ start = f$locate("=",cparm) + 1 | 285 | $ if cparm .eqs. "DEBUG" |
232 | $ len = f$length(cparm) - start | ||
233 | $ cc_com = f$extract(start,len,cparm) | ||
234 | if (cc_com .nes. "DECC") .and. - | ||
235 | (cc_com .nes. "VAXC") .and. - | ||
236 | (cc_com .nes. "GNUC") | ||
237 | $ then | 286 | $ then |
238 | $ write sys$output "Unsupported compiler choice ''cc_com' ignored" | 287 | $ ccopt = ccopt + "/noopt/deb" |
239 | $ write sys$output "Use DECC, VAXC, or GNUC instead" | 288 | $ lopts = lopts + "/deb" |
240 | $ else | ||
241 | $ if cc_com .eqs. "DECC" then its_decc = true | ||
242 | $ if cc_com .eqs. "VAXC" then its_vaxc = true | ||
243 | $ if cc_com .eqs. "GNUC" then its_gnuc = true | ||
244 | $ endif | 289 | $ endif |
245 | $ endif | 290 | $ if f$locate("CCOPT=",cparm) .lt. f$length(cparm) |
246 | $ if f$locate("MAKE=",cparm) .lt. f$length(cparm) | ||
247 | $ then | ||
248 | $ start = f$locate("=",cparm) + 1 | ||
249 | $ len = f$length(cparm) - start | ||
250 | $ mmks = f$extract(start,len,cparm) | ||
251 | $ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS") | ||
252 | $ then | 291 | $ then |
253 | $ make = mmks | 292 | $ start = f$locate("=",cparm) + 1 |
254 | $ else | 293 | $ len = f$length(cparm) - start |
255 | $ write sys$output "Unsupported make choice ''mmks' ignored" | 294 | $ ccopt = ccopt + f$extract(start,len,cparm) |
256 | $ write sys$output "Use MMK or MMS instead" | 295 | $ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) - |
296 | then s_case = true | ||
297 | $ endif | ||
298 | $ if cparm .eqs. "LINK" then linkonly = true | ||
299 | $ if f$locate("LOPTS=",cparm) .lt. f$length(cparm) | ||
300 | $ then | ||
301 | $ start = f$locate("=",cparm) + 1 | ||
302 | $ len = f$length(cparm) - start | ||
303 | $ lopts = lopts + f$extract(start,len,cparm) | ||
304 | $ endif | ||
305 | $ if f$locate("CC=",cparm) .lt. f$length(cparm) | ||
306 | $ then | ||
307 | $ start = f$locate("=",cparm) + 1 | ||
308 | $ len = f$length(cparm) - start | ||
309 | $ cc_com = f$extract(start,len,cparm) | ||
310 | if (cc_com .nes. "DECC") .and. - | ||
311 | (cc_com .nes. "VAXC") .and. - | ||
312 | (cc_com .nes. "GNUC") | ||
313 | $ then | ||
314 | $ write sys$output "Unsupported compiler choice ''cc_com' ignored" | ||
315 | $ write sys$output "Use DECC, VAXC, or GNUC instead" | ||
316 | $ else | ||
317 | $ if cc_com .eqs. "DECC" then its_decc = true | ||
318 | $ if cc_com .eqs. "VAXC" then its_vaxc = true | ||
319 | $ if cc_com .eqs. "GNUC" then its_gnuc = true | ||
320 | $ endif | ||
257 | $ endif | 321 | $ endif |
322 | $ if f$locate("MAKE=",cparm) .lt. f$length(cparm) | ||
323 | $ then | ||
324 | $ start = f$locate("=",cparm) + 1 | ||
325 | $ len = f$length(cparm) - start | ||
326 | $ mmks = f$extract(start,len,cparm) | ||
327 | $ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS") | ||
328 | $ then | ||
329 | $ make = mmks | ||
330 | $ else | ||
331 | $ write sys$output "Unsupported make choice ''mmks' ignored" | ||
332 | $ write sys$output "Use MMK or MMS instead" | ||
333 | $ endif | ||
334 | $ endif | ||
335 | $ if cparm .eqs. "HELP" then gosub bhelp | ||
258 | $ endif | 336 | $ endif |
259 | $ i = i + 1 | 337 | $ i = i + 1 |
260 | $ goto opt_loop | 338 | $ goto opt_loop |
@@ -267,6 +345,8 @@ $! | |||
267 | $! Version history | 345 | $! Version history |
268 | $! 0.01 20040223 First version to receive a number | 346 | $! 0.01 20040223 First version to receive a number |
269 | $! 0.02 20040229 Save/set value of decc$no_rooted_search_lists | 347 | $! 0.02 20040229 Save/set value of decc$no_rooted_search_lists |
348 | $! 0.03 20060202 Extend handling of GNU C | ||
349 | $! 0.04 20090402 Compaq -> hp | ||
270 | $CHECK_COMPILER: | 350 | $CHECK_COMPILER: |
271 | $ if (.not. (its_decc .or. its_vaxc .or. its_gnuc)) | 351 | $ if (.not. (its_decc .or. its_vaxc .or. its_gnuc)) |
272 | $ then | 352 | $ then |
@@ -282,15 +362,21 @@ $ then goto CC_ERR | |||
282 | $ else | 362 | $ else |
283 | $ if its_decc | 363 | $ if its_decc |
284 | $ then | 364 | $ then |
285 | $ write sys$output "CC compiler check ... Compaq C" | 365 | $ write sys$output "CC compiler check ... hp C" |
286 | $ if f$trnlnm("decc$no_rooted_search_lists") .nes. "" | 366 | $ if f$trnlnm("decc$no_rooted_search_lists") .nes. "" |
287 | $ then | 367 | $ then |
288 | $ dnrsl = f$trnlnm("decc$no_rooted_search_lists") | 368 | $ dnrsl = f$trnlnm("decc$no_rooted_search_lists") |
289 | $ endif | 369 | $ endif |
290 | $ define decc$no_rooted_search_lists 1 | 370 | $ define/nolog decc$no_rooted_search_lists 1 |
291 | $ else | 371 | $ else |
292 | $ if its_vaxc then write sys$output "CC compiler check ... VAX C" | 372 | $ if its_vaxc then write sys$output "CC compiler check ... VAX C" |
293 | $ if its_gnuc then write sys$output "CC compiler check ... GNU C" | 373 | $ if its_gnuc |
374 | $ then | ||
375 | $ write sys$output "CC compiler check ... GNU C" | ||
376 | $ if f$trnlnm(topt) then write topt "gnu_cc:[000000]gcclib.olb/lib" | ||
377 | $ if f$trnlnm(optf) then write optf "gnu_cc:[000000]gcclib.olb/lib" | ||
378 | $ cc = "gcc" | ||
379 | $ endif | ||
294 | $ if f$trnlnm(topt) then write topt "sys$share:vaxcrtl.exe/share" | 380 | $ if f$trnlnm(topt) then write topt "sys$share:vaxcrtl.exe/share" |
295 | $ if f$trnlnm(optf) then write optf "sys$share:vaxcrtl.exe/share" | 381 | $ if f$trnlnm(optf) then write optf "sys$share:vaxcrtl.exe/share" |
296 | $ endif | 382 | $ endif |
@@ -310,7 +396,8 @@ $ deck | |||
310 | # written by Martin P.J. Zinser | 396 | # written by Martin P.J. Zinser |
311 | # <zinser@zinser.no-ip.info or zinser@sysdev.deutsche-boerse.com> | 397 | # <zinser@zinser.no-ip.info or zinser@sysdev.deutsche-boerse.com> |
312 | 398 | ||
313 | OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj, infback.obj\ | 399 | OBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzio.obj, gzlib.obj\ |
400 | gzread.obj, gzwrite.obj, uncompr.obj, infback.obj\ | ||
314 | deflate.obj, trees.obj, zutil.obj, inflate.obj, \ | 401 | deflate.obj, trees.obj, zutil.obj, inflate.obj, \ |
315 | inftrees.obj, inffast.obj | 402 | inftrees.obj, inffast.obj |
316 | 403 | ||
@@ -342,7 +429,11 @@ compress.obj : compress.c zlib.h zconf.h zlibdefs.h | |||
342 | crc32.obj : crc32.c zutil.h zlib.h zconf.h zlibdefs.h | 429 | crc32.obj : crc32.c zutil.h zlib.h zconf.h zlibdefs.h |
343 | deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h | 430 | deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h |
344 | example.obj : example.c zlib.h zconf.h zlibdefs.h | 431 | example.obj : example.c zlib.h zconf.h zlibdefs.h |
432 | gzclose.obj : gzclose.c zutil.h zlib.h zconf.h zlibdefs.h | ||
345 | gzio.obj : gzio.c zutil.h zlib.h zconf.h zlibdefs.h | 433 | gzio.obj : gzio.c zutil.h zlib.h zconf.h zlibdefs.h |
434 | gzlib.obj : gzlib.c zutil.h zlib.h zconf.h zlibdefs.h | ||
435 | gzread.obj : gzread.c zutil.h zlib.h zconf.h zlibdefs.h | ||
436 | gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h zlibdefs.h | ||
346 | inffast.obj : inffast.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inffast.h | 437 | inffast.obj : inffast.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inffast.h |
347 | inflate.obj : inflate.c zutil.h zlib.h zconf.h zlibdefs.h | 438 | inflate.obj : inflate.c zutil.h zlib.h zconf.h zlibdefs.h |
348 | inftrees.obj : inftrees.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h | 439 | inftrees.obj : inftrees.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h |
@@ -416,6 +507,169 @@ $ close h_in | |||
416 | $ return | 507 | $ return |
417 | $!------------------------------------------------------------------------------ | 508 | $!------------------------------------------------------------------------------ |
418 | $! | 509 | $! |
510 | $CHECK_CONFIG: | ||
511 | $! | ||
512 | $ in_ldef = f$locate(cdef,libdefs) | ||
513 | $ if (in_ldef .lt. f$length(libdefs)) | ||
514 | $ then | ||
515 | $ write aconf "#define ''cdef' 1" | ||
516 | $ libdefs = f$extract(0,in_ldef,libdefs) + - | ||
517 | f$extract(in_ldef + f$length(cdef) + 1, - | ||
518 | f$length(libdefs) - in_ldef - f$length(cdef) - 1, - | ||
519 | libdefs) | ||
520 | $ else | ||
521 | $ if (f$type('cdef') .eqs. "INTEGER") | ||
522 | $ then | ||
523 | $ write aconf "#define ''cdef' ", 'cdef' | ||
524 | $ else | ||
525 | $ if (f$type('cdef') .eqs. "STRING") | ||
526 | $ then | ||
527 | $ write aconf "#define ''cdef' ", """", '''cdef'', """" | ||
528 | $ else | ||
529 | $ gosub check_cc_def | ||
530 | $ endif | ||
531 | $ endif | ||
532 | $ endif | ||
533 | $ return | ||
534 | $!------------------------------------------------------------------------------ | ||
535 | $! | ||
536 | $! Check if this is a define relating to the properties of the C/C++ | ||
537 | $! compiler | ||
538 | $! | ||
539 | $ CHECK_CC_DEF: | ||
540 | $ if (cdef .eqs. "_LARGEFILE64_SOURCE") | ||
541 | $ then | ||
542 | $ copy sys$input: 'tc' | ||
543 | $ deck | ||
544 | #include "tconfig" | ||
545 | #define _LARGEFILE | ||
546 | #include <stdio.h> | ||
547 | |||
548 | int main(){ | ||
549 | FILE *fp; | ||
550 | fp = fopen("temp.txt","r"); | ||
551 | fseeko(fp,1,SEEK_SET); | ||
552 | fclose(fp); | ||
553 | } | ||
554 | |||
555 | $ eod | ||
556 | $ test_inv = false | ||
557 | $ comm_h = false | ||
558 | $ gosub cc_prop_check | ||
559 | $ return | ||
560 | $ endif | ||
561 | $ write aconf "/* ", line, " */" | ||
562 | $ return | ||
563 | $!------------------------------------------------------------------------------ | ||
564 | $! | ||
565 | $! Check for properties of C/C++ compiler | ||
566 | $! | ||
567 | $! Version history | ||
568 | $! 0.01 20031020 First version to receive a number | ||
569 | $! 0.02 20031022 Added logic for defines with value | ||
570 | $! 0.03 20040309 Make sure local config file gets not deleted | ||
571 | $! 0.04 20041230 Also write include for configure run | ||
572 | $! 0.05 20050103 Add processing of "comment defines" | ||
573 | $CC_PROP_CHECK: | ||
574 | $ cc_prop = true | ||
575 | $ is_need = false | ||
576 | $ is_need = (f$extract(0,4,cdef) .eqs. "NEED") .or. (test_inv .eq. true) | ||
577 | $ if f$search(th) .eqs. "" then create 'th' | ||
578 | $ set message/nofac/noident/nosever/notext | ||
579 | $ on error then continue | ||
580 | $ cc 'tmpnam' | ||
581 | $ if .not. ($status) then cc_prop = false | ||
582 | $ on error then continue | ||
583 | $! The headers might lie about the capabilities of the RTL | ||
584 | $ link 'tmpnam',tmp.opt/opt | ||
585 | $ if .not. ($status) then cc_prop = false | ||
586 | $ set message/fac/ident/sever/text | ||
587 | $ on error then goto err_exit | ||
588 | $ delete/nolog 'tmpnam'.*;*/exclude='th' | ||
589 | $ if (cc_prop .and. .not. is_need) .or. - | ||
590 | (.not. cc_prop .and. is_need) | ||
591 | $ then | ||
592 | $ write sys$output "Checking for ''cdef'... yes" | ||
593 | $ if f$type('cdef_val'_yes) .nes. "" | ||
594 | $ then | ||
595 | $ if f$type('cdef_val'_yes) .eqs. "INTEGER" - | ||
596 | then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_yes) | ||
597 | $ if f$type('cdef_val'_yes) .eqs. "STRING" - | ||
598 | then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_yes) | ||
599 | $ else | ||
600 | $ call write_config f$fao("#define !AS 1",cdef) | ||
601 | $ endif | ||
602 | $ if (cdef .eqs. "HAVE_FSEEKO") .or. (cdef .eqs. "_LARGE_FILES") .or. - | ||
603 | (cdef .eqs. "_LARGEFILE64_SOURCE") then - | ||
604 | call write_config f$string("#define _LARGEFILE 1") | ||
605 | $ else | ||
606 | $ write sys$output "Checking for ''cdef'... no" | ||
607 | $ if (comm_h) | ||
608 | $ then | ||
609 | call write_config f$fao("/* !AS */",line) | ||
610 | $ else | ||
611 | $ if f$type('cdef_val'_no) .nes. "" | ||
612 | $ then | ||
613 | $ if f$type('cdef_val'_no) .eqs. "INTEGER" - | ||
614 | then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_no) | ||
615 | $ if f$type('cdef_val'_no) .eqs. "STRING" - | ||
616 | then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_no) | ||
617 | $ else | ||
618 | $ call write_config f$fao("#undef !AS",cdef) | ||
619 | $ endif | ||
620 | $ endif | ||
621 | $ endif | ||
622 | $ return | ||
623 | $!------------------------------------------------------------------------------ | ||
624 | $! | ||
625 | $! Check for properties of C/C++ compiler with multiple result values | ||
626 | $! | ||
627 | $! Version history | ||
628 | $! 0.01 20040127 First version | ||
629 | $! 0.02 20050103 Reconcile changes from cc_prop up to version 0.05 | ||
630 | $CC_MPROP_CHECK: | ||
631 | $ cc_prop = true | ||
632 | $ i = 1 | ||
633 | $ idel = 1 | ||
634 | $ MT_LOOP: | ||
635 | $ if f$type(result_'i') .eqs. "STRING" | ||
636 | $ then | ||
637 | $ set message/nofac/noident/nosever/notext | ||
638 | $ on error then continue | ||
639 | $ cc 'tmpnam'_'i' | ||
640 | $ if .not. ($status) then cc_prop = false | ||
641 | $ on error then continue | ||
642 | $! The headers might lie about the capabilities of the RTL | ||
643 | $ link 'tmpnam'_'i',tmp.opt/opt | ||
644 | $ if .not. ($status) then cc_prop = false | ||
645 | $ set message/fac/ident/sever/text | ||
646 | $ on error then goto err_exit | ||
647 | $ delete/nolog 'tmpnam'_'i'.*;* | ||
648 | $ if (cc_prop) | ||
649 | $ then | ||
650 | $ write sys$output "Checking for ''cdef'... ", mdef_'i' | ||
651 | $ if f$type(mdef_'i') .eqs. "INTEGER" - | ||
652 | then call write_config f$fao("#define !AS !UL",cdef,mdef_'i') | ||
653 | $ if f$type('cdef_val'_yes) .eqs. "STRING" - | ||
654 | then call write_config f$fao("#define !AS !AS",cdef,mdef_'i') | ||
655 | $ goto msym_clean | ||
656 | $ else | ||
657 | $ i = i + 1 | ||
658 | $ goto mt_loop | ||
659 | $ endif | ||
660 | $ endif | ||
661 | $ write sys$output "Checking for ''cdef'... no" | ||
662 | $ call write_config f$fao("#undef !AS",cdef) | ||
663 | $ MSYM_CLEAN: | ||
664 | $ if (idel .le. msym_max) | ||
665 | $ then | ||
666 | $ delete/sym mdef_'idel' | ||
667 | $ idel = idel + 1 | ||
668 | $ goto msym_clean | ||
669 | $ endif | ||
670 | $ return | ||
671 | $!------------------------------------------------------------------------------ | ||
672 | $! | ||
419 | $! Analyze Object files for OpenVMS AXP to extract Procedure and Data | 673 | $! Analyze Object files for OpenVMS AXP to extract Procedure and Data |
420 | $! information to build a symbol vector for a shareable image | 674 | $! information to build a symbol vector for a shareable image |
421 | $! All the "brains" of this logic was suggested by Hartmut Becker | 675 | $! All the "brains" of this logic was suggested by Hartmut Becker |
@@ -533,3 +787,16 @@ $ EXIT_AA: | |||
533 | $ if V then set verify | 787 | $ if V then set verify |
534 | $ endsubroutine | 788 | $ endsubroutine |
535 | $!------------------------------------------------------------------------------ | 789 | $!------------------------------------------------------------------------------ |
790 | $! | ||
791 | $! Write configuration to both permanent and temporary config file | ||
792 | $! | ||
793 | $! Version history | ||
794 | $! 0.01 20031029 First version to receive a number | ||
795 | $! | ||
796 | $WRITE_CONFIG: SUBROUTINE | ||
797 | $ write aconf 'p1' | ||
798 | $ open/append confh 'th' | ||
799 | $ write confh 'p1' | ||
800 | $ close confh | ||
801 | $ENDSUBROUTINE | ||
802 | $!------------------------------------------------------------------------------ | ||