[gnu.gcc] Easier way to Link GCC

SUE@geneseo.bitnet (Sue Chichester) (04/10/89)

I thought it would be nice for my users not to have to think about 
linking with the GCCLIB and the VAXC libraries when they linked their 
GCC programs.  So what I wanted to have them do is say GLINK fn when
linking.  The first GLINK was just suppose to be a quick and dirty way of
doing this.  I made up a little command procedure GLINK.COM.


$ !          GLINK.COM - LINK for GCC
$!
$ IF P1 .NES. "" THEN GOTO LINK
$ INQUIRE P1 "File"
$LINK:
$LINK 'P1',GNU_CC:[000000]GCCLIB/LIB,VAXC/OPTIONS
$EXIT

This is okay but what I really want is something that you can also 
use the options available on the LINK command.  I used VERB to extract
LINK.CLD and thought I'd modify it.  (By the way, I don't know too much
about writing .CLD files)  To be quick honest, I really didn't know what I was
doing with this GLINK.CLD but I tried the following and I get an error when I
say GLINK my.obj
LINK-F-FIRSTMOD first input file being a library requires module extraction.

My question:  Does anyone know how LINK.CLD should be modified to always
link with the GCCLIB and VAXC libraries?  Is it even possible?
-OR-
Can my DCL command procedure be modified to allow for options on the LINK
command?

Thanks in advance.
Sue Chichester
SUNY Geneseo
SUE@GENESEO.BITNET

!*************************************GLINK**************************************
define type CHECK_KEY
   keyword SYSTEM
      default
   keyword TASK
define type SHARE_KEY
   keyword TASK
      default
   keyword COMMON
   keyword LIBRARY
define syntax LINK_USING_TKB
   image BACKTRANS
   parameter P1 , prompt="File"
      value (required,impcat,list,type=$infile)
   qualifier BRIEF
      default
   qualifier CHECKPOINT
      value (type=CHECK_KEY)
   qualifier COMPATIBLE
      default
   qualifier CONCATENATED
      placement=local
   qualifier CROSS_REFERENCE
   qualifier DEBUG
      value (type=$infile)
   qualifier DEFAULT_LIBRARY
      value (required,type=$infile)
   qualifier ERROR_LIMIT
      value (default="1")
   qualifier EXECUTABLE
      default
      value (type=$outfile)
      placement=positional
   qualifier EXIT
      value (default="1")
   qualifier FULL
   qualifier HEADER
      default
   qualifier INCLUDE
      value (required,list)
      placement=local
   qualifier LIBRARY
      placement=local
   qualifier LONG
   qualifier MAP
      batch
      value (type=$outfile)
      placement=positional
   qualifier OPTIONS
      value (type=$infile)
   qualifier OVERLAY_DESCRIPTION
   qualifier POSITION_INDEPENDENT
   qualifier POST_MORTEM
   qualifier RECEIVE
      default
   qualifier RESIDENT_OVERLAY
      default
   qualifier RSX11
   qualifier SEGREGATE
   qualifier SELECTIVE_SEARCH
      placement=local
   qualifier SEQUENTIAL
   qualifier SHAREABLE
      value (type=SHARE_KEY)
   qualifier SLOW
   qualifier SYMBOL_TABLE
      value (type=$outfile)
      placement=positional
   qualifier TKB_OPTIONS
      value (type=$infile)
   qualifier TRACE
   disallow ((LONG or FULL or BRIEF or CROSS_REFERENCE) and not MAP)
   disallow (EXIT and ERROR_LIMIT)
   disallow any2(BRIEF,LONG,FULL)
   disallow (OPTIONS and TKB_OPTIONS)
define verb GLINK
   image LINK
   parameter P1 , prompt="File"
      value (required,impcat,list,type=$infile)
   qualifier BRIEF
   qualifier CROSS_REFERENCE
   qualifier DEBUG
      value (type=$infile)
   qualifier EXECUTABLE
      default
      value (type=$outfile)
      placement=positional
   qualifier INCLUDE
      value (required,list)
      placement=local
   qualifier LIBRARY
      default
      value(default="gnu_cc:[000000]gcclib,sys$library:vaxcrtl")
      placement=local
   qualifier SHAREABLE
      value (type=$outfile)
   qualifier CONTIGUOUS
   qualifier MAP
      batch
      value (type=$outfile)
      placement=positional
   qualifier OPTIONS
      placement=local
   qualifier SELECTIVE_SEARCH
      placement=local
   qualifier SYMBOL_TABLE
      value (type=$outfile)
      placement=positional
   qualifier SYSLIB
      default
   qualifier SYSTEM
      value
   qualifier SUPRESS
      default
      value (default="SYSLIB,DEBUG,WEAK")
   qualifier RSX11 , syntax=LINK_USING_TKB
   qualifier FULL
   qualifier HEADER
   qualifier TRACE
      default
   qualifier SYSSHR
      default
   qualifier USERLIBRARY
      default
      value (list)
   qualifier P0IMAGE
   qualifier PROTECT
   disallow ((FULL or BRIEF or CROSS_REFERENCE) and not MAP)
   disallow (SYSTEM and DEBUG)
   disallow (PROTECT and SYSTEM)
   disallow (P0IMAGE and (SHAREABLE or SYSTEM))
   disallow (HEADER and SHAREABLE)
   disallow (BRIEF and (CROSS_REFERENCE or FULL))

huxtable@kuhub.cc.ukans.edu (Kathryn Huxtable) (04/12/89)

In article <8904101437.AA11953@life.ai.mit.edu>, SUE@geneseo.bitnet
(Sue Chichester) writes:
> I thought it would be nice for my users not to have to think about 
> linking with the GCCLIB and the VAXC libraries when they linked their 
> GCC programs.  So what I wanted to have them do is say GLINK fn when
> linking.  The first GLINK was just suppose to be a quick and dirty way of
> doing this.  I made up a little command procedure GLINK.COM.
> 
> 
> $ !          GLINK.COM - LINK for GCC
> $!
> $ IF P1 .NES. "" THEN GOTO LINK
> $ INQUIRE P1 "File"
> $LINK:
> $LINK 'P1',GNU_CC:[000000]GCCLIB/LIB,VAXC/OPTIONS
> $EXIT

You can't do what you want with the CLD file because you are not allowed to
specify a list for a default value.  CLD won't parse it, and the LINK command
doesn't think it has to.

Try the following:  declare a symbol, as follows:

$ glink == "@ gnu_cc:[000000]glink """""

This will supply a null 'P1' to the command procedure.  This will allow
qualifiers to be used immediately after the symbol name.  Replace the first    
two occurrences of P1 with P2.  Then replace the LINK command in your
command procedure with:

$ LINK 'P2' 'P3' 'P4' 'P5' 'P6' 'P7' 'P8', -
        GNU_CC:[000000]GCCLIB/LIB,VAXC/OPTIONS

Any qualifiers will be passed through, commas won't be stripped, so DCL should
be happy.  I use something similar to this, myself.

Good luck,

Kathryn Huxtable
huxtable@kuhub.cc.ukans.edu