From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 29-OCT-1991 10:08:38.63
To:	ARISIA::EVERHART
CC:	
Subj:	GLINK.COM - for GNU C users with VAX's nasty LINK

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.115)
	 id AA06091; Tue, 29 Oct 91 08:46:56 EST
Received: From HAMP.HAMPSHIRE.EDU by CRVAX.SRI.COM with TCP; Mon, 28 OCT 91 16:58:21 PST
Date: Mon, 28 Oct 91 19:59 EDT
From: Children's Rights List Co-ordinator <KUDUT@hamp.hampshire.edu>
Subject: GLINK.COM - for GNU C users with VAX's nasty LINK
To: info-vax@sri.COM
Message-Id: <F316BDB530BF013837@hamp.hampshire.edu>
X-Envelope-To: info-vax@sri.COM
X-Vms-To: IN%"info-vax@sri.com"
X-Vms-Cc: KUDUT

$ ! GLINK.COM by KUDUT@hamp.hampshire.edu (Kenneth Udut)
$ ! Date: 10-28-91
$ ! Purpose: When LINKing .OBJ files, the default is to take the whole VAX C
$ !          (and GNU C) library and place it in the .EXE, whether it gets
$ !          used or not.  This program, adapted from an example in the
$ !          HELP GCC Linking, uses only the necessary items from the Library
$ !          to make it functional.  It will Link GNU C .OBJ files and VAX C
$ !          .OBJ files.  However, the GNU C library must be in place at
$ !          logical GNU_CC:[000000]
$ !
$ ! Known Limitations: None as of yet.  If you find any bugs, contact me
$ !                    at KUDUT@hamp.hampshire.edu
$ !
$ write sys$output "GLINK.COM                                           (c) 1991 Kenneth Udut"
$ write sys$output "Improved LINK.  Works with shared GNU C and VAX C libraries."
$ write sys$output "This reduces the size of the .EXE file, as well as make it smaller"
$ write sys$output "when it's running.  
$ write sys$output " "
$ if p1 .eqs. "" then inquire/nopunct p1 "Name of .OBJ file: "
$ open/write input_file vaxcrtl.opt
$ write input_file "SYS$SHARE:VAXCRTL/SHARE"
$ close input_file
$ open/write input_file link.dat
$ write input_file "$ LINK ''p1',GNU_CC:[000000]gcclib/lib,SYS$LOGIN:VAXCRTL.OPT/OPT"
$ close input_file
$ write sys$output "Linking ''p1'"
$ @link.dat
$ delete vaxcrtl.opt;
$ delete link.dat;
$ write sys$output "Executable version of ''p1' created"

