[gs-devel] ghostscript: a proposal for site-wide and user-specific configuration files and environment variables

Nelson H. F. Beebe beebe at math.utah.edu
Fri May 17 16:02:55 PDT 2002


I've taken up the challenge that I posted last night for a way to
provide ghostscript with enhanced GS_LIB path handling and
customization, eliminating the need for build-time customization.

The result is a well-documented wrapper script that is now installed
on all of our local systems, such that ${prefix}/bin/gs is a symlink
to a single common file: ${gsdir}/gs-wrapper.sh.

Now, I can change that single file, and have instant updates across
all of our 200+ architectures and systems sharing a common
${prefix}/share tree.

You can find the script at:

	http://www.math.utah.edu/~beebe/software/ghostscript/

Users can now define GS_LIB like this, as they can with TeX Live
software:

	GS_LIB=:$HOME/fonts//                   # user font directory tree last
	GS_LIB=$HOME/fonts//:                   # user font directory tree first
	GS_LIB=$HOME/newfonts::$HOME/fonts//   # system default in middle

A doubled slash in a directory path component requests replacement
with a sorted list of that directory and all of its nested
subdirectories.

An empty element in the path is replaced by the local system default
path, set in the gs-wrapper.sh script.

The script also accepts an -x.yz argument to select gs-x.yz, instead
of the default set by the installer.  Thus, it serves to wrap all
installed versions of ghostscript (I have more than two dozen on some
of my systems).

I will be happy to have feedback from testers about whether this is
useful to them, whether additional features are desirable, and, of
course, whether there are bugs (I certainly hope not: the code is very
clear, and has worked on several tests on each of my dozen or so
development platforms).  If people find this useful, it could be
included in future ghostscript distributions.  To that end, I've
placed the code under the AFPL (or GPL, depending on the ghostscript
code source).

Tests show that the wrappers adds about 0.1 sec of wall-clock overhead
on older systems (180 MHz RISC processors): I doubt that any of our
users will even notice.

This script exposed a fairly serious limitation in ghostscript that
took quite some time this morning to track down: there is an
undocumented (in doc/*.htm*) limit on the number of directories in a
search path, defined by the compile-time-customizable preprocessor
symbol GS_MAX_LIB_DIRS in src/imainarg.c.  That symbol has had the
value 25 since gs-3.68.  I will post a suitable patch in a subsequent
message to this list.

The TeX Live tree in particular has a lot of font directories that
make that limit much too small.  In the meantime, gs-wrapper.sh avoids
including that tree in the search path for versions up to and
including 7.20.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 585 1640, +1 801 581 4148 -
- University of Utah                    Internet e-mail: beebe at math.utah.edu  -
- Department of Mathematics, 110 LCB        beebe at acm.org  beebe at computer.org -
- 155 S 1400 E RM 233                       beebe at ieee.org                    -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------



More information about the gs-devel mailing list