Alice Project


________ Overview ____________________________________________________

The static linker allows to bundle a component together with (a subset of) its direct and indirect imports. It can also be used to inspect import and export signatures of components.

________ Synopsis ____________________________________________________

alicelink [<options>] <root url> [<options>]
alicelink [<options>] -d <root url>

________ Description _________________________________________________

In the first form, the linker takes the root component from <root url>, bundles it with the components it depends on, and writes an output component that has the same export signature as the root component. Components can be selected for inclusion depending on the URL they reside on.

When the URL of a component is tested for inclusion, it is tested in order against the prefixes given by the --include and --exclude options (see below), where string prefix matching is used. The first match decides. If no --include option is given, only the root component will be included.

Note that Alice library components (under the x-alice: scheme) are always excluded. This is necessary to achieve sandboxing security with component managers.

In the second form, the linker just prints the import and export signatures of the component at <root url> to standard output.


A typical application of the linker is to link all components imported using relative imports from the same directory as or a subdirectory of the root component. The following command line accomplishes this for a root component Foo:

alicelink -v ./Foo --include ./ -o LinkedFoo.alc

________ Options _____________________________________________________

-?, -h, --help, --usage

Print usage information.

-o <file>, --output <file>

Specify where to write the output component. If omitted, do not produce any output.

-v, --verbose

Print messages on activities performed.

-d, --dumpsig

Dump import/export signatures of resulting component, or of root component if no ouput file has been specified.

-z, --minimize

Minimize output component.

--include <url>,...,<url>

Include components with these URL prefixes.

--exclude <url>,...,<url>

Exclude components with these URL prefixes.

--rewrite <rule>,...,<rule>

Specifies how to rewrite import URLs in resulting component. A <rule> is of the form <from>=<to>, where <from> and <to> are patterns in which ?{x} denotes a variable. It is an error if multiple import URLs from the resulting component are rewritten to the same URL. If the environment variable ALICE_TRACE_REWRITE is set (its value does not matter), trace messages about rewriting attempts are output to standard error.

________ Environment variables _______________________________________

The static linker is parameterized by the same environment variables as the virtual machine, plus:


if set (its value does not matter), causes rewriting of URLs to output trace messages to standard error. Use this for debugging when you have multiple (possibly overlapping) rewrite rules and you want to understand the results of rewriting.

last modified 2005/02/24 14:07