$! gnu_setup.com $! $! This version by Klaus Kaempf (kkaempf@progis.de) $! $ v = 'f$verify(0)' $! $! This command file sets up the necessary logical names for GNU. $! $! It defines GNU_ROOT such that it resembles the /usr/local directory $! tree from typical un*x installations. It also allows for different $! versions of the GNU C compiler. $! $ gosub make_path $ prfx = path - brkt $! $! Set architecture and version $! $ arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 $ arch = f$element(arch_indx,"|","|VAX|ALPHA|") $ vers = f$getsyi("VERSION")-"V" $ vers = f$edit(vers, "COLLAPSE") $ vmajor = f$element(0,".",vers) $ vminor = f$extract(0,1,f$element(1,".",vers)) $! $ target = arch+"-PROGIS-VMS_"+vmajor+"_"+vminor $! $ version = f$trnlnm ("GNU_CC_VERSION") $! $! Select which logical name table will hold the definition. $! [Bug: this ought to come from our command line.] $ table = "/Job" $! if f$priv("GRPNAM").or.f$priv("GRPPRV") then table = "/Group" $! if f$priv("SYSNAM").or.f$priv("SYSPRV") then table = "/System" $! $ define GNU_CC_LIBRARY 'f$string(prfx + target + "." + version + brkt)' $! $! Define GNU, GNU_CC_INCLUDE, and possibly GNU_GXX_INCLUDE $! (GNU_CC_INCLUDE is a searchlist when using the newer header file set). $ on error then goto bail $ define 'table' /Translation=(Concealed) - GNU_ROOT 'path' $ define 'table' /Translation=(Concealed) - GNU_CC_INCLUDE 'f$string(prfx + target + "." + version + ".INCLUDE." + brkt)', - 'f$string(prfx + target + "." + version + ".INCLUDE.VMS." + brkt)' $ define 'table' - GNU_CC_LIBRARY 'f$string(prfx + target + "." + version + brkt)' $ define 'table' /Translation=(Concealed) - GNU_GXX_INCLUDE 'f$string(prfx + target + "." + version + ".GXX-INCLUDE." + brkt)' $! define 'table /Translation=(Concealed) - GNU_BISON 'f$string(prfx + "SHARE." + brkt)' $! $! Done. $bail: $ exit ($status .or. %x10000000) + 0*f$verify(v) $! $make_path: $! Construct a rooted path for our directory. $! $! Start with the full file specification for this procedure. $ path = f$environment("PROCEDURE") $ pdev = f$parse(path,,,"DEVICE","NO_CONCEAL") $ pdev = f$parse(f$getdvi(pdev,"LOGVOLNAM"),pdev,,"DEVICE","SYNTAX_ONLY") $ pdir = f$parse(path,,,"DIRECTORY","NO_CONCEAL") $ root = "" $! Split pdir into root, if present, and directory. $ dlen = f$length(pdir) $ path = f$locate(".]",pdir) $ if path.lt.dlen $ then $ root = f$extract(0,path+2,pdir) $ pdir = f$extract(path+2,255,pdir) $ else $ path = f$locate(".>",pdir) $ if path.lt.dlen then root = f$extract(0,path+2,pdir) $ if path.lt.dlen then pdir = f$extract(path+2,255,pdir) $ endif $! An explicit reference to the MFD is redundant. $ if f$extract(1,7,pdir).eqs."000000." then pdir = pdir - "000000." $ dlen = f$length(pdir) $ rlen = f$length(root) $ brkt = f$extract(dlen-1,1,pdir) !closing bracket, "]" or ">" $! $! Possibly fixup rooted directory specification. $ if rlen.eq.0 $ then $! not already rooted; easy to deal with $ root = f$extract(0,dlen-1,pdir) + "." + brkt $ else $! first force root to use same punctuation as regular directory $ root = f$extract(0,1,pdir) + f$extract(1,rlen-2,root) + brkt $! now merge root and directory into new root $ if pdir.nes."[000000]" .and. pdir.nes."<000000>" then - root = f$extract(0,rlen-1,root) + f$extract(1,dlen-2,pdir) + "." + brkt $ endif $! $! Join device and directory into path. $ path = pdev + root $ return !from make_path $!