elink(5) DG/UX R4.11 elink(5)
NAME
elink - environment variable-sensitive file link
DESCRIPTION
An elink is the mechanism used to encode environment variable-
sensitive references into symbolic links. This non-standard use of
symbolic links is used by a number of software development tools such
as cc to find files that pertain to a development environment
selected with sde-target(1).
The elink mechanism is incorporated into a number of software
development tools to support the generation of programs and libraries
that conform to different standards on the same machine. It is
implemented by inserting code into the error paths of special
versions of some system library routines.
An elink is a symbolic link whose value conforms to the following
grammar:
<elink> ::= "elink:" <sp> <pathname> <sp> <comment>
<pathname> ::= <pathname> <evref> <pathname>
| <pathchars>
|
<evref> ::= "$" <evname>
| "${" <evname> "}"
| "${" <evname> ":-" <default> "}"
<evname> ::= <id>
<default> ::= <id>
<pathchars> ::= <id>
| <pathchars> "/" <pathchars>
<comment> ::= "#" <text>
|
<sp> is zero or more tab or space characters.
<id> is a sequence of identifier characters.
<text> is zero or more characters.
This grammar is ambiguous in a number of ways that are not
significant. For example, you can't tell how <evref> terminates if
it is not the "${}" form and it is followed by an <id>.
Within one of the specially modified tools, when an operation such as
open(2) is performed, nothing is done unless an error would be
reported. In that case, the pathname argument is checked to see if
it or any component is a symbolic link. If one is found, then the
contents of the link are checked to see if they conform to the above
grammar. If so, the <pathname> component is extracted, environment
variable substitution is performed, and the operation is tried again,
substituting the newly created pathname for the value of the symbolic
link in the original argument. The previous steps are repeated until
the operation succeeds or the argument does not resolve to a valid
symbolic link (and an error is reported).
Environment variable substitution is defined as the replacement of
all <evref> components in the <pathname> with the appropriate
environment variable value. If a given environment variable is not
defined, then the <default> value is used if it is supplied;
otherwise "" is used.
For example, consider the following symbolic link:
/usr/lib/libc.a ->
elink:/usr/sde/${TARGET_BINARY_INTERFACE:-dg}/
usr/lib/libc.a # See sde-target(1)
Links begin with "elink:" to give a visual cue that something is
different about this symbolic link. The comment allows the insertion
of other informational pointers.
This link makes reference to one environment variable although more
could have been used. If the environment variable
TARGET_BINARY_INTERFACE is not defined when a tool such as ld(1)
attempts to open /usr/lib/libc.a then the tool will use the path
/usr/sde/dg/usr/lib/libc.a. If TARGET_BINARY_INTERFACE is some value
such as m88k_bcs, the the path used to find libc.a will include the
value of the variable such as /usr/sde/m88k_bcs/usr/lib/libc.a.
NOTES
The elink mechanism is incorporated only in a small set of tools.
Other tools that attempt to use a pathname that contains an elink
will get an error indicating that the file does not exist.
There is a current restriction that an elink cannot reference another
elink.
SEE ALSO
sde-target(1), sde(5).
Licensed material--property of copyright holder(s)