Home | History | Annotate | Line # | Download | only in zlib
make_vms.com revision 1.1
      1  1.1  christos $! make libz under VMS written by
      2  1.1  christos $! Martin P.J. Zinser
      3  1.1  christos $! <zinser@zinser.no-ip.info or zinser@sysdev.deutsche-boerse.com>
      4  1.1  christos $!
      5  1.1  christos $ on error then goto err_exit
      6  1.1  christos $!
      7  1.1  christos $!
      8  1.1  christos $! Just some general constants...
      9  1.1  christos $!
     10  1.1  christos $ true  = 1
     11  1.1  christos $ false = 0
     12  1.1  christos $ tmpnam = "temp_" + f$getjpi("","pid")
     13  1.1  christos $ SAY = "WRITE SYS$OUTPUT"
     14  1.1  christos $!
     15  1.1  christos $! Setup variables holding "config" information
     16  1.1  christos $!
     17  1.1  christos $ Make     = ""
     18  1.1  christos $ name     = "Zlib"
     19  1.1  christos $ version  = "?.?.?"
     20  1.1  christos $ v_string = "ZLIB_VERSION"
     21  1.1  christos $ v_file   = "zlib.h"
     22  1.1  christos $ ccopt    = ""
     23  1.1  christos $ lopts    = ""
     24  1.1  christos $ linkonly = false
     25  1.1  christos $ optfile  = name + ".opt"
     26  1.1  christos $ its_decc = false
     27  1.1  christos $ its_vaxc = false
     28  1.1  christos $ its_gnuc = false
     29  1.1  christos $ axp      = f$getsyi("HW_MODEL").ge.1024
     30  1.1  christos $ s_case   = false
     31  1.1  christos $! Check for MMK/MMS
     32  1.1  christos $!
     33  1.1  christos $ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
     34  1.1  christos $ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
     35  1.1  christos $!
     36  1.1  christos $!
     37  1.1  christos $ gosub find_version
     38  1.1  christos $!
     39  1.1  christos $ gosub check_opts
     40  1.1  christos $!
     41  1.1  christos $! Look for the compiler used
     42  1.1  christos $!
     43  1.1  christos $ gosub check_compiler
     44  1.1  christos $ if its_decc
     45  1.1  christos $ then
     46  1.1  christos $   ccopt = "/prefix=all" + ccopt
     47  1.1  christos $   if f$trnlnm("SYS") .eqs. ""
     48  1.1  christos $   then
     49  1.1  christos $     if axp
     50  1.1  christos $     then
     51  1.1  christos $       define sys sys$library:
     52  1.1  christos $     else
     53  1.1  christos $       ccopt = "/decc" + ccopt
     54  1.1  christos $       define sys decc$library_include:
     55  1.1  christos $     endif
     56  1.1  christos $   endif
     57  1.1  christos $ endif
     58  1.1  christos $ if its_vaxc .or. its_gnuc
     59  1.1  christos $ then
     60  1.1  christos $    if f$trnlnm("SYS").eqs."" then define sys sys$library:
     61  1.1  christos $ endif
     62  1.1  christos $!
     63  1.1  christos $! Build the thing plain or with mms
     64  1.1  christos $!
     65  1.1  christos $ write sys$output "Compiling Zlib sources ..."
     66  1.1  christos $ if make.eqs.""
     67  1.1  christos $  then
     68  1.1  christos $   dele example.obj;*,minigzip.obj;*
     69  1.1  christos $   CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
     70  1.1  christos                 adler32.c zlib.h zconf.h
     71  1.1  christos $   CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
     72  1.1  christos                 compress.c zlib.h zconf.h
     73  1.1  christos $   CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
     74  1.1  christos                 crc32.c zlib.h zconf.h
     75  1.1  christos $   CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
     76  1.1  christos                 deflate.c deflate.h zutil.h zlib.h zconf.h
     77  1.1  christos $   CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
     78  1.1  christos                 gzio.c zutil.h zlib.h zconf.h
     79  1.1  christos $   CALL MAKE infback.OBJ "CC ''CCOPT' infback" -
     80  1.1  christos                 infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
     81  1.1  christos $   CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
     82  1.1  christos                 inffast.c zutil.h zlib.h zconf.h inffast.h
     83  1.1  christos $   CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
     84  1.1  christos                 inflate.c zutil.h zlib.h zconf.h infblock.h
     85  1.1  christos $   CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
     86  1.1  christos                 inftrees.c zutil.h zlib.h zconf.h inftrees.h
     87  1.1  christos $   CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
     88  1.1  christos                 trees.c deflate.h zutil.h zlib.h zconf.h
     89  1.1  christos $   CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
     90  1.1  christos                 uncompr.c zlib.h zconf.h
     91  1.1  christos $   CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
     92  1.1  christos                 zutil.c zutil.h zlib.h zconf.h
     93  1.1  christos $   write sys$output "Building Zlib ..."
     94  1.1  christos $   CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
     95  1.1  christos $   write sys$output "Building example..."
     96  1.1  christos $   CALL MAKE example.OBJ "CC ''CCOPT' example" -
     97  1.1  christos                 example.c zlib.h zconf.h
     98  1.1  christos $   call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
     99  1.1  christos $   if f$search("x11vms:xvmsutils.olb") .nes. ""
    100  1.1  christos $   then
    101  1.1  christos $     write sys$output "Building minigzip..."
    102  1.1  christos $     CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
    103  1.1  christos                 minigzip.c zlib.h zconf.h
    104  1.1  christos $     call make minigzip.exe -
    105  1.1  christos                 "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
    106  1.1  christos                 minigzip.obj libz.olb
    107  1.1  christos $   endif
    108  1.1  christos $  else
    109  1.1  christos $   gosub crea_mms
    110  1.1  christos $   SAY "Make ''name' ''version' with ''Make' "
    111  1.1  christos $   'make'
    112  1.1  christos $  endif
    113  1.1  christos $!
    114  1.1  christos $! Alpha gets a shareable image
    115  1.1  christos $!
    116  1.1  christos $ If axp
    117  1.1  christos $ Then
    118  1.1  christos $   gosub crea_olist
    119  1.1  christos $   write sys$output "Creating libzshr.exe"
    120  1.1  christos $   call anal_obj_axp modules.opt _link.opt
    121  1.1  christos $   if s_case
    122  1.1  christos $   then
    123  1.1  christos $      open/append optf modules.opt
    124  1.1  christos $      write optf "case_sensitive=YES"
    125  1.1  christos $      close optf
    126  1.1  christos $   endif
    127  1.1  christos $   LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,_link.opt/opt
    128  1.1  christos $ endif
    129  1.1  christos $ write sys$output "Zlib build completed"
    130  1.1  christos $ exit
    131  1.1  christos $CC_ERR:
    132  1.1  christos $ write sys$output "C compiler required to build ''name'"
    133  1.1  christos $ goto err_exit
    134  1.1  christos $ERR_EXIT:
    135  1.1  christos $ set message/facil/ident/sever/text
    136  1.1  christos $ write sys$output "Exiting..."
    137  1.1  christos $ exit 2
    138  1.1  christos $!
    139  1.1  christos $!
    140  1.1  christos $MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
    141  1.1  christos $ V = 'F$Verify(0)
    142  1.1  christos $! P1 = What we are trying to make
    143  1.1  christos $! P2 = Command to make it
    144  1.1  christos $! P3 - P8  What it depends on
    145  1.1  christos $
    146  1.1  christos $ If F$Search(P1) .Eqs. "" Then Goto Makeit
    147  1.1  christos $ Time = F$CvTime(F$File(P1,"RDT"))
    148  1.1  christos $arg=3
    149  1.1  christos $Loop:
    150  1.1  christos $       Argument = P'arg
    151  1.1  christos $       If Argument .Eqs. "" Then Goto Exit
    152  1.1  christos $       El=0
    153  1.1  christos $Loop2:
    154  1.1  christos $       File = F$Element(El," ",Argument)
    155  1.1  christos $       If File .Eqs. " " Then Goto Endl
    156  1.1  christos $       AFile = ""
    157  1.1  christos $Loop3:
    158  1.1  christos $       OFile = AFile
    159  1.1  christos $       AFile = F$Search(File)
    160  1.1  christos $       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
    161  1.1  christos $       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
    162  1.1  christos $       Goto Loop3
    163  1.1  christos $NextEL:
    164  1.1  christos $       El = El + 1
    165  1.1  christos $       Goto Loop2
    166  1.1  christos $EndL:
    167  1.1  christos $ arg=arg+1
    168  1.1  christos $ If arg .Le. 8 Then Goto Loop
    169  1.1  christos $ Goto Exit
    170  1.1  christos $
    171  1.1  christos $Makeit:
    172  1.1  christos $ VV=F$VERIFY(0)
    173  1.1  christos $ write sys$output P2
    174  1.1  christos $ 'P2
    175  1.1  christos $ VV='F$Verify(VV)
    176  1.1  christos $Exit:
    177  1.1  christos $ If V Then Set Verify
    178  1.1  christos $ENDSUBROUTINE
    179  1.1  christos $!------------------------------------------------------------------------------
    180  1.1  christos $!
    181  1.1  christos $! Check command line options and set symbols accordingly
    182  1.1  christos $!
    183  1.1  christos $ CHECK_OPTS:
    184  1.1  christos $ i = 1
    185  1.1  christos $ OPT_LOOP:
    186  1.1  christos $ if i .lt. 9
    187  1.1  christos $ then
    188  1.1  christos $   cparm = f$edit(p'i',"upcase")
    189  1.1  christos $   if cparm .eqs. "DEBUG"
    190  1.1  christos $   then
    191  1.1  christos $     ccopt = ccopt + "/noopt/deb"
    192  1.1  christos $     lopts = lopts + "/deb"
    193  1.1  christos $   endif
    194  1.1  christos $   if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
    195  1.1  christos $   then
    196  1.1  christos $     start = f$locate("=",cparm) + 1
    197  1.1  christos $     len   = f$length(cparm) - start
    198  1.1  christos $     ccopt = ccopt + f$extract(start,len,cparm)
    199  1.1  christos $     if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) -
    200  1.1  christos          then s_case = true
    201  1.1  christos $   endif
    202  1.1  christos $   if cparm .eqs. "LINK" then linkonly = true
    203  1.1  christos $   if f$locate("LOPTS=",cparm) .lt. f$length(cparm)
    204  1.1  christos $   then
    205  1.1  christos $     start = f$locate("=",cparm) + 1
    206  1.1  christos $     len   = f$length(cparm) - start
    207  1.1  christos $     lopts = lopts + f$extract(start,len,cparm)
    208  1.1  christos $   endif
    209  1.1  christos $   if f$locate("CC=",cparm) .lt. f$length(cparm)
    210  1.1  christos $   then
    211  1.1  christos $     start  = f$locate("=",cparm) + 1
    212  1.1  christos $     len    = f$length(cparm) - start
    213  1.1  christos $     cc_com = f$extract(start,len,cparm)
    214  1.1  christos       if (cc_com .nes. "DECC") .and. -
    215  1.1  christos          (cc_com .nes. "VAXC") .and. -
    216  1.1  christos 	 (cc_com .nes. "GNUC")
    217  1.1  christos $     then
    218  1.1  christos $       write sys$output "Unsupported compiler choice ''cc_com' ignored"
    219  1.1  christos $       write sys$output "Use DECC, VAXC, or GNUC instead"
    220  1.1  christos $     else
    221  1.1  christos $     	if cc_com .eqs. "DECC" then its_decc = true
    222  1.1  christos $     	if cc_com .eqs. "VAXC" then its_vaxc = true
    223  1.1  christos $     	if cc_com .eqs. "GNUC" then its_gnuc = true
    224  1.1  christos $     endif
    225  1.1  christos $   endif
    226  1.1  christos $   if f$locate("MAKE=",cparm) .lt. f$length(cparm)
    227  1.1  christos $   then
    228  1.1  christos $     start  = f$locate("=",cparm) + 1
    229  1.1  christos $     len    = f$length(cparm) - start
    230  1.1  christos $     mmks = f$extract(start,len,cparm)
    231  1.1  christos $     if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS")
    232  1.1  christos $     then
    233  1.1  christos $       make = mmks
    234  1.1  christos $     else
    235  1.1  christos $       write sys$output "Unsupported make choice ''mmks' ignored"
    236  1.1  christos $       write sys$output "Use MMK or MMS instead"
    237  1.1  christos $     endif
    238  1.1  christos $   endif
    239  1.1  christos $   i = i + 1
    240  1.1  christos $   goto opt_loop
    241  1.1  christos $ endif
    242  1.1  christos $ return
    243  1.1  christos $!------------------------------------------------------------------------------
    244  1.1  christos $!
    245  1.1  christos $! Look for the compiler used
    246  1.1  christos $!
    247  1.1  christos $CHECK_COMPILER:
    248  1.1  christos $ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
    249  1.1  christos $ then
    250  1.1  christos $   its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "")
    251  1.1  christos $   its_vaxc = .not. its_decc .and. (F$Search("SYS$System:VAXC.Exe") .nes. "")
    252  1.1  christos $   its_gnuc = .not. (its_decc .or. its_vaxc) .and. (f$trnlnm("gnu_cc") .nes. "")
    253  1.1  christos $ endif
    254  1.1  christos $!
    255  1.1  christos $! Exit if no compiler available
    256  1.1  christos $!
    257  1.1  christos $ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
    258  1.1  christos $ then goto CC_ERR
    259  1.1  christos $ else
    260  1.1  christos $   if its_decc then write sys$output "CC compiler check ... Compaq C"
    261  1.1  christos $   if its_vaxc then write sys$output "CC compiler check ... VAX C"
    262  1.1  christos $   if its_gnuc then write sys$output "CC compiler check ... GNU C"
    263  1.1  christos $ endif
    264  1.1  christos $ return
    265  1.1  christos $!------------------------------------------------------------------------------
    266  1.1  christos $!
    267  1.1  christos $! If MMS/MMK are available dump out the descrip.mms if required
    268  1.1  christos $!
    269  1.1  christos $CREA_MMS:
    270  1.1  christos $ write sys$output "Creating descrip.mms..."
    271  1.1  christos $ create descrip.mms
    272  1.1  christos $ open/append out descrip.mms
    273  1.1  christos $ copy sys$input: out
    274  1.1  christos $ deck
    275  1.1  christos # descrip.mms: MMS description file for building zlib on VMS
    276  1.1  christos # written by Martin P.J. Zinser
    277  1.1  christos # <zinser (at] zinser.no-ip.info or zinser (at] sysdev.deutsche-boerse.com>
    278  1.1  christos 
    279  1.1  christos OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj, infback.obj\
    280  1.1  christos        deflate.obj, trees.obj, zutil.obj, inflate.obj, \
    281  1.1  christos        inftrees.obj, inffast.obj
    282  1.1  christos 
    283  1.1  christos $ eod
    284  1.1  christos $ write out "CFLAGS=", ccopt
    285  1.1  christos $ write out "LOPTS=", lopts
    286  1.1  christos $ copy sys$input: out
    287  1.1  christos $ deck
    288  1.1  christos 
    289  1.1  christos all : example.exe minigzip.exe libz.olb
    290  1.1  christos         @ write sys$output " Example applications available"
    291  1.1  christos 
    292  1.1  christos libz.olb : libz.olb($(OBJS))
    293  1.1  christos 	@ write sys$output " libz available"
    294  1.1  christos 
    295  1.1  christos example.exe : example.obj libz.olb
    296  1.1  christos               link $(LOPTS) example,libz.olb/lib
    297  1.1  christos 
    298  1.1  christos minigzip.exe : minigzip.obj libz.olb
    299  1.1  christos               link $(LOPTS) minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib
    300  1.1  christos 
    301  1.1  christos clean :
    302  1.1  christos 	delete *.obj;*,libz.olb;*,*.opt;*,*.exe;*
    303  1.1  christos 
    304  1.1  christos 
    305  1.1  christos # Other dependencies.
    306  1.1  christos adler32.obj  : adler32.c zutil.h zlib.h zconf.h
    307  1.1  christos compress.obj : compress.c zlib.h zconf.h
    308  1.1  christos crc32.obj    : crc32.c zutil.h zlib.h zconf.h
    309  1.1  christos deflate.obj  : deflate.c deflate.h zutil.h zlib.h zconf.h
    310  1.1  christos example.obj  : example.c zlib.h zconf.h
    311  1.1  christos gzio.obj     : gzio.c zutil.h zlib.h zconf.h
    312  1.1  christos inffast.obj  : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h
    313  1.1  christos inflate.obj  : inflate.c zutil.h zlib.h zconf.h
    314  1.1  christos inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h
    315  1.1  christos minigzip.obj : minigzip.c zlib.h zconf.h
    316  1.1  christos trees.obj    : trees.c deflate.h zutil.h zlib.h zconf.h
    317  1.1  christos uncompr.obj  : uncompr.c zlib.h zconf.h
    318  1.1  christos zutil.obj    : zutil.c zutil.h zlib.h zconf.h
    319  1.1  christos infback.obj  : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
    320  1.1  christos $ eod
    321  1.1  christos $ close out
    322  1.1  christos $ return
    323  1.1  christos $!------------------------------------------------------------------------------
    324  1.1  christos $!
    325  1.1  christos $! Read list of core library sources from makefile.in and create options
    326  1.1  christos $! needed to build shareable image
    327  1.1  christos $!
    328  1.1  christos $CREA_OLIST:
    329  1.1  christos $ open/read min makefile.in
    330  1.1  christos $ open/write mod modules.opt
    331  1.1  christos $ src_check = "OBJS ="
    332  1.1  christos $MRLOOP:
    333  1.1  christos $ read/end=mrdone min rec
    334  1.1  christos $ if (f$extract(0,6,rec) .nes. src_check) then goto mrloop
    335  1.1  christos $ rec = rec - src_check
    336  1.1  christos $ gosub extra_filnam
    337  1.1  christos $ if (f$element(1,"\",rec) .eqs. "\") then goto mrdone
    338  1.1  christos $MRSLOOP:
    339  1.1  christos $ read/end=mrdone min rec
    340  1.1  christos $ gosub extra_filnam
    341  1.1  christos $ if (f$element(1,"\",rec) .nes. "\") then goto mrsloop
    342  1.1  christos $MRDONE:
    343  1.1  christos $ close min
    344  1.1  christos $ close mod
    345  1.1  christos $ return
    346  1.1  christos $!------------------------------------------------------------------------------
    347  1.1  christos $!
    348  1.1  christos $! Take record extracted in crea_olist and split it into single filenames
    349  1.1  christos $!
    350  1.1  christos $EXTRA_FILNAM:
    351  1.1  christos $ myrec = f$edit(rec - "\", "trim,compress")
    352  1.1  christos $ i = 0
    353  1.1  christos $FELOOP:
    354  1.1  christos $ srcfil = f$element(i," ", myrec)
    355  1.1  christos $ if (srcfil .nes. " ")
    356  1.1  christos $ then
    357  1.1  christos $   write mod f$parse(srcfil,,,"NAME"), ".obj"
    358  1.1  christos $   i = i + 1
    359  1.1  christos $   goto feloop
    360  1.1  christos $ endif
    361  1.1  christos $ return
    362  1.1  christos $!------------------------------------------------------------------------------
    363  1.1  christos $!
    364  1.1  christos $! Find current Zlib version number
    365  1.1  christos $!
    366  1.1  christos $FIND_VERSION:
    367  1.1  christos $ open/read h_in 'v_file'
    368  1.1  christos $hloop:
    369  1.1  christos $ read/end=hdone h_in rec
    370  1.1  christos $ rec = f$edit(rec,"TRIM")
    371  1.1  christos $ if (f$extract(0,1,rec) .nes. "#") then goto hloop
    372  1.1  christos $ rec = f$edit(rec - "#", "TRIM")
    373  1.1  christos $ if f$element(0," ",rec) .nes. "define" then goto hloop
    374  1.1  christos $ if f$element(1," ",rec) .eqs. v_string
    375  1.1  christos $ then
    376  1.1  christos $   version = 'f$element(2," ",rec)'
    377  1.1  christos $   goto hdone
    378  1.1  christos $ endif
    379  1.1  christos $ goto hloop
    380  1.1  christos $hdone:
    381  1.1  christos $ close h_in
    382  1.1  christos $ return
    383  1.1  christos $!------------------------------------------------------------------------------
    384  1.1  christos $!
    385  1.1  christos $! Analyze Object files for OpenVMS AXP to extract Procedure and Data
    386  1.1  christos $! information to build a symbol vector for a shareable image
    387  1.1  christos $! All the "brains" of this logic was suggested by Hartmut Becker
    388  1.1  christos $! (Hartmut.Becker@compaq.com). All the bugs were introduced by me
    389  1.1  christos $! (zinser@decus.de), so if you do have problem reports please do not
    390  1.1  christos $! bother Hartmut/HP, but get in touch with me
    391  1.1  christos $!
    392  1.1  christos $ ANAL_OBJ_AXP: Subroutine
    393  1.1  christos $ V = 'F$Verify(0)
    394  1.1  christos $ SAY := "WRITE_ SYS$OUTPUT"
    395  1.1  christos $
    396  1.1  christos $ IF F$SEARCH("''P1'") .EQS. ""
    397  1.1  christos $ THEN
    398  1.1  christos $    SAY "ANAL_OBJ_AXP-E-NOSUCHFILE:  Error, inputfile ''p1' not available"
    399  1.1  christos $    goto exit_aa
    400  1.1  christos $ ENDIF
    401  1.1  christos $ IF "''P2'" .EQS. ""
    402  1.1  christos $ THEN
    403  1.1  christos $    SAY "ANAL_OBJ_AXP:  Error, no output file provided"
    404  1.1  christos $    goto exit_aa
    405  1.1  christos $ ENDIF
    406  1.1  christos $
    407  1.1  christos $ open/read in 'p1
    408  1.1  christos $ create a.tmp
    409  1.1  christos $ open/append atmp a.tmp
    410  1.1  christos $ loop:
    411  1.1  christos $ read/end=end_loop in line
    412  1.1  christos $ f= f$search(line)
    413  1.1  christos $ if f .eqs. ""
    414  1.1  christos $ then
    415  1.1  christos $	write sys$output "ANAL_OBJ_AXP-w-nosuchfile, ''line'"
    416  1.1  christos $	goto loop
    417  1.1  christos $ endif
    418  1.1  christos $ define/user sys$output nl:
    419  1.1  christos $ define/user sys$error nl:
    420  1.1  christos $ anal/obj/gsd 'f /out=x.tmp
    421  1.1  christos $ open/read xtmp x.tmp
    422  1.1  christos $ XLOOP:
    423  1.1  christos $ read/end=end_xloop xtmp xline
    424  1.1  christos $ xline = f$edit(xline,"compress")
    425  1.1  christos $ write atmp xline
    426  1.1  christos $ goto xloop
    427  1.1  christos $ END_XLOOP:
    428  1.1  christos $ close xtmp
    429  1.1  christos $ goto loop
    430  1.1  christos $ end_loop:
    431  1.1  christos $ close in
    432  1.1  christos $ close atmp
    433  1.1  christos $ if f$search("a.tmp") .eqs. "" -
    434  1.1  christos 	then $ exit
    435  1.1  christos $ ! all global definitions
    436  1.1  christos $ search a.tmp "symbol:","EGSY$V_DEF 1","EGSY$V_NORM 1"/out=b.tmp
    437  1.1  christos $ ! all procedures
    438  1.1  christos $ search b.tmp "EGSY$V_NORM 1"/wind=(0,1) /out=c.tmp
    439  1.1  christos $ search c.tmp "symbol:"/out=d.tmp
    440  1.1  christos $ define/user sys$output nl:
    441  1.1  christos $ edito/edt/command=sys$input d.tmp
    442  1.1  christos sub/symbol: "/symbol_vector=(/whole
    443  1.1  christos sub/"/=PROCEDURE)/whole
    444  1.1  christos exit
    445  1.1  christos $ ! all data
    446  1.1  christos $ search b.tmp "EGSY$V_DEF 1"/wind=(0,1) /out=e.tmp
    447  1.1  christos $ search e.tmp "symbol:"/out=f.tmp
    448  1.1  christos $ define/user sys$output nl:
    449  1.1  christos $ edito/edt/command=sys$input f.tmp
    450  1.1  christos sub/symbol: "/symbol_vector=(/whole
    451  1.1  christos sub/"/=DATA)/whole
    452  1.1  christos exit
    453  1.1  christos $ sort/nodupl d.tmp,f.tmp 'p2'
    454  1.1  christos $ delete a.tmp;*,b.tmp;*,c.tmp;*,d.tmp;*,e.tmp;*,f.tmp;*
    455  1.1  christos $ if f$search("x.tmp") .nes. "" -
    456  1.1  christos 	then $ delete x.tmp;*
    457  1.1  christos $!
    458  1.1  christos $ EXIT_AA:
    459  1.1  christos $ if V then set verify
    460  1.1  christos $ endsubroutine
    461  1.1  christos $!------------------------------------------------------------------------------
    462