1*212397c6Schristos$! make libz under VMS written by 2*212397c6Schristos$! Martin P.J. Zinser 3*212397c6Schristos$! 4*212397c6Schristos$! In case of problems with the install you might contact me at 5*212397c6Schristos$! zinser@zinser.no-ip.info(preferred) or 6*212397c6Schristos$! martin.zinser@eurexchange.com (work) 7*212397c6Schristos$! 8*212397c6Schristos$! Make procedure history for Zlib 9*212397c6Schristos$! 10*212397c6Schristos$!------------------------------------------------------------------------------ 11*212397c6Schristos$! Version history 12*212397c6Schristos$! 0.01 20060120 First version to receive a number 13*212397c6Schristos$! 0.02 20061008 Adapt to new Makefile.in 14*212397c6Schristos$! 0.03 20091224 Add support for large file check 15*212397c6Schristos$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite 16*212397c6Schristos$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in 17*212397c6Schristos$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples 18*212397c6Schristos$! subdir path, update module search in makefile.in 19*212397c6Schristos$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned 20*212397c6Schristos$! shared image creation 21*212397c6Schristos$! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared 22*212397c6Schristos$! image 23*212397c6Schristos$! 0.09 20120305 SMS. P1 sets builder ("MMK", "MMS", " " (built-in)). 24*212397c6Schristos$! "" -> automatic, preference: MMK, MMS, built-in. 25*212397c6Schristos$! 26*212397c6Schristos$ on error then goto err_exit 27*212397c6Schristos$! 28*212397c6Schristos$ true = 1 29*212397c6Schristos$ false = 0 30*212397c6Schristos$ tmpnam = "temp_" + f$getjpi("","pid") 31*212397c6Schristos$ tt = tmpnam + ".txt" 32*212397c6Schristos$ tc = tmpnam + ".c" 33*212397c6Schristos$ th = tmpnam + ".h" 34*212397c6Schristos$ define/nolog tconfig 'th' 35*212397c6Schristos$ its_decc = false 36*212397c6Schristos$ its_vaxc = false 37*212397c6Schristos$ its_gnuc = false 38*212397c6Schristos$ s_case = False 39*212397c6Schristos$! 40*212397c6Schristos$! Setup variables holding "config" information 41*212397c6Schristos$! 42*212397c6Schristos$ Make = "''p1'" 43*212397c6Schristos$ name = "Zlib" 44*212397c6Schristos$ version = "?.?.?" 45*212397c6Schristos$ v_string = "ZLIB_VERSION" 46*212397c6Schristos$ v_file = "zlib.h" 47*212397c6Schristos$ ccopt = "/include = []" 48*212397c6Schristos$ lopts = "" 49*212397c6Schristos$ dnsrl = "" 50*212397c6Schristos$ aconf_in_file = "zconf.h.in#zconf.h_in#zconf_h.in" 51*212397c6Schristos$ conf_check_string = "" 52*212397c6Schristos$ linkonly = false 53*212397c6Schristos$ optfile = name + ".opt" 54*212397c6Schristos$ mapfile = name + ".map" 55*212397c6Schristos$ libdefs = "" 56*212397c6Schristos$ vax = f$getsyi("HW_MODEL").lt.1024 57*212397c6Schristos$ axp = f$getsyi("HW_MODEL").ge.1024 .and. f$getsyi("HW_MODEL").lt.4096 58*212397c6Schristos$ ia64 = f$getsyi("HW_MODEL").ge.4096 59*212397c6Schristos$! 60*212397c6Schristos$! 2012-03-05 SMS. 61*212397c6Schristos$! Why is this needed? And if it is needed, why not simply ".not. vax"? 62*212397c6Schristos$! 63*212397c6Schristos$!!! if axp .or. ia64 then set proc/parse=extended 64*212397c6Schristos$! 65*212397c6Schristos$ whoami = f$parse(f$environment("Procedure"),,,,"NO_CONCEAL") 66*212397c6Schristos$ mydef = F$parse(whoami,,,"DEVICE") 67*212397c6Schristos$ mydir = f$parse(whoami,,,"DIRECTORY") - "][" 68*212397c6Schristos$ myproc = f$parse(whoami,,,"Name") + f$parse(whoami,,,"type") 69*212397c6Schristos$! 70*212397c6Schristos$! Check for MMK/MMS 71*212397c6Schristos$! 72*212397c6Schristos$ if (Make .eqs. "") 73*212397c6Schristos$ then 74*212397c6Schristos$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS" 75*212397c6Schristos$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK" 76*212397c6Schristos$ else 77*212397c6Schristos$ Make = f$edit( Make, "trim") 78*212397c6Schristos$ endif 79*212397c6Schristos$! 80*212397c6Schristos$ gosub find_version 81*212397c6Schristos$! 82*212397c6Schristos$ open/write topt tmp.opt 83*212397c6Schristos$ open/write optf 'optfile' 84*212397c6Schristos$! 85*212397c6Schristos$ gosub check_opts 86*212397c6Schristos$! 87*212397c6Schristos$! Look for the compiler used 88*212397c6Schristos$! 89*212397c6Schristos$ gosub check_compiler 90*212397c6Schristos$ close topt 91*212397c6Schristos$ close optf 92*212397c6Schristos$! 93*212397c6Schristos$ if its_decc 94*212397c6Schristos$ then 95*212397c6Schristos$ ccopt = "/prefix=all" + ccopt 96*212397c6Schristos$ if f$trnlnm("SYS") .eqs. "" 97*212397c6Schristos$ then 98*212397c6Schristos$ if axp 99*212397c6Schristos$ then 100*212397c6Schristos$ define sys sys$library: 101*212397c6Schristos$ else 102*212397c6Schristos$ ccopt = "/decc" + ccopt 103*212397c6Schristos$ define sys decc$library_include: 104*212397c6Schristos$ endif 105*212397c6Schristos$ endif 106*212397c6Schristos$! 107*212397c6Schristos$! 2012-03-05 SMS. 108*212397c6Schristos$! Why /NAMES = AS_IS? Why not simply ".not. vax"? And why not on VAX? 109*212397c6Schristos$! 110*212397c6Schristos$ if axp .or. ia64 111*212397c6Schristos$ then 112*212397c6Schristos$ ccopt = ccopt + "/name=as_is/opt=(inline=speed)" 113*212397c6Schristos$ s_case = true 114*212397c6Schristos$ endif 115*212397c6Schristos$ endif 116*212397c6Schristos$ if its_vaxc .or. its_gnuc 117*212397c6Schristos$ then 118*212397c6Schristos$ if f$trnlnm("SYS").eqs."" then define sys sys$library: 119*212397c6Schristos$ endif 120*212397c6Schristos$! 121*212397c6Schristos$! Build a fake configure input header 122*212397c6Schristos$! 123*212397c6Schristos$ open/write conf_hin config.hin 124*212397c6Schristos$ write conf_hin "#undef _LARGEFILE64_SOURCE" 125*212397c6Schristos$ close conf_hin 126*212397c6Schristos$! 127*212397c6Schristos$! 128*212397c6Schristos$ i = 0 129*212397c6Schristos$FIND_ACONF: 130*212397c6Schristos$ fname = f$element(i,"#",aconf_in_file) 131*212397c6Schristos$ if fname .eqs. "#" then goto AMISS_ERR 132*212397c6Schristos$ if f$search(fname) .eqs. "" 133*212397c6Schristos$ then 134*212397c6Schristos$ i = i + 1 135*212397c6Schristos$ goto find_aconf 136*212397c6Schristos$ endif 137*212397c6Schristos$ open/read/err=aconf_err aconf_in 'fname' 138*212397c6Schristos$ open/write aconf zconf.h 139*212397c6Schristos$ACONF_LOOP: 140*212397c6Schristos$ read/end_of_file=aconf_exit aconf_in line 141*212397c6Schristos$ work = f$edit(line, "compress,trim") 142*212397c6Schristos$ if f$extract(0,6,work) .nes. "#undef" 143*212397c6Schristos$ then 144*212397c6Schristos$ if f$extract(0,12,work) .nes. "#cmakedefine" 145*212397c6Schristos$ then 146*212397c6Schristos$ write aconf line 147*212397c6Schristos$ endif 148*212397c6Schristos$ else 149*212397c6Schristos$ cdef = f$element(1," ",work) 150*212397c6Schristos$ gosub check_config 151*212397c6Schristos$ endif 152*212397c6Schristos$ goto aconf_loop 153*212397c6Schristos$ACONF_EXIT: 154*212397c6Schristos$ write aconf "" 155*212397c6Schristos$ write aconf "/* VMS specifics added by make_vms.com: */" 156*212397c6Schristos$ write aconf "#define VMS 1" 157*212397c6Schristos$ write aconf "#include <unistd.h>" 158*212397c6Schristos$ write aconf "#include <unixio.h>" 159*212397c6Schristos$ write aconf "#ifdef _LARGEFILE" 160*212397c6Schristos$ write aconf "# define off64_t __off64_t" 161*212397c6Schristos$ write aconf "# define fopen64 fopen" 162*212397c6Schristos$ write aconf "# define fseeko64 fseeko" 163*212397c6Schristos$ write aconf "# define lseek64 lseek" 164*212397c6Schristos$ write aconf "# define ftello64 ftell" 165*212397c6Schristos$ write aconf "#endif" 166*212397c6Schristos$ write aconf "#if !defined( __VAX) && (__CRTL_VER >= 70312000)" 167*212397c6Schristos$ write aconf "# define HAVE_VSNPRINTF" 168*212397c6Schristos$ write aconf "#endif" 169*212397c6Schristos$ close aconf_in 170*212397c6Schristos$ close aconf 171*212397c6Schristos$ if f$search("''th'") .nes. "" then delete 'th';* 172*212397c6Schristos$! Build the thing plain or with mms 173*212397c6Schristos$! 174*212397c6Schristos$ write sys$output "Compiling Zlib sources ..." 175*212397c6Schristos$ if make.eqs."" 176*212397c6Schristos$ then 177*212397c6Schristos$ if (f$search( "example.obj;*") .nes. "") then delete example.obj;* 178*212397c6Schristos$ if (f$search( "minigzip.obj;*") .nes. "") then delete minigzip.obj;* 179*212397c6Schristos$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" - 180*212397c6Schristos adler32.c zlib.h zconf.h 181*212397c6Schristos$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" - 182*212397c6Schristos compress.c zlib.h zconf.h 183*212397c6Schristos$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - 184*212397c6Schristos crc32.c zlib.h zconf.h 185*212397c6Schristos$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - 186*212397c6Schristos deflate.c deflate.h zutil.h zlib.h zconf.h 187*212397c6Schristos$ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" - 188*212397c6Schristos gzclose.c zutil.h zlib.h zconf.h 189*212397c6Schristos$ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" - 190*212397c6Schristos gzlib.c zutil.h zlib.h zconf.h 191*212397c6Schristos$ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" - 192*212397c6Schristos gzread.c zutil.h zlib.h zconf.h 193*212397c6Schristos$ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" - 194*212397c6Schristos gzwrite.c zutil.h zlib.h zconf.h 195*212397c6Schristos$ CALL MAKE infback.OBJ "CC ''CCOPT' infback" - 196*212397c6Schristos infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h 197*212397c6Schristos$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - 198*212397c6Schristos inffast.c zutil.h zlib.h zconf.h inffast.h 199*212397c6Schristos$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" - 200*212397c6Schristos inflate.c zutil.h zlib.h zconf.h infblock.h 201*212397c6Schristos$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" - 202*212397c6Schristos inftrees.c zutil.h zlib.h zconf.h inftrees.h 203*212397c6Schristos$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" - 204*212397c6Schristos trees.c deflate.h zutil.h zlib.h zconf.h 205*212397c6Schristos$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" - 206*212397c6Schristos uncompr.c zlib.h zconf.h 207*212397c6Schristos$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" - 208*212397c6Schristos zutil.c zutil.h zlib.h zconf.h 209*212397c6Schristos$ write sys$output "Building Zlib ..." 210*212397c6Schristos$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ 211*212397c6Schristos$ write sys$output "Building example..." 212*212397c6Schristos$ CALL MAKE example.OBJ "CC ''CCOPT' [.test]example" - 213*212397c6Schristos [.test]example.c zlib.h zconf.h 214*212397c6Schristos$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb 215*212397c6Schristos$ write sys$output "Building minigzip..." 216*212397c6Schristos$ CALL MAKE minigzip.OBJ "CC ''CCOPT' [.test]minigzip" - 217*212397c6Schristos [.test]minigzip.c zlib.h zconf.h 218*212397c6Schristos$ call make minigzip.exe - 219*212397c6Schristos "LINK minigzip,libz.olb/lib" - 220*212397c6Schristos minigzip.obj libz.olb 221*212397c6Schristos$ else 222*212397c6Schristos$ gosub crea_mms 223*212397c6Schristos$ write sys$output "Make ''name' ''version' with ''Make' " 224*212397c6Schristos$ 'make' 225*212397c6Schristos$ endif 226*212397c6Schristos$! 227*212397c6Schristos$! Create shareable image 228*212397c6Schristos$! 229*212397c6Schristos$ gosub crea_olist 230*212397c6Schristos$ write sys$output "Creating libzshr.exe" 231*212397c6Schristos$ call map_2_shopt 'mapfile' 'optfile' 232*212397c6Schristos$ LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,'optfile'/opt 233*212397c6Schristos$ write sys$output "Zlib build completed" 234*212397c6Schristos$ delete/nolog tmp.opt;* 235*212397c6Schristos$ exit 236*212397c6Schristos$AMISS_ERR: 237*212397c6Schristos$ write sys$output "No source for config.hin found." 238*212397c6Schristos$ write sys$output "Tried any of ''aconf_in_file'" 239*212397c6Schristos$ goto err_exit 240*212397c6Schristos$CC_ERR: 241*212397c6Schristos$ write sys$output "C compiler required to build ''name'" 242*212397c6Schristos$ goto err_exit 243*212397c6Schristos$ERR_EXIT: 244*212397c6Schristos$ set message/facil/ident/sever/text 245*212397c6Schristos$ close/nolog optf 246*212397c6Schristos$ close/nolog topt 247*212397c6Schristos$ close/nolog aconf_in 248*212397c6Schristos$ close/nolog aconf 249*212397c6Schristos$ close/nolog out 250*212397c6Schristos$ close/nolog min 251*212397c6Schristos$ close/nolog mod 252*212397c6Schristos$ close/nolog h_in 253*212397c6Schristos$ write sys$output "Exiting..." 254*212397c6Schristos$ exit 2 255*212397c6Schristos$! 256*212397c6Schristos$! 257*212397c6Schristos$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES 258*212397c6Schristos$ V = 'F$Verify(0) 259*212397c6Schristos$! P1 = What we are trying to make 260*212397c6Schristos$! P2 = Command to make it 261*212397c6Schristos$! P3 - P8 What it depends on 262*212397c6Schristos$ 263*212397c6Schristos$ If F$Search(P1) .Eqs. "" Then Goto Makeit 264*212397c6Schristos$ Time = F$CvTime(F$File(P1,"RDT")) 265*212397c6Schristos$arg=3 266*212397c6Schristos$Loop: 267*212397c6Schristos$ Argument = P'arg 268*212397c6Schristos$ If Argument .Eqs. "" Then Goto Exit 269*212397c6Schristos$ El=0 270*212397c6Schristos$Loop2: 271*212397c6Schristos$ File = F$Element(El," ",Argument) 272*212397c6Schristos$ If File .Eqs. " " Then Goto Endl 273*212397c6Schristos$ AFile = "" 274*212397c6Schristos$Loop3: 275*212397c6Schristos$ OFile = AFile 276*212397c6Schristos$ AFile = F$Search(File) 277*212397c6Schristos$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl 278*212397c6Schristos$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit 279*212397c6Schristos$ Goto Loop3 280*212397c6Schristos$NextEL: 281*212397c6Schristos$ El = El + 1 282*212397c6Schristos$ Goto Loop2 283*212397c6Schristos$EndL: 284*212397c6Schristos$ arg=arg+1 285*212397c6Schristos$ If arg .Le. 8 Then Goto Loop 286*212397c6Schristos$ Goto Exit 287*212397c6Schristos$ 288*212397c6Schristos$Makeit: 289*212397c6Schristos$ VV=F$VERIFY(0) 290*212397c6Schristos$ write sys$output P2 291*212397c6Schristos$ 'P2 292*212397c6Schristos$ VV='F$Verify(VV) 293*212397c6Schristos$Exit: 294*212397c6Schristos$ If V Then Set Verify 295*212397c6Schristos$ENDSUBROUTINE 296*212397c6Schristos$!------------------------------------------------------------------------------ 297*212397c6Schristos$! 298*212397c6Schristos$! Check command line options and set symbols accordingly 299*212397c6Schristos$! 300*212397c6Schristos$!------------------------------------------------------------------------------ 301*212397c6Schristos$! Version history 302*212397c6Schristos$! 0.01 20041206 First version to receive a number 303*212397c6Schristos$! 0.02 20060126 Add new "HELP" target 304*212397c6Schristos$ CHECK_OPTS: 305*212397c6Schristos$ i = 1 306*212397c6Schristos$ OPT_LOOP: 307*212397c6Schristos$ if i .lt. 9 308*212397c6Schristos$ then 309*212397c6Schristos$ cparm = f$edit(p'i',"upcase") 310*212397c6Schristos$! 311*212397c6Schristos$! Check if parameter actually contains something 312*212397c6Schristos$! 313*212397c6Schristos$ if f$edit(cparm,"trim") .nes. "" 314*212397c6Schristos$ then 315*212397c6Schristos$ if cparm .eqs. "DEBUG" 316*212397c6Schristos$ then 317*212397c6Schristos$ ccopt = ccopt + "/noopt/deb" 318*212397c6Schristos$ lopts = lopts + "/deb" 319*212397c6Schristos$ endif 320*212397c6Schristos$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm) 321*212397c6Schristos$ then 322*212397c6Schristos$ start = f$locate("=",cparm) + 1 323*212397c6Schristos$ len = f$length(cparm) - start 324*212397c6Schristos$ ccopt = ccopt + f$extract(start,len,cparm) 325*212397c6Schristos$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) - 326*212397c6Schristos then s_case = true 327*212397c6Schristos$ endif 328*212397c6Schristos$ if cparm .eqs. "LINK" then linkonly = true 329*212397c6Schristos$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm) 330*212397c6Schristos$ then 331*212397c6Schristos$ start = f$locate("=",cparm) + 1 332*212397c6Schristos$ len = f$length(cparm) - start 333*212397c6Schristos$ lopts = lopts + f$extract(start,len,cparm) 334*212397c6Schristos$ endif 335*212397c6Schristos$ if f$locate("CC=",cparm) .lt. f$length(cparm) 336*212397c6Schristos$ then 337*212397c6Schristos$ start = f$locate("=",cparm) + 1 338*212397c6Schristos$ len = f$length(cparm) - start 339*212397c6Schristos$ cc_com = f$extract(start,len,cparm) 340*212397c6Schristos if (cc_com .nes. "DECC") .and. - 341*212397c6Schristos (cc_com .nes. "VAXC") .and. - 342*212397c6Schristos (cc_com .nes. "GNUC") 343*212397c6Schristos$ then 344*212397c6Schristos$ write sys$output "Unsupported compiler choice ''cc_com' ignored" 345*212397c6Schristos$ write sys$output "Use DECC, VAXC, or GNUC instead" 346*212397c6Schristos$ else 347*212397c6Schristos$ if cc_com .eqs. "DECC" then its_decc = true 348*212397c6Schristos$ if cc_com .eqs. "VAXC" then its_vaxc = true 349*212397c6Schristos$ if cc_com .eqs. "GNUC" then its_gnuc = true 350*212397c6Schristos$ endif 351*212397c6Schristos$ endif 352*212397c6Schristos$ if f$locate("MAKE=",cparm) .lt. f$length(cparm) 353*212397c6Schristos$ then 354*212397c6Schristos$ start = f$locate("=",cparm) + 1 355*212397c6Schristos$ len = f$length(cparm) - start 356*212397c6Schristos$ mmks = f$extract(start,len,cparm) 357*212397c6Schristos$ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS") 358*212397c6Schristos$ then 359*212397c6Schristos$ make = mmks 360*212397c6Schristos$ else 361*212397c6Schristos$ write sys$output "Unsupported make choice ''mmks' ignored" 362*212397c6Schristos$ write sys$output "Use MMK or MMS instead" 363*212397c6Schristos$ endif 364*212397c6Schristos$ endif 365*212397c6Schristos$ if cparm .eqs. "HELP" then gosub bhelp 366*212397c6Schristos$ endif 367*212397c6Schristos$ i = i + 1 368*212397c6Schristos$ goto opt_loop 369*212397c6Schristos$ endif 370*212397c6Schristos$ return 371*212397c6Schristos$!------------------------------------------------------------------------------ 372*212397c6Schristos$! 373*212397c6Schristos$! Look for the compiler used 374*212397c6Schristos$! 375*212397c6Schristos$! Version history 376*212397c6Schristos$! 0.01 20040223 First version to receive a number 377*212397c6Schristos$! 0.02 20040229 Save/set value of decc$no_rooted_search_lists 378*212397c6Schristos$! 0.03 20060202 Extend handling of GNU C 379*212397c6Schristos$! 0.04 20090402 Compaq -> hp 380*212397c6Schristos$CHECK_COMPILER: 381*212397c6Schristos$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc)) 382*212397c6Schristos$ then 383*212397c6Schristos$ its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "") 384*212397c6Schristos$ its_vaxc = .not. its_decc .and. (F$Search("SYS$System:VAXC.Exe") .nes. "") 385*212397c6Schristos$ its_gnuc = .not. (its_decc .or. its_vaxc) .and. (f$trnlnm("gnu_cc") .nes. "") 386*212397c6Schristos$ endif 387*212397c6Schristos$! 388*212397c6Schristos$! Exit if no compiler available 389*212397c6Schristos$! 390*212397c6Schristos$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc)) 391*212397c6Schristos$ then goto CC_ERR 392*212397c6Schristos$ else 393*212397c6Schristos$ if its_decc 394*212397c6Schristos$ then 395*212397c6Schristos$ write sys$output "CC compiler check ... hp C" 396*212397c6Schristos$ if f$trnlnm("decc$no_rooted_search_lists") .nes. "" 397*212397c6Schristos$ then 398*212397c6Schristos$ dnrsl = f$trnlnm("decc$no_rooted_search_lists") 399*212397c6Schristos$ endif 400*212397c6Schristos$ define/nolog decc$no_rooted_search_lists 1 401*212397c6Schristos$ else 402*212397c6Schristos$ if its_vaxc then write sys$output "CC compiler check ... VAX C" 403*212397c6Schristos$ if its_gnuc 404*212397c6Schristos$ then 405*212397c6Schristos$ write sys$output "CC compiler check ... GNU C" 406*212397c6Schristos$ if f$trnlnm(topt) then write topt "gnu_cc:[000000]gcclib.olb/lib" 407*212397c6Schristos$ if f$trnlnm(optf) then write optf "gnu_cc:[000000]gcclib.olb/lib" 408*212397c6Schristos$ cc = "gcc" 409*212397c6Schristos$ endif 410*212397c6Schristos$ if f$trnlnm(topt) then write topt "sys$share:vaxcrtl.exe/share" 411*212397c6Schristos$ if f$trnlnm(optf) then write optf "sys$share:vaxcrtl.exe/share" 412*212397c6Schristos$ endif 413*212397c6Schristos$ endif 414*212397c6Schristos$ return 415*212397c6Schristos$!------------------------------------------------------------------------------ 416*212397c6Schristos$! 417*212397c6Schristos$! If MMS/MMK are available dump out the descrip.mms if required 418*212397c6Schristos$! 419*212397c6Schristos$CREA_MMS: 420*212397c6Schristos$ write sys$output "Creating descrip.mms..." 421*212397c6Schristos$ create descrip.mms 422*212397c6Schristos$ open/append out descrip.mms 423*212397c6Schristos$ copy sys$input: out 424*212397c6Schristos$ deck 425*212397c6Schristos# descrip.mms: MMS description file for building zlib on VMS 426*212397c6Schristos# written by Martin P.J. Zinser 427*212397c6Schristos# <zinser@zinser.no-ip.info or martin.zinser@eurexchange.com> 428*212397c6Schristos 429*212397c6SchristosOBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzlib.obj\ 430*212397c6Schristos gzread.obj, gzwrite.obj, uncompr.obj, infback.obj\ 431*212397c6Schristos deflate.obj, trees.obj, zutil.obj, inflate.obj, \ 432*212397c6Schristos inftrees.obj, inffast.obj 433*212397c6Schristos 434*212397c6Schristos$ eod 435*212397c6Schristos$ write out "CFLAGS=", ccopt 436*212397c6Schristos$ write out "LOPTS=", lopts 437*212397c6Schristos$ write out "all : example.exe minigzip.exe libz.olb" 438*212397c6Schristos$ copy sys$input: out 439*212397c6Schristos$ deck 440*212397c6Schristos @ write sys$output " Example applications available" 441*212397c6Schristos 442*212397c6Schristoslibz.olb : libz.olb($(OBJS)) 443*212397c6Schristos @ write sys$output " libz available" 444*212397c6Schristos 445*212397c6Schristosexample.exe : example.obj libz.olb 446*212397c6Schristos link $(LOPTS) example,libz.olb/lib 447*212397c6Schristos 448*212397c6Schristosminigzip.exe : minigzip.obj libz.olb 449*212397c6Schristos link $(LOPTS) minigzip,libz.olb/lib 450*212397c6Schristos 451*212397c6Schristosclean : 452*212397c6Schristos delete *.obj;*,libz.olb;*,*.opt;*,*.exe;* 453*212397c6Schristos 454*212397c6Schristos 455*212397c6Schristos# Other dependencies. 456*212397c6Schristosadler32.obj : adler32.c zutil.h zlib.h zconf.h 457*212397c6Schristoscompress.obj : compress.c zlib.h zconf.h 458*212397c6Schristoscrc32.obj : crc32.c zutil.h zlib.h zconf.h 459*212397c6Schristosdeflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h 460*212397c6Schristosexample.obj : [.test]example.c zlib.h zconf.h 461*212397c6Schristosgzclose.obj : gzclose.c zutil.h zlib.h zconf.h 462*212397c6Schristosgzlib.obj : gzlib.c zutil.h zlib.h zconf.h 463*212397c6Schristosgzread.obj : gzread.c zutil.h zlib.h zconf.h 464*212397c6Schristosgzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h 465*212397c6Schristosinffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h 466*212397c6Schristosinflate.obj : inflate.c zutil.h zlib.h zconf.h 467*212397c6Schristosinftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h 468*212397c6Schristosminigzip.obj : [.test]minigzip.c zlib.h zconf.h 469*212397c6Schristostrees.obj : trees.c deflate.h zutil.h zlib.h zconf.h 470*212397c6Schristosuncompr.obj : uncompr.c zlib.h zconf.h 471*212397c6Schristoszutil.obj : zutil.c zutil.h zlib.h zconf.h 472*212397c6Schristosinfback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h 473*212397c6Schristos$ eod 474*212397c6Schristos$ close out 475*212397c6Schristos$ return 476*212397c6Schristos$!------------------------------------------------------------------------------ 477*212397c6Schristos$! 478*212397c6Schristos$! Read list of core library sources from makefile.in and create options 479*212397c6Schristos$! needed to build shareable image 480*212397c6Schristos$! 481*212397c6Schristos$CREA_OLIST: 482*212397c6Schristos$ open/read min makefile.in 483*212397c6Schristos$ open/write mod modules.opt 484*212397c6Schristos$ src_check_list = "OBJZ =#OBJG =" 485*212397c6Schristos$MRLOOP: 486*212397c6Schristos$ read/end=mrdone min rec 487*212397c6Schristos$ i = 0 488*212397c6Schristos$SRC_CHECK_LOOP: 489*212397c6Schristos$ src_check = f$element(i, "#", src_check_list) 490*212397c6Schristos$ i = i+1 491*212397c6Schristos$ if src_check .eqs. "#" then goto mrloop 492*212397c6Schristos$ if (f$extract(0,6,rec) .nes. src_check) then goto src_check_loop 493*212397c6Schristos$ rec = rec - src_check 494*212397c6Schristos$ gosub extra_filnam 495*212397c6Schristos$ if (f$element(1,"\",rec) .eqs. "\") then goto mrloop 496*212397c6Schristos$MRSLOOP: 497*212397c6Schristos$ read/end=mrdone min rec 498*212397c6Schristos$ gosub extra_filnam 499*212397c6Schristos$ if (f$element(1,"\",rec) .nes. "\") then goto mrsloop 500*212397c6Schristos$MRDONE: 501*212397c6Schristos$ close min 502*212397c6Schristos$ close mod 503*212397c6Schristos$ return 504*212397c6Schristos$!------------------------------------------------------------------------------ 505*212397c6Schristos$! 506*212397c6Schristos$! Take record extracted in crea_olist and split it into single filenames 507*212397c6Schristos$! 508*212397c6Schristos$EXTRA_FILNAM: 509*212397c6Schristos$ myrec = f$edit(rec - "\", "trim,compress") 510*212397c6Schristos$ i = 0 511*212397c6Schristos$FELOOP: 512*212397c6Schristos$ srcfil = f$element(i," ", myrec) 513*212397c6Schristos$ if (srcfil .nes. " ") 514*212397c6Schristos$ then 515*212397c6Schristos$ write mod f$parse(srcfil,,,"NAME"), ".obj" 516*212397c6Schristos$ i = i + 1 517*212397c6Schristos$ goto feloop 518*212397c6Schristos$ endif 519*212397c6Schristos$ return 520*212397c6Schristos$!------------------------------------------------------------------------------ 521*212397c6Schristos$! 522*212397c6Schristos$! Find current Zlib version number 523*212397c6Schristos$! 524*212397c6Schristos$FIND_VERSION: 525*212397c6Schristos$ open/read h_in 'v_file' 526*212397c6Schristos$hloop: 527*212397c6Schristos$ read/end=hdone h_in rec 528*212397c6Schristos$ rec = f$edit(rec,"TRIM") 529*212397c6Schristos$ if (f$extract(0,1,rec) .nes. "#") then goto hloop 530*212397c6Schristos$ rec = f$edit(rec - "#", "TRIM") 531*212397c6Schristos$ if f$element(0," ",rec) .nes. "define" then goto hloop 532*212397c6Schristos$ if f$element(1," ",rec) .eqs. v_string 533*212397c6Schristos$ then 534*212397c6Schristos$ version = 'f$element(2," ",rec)' 535*212397c6Schristos$ goto hdone 536*212397c6Schristos$ endif 537*212397c6Schristos$ goto hloop 538*212397c6Schristos$hdone: 539*212397c6Schristos$ close h_in 540*212397c6Schristos$ return 541*212397c6Schristos$!------------------------------------------------------------------------------ 542*212397c6Schristos$! 543*212397c6Schristos$CHECK_CONFIG: 544*212397c6Schristos$! 545*212397c6Schristos$ in_ldef = f$locate(cdef,libdefs) 546*212397c6Schristos$ if (in_ldef .lt. f$length(libdefs)) 547*212397c6Schristos$ then 548*212397c6Schristos$ write aconf "#define ''cdef' 1" 549*212397c6Schristos$ libdefs = f$extract(0,in_ldef,libdefs) + - 550*212397c6Schristos f$extract(in_ldef + f$length(cdef) + 1, - 551*212397c6Schristos f$length(libdefs) - in_ldef - f$length(cdef) - 1, - 552*212397c6Schristos libdefs) 553*212397c6Schristos$ else 554*212397c6Schristos$ if (f$type('cdef') .eqs. "INTEGER") 555*212397c6Schristos$ then 556*212397c6Schristos$ write aconf "#define ''cdef' ", 'cdef' 557*212397c6Schristos$ else 558*212397c6Schristos$ if (f$type('cdef') .eqs. "STRING") 559*212397c6Schristos$ then 560*212397c6Schristos$ write aconf "#define ''cdef' ", """", '''cdef'', """" 561*212397c6Schristos$ else 562*212397c6Schristos$ gosub check_cc_def 563*212397c6Schristos$ endif 564*212397c6Schristos$ endif 565*212397c6Schristos$ endif 566*212397c6Schristos$ return 567*212397c6Schristos$!------------------------------------------------------------------------------ 568*212397c6Schristos$! 569*212397c6Schristos$! Check if this is a define relating to the properties of the C/C++ 570*212397c6Schristos$! compiler 571*212397c6Schristos$! 572*212397c6Schristos$ CHECK_CC_DEF: 573*212397c6Schristos$ if (cdef .eqs. "_LARGEFILE64_SOURCE") 574*212397c6Schristos$ then 575*212397c6Schristos$ copy sys$input: 'tc' 576*212397c6Schristos$ deck 577*212397c6Schristos#include "tconfig" 578*212397c6Schristos#define _LARGEFILE 579*212397c6Schristos#include <stdio.h> 580*212397c6Schristos 581*212397c6Schristosint main(){ 582*212397c6SchristosFILE *fp; 583*212397c6Schristos fp = fopen("temp.txt","r"); 584*212397c6Schristos fseeko(fp,1,SEEK_SET); 585*212397c6Schristos fclose(fp); 586*212397c6Schristos} 587*212397c6Schristos 588*212397c6Schristos$ eod 589*212397c6Schristos$ test_inv = false 590*212397c6Schristos$ comm_h = false 591*212397c6Schristos$ gosub cc_prop_check 592*212397c6Schristos$ return 593*212397c6Schristos$ endif 594*212397c6Schristos$ write aconf "/* ", line, " */" 595*212397c6Schristos$ return 596*212397c6Schristos$!------------------------------------------------------------------------------ 597*212397c6Schristos$! 598*212397c6Schristos$! Check for properties of C/C++ compiler 599*212397c6Schristos$! 600*212397c6Schristos$! Version history 601*212397c6Schristos$! 0.01 20031020 First version to receive a number 602*212397c6Schristos$! 0.02 20031022 Added logic for defines with value 603*212397c6Schristos$! 0.03 20040309 Make sure local config file gets not deleted 604*212397c6Schristos$! 0.04 20041230 Also write include for configure run 605*212397c6Schristos$! 0.05 20050103 Add processing of "comment defines" 606*212397c6Schristos$CC_PROP_CHECK: 607*212397c6Schristos$ cc_prop = true 608*212397c6Schristos$ is_need = false 609*212397c6Schristos$ is_need = (f$extract(0,4,cdef) .eqs. "NEED") .or. (test_inv .eq. true) 610*212397c6Schristos$ if f$search(th) .eqs. "" then create 'th' 611*212397c6Schristos$ set message/nofac/noident/nosever/notext 612*212397c6Schristos$ on error then continue 613*212397c6Schristos$ cc 'tmpnam' 614*212397c6Schristos$ if .not. ($status) then cc_prop = false 615*212397c6Schristos$ on error then continue 616*212397c6Schristos$! The headers might lie about the capabilities of the RTL 617*212397c6Schristos$ link 'tmpnam',tmp.opt/opt 618*212397c6Schristos$ if .not. ($status) then cc_prop = false 619*212397c6Schristos$ set message/fac/ident/sever/text 620*212397c6Schristos$ on error then goto err_exit 621*212397c6Schristos$ delete/nolog 'tmpnam'.*;*/exclude='th' 622*212397c6Schristos$ if (cc_prop .and. .not. is_need) .or. - 623*212397c6Schristos (.not. cc_prop .and. is_need) 624*212397c6Schristos$ then 625*212397c6Schristos$ write sys$output "Checking for ''cdef'... yes" 626*212397c6Schristos$ if f$type('cdef_val'_yes) .nes. "" 627*212397c6Schristos$ then 628*212397c6Schristos$ if f$type('cdef_val'_yes) .eqs. "INTEGER" - 629*212397c6Schristos then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_yes) 630*212397c6Schristos$ if f$type('cdef_val'_yes) .eqs. "STRING" - 631*212397c6Schristos then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_yes) 632*212397c6Schristos$ else 633*212397c6Schristos$ call write_config f$fao("#define !AS 1",cdef) 634*212397c6Schristos$ endif 635*212397c6Schristos$ if (cdef .eqs. "HAVE_FSEEKO") .or. (cdef .eqs. "_LARGE_FILES") .or. - 636*212397c6Schristos (cdef .eqs. "_LARGEFILE64_SOURCE") then - 637*212397c6Schristos call write_config f$string("#define _LARGEFILE 1") 638*212397c6Schristos$ else 639*212397c6Schristos$ write sys$output "Checking for ''cdef'... no" 640*212397c6Schristos$ if (comm_h) 641*212397c6Schristos$ then 642*212397c6Schristos call write_config f$fao("/* !AS */",line) 643*212397c6Schristos$ else 644*212397c6Schristos$ if f$type('cdef_val'_no) .nes. "" 645*212397c6Schristos$ then 646*212397c6Schristos$ if f$type('cdef_val'_no) .eqs. "INTEGER" - 647*212397c6Schristos then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_no) 648*212397c6Schristos$ if f$type('cdef_val'_no) .eqs. "STRING" - 649*212397c6Schristos then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_no) 650*212397c6Schristos$ else 651*212397c6Schristos$ call write_config f$fao("#undef !AS",cdef) 652*212397c6Schristos$ endif 653*212397c6Schristos$ endif 654*212397c6Schristos$ endif 655*212397c6Schristos$ return 656*212397c6Schristos$!------------------------------------------------------------------------------ 657*212397c6Schristos$! 658*212397c6Schristos$! Check for properties of C/C++ compiler with multiple result values 659*212397c6Schristos$! 660*212397c6Schristos$! Version history 661*212397c6Schristos$! 0.01 20040127 First version 662*212397c6Schristos$! 0.02 20050103 Reconcile changes from cc_prop up to version 0.05 663*212397c6Schristos$CC_MPROP_CHECK: 664*212397c6Schristos$ cc_prop = true 665*212397c6Schristos$ i = 1 666*212397c6Schristos$ idel = 1 667*212397c6Schristos$ MT_LOOP: 668*212397c6Schristos$ if f$type(result_'i') .eqs. "STRING" 669*212397c6Schristos$ then 670*212397c6Schristos$ set message/nofac/noident/nosever/notext 671*212397c6Schristos$ on error then continue 672*212397c6Schristos$ cc 'tmpnam'_'i' 673*212397c6Schristos$ if .not. ($status) then cc_prop = false 674*212397c6Schristos$ on error then continue 675*212397c6Schristos$! The headers might lie about the capabilities of the RTL 676*212397c6Schristos$ link 'tmpnam'_'i',tmp.opt/opt 677*212397c6Schristos$ if .not. ($status) then cc_prop = false 678*212397c6Schristos$ set message/fac/ident/sever/text 679*212397c6Schristos$ on error then goto err_exit 680*212397c6Schristos$ delete/nolog 'tmpnam'_'i'.*;* 681*212397c6Schristos$ if (cc_prop) 682*212397c6Schristos$ then 683*212397c6Schristos$ write sys$output "Checking for ''cdef'... ", mdef_'i' 684*212397c6Schristos$ if f$type(mdef_'i') .eqs. "INTEGER" - 685*212397c6Schristos then call write_config f$fao("#define !AS !UL",cdef,mdef_'i') 686*212397c6Schristos$ if f$type('cdef_val'_yes) .eqs. "STRING" - 687*212397c6Schristos then call write_config f$fao("#define !AS !AS",cdef,mdef_'i') 688*212397c6Schristos$ goto msym_clean 689*212397c6Schristos$ else 690*212397c6Schristos$ i = i + 1 691*212397c6Schristos$ goto mt_loop 692*212397c6Schristos$ endif 693*212397c6Schristos$ endif 694*212397c6Schristos$ write sys$output "Checking for ''cdef'... no" 695*212397c6Schristos$ call write_config f$fao("#undef !AS",cdef) 696*212397c6Schristos$ MSYM_CLEAN: 697*212397c6Schristos$ if (idel .le. msym_max) 698*212397c6Schristos$ then 699*212397c6Schristos$ delete/sym mdef_'idel' 700*212397c6Schristos$ idel = idel + 1 701*212397c6Schristos$ goto msym_clean 702*212397c6Schristos$ endif 703*212397c6Schristos$ return 704*212397c6Schristos$!------------------------------------------------------------------------------ 705*212397c6Schristos$! 706*212397c6Schristos$! Write configuration to both permanent and temporary config file 707*212397c6Schristos$! 708*212397c6Schristos$! Version history 709*212397c6Schristos$! 0.01 20031029 First version to receive a number 710*212397c6Schristos$! 711*212397c6Schristos$WRITE_CONFIG: SUBROUTINE 712*212397c6Schristos$ write aconf 'p1' 713*212397c6Schristos$ open/append confh 'th' 714*212397c6Schristos$ write confh 'p1' 715*212397c6Schristos$ close confh 716*212397c6Schristos$ENDSUBROUTINE 717*212397c6Schristos$!------------------------------------------------------------------------------ 718*212397c6Schristos$! 719*212397c6Schristos$! Analyze the project map file and create the symbol vector for a shareable 720*212397c6Schristos$! image from it 721*212397c6Schristos$! 722*212397c6Schristos$! Version history 723*212397c6Schristos$! 0.01 20120128 First version 724*212397c6Schristos$! 0.02 20120226 Add pre-load logic 725*212397c6Schristos$! 726*212397c6Schristos$ MAP_2_SHOPT: Subroutine 727*212397c6Schristos$! 728*212397c6Schristos$ SAY := "WRITE_ SYS$OUTPUT" 729*212397c6Schristos$! 730*212397c6Schristos$ IF F$SEARCH("''P1'") .EQS. "" 731*212397c6Schristos$ THEN 732*212397c6Schristos$ SAY "MAP_2_SHOPT-E-NOSUCHFILE: Error, inputfile ''p1' not available" 733*212397c6Schristos$ goto exit_m2s 734*212397c6Schristos$ ENDIF 735*212397c6Schristos$ IF "''P2'" .EQS. "" 736*212397c6Schristos$ THEN 737*212397c6Schristos$ SAY "MAP_2_SHOPT: Error, no output file provided" 738*212397c6Schristos$ goto exit_m2s 739*212397c6Schristos$ ENDIF 740*212397c6Schristos$! 741*212397c6Schristos$ module1 = "deflate#deflateEnd#deflateInit_#deflateParams#deflateSetDictionary" 742*212397c6Schristos$ module2 = "gzclose#gzerror#gzgetc#gzgets#gzopen#gzprintf#gzputc#gzputs#gzread" 743*212397c6Schristos$ module3 = "gzseek#gztell#inflate#inflateEnd#inflateInit_#inflateSetDictionary" 744*212397c6Schristos$ module4 = "inflateSync#uncompress#zlibVersion#compress" 745*212397c6Schristos$ open/read map 'p1 746*212397c6Schristos$ if axp .or. ia64 747*212397c6Schristos$ then 748*212397c6Schristos$ open/write aopt a.opt 749*212397c6Schristos$ open/write bopt b.opt 750*212397c6Schristos$ write aopt " CASE_SENSITIVE=YES" 751*212397c6Schristos$ write bopt "SYMBOL_VECTOR= (-" 752*212397c6Schristos$ mod_sym_num = 1 753*212397c6Schristos$ MOD_SYM_LOOP: 754*212397c6Schristos$ if f$type(module'mod_sym_num') .nes. "" 755*212397c6Schristos$ then 756*212397c6Schristos$ mod_in = 0 757*212397c6Schristos$ MOD_SYM_IN: 758*212397c6Schristos$ shared_proc = f$element(mod_in, "#", module'mod_sym_num') 759*212397c6Schristos$ if shared_proc .nes. "#" 760*212397c6Schristos$ then 761*212397c6Schristos$ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",- 762*212397c6Schristos f$edit(shared_proc,"upcase"),shared_proc) 763*212397c6Schristos$ write bopt f$fao("!AS=PROCEDURE,-",shared_proc) 764*212397c6Schristos$ mod_in = mod_in + 1 765*212397c6Schristos$ goto mod_sym_in 766*212397c6Schristos$ endif 767*212397c6Schristos$ mod_sym_num = mod_sym_num + 1 768*212397c6Schristos$ goto mod_sym_loop 769*212397c6Schristos$ endif 770*212397c6Schristos$MAP_LOOP: 771*212397c6Schristos$ read/end=map_end map line 772*212397c6Schristos$ if (f$locate("{",line).lt. f$length(line)) .or. - 773*212397c6Schristos (f$locate("global:", line) .lt. f$length(line)) 774*212397c6Schristos$ then 775*212397c6Schristos$ proc = true 776*212397c6Schristos$ goto map_loop 777*212397c6Schristos$ endif 778*212397c6Schristos$ if f$locate("}",line).lt. f$length(line) then proc = false 779*212397c6Schristos$ if f$locate("local:", line) .lt. f$length(line) then proc = false 780*212397c6Schristos$ if proc 781*212397c6Schristos$ then 782*212397c6Schristos$ shared_proc = f$edit(line,"collapse") 783*212397c6Schristos$ chop_semi = f$locate(";", shared_proc) 784*212397c6Schristos$ if chop_semi .lt. f$length(shared_proc) then - 785*212397c6Schristos shared_proc = f$extract(0, chop_semi, shared_proc) 786*212397c6Schristos$ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",- 787*212397c6Schristos f$edit(shared_proc,"upcase"),shared_proc) 788*212397c6Schristos$ write bopt f$fao("!AS=PROCEDURE,-",shared_proc) 789*212397c6Schristos$ endif 790*212397c6Schristos$ goto map_loop 791*212397c6Schristos$MAP_END: 792*212397c6Schristos$ close/nolog aopt 793*212397c6Schristos$ close/nolog bopt 794*212397c6Schristos$ open/append libopt 'p2' 795*212397c6Schristos$ open/read aopt a.opt 796*212397c6Schristos$ open/read bopt b.opt 797*212397c6Schristos$ALOOP: 798*212397c6Schristos$ read/end=aloop_end aopt line 799*212397c6Schristos$ write libopt line 800*212397c6Schristos$ goto aloop 801*212397c6Schristos$ALOOP_END: 802*212397c6Schristos$ close/nolog aopt 803*212397c6Schristos$ sv = "" 804*212397c6Schristos$BLOOP: 805*212397c6Schristos$ read/end=bloop_end bopt svn 806*212397c6Schristos$ if (svn.nes."") 807*212397c6Schristos$ then 808*212397c6Schristos$ if (sv.nes."") then write libopt sv 809*212397c6Schristos$ sv = svn 810*212397c6Schristos$ endif 811*212397c6Schristos$ goto bloop 812*212397c6Schristos$BLOOP_END: 813*212397c6Schristos$ write libopt f$extract(0,f$length(sv)-2,sv), "-" 814*212397c6Schristos$ write libopt ")" 815*212397c6Schristos$ close/nolog bopt 816*212397c6Schristos$ delete/nolog/noconf a.opt;*,b.opt;* 817*212397c6Schristos$ else 818*212397c6Schristos$ if vax 819*212397c6Schristos$ then 820*212397c6Schristos$ open/append libopt 'p2' 821*212397c6Schristos$ mod_sym_num = 1 822*212397c6Schristos$ VMOD_SYM_LOOP: 823*212397c6Schristos$ if f$type(module'mod_sym_num') .nes. "" 824*212397c6Schristos$ then 825*212397c6Schristos$ mod_in = 0 826*212397c6Schristos$ VMOD_SYM_IN: 827*212397c6Schristos$ shared_proc = f$element(mod_in, "#", module'mod_sym_num') 828*212397c6Schristos$ if shared_proc .nes. "#" 829*212397c6Schristos$ then 830*212397c6Schristos$ write libopt f$fao("UNIVERSAL=!AS",- 831*212397c6Schristos f$edit(shared_proc,"upcase")) 832*212397c6Schristos$ mod_in = mod_in + 1 833*212397c6Schristos$ goto vmod_sym_in 834*212397c6Schristos$ endif 835*212397c6Schristos$ mod_sym_num = mod_sym_num + 1 836*212397c6Schristos$ goto vmod_sym_loop 837*212397c6Schristos$ endif 838*212397c6Schristos$VMAP_LOOP: 839*212397c6Schristos$ read/end=vmap_end map line 840*212397c6Schristos$ if (f$locate("{",line).lt. f$length(line)) .or. - 841*212397c6Schristos (f$locate("global:", line) .lt. f$length(line)) 842*212397c6Schristos$ then 843*212397c6Schristos$ proc = true 844*212397c6Schristos$ goto vmap_loop 845*212397c6Schristos$ endif 846*212397c6Schristos$ if f$locate("}",line).lt. f$length(line) then proc = false 847*212397c6Schristos$ if f$locate("local:", line) .lt. f$length(line) then proc = false 848*212397c6Schristos$ if proc 849*212397c6Schristos$ then 850*212397c6Schristos$ shared_proc = f$edit(line,"collapse") 851*212397c6Schristos$ chop_semi = f$locate(";", shared_proc) 852*212397c6Schristos$ if chop_semi .lt. f$length(shared_proc) then - 853*212397c6Schristos shared_proc = f$extract(0, chop_semi, shared_proc) 854*212397c6Schristos$ write libopt f$fao("UNIVERSAL=!AS",- 855*212397c6Schristos f$edit(shared_proc,"upcase")) 856*212397c6Schristos$ endif 857*212397c6Schristos$ goto vmap_loop 858*212397c6Schristos$VMAP_END: 859*212397c6Schristos$ else 860*212397c6Schristos$ write sys$output "Unknown Architecture (Not VAX, AXP, or IA64)" 861*212397c6Schristos$ write sys$output "No options file created" 862*212397c6Schristos$ endif 863*212397c6Schristos$ endif 864*212397c6Schristos$ EXIT_M2S: 865*212397c6Schristos$ close/nolog map 866*212397c6Schristos$ close/nolog libopt 867*212397c6Schristos$ endsubroutine 868