1 $! make libz under VMS written by
4 $! In case of problems with the install you might contact me at
5 $! zinser@zinser.no-ip.info(preferred) or
6 $! martin.zinser@eurexchange.com (work)
8 $! Make procedure history for Zlib
10 $!------------------------------------------------------------------------------
12 $! 0.01 20060120 First version to receive a number
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
16 $! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
17 $! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples
18 $! subdir path, update module search in makefile.in
19 $! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned
20 $! shared image creation
21 $! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared
23 $! 0.09 20120305 SMS. P1 sets builder ("MMK", "MMS", " " (built-in)).
24 $! "" -> automatic, preference: MMK, MMS, built-in.
26 $ on error then goto err_exit
30 $ tmpnam = "temp_" + f$getjpi("","pid")
31 $ tt = tmpnam + ".txt"
34 $ define/nolog tconfig 'th'
40 $! Setup variables holding "config" information
45 $ v_string = "ZLIB_VERSION"
47 $ ccopt = "/include = []"
50 $ aconf_in_file = "zconf.h.in#zconf.h_in#zconf_h.in"
51 $ conf_check_string = ""
53 $ optfile = name + ".opt"
54 $ mapfile = name + ".map"
56 $ vax = f$getsyi("HW_MODEL").lt.1024
57 $ axp = f$getsyi("HW_MODEL").ge.1024 .and. f$getsyi("HW_MODEL").lt.4096
58 $ ia64 = f$getsyi("HW_MODEL").ge.4096
61 $! Why is this needed? And if it is needed, why not simply ".not. vax"?
63 $!!! if axp .or. ia64 then set proc/parse=extended
65 $ whoami = f$parse(f$environment("Procedure"),,,,"NO_CONCEAL")
66 $ mydef = F$parse(whoami,,,"DEVICE")
67 $ mydir = f$parse(whoami,,,"DIRECTORY") - "]["
68 $ myproc = f$parse(whoami,,,"Name") + f$parse(whoami,,,"type")
74 $ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
75 $ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
77 $ Make = f$edit( Make, "trim")
82 $ open/write topt tmp.opt
83 $ open/write optf 'optfile'
87 $! Look for the compiler used
89 $ gosub check_compiler
95 $ ccopt = "/prefix=all" + ccopt
96 $ if f$trnlnm("SYS") .eqs. ""
100 $ define sys sys$library:
102 $ ccopt = "/decc" + ccopt
103 $ define sys decc$library_include:
108 $! Why /NAMES = AS_IS? Why not simply ".not. vax"? And why not on VAX?
112 $ ccopt = ccopt + "/name=as_is/opt=(inline=speed)"
116 $ if its_vaxc .or. its_gnuc
118 $ if f$trnlnm("SYS").eqs."" then define sys sys$library:
121 $! Build a fake configure input header
123 $ open/write conf_hin config.hin
124 $ write conf_hin "#undef _LARGEFILE64_SOURCE"
130 $ fname = f$element(i,"#",aconf_in_file)
131 $ if fname .eqs. "#" then goto AMISS_ERR
132 $ if f$search(fname) .eqs. ""
137 $ open/read/err=aconf_err aconf_in 'fname'
138 $ open/write aconf zconf.h
140 $ read/end_of_file=aconf_exit aconf_in line
141 $ work = f$edit(line, "compress,trim")
142 $ if f$extract(0,6,work) .nes. "#undef"
144 $ if f$extract(0,12,work) .nes. "#cmakedefine"
149 $ cdef = f$element(1," ",work)
155 $ write aconf "/* VMS specifics added by make_vms.com: */"
156 $ write aconf "#define VMS 1"
157 $ write aconf "#include <unistd.h>"
158 $ write aconf "#include <unixio.h>"
159 $ write aconf "#ifdef _LARGEFILE"
160 $ write aconf "# define off64_t __off64_t"
161 $ write aconf "# define fopen64 fopen"
162 $ write aconf "# define fseeko64 fseeko"
163 $ write aconf "# define lseek64 lseek"
164 $ write aconf "# define ftello64 ftell"
165 $ write aconf "#endif"
166 $ write aconf "#if !defined( __VAX) && (__CRTL_VER >= 70312000)"
167 $ write aconf "# define HAVE_VSNPRINTF"
168 $ write aconf "#endif"
171 $ if f$search("''th'") .nes. "" then delete 'th';*
172 $! Build the thing plain or with mms
174 $ write sys$output "Compiling Zlib sources ..."
177 $ if (f$search( "example.obj;*") .nes. "") then delete example.obj;*
178 $ if (f$search( "minigzip.obj;*") .nes. "") then delete minigzip.obj;*
179 $ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
180 adler32.c zlib.h zconf.h
181 $ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
182 compress.c zlib.h zconf.h
183 $ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
184 crc32.c zlib.h zconf.h
185 $ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
186 deflate.c deflate.h zutil.h zlib.h zconf.h
187 $ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" -
188 gzclose.c zutil.h zlib.h zconf.h
189 $ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" -
190 gzlib.c zutil.h zlib.h zconf.h
191 $ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" -
192 gzread.c zutil.h zlib.h zconf.h
193 $ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" -
194 gzwrite.c zutil.h zlib.h zconf.h
195 $ CALL MAKE infback.OBJ "CC ''CCOPT' infback" -
196 infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
197 $ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
198 inffast.c zutil.h zlib.h zconf.h inffast.h
199 $ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
200 inflate.c zutil.h zlib.h zconf.h infblock.h
201 $ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
202 inftrees.c zutil.h zlib.h zconf.h inftrees.h
203 $ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
204 trees.c deflate.h zutil.h zlib.h zconf.h
205 $ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
206 uncompr.c zlib.h zconf.h
207 $ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
208 zutil.c zutil.h zlib.h zconf.h
209 $ write sys$output "Building Zlib ..."
210 $ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
211 $ write sys$output "Building example..."
212 $ CALL MAKE example.OBJ "CC ''CCOPT' [.test]example" -
213 [.test]example.c zlib.h zconf.h
214 $ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
215 $ write sys$output "Building minigzip..."
216 $ CALL MAKE minigzip.OBJ "CC ''CCOPT' [.test]minigzip" -
217 [.test]minigzip.c zlib.h zconf.h
218 $ call make minigzip.exe -
219 "LINK minigzip,libz.olb/lib" -
220 minigzip.obj libz.olb
223 $ write sys$output "Make ''name' ''version' with ''Make' "
227 $! Create shareable image
230 $ write sys$output "Creating libzshr.exe"
231 $ call map_2_shopt 'mapfile' 'optfile'
232 $ LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,'optfile'/opt
233 $ write sys$output "Zlib build completed"
234 $ delete/nolog tmp.opt;*
237 $ write sys$output "No source for config.hin found."
238 $ write sys$output "Tried any of ''aconf_in_file'"
241 $ write sys$output "C compiler required to build ''name'"
244 $ set message/facil/ident/sever/text
247 $ close/nolog aconf_in
253 $ write sys$output "Exiting..."
257 $MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
259 $! P1 = What we are trying to make
260 $! P2 = Command to make it
261 $! P3 - P8 What it depends on
263 $ If F$Search(P1) .Eqs. "" Then Goto Makeit
264 $ Time = F$CvTime(F$File(P1,"RDT"))
268 $ If Argument .Eqs. "" Then Goto Exit
271 $ File = F$Element(El," ",Argument)
272 $ If File .Eqs. " " Then Goto Endl
276 $ AFile = F$Search(File)
277 $ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
278 $ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
285 $ If arg .Le. 8 Then Goto Loop
290 $ write sys$output P2
294 $ If V Then Set Verify
296 $!------------------------------------------------------------------------------
298 $! Check command line options and set symbols accordingly
300 $!------------------------------------------------------------------------------
302 $! 0.01 20041206 First version to receive a number
303 $! 0.02 20060126 Add new "HELP" target
309 $ cparm = f$edit(p'i',"upcase")
311 $! Check if parameter actually contains something
313 $ if f$edit(cparm,"trim") .nes. ""
315 $ if cparm .eqs. "DEBUG"
317 $ ccopt = ccopt + "/noopt/deb"
318 $ lopts = lopts + "/deb"
320 $ if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
322 $ start = f$locate("=",cparm) + 1
323 $ len = f$length(cparm) - start
324 $ ccopt = ccopt + f$extract(start,len,cparm)
325 $ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) -
328 $ if cparm .eqs. "LINK" then linkonly = true
329 $ if f$locate("LOPTS=",cparm) .lt. f$length(cparm)
331 $ start = f$locate("=",cparm) + 1
332 $ len = f$length(cparm) - start
333 $ lopts = lopts + f$extract(start,len,cparm)
335 $ if f$locate("CC=",cparm) .lt. f$length(cparm)
337 $ start = f$locate("=",cparm) + 1
338 $ len = f$length(cparm) - start
339 $ cc_com = f$extract(start,len,cparm)
340 if (cc_com .nes. "DECC") .and. -
341 (cc_com .nes. "VAXC") .and. -
342 (cc_com .nes. "GNUC")
344 $ write sys$output "Unsupported compiler choice ''cc_com' ignored"
345 $ write sys$output "Use DECC, VAXC, or GNUC instead"
347 $ if cc_com .eqs. "DECC" then its_decc = true
348 $ if cc_com .eqs. "VAXC" then its_vaxc = true
349 $ if cc_com .eqs. "GNUC" then its_gnuc = true
352 $ if f$locate("MAKE=",cparm) .lt. f$length(cparm)
354 $ start = f$locate("=",cparm) + 1
355 $ len = f$length(cparm) - start
356 $ mmks = f$extract(start,len,cparm)
357 $ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS")
361 $ write sys$output "Unsupported make choice ''mmks' ignored"
362 $ write sys$output "Use MMK or MMS instead"
365 $ if cparm .eqs. "HELP" then gosub bhelp
371 $!------------------------------------------------------------------------------
373 $! Look for the compiler used
376 $! 0.01 20040223 First version to receive a number
377 $! 0.02 20040229 Save/set value of decc$no_rooted_search_lists
378 $! 0.03 20060202 Extend handling of GNU C
379 $! 0.04 20090402 Compaq -> hp
381 $ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
383 $ its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "")
384 $ its_vaxc = .not. its_decc .and. (F$Search("SYS$System:VAXC.Exe") .nes. "")
385 $ its_gnuc = .not. (its_decc .or. its_vaxc) .and. (f$trnlnm("gnu_cc") .nes. "")
388 $! Exit if no compiler available
390 $ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
395 $ write sys$output "CC compiler check ... hp C"
396 $ if f$trnlnm("decc$no_rooted_search_lists") .nes. ""
398 $ dnrsl = f$trnlnm("decc$no_rooted_search_lists")
400 $ define/nolog decc$no_rooted_search_lists 1
402 $ if its_vaxc then write sys$output "CC compiler check ... VAX C"
405 $ write sys$output "CC compiler check ... GNU C"
406 $ if f$trnlnm(topt) then write topt "gnu_cc:[000000]gcclib.olb/lib"
407 $ if f$trnlnm(optf) then write optf "gnu_cc:[000000]gcclib.olb/lib"
410 $ if f$trnlnm(topt) then write topt "sys$share:vaxcrtl.exe/share"
411 $ if f$trnlnm(optf) then write optf "sys$share:vaxcrtl.exe/share"
415 $!------------------------------------------------------------------------------
417 $! If MMS/MMK are available dump out the descrip.mms if required
420 $ write sys$output "Creating descrip.mms..."
422 $ open/append out descrip.mms
423 $ copy sys$input: out
425 # descrip.mms: MMS description file for building zlib on VMS
426 # written by Martin P.J. Zinser
427 # <zinser@zinser.no-ip.info or martin.zinser@eurexchange.com>
429 OBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzlib.obj\
430 gzread.obj, gzwrite.obj, uncompr.obj, infback.obj\
431 deflate.obj, trees.obj, zutil.obj, inflate.obj, \
432 inftrees.obj, inffast.obj
435 $ write out "CFLAGS=", ccopt
436 $ write out "LOPTS=", lopts
437 $ write out "all : example.exe minigzip.exe libz.olb"
438 $ copy sys$input: out
440 @ write sys$output " Example applications available"
442 libz.olb : libz.olb($(OBJS))
443 @ write sys$output " libz available"
445 example.exe : example.obj libz.olb
446 link $(LOPTS) example,libz.olb/lib
448 minigzip.exe : minigzip.obj libz.olb
449 link $(LOPTS) minigzip,libz.olb/lib
452 delete *.obj;*,libz.olb;*,*.opt;*,*.exe;*
455 # Other dependencies.
456 adler32.obj : adler32.c zutil.h zlib.h zconf.h
457 compress.obj : compress.c zlib.h zconf.h
458 crc32.obj : crc32.c zutil.h zlib.h zconf.h
459 deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h
460 example.obj : [.test]example.c zlib.h zconf.h
461 gzclose.obj : gzclose.c zutil.h zlib.h zconf.h
462 gzlib.obj : gzlib.c zutil.h zlib.h zconf.h
463 gzread.obj : gzread.c zutil.h zlib.h zconf.h
464 gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h
465 inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h
466 inflate.obj : inflate.c zutil.h zlib.h zconf.h
467 inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h
468 minigzip.obj : [.test]minigzip.c zlib.h zconf.h
469 trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h
470 uncompr.obj : uncompr.c zlib.h zconf.h
471 zutil.obj : zutil.c zutil.h zlib.h zconf.h
472 infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
476 $!------------------------------------------------------------------------------
478 $! Read list of core library sources from makefile.in and create options
479 $! needed to build shareable image
482 $ open/read min makefile.in
483 $ open/write mod modules.opt
484 $ src_check_list = "OBJZ =#OBJG ="
486 $ read/end=mrdone min rec
489 $ src_check = f$element(i, "#", src_check_list)
491 $ if src_check .eqs. "#" then goto mrloop
492 $ if (f$extract(0,6,rec) .nes. src_check) then goto src_check_loop
493 $ rec = rec - src_check
495 $ if (f$element(1,"\",rec) .eqs. "\") then goto mrloop
497 $ read/end=mrdone min rec
499 $ if (f$element(1,"\",rec) .nes. "\") then goto mrsloop
504 $!------------------------------------------------------------------------------
506 $! Take record extracted in crea_olist and split it into single filenames
509 $ myrec = f$edit(rec - "\", "trim,compress")
512 $ srcfil = f$element(i," ", myrec)
513 $ if (srcfil .nes. " ")
515 $ write mod f$parse(srcfil,,,"NAME"), ".obj"
520 $!------------------------------------------------------------------------------
522 $! Find current Zlib version number
525 $ open/read h_in 'v_file'
527 $ read/end=hdone h_in rec
528 $ rec = f$edit(rec,"TRIM")
529 $ if (f$extract(0,1,rec) .nes. "#") then goto hloop
530 $ rec = f$edit(rec - "#", "TRIM")
531 $ if f$element(0," ",rec) .nes. "define" then goto hloop
532 $ if f$element(1," ",rec) .eqs. v_string
534 $ version = 'f$element(2," ",rec)'
541 $!------------------------------------------------------------------------------
545 $ in_ldef = f$locate(cdef,libdefs)
546 $ if (in_ldef .lt. f$length(libdefs))
548 $ write aconf "#define ''cdef' 1"
549 $ libdefs = f$extract(0,in_ldef,libdefs) + -
550 f$extract(in_ldef + f$length(cdef) + 1, -
551 f$length(libdefs) - in_ldef - f$length(cdef) - 1, -
554 $ if (f$type('cdef') .eqs. "INTEGER")
556 $ write aconf "#define ''cdef' ", 'cdef'
558 $ if (f$type('cdef') .eqs. "STRING")
560 $ write aconf "#define ''cdef' ", """", '''cdef'', """"
567 $!------------------------------------------------------------------------------
569 $! Check if this is a define relating to the properties of the C/C++
573 $ if (cdef .eqs. "_LARGEFILE64_SOURCE")
575 $ copy sys$input: 'tc'
583 fp = fopen("temp.txt","r");
584 fseeko(fp,1,SEEK_SET);
591 $ gosub cc_prop_check
594 $ write aconf "/* ", line, " */"
596 $!------------------------------------------------------------------------------
598 $! Check for properties of C/C++ compiler
601 $! 0.01 20031020 First version to receive a number
602 $! 0.02 20031022 Added logic for defines with value
603 $! 0.03 20040309 Make sure local config file gets not deleted
604 $! 0.04 20041230 Also write include for configure run
605 $! 0.05 20050103 Add processing of "comment defines"
609 $ is_need = (f$extract(0,4,cdef) .eqs. "NEED") .or. (test_inv .eq. true)
610 $ if f$search(th) .eqs. "" then create 'th'
611 $ set message/nofac/noident/nosever/notext
612 $ on error then continue
614 $ if .not. ($status) then cc_prop = false
615 $ on error then continue
616 $! The headers might lie about the capabilities of the RTL
617 $ link 'tmpnam',tmp.opt/opt
618 $ if .not. ($status) then cc_prop = false
619 $ set message/fac/ident/sever/text
620 $ on error then goto err_exit
621 $ delete/nolog 'tmpnam'.*;*/exclude='th'
622 $ if (cc_prop .and. .not. is_need) .or. -
623 (.not. cc_prop .and. is_need)
625 $ write sys$output "Checking for ''cdef'... yes"
626 $ if f$type('cdef_val'_yes) .nes. ""
628 $ if f$type('cdef_val'_yes) .eqs. "INTEGER" -
629 then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_yes)
630 $ if f$type('cdef_val'_yes) .eqs. "STRING" -
631 then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_yes)
633 $ call write_config f$fao("#define !AS 1",cdef)
635 $ if (cdef .eqs. "HAVE_FSEEKO") .or. (cdef .eqs. "_LARGE_FILES") .or. -
636 (cdef .eqs. "_LARGEFILE64_SOURCE") then -
637 call write_config f$string("#define _LARGEFILE 1")
639 $ write sys$output "Checking for ''cdef'... no"
642 call write_config f$fao("/* !AS */",line)
644 $ if f$type('cdef_val'_no) .nes. ""
646 $ if f$type('cdef_val'_no) .eqs. "INTEGER" -
647 then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_no)
648 $ if f$type('cdef_val'_no) .eqs. "STRING" -
649 then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_no)
651 $ call write_config f$fao("#undef !AS",cdef)
656 $!------------------------------------------------------------------------------
658 $! Check for properties of C/C++ compiler with multiple result values
661 $! 0.01 20040127 First version
662 $! 0.02 20050103 Reconcile changes from cc_prop up to version 0.05
668 $ if f$type(result_'i') .eqs. "STRING"
670 $ set message/nofac/noident/nosever/notext
671 $ on error then continue
673 $ if .not. ($status) then cc_prop = false
674 $ on error then continue
675 $! The headers might lie about the capabilities of the RTL
676 $ link 'tmpnam'_'i',tmp.opt/opt
677 $ if .not. ($status) then cc_prop = false
678 $ set message/fac/ident/sever/text
679 $ on error then goto err_exit
680 $ delete/nolog 'tmpnam'_'i'.*;*
683 $ write sys$output "Checking for ''cdef'... ", mdef_'i'
684 $ if f$type(mdef_'i') .eqs. "INTEGER" -
685 then call write_config f$fao("#define !AS !UL",cdef,mdef_'i')
686 $ if f$type('cdef_val'_yes) .eqs. "STRING" -
687 then call write_config f$fao("#define !AS !AS",cdef,mdef_'i')
694 $ write sys$output "Checking for ''cdef'... no"
695 $ call write_config f$fao("#undef !AS",cdef)
697 $ if (idel .le. msym_max)
699 $ delete/sym mdef_'idel'
704 $!------------------------------------------------------------------------------
706 $! Write configuration to both permanent and temporary config file
709 $! 0.01 20031029 First version to receive a number
711 $WRITE_CONFIG: SUBROUTINE
713 $ open/append confh 'th'
717 $!------------------------------------------------------------------------------
719 $! Analyze the project map file and create the symbol vector for a shareable
723 $! 0.01 20120128 First version
724 $! 0.02 20120226 Add pre-load logic
726 $ MAP_2_SHOPT: Subroutine
728 $ SAY := "WRITE_ SYS$OUTPUT"
730 $ IF F$SEARCH("''P1'") .EQS. ""
732 $ SAY "MAP_2_SHOPT-E-NOSUCHFILE: Error, inputfile ''p1' not available"
735 $ IF "''P2'" .EQS. ""
737 $ SAY "MAP_2_SHOPT: Error, no output file provided"
741 $ module1 = "deflate#deflateEnd#deflateInit_#deflateParams#deflateSetDictionary"
742 $ module2 = "gzclose#gzerror#gzgetc#gzgets#gzopen#gzprintf#gzputc#gzputs#gzread"
743 $ module3 = "gzseek#gztell#inflate#inflateEnd#inflateInit_#inflateSetDictionary"
744 $ module4 = "inflateSync#uncompress#zlibVersion#compress"
748 $ open/write aopt a.opt
749 $ open/write bopt b.opt
750 $ write aopt " CASE_SENSITIVE=YES"
751 $ write bopt "SYMBOL_VECTOR= (-"
754 $ if f$type(module'mod_sym_num') .nes. ""
758 $ shared_proc = f$element(mod_in, "#", module'mod_sym_num')
759 $ if shared_proc .nes. "#"
761 $ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",-
762 f$edit(shared_proc,"upcase"),shared_proc)
763 $ write bopt f$fao("!AS=PROCEDURE,-",shared_proc)
764 $ mod_in = mod_in + 1
767 $ mod_sym_num = mod_sym_num + 1
771 $ read/end=map_end map line
772 $ if (f$locate("{",line).lt. f$length(line)) .or. -
773 (f$locate("global:", line) .lt. f$length(line))
778 $ if f$locate("}",line).lt. f$length(line) then proc = false
779 $ if f$locate("local:", line) .lt. f$length(line) then proc = false
782 $ shared_proc = f$edit(line,"collapse")
783 $ chop_semi = f$locate(";", shared_proc)
784 $ if chop_semi .lt. f$length(shared_proc) then -
785 shared_proc = f$extract(0, chop_semi, shared_proc)
786 $ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",-
787 f$edit(shared_proc,"upcase"),shared_proc)
788 $ write bopt f$fao("!AS=PROCEDURE,-",shared_proc)
794 $ open/append libopt 'p2'
795 $ open/read aopt a.opt
796 $ open/read bopt b.opt
798 $ read/end=aloop_end aopt line
805 $ read/end=bloop_end bopt svn
808 $ if (sv.nes."") then write libopt sv
813 $ write libopt f$extract(0,f$length(sv)-2,sv), "-"
816 $ delete/nolog/noconf a.opt;*,b.opt;*
820 $ open/append libopt 'p2'
823 $ if f$type(module'mod_sym_num') .nes. ""
827 $ shared_proc = f$element(mod_in, "#", module'mod_sym_num')
828 $ if shared_proc .nes. "#"
830 $ write libopt f$fao("UNIVERSAL=!AS",-
831 f$edit(shared_proc,"upcase"))
832 $ mod_in = mod_in + 1
835 $ mod_sym_num = mod_sym_num + 1
839 $ read/end=vmap_end map line
840 $ if (f$locate("{",line).lt. f$length(line)) .or. -
841 (f$locate("global:", line) .lt. f$length(line))
846 $ if f$locate("}",line).lt. f$length(line) then proc = false
847 $ if f$locate("local:", line) .lt. f$length(line) then proc = false
850 $ shared_proc = f$edit(line,"collapse")
851 $ chop_semi = f$locate(";", shared_proc)
852 $ if chop_semi .lt. f$length(shared_proc) then -
853 shared_proc = f$extract(0, chop_semi, shared_proc)
854 $ write libopt f$fao("UNIVERSAL=!AS",-
855 f$edit(shared_proc,"upcase"))
860 $ write sys$output "Unknown Architecture (Not VAX, AXP, or IA64)"
861 $ write sys$output "No options file created"