[comp.sys.apple2] Zaplink Question

STEIN@UCONNVM.BITNET (Alan Stein) (03/04/91)

I'm trying to put together my own generic shell, sort of like hodgepodge,
out of small components.  So far, I have about six different source files.
When I compiled them, and then tried to link the object files, I got a
"expanding file names made the line too long" message from the Orca Shell.

Is there a limit on the number of files that can be linked?  How do I get
around this problem without combining source files?  Can object files be
combined prior to linking?  Can linking be done in stages?

 __________________________________________________________
|                                                          |
| Alan H. Stein              | stein@uconnvm.bitnet        |
| Department of Mathematics  |                             |
| University of Connecticut  | Compu$erve  71545,1500      |
| 32 Hillside Avenue         | GEnie       ah.stein        |
| Waterbury, CT 06710        | SNET        (203) 757-1231  |
|__________________________________________________________|

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) (03/04/91)

STEIN@UCONNVM.BITNET (Alan Stein) writes:

>I'm trying to put together my own generic shell, sort of like hodgepodge,
>out of small components.  So far, I have about six different source files.
>When I compiled them, and then tried to link the object files, I got a
>"expanding file names made the line too long" message from the Orca Shell.

Here's what happens. The linker tries to expand all the names you give it
(in case of wildcard and crap like that, I think) and the new length of the
line exceeds the internal buffer that's being used for the command line
(255 bytes, probably). Shortening your directory names or filenames is the
cheap way to get around it.

>Is there a limit on the number of files that can be linked?  How do I get
>around this problem without combining source files?  Can object files be
>combined prior to linking?  Can linking be done in stages?

The answer to these questions is no, just a sec, yes, and yes.

After you've compiled each source file, use the MAKELIB utility to combine
them:

makelib -r object.a -l mylib

this takes object.a and replaces or adds it to mylib, a LIB file whose name
you specify on the linker command line. For instance,

compile main.c
compile stuff.c
compile morestuff.c
makelib -r stuff.c -l mylib
makelib -r morestuff.c -l mylib
link main mylib

makelib has more options than r and l, but the above is essentially what I do
(with some EXEC's) and it works.

Todd Whitesel
toddpw @ tybalt.caltech.edu

JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") (03/05/91)

On Mon, 4 Mar 91 06:25:07 GMT Todd P. Whitesel said:
>STEIN@UCONNVM.BITNET (Alan Stein) writes:
>>Is there a limit on the number of files that can be linked?  How do I get
>>around this problem without combining source files?  Can object files be
>>combined prior to linking?  Can linking be done in stages?
>
>The answer to these questions is no, just a sec, yes, and yes.
>
>After you've compiled each source file, use the MAKELIB utility to combine
>them:
[example deleted]

Man, talk about work!!!  The *easy* way is to create a ZapLink script.
Basically, a script is a source file of the type LINKER (I think the
language number is 265).  You can include any number of object files
and libraries to be linked in a script.  A sample script looks like:

+l
+w
      Object1
      Object2
      Object3
      Library1

      Keep=KeepName

>Todd Whitesel
>toddpw @ tybalt.caltech.edu

--
===> Josef W. Wankerl, Technical Editor for GS+ Magazine
  BITNET:  JWANKERL@UTCVM.BITNET       | America Online:  JWankerl
 ProLine:  jwankerl@pro-gsplus         |--------------------------------
Internet:  jwankerl@pro-gsplus.cts.com | "I am a Viking"  -Y. Malmsteen

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) (03/05/91)

JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes:

>Man, talk about work!!!  The *easy* way is to create a ZapLink script.

Mind telling me where this is documented? The Orca/C manual doesn't say
jack about the linker.

Todd Whitesel
toddpw @ tybalt.caltech.edu

daveh@ccwf.cc.utexas.edu (David H. Huang) (03/05/91)

In article <1991Mar5.035623.3183@nntp-server.caltech.edu> toddpw@nntp-server.caltech.edu (Todd P. Whitesel) writes:
>JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes:
>>Man, talk about work!!!  The *easy* way is to create a ZapLink script.

>Mind telling me where this is documented? The Orca/C manual doesn't say
>jack about the linker.

I saw something about it in the doc file for ZapLink that came with
the v1.2 upgrade of the shell (look on the :Extras disk). I think it
was also in an article by Mike Westerfield in Call-A.P.P.L.E. The
ZapLink docs don't say much though, so I've only written a ZapLink
script once... Maybe I'll start using it more when I can afford Orca/C
or some other high level language. 

>Todd Whitesel 
>toddpw @ tybalt.caltech.edu


-- 
David Huang                                 |
Internet: daveh@ccwf.cc.utexas.edu          | "Slight accidents with funny rays
UUCP: ...!ut-emx!ccwf.cc.utexas.edu!daveh   |   can have serious consequences"
America Online: DrWho29                     |

scott@brnded.ne1300.ingr.com (Scott Gentry) (03/06/91)

toddpw@nntp-server.caltech.edu (Todd P. Whitesel) writes:

>JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes:

>>Man, talk about work!!!  The *easy* way is to create a ZapLink script.

>Mind telling me where this is documented? The Orca/C manual doesn't say
>jack about the linker.

Catch 22, Todd.  It's not well documented.  There is a readme file of sorts 
that is included when you buy Zaplink.  Other than the readme file, I've not
seen it completely documented anywhere.  It is a good linker, though.  

--
*******************************************************************************
* W. Scott Gentry       | uucp: uunet!ingr!ne1300!brnded!scott |   I didn't   *
* Intergraph Corporation| America Online: AFL Scott            |   mean it!   *
******************************************************************************* 

acmfiu@serss0.fiu.edu (ACMFIU) (03/07/91)

In article <9103032217.AA18834@apple.com> STEIN@UCONNVM.BITNET (Alan Stein) writes:
>I'm trying to put together my own generic shell, sort of like hodgepodge,
>out of small components.  So far, I have about six different source files.
>When I compiled them, and then tried to link the object files, I got a
>"expanding file names made the line too long" message from the Orca Shell.
>
>Is there a limit on the number of files that can be linked?  How do I get
>around this problem without combining source files?  Can object files be
>combined prior to linking?  Can linking be done in stages?

Alan,
	Because of the limited length of command-lines in the current
	Orca shell (this will be changed in the 2.0 shell), you cannot put
	a great deal of information on the command-line. According to the
	ZapLink documentation, you can, however, put all your link files
	into a single file with auxtype 'linker' (i.e. change <file> linker).
	your file might look somethin like this:
		file1		/* i don't know if you need .a or .root */
		file2
		file3
		file4
		file5

	and then you save it and link like so:
		compile <filename> keep=executable

albert

bclark@pro-harvest.cts.com (Brian Clark) (03/07/91)

In-Reply-To: message from STEIN@UCONNVM.BITNET

>From: STEIN@UCONNVM.BITNET (Alan Stein)
>Subject: Zaplink Question
>
>I'm trying to put together my own generic shell, sort of like hodgepodge,
>out of small components.  So far, I have about six different source files.
>When I compiled them, and then tried to link the object files, I got a
>"expanding file names made the line too long" message from the Orca Shell.
>
>Is there a limit on the number of files that can be linked?  How do I get
>around this problem without combining source files?  Can object files be
>combined prior to linking?  Can linking be done in stages?

Zaplink is a scriptable linker, therefore you can have a listing of the
files needing to be linked in a file and pass the file to the compile
command... giving you the ability to link any number of files without
having to squash them together either 8-).

Heres an example:  Have a file with language type LINKER (consult the sheet
that came with ZapLink if you don't have this langauge setup or send me
mail if you can not locate the neccessary documentation).  Say you have
source files like  foobar.c  is.c  wierd.c  : have a file with:

foobar
is
wierd

Issue a command like this (or tweaked however you like) where linkfile
is the above file that is of language type LINKER.

cmpl +w linkfile KEEP=a.out

**Note: I will also be posting a multi-file compilational aid utility
(basically a make) to comp.binaries.apple2 within the week as soon as
I get it all packaged together, its an assortment of utils and scripts.
 ___________________________________________________________________
|                  |||                                              |
|   Brian Clark    |||  \    ProLine:  bclark@pro-harvest           |
|------------------|-|--=>  InterNet:  bclark@pro-harvest.cts.com   |
| "][gs Forever!!" |||  /       UUCP:  crash!pro-harvest!bclark     |
|__________________|||______________________________________________|