A collection is a group of files that conform to MzScheme's library collection system; see library collections in PLT MzScheme: Language Manual for details.
The --collection-zo and --collection-extension flags direct mzc to compile a whole collection. The --collection-zo flag produces individual .zo files for each library in the collection. The --collection-extension flag produces a single _loader library for the collection.
The (sub-)collection to compile is specified on the command line for mzc. The specified collection must contain an info.ss library that provides information about how to compile the collection. The result of loading the info.ss library must be a procedure that takes two arguments: a symbol and a failure thunk. The symbol specifies a requested field, i.e., the kind of information is requested. If the requested information is available, then the info.ss procedure returns that information; otherwise, it must call the failure thunk.
For example, the following procedure is in the info.ss library of the help collection:
(lambda (request failure-thunk)
(case request
[(name) "Help"]
[(compile-prefix) `(begin
(require-library "sig.ss" "mred")
(require-library "sig.ss" "help"))]
[(compile-omit-files) (list "sig.ss" "manuals.ss")]
[(compile-elaboration-zos) (list "sig.ss")]
[(mred-launcher-libraries) (list "help.ss")]
[(mred-launcher-names) (list "Help Desk")]
[else (failure-thunk)]))
This example info.ss procedure provides information for six
fields: 'name, 'compile-prefix, etc.
The info.ss system is standardized by convention. A collection's info.ss file can be used by several clients (including mzc, Setup PLT, and Help Desk), each requesting a different set of fields.
To compile a collection, mzc extracts info.ss information for the following fields:
When compiling a collection to byte code files, mzc automatically creates a compiled directory in the collection directory and puts .zo files there.
When compiling a collection to native code, mzc automatically created a compiled directory in the collection directory, a native directory in that compiled directory, and a platform-specific directory in native using the directory name returned by system-library-subpath. Intermediate .c and .kp files are kept in native. The platform-specific directory gets intermediate .o/.obj files and the final _loader.so or _loader.dll.
To compile a collection, mzc compiles only the library files that have changed since the last compilation. This form of dependency-checking is usually too weak. For example, when a signature file changes, mzc does not automatically recompile all files that rely on the signatures. In this case, delete the compiled directory when a macro or signature file changes to ensure that the collection is compiled correctly.