.TI F77/BIGLIBS "Sep. 15, 1984"
Techniques for Creating Large User Libraries

If you have a large library, it saves space to strip the object files
of local symbols before putting them in the library.
The following
C shell commands strip all the '.o' files in the current directory
and create a new random library, mylib.a, from them.
Do this only with debugged files as the source level debuger,
dbx, can not be used with stripped object files.

.nf
	foreach i (*.o)
	   ld -r -x $i
	   /bin/mv a.out $i
	end
	/bin/rm -f mylib.a
	ar qv mylib.a *.o
	ranlib mylib.a
.fi

The /bin/rm -f will remove an existing version of the library without
prompting if it exists and without error comment if none exists.
\&'Ar q' is faster than 'ar r' or 'ar u' when creating libraries, especially
when creating an archive piece-by-piece.  'q' cannot be used when
updating an archive.  The 'v' option causes the names of the files
being added to be typed on standard output.

With large archives, loading time often is improved if the files
in the archive are ordered so that the loader will make only one
pass through the archive.  To do this, replace the ar by:

.nf
	ar qv mylib.a `lorder *.o | tsort`
.fi

If you are creating a archive with over 500 object files, 'lorder *.o'
may cause the error: "Arguments too long".
This can be overcome by a sequence such as:

.nf
	ar q tmp.a [a-d]*.o
	ar q tmp.a [e-n]*.o
	ar q tmp.a [o-z]*.o
	lorder tmp.a | tsort | split -100 - XXlists
	/bin/rm tmp.a
	foreach i ( XXlists* )
		ar qv mylib.a `cat $i`
	end
	/bin/rm -f XXlists*
.fi
