source: trunk/athena/bin/athdir/athdir.man @ 7899

Revision 7899, 6.3 KB checked in by cfields, 29 years ago (diff)
Fix -r in the body.
Line 
1.TH ATHDIR 1 "1 January 1995"
2.ds ]W MIT Athena
3.SH NAME
4athdir \- find machine specific directories using Athena conventions
5.SH SYNOPSIS
6.nf
7athdir \fIlockerpath\fR [\fItype\fR]
8
9athdir [-t \fItype\fR] [-p \fIlockerpath\fR ...] [-e] [-c] [-l] [-i | -d]
10       [-r \fIrecsep\fR] [-f \fIformat\fR] [-s \fIsysname\fR] [-m \fImachtype\fR]
11.fi
12.SH DESCRIPTION
13\fIathdir\fR provides the most reliable way to determine the location
14in a locker of specific types of machine dependent files. While in C
15shell scripts the shell variable \fIbindir\fR is typically available,
16that information is not available in all environments (such as
17makefiles) and not necessarily as reliable, as it contains no
18intelligence. Similarly, while the environment variable
19\fIATHENA_SYS\fR is widely available, attempting to use it in
20makefiles or resource files may fail on older lockers that have not
21yet been upgraded to use the new conventions. (See \fIlockers\fR(7)
22for more information on locker directory conventions.)
23
24In the first invocation shown above, \fIathdir\fR does not accept
25command line options other than the two listed, and they must be in
26the listed order. If \fItype\fR is not specified, ``bin'' is assumed.
27
28In the second invocation above, no particular option is required,
29though at least one option is.  \fItype\fR has no default value, and
30the options may be specified in any order.
31.SH EXAMPLES
32\fIathdir\fR may be used to find directories for any sort of machine
33dependent or potentially machine dependent files. In its most common
34form, it should be used to replace \fImachtype\fR(1) (as in
35``/mit/locker/`machtype`bin''). For example,
36
37     set path=($path `athdir /mit/locker`)
38
39will append ``/mit/locker/arch/pmax_ul4/bin'' to the user's search
40path if the locker supports that as the machine specific binary
41directory, or ``/mit/locker/decmipsbin'' otherwise. Note that in this
42case, no type argument is specified, so ``bin'' is assumed. The
43example is shorthand for using `athdir /mit/locker bin`. Similarly,
44one might have in one's .twmrc file:
45
46    "meow"   f.exec "`athdir /mit/sipb`/oneko &"
47
48to replace:
49
50    "meow"   f.exec "/mit/sipb/`machtype`bin/oneko &"
51
52The rest of this manual page will probably not be of interest to most
53users, but may be of interest to developers.
54
55Another useful application for \fIathdir\fR is in makefiles. For
56example, suppose you wish to build a program against the x11 locker.
57You might start with
58
59     INCLUDES = `athdir /mit/x11 include`
60     LIBS = `athdir /mit/x11 lib`
61
62to find the appropriate directories in the locker. For dependencies
63on multiple lockers, you might have
64
65     INCLUDES = `athdir -t include -p /mit/motif /mit/x11`
66     LIBS = `athdir -t lib -p /mit/motif /mit/x11`
67
68which might resolve to
69
70     INCLUDES = /mit/motif/include /mit/x11/include
71     LIBS = /mit/motif/sun4lib /mit/x11/arch/sun4m_53/lib
72
73Note that this example allows for the possibility of machine dependent
74include files as well as libraries.
75
76In general, \fItype\fRs are treated as random strings by
77\fIathdir\fR. \fIathdir\fR checks the locker first for
78arch/$ATHENA_SYS/\fItype\fR, then for `machtype`\fItype\fR, then
79finally for simply \fItype\fR. Exceptions to this rule are cases where
80a convention is never expected to be used, or where a convention is
81explicitly discouraged and has never been supported. Note that if any
82future conventions arise, \fIathdir\fR will know about them and act
83accordingly. Thus, in theory, the usage of \fIathdir\fR should be
84forward compatible, and is encouraged.
85.SH OPTIONS
86\fIathdir\fR provides a few options for modifying its default behavior
87and providing other useful information.
88.TP 8
89.B \-e
90This option causes \fIathdir\fR to not engage in potentially annoying
91editorial behavior. It will not implement the above mentioned
92exceptions on conventions not expected or discouraged.
93.TP 8
94.B \-c
95This option causes \fIathdir\fR to not check for the usage of
96different possible conventions, and simply return output in the form
97of currently favored convention (arch). This is useful, for example,
98in makefiles that may wish to ``\fImkdir\fR -p'' target directories.
99.TP 8
100.B \-d
101This option, when used with \-c, tells \fIathdir\fR that you wish it
102to use the favored machine dependent directory convention when
103returning a pathname. \fIathdir\fR makes assumptions, based on
104\fItype\fR, what kind of directory should be returned. For example, if
105the \fItype\fR were ``include,'' \fIathdir\fR would ordinarily return
106something like ``/mit/locker/include.'' If you specify \-d, it would
107return ``/mit/locker/arch/$ATHENA_SYS/include'' instead.
108.TP 8
109.B \-i
110This option, when used with \-c, tells \fIathdir\fR that you wish it
111to use the favored machine independent directory convention when
112returning a pathname. This is basically the reverse of the \-d option.
113\fIathdir\fR, when it does not recognize a \fItype\fR, assumes the
114type to be machine dependent, so \-i may be used to override that.
115.TP 8
116.B \-l
117This option causes \fIathdir\fR to list the locations it would look
118for the \fItype\fR of directory requested, rather than looking in them
119and returning a single value. If a directory path is not specified,
120\fIathdir\fR will output a ``%p'' in its place; if a \fItype\fR is not
121specified, a ``%t'' will be output in its place, and all three above
122mentioned possibilities will be output.
123.TP 8
124.B \-f \fIformat\fR
125This option passes a format string to \fIathdir\fR to be used as a
126style for searching for directories. It is used as the preferred
127path style, with the built-in styles as fallbacks. It makes the following
128substitutions:
129
130        %p   path (as passed by -p)
131        %t   type (as passed by -t)
132        %s   sysname
133        %m   machtype value
134
135For example, the arch convention uses the string %p/arch/%s/%t.
136.TP 8
137.B \-r \fIrecsep\fR
138Specify the record separator when multiple paths are output. By default this
139is a newline. It may be useful to specify it to be a space or colon on
140various occasions.
141.TP 8
142.B \-s \fIsysname\fR
143This option allows a command line override for the \fIATHENA_SYS\fR
144value used in generating new style machine directories.
145.TP 8
146.B \-m \fImachtype\fR
147This option allows a command line override for the \fImachtype\fR
148value used in generating old style machine directories.
149.SH SEE ALSO
150machtype(1), lockers(7), mkdir(1)
151.SH AUTHOR
152Craig Fields, MIT Information Systems
153.br
154Copyright (c) 1995, Massachusetts Institute of Technology
Note: See TracBrowser for help on using the repository browser.