Each library should provide linker options files (with a file type of .OPT) to be used by software developers when linking against the library. These files should reside in the library directory and should be assigned logical names of the following standard form in order to identify them:
LIB_LINK |
|
and/or | LIB_LINK_ADAM |
The first of these allows linking with the stand-alone version of the library, and the second with the ADAM version. As usual, if either version of the library does not exist, then the corresponding logical name should be left undefined.
Normally the options file for linking with a shareable image will refer directly to that image, which should be identified by its logical name according to the conventions in §7, e.g:
or
In cases where there is no difference between the stand-alone and ADAM executable images, both versions of the linker options file should nevertheless still be provided, and each options file should access the image through the appropriate logical name.
Users of linker options files should always assume that the stand-alone and ADAM linking processes will differ. Thus, a stand-alone application might be linked with a particular library as follows:
while an ADAM application would be linked thus:
Note that only those libraries explicitly referenced in the application need be considered when constructing a linker command line. Any sub-libraries called at lower levels will be included automatically through having previously been linked into those shareable images which are referenced.
In practice, explicit reference to startup commands or linker options files will not normally be required in order to access libraries which form part of the ADAM programming environment, since the appropriate ADAM startup and linking procedures will access all relevant libraries automatically. However, newly developed libraries, or those which are not part of ADAM, may still be accessed in ADAM applications by referring to them explicitly, as above. The number of libraries which are made available as part of the ADAM environment is likely to increase as a result of standardising the methods of library access, but the relevant ADAM documentation should be consulted for a complete list of these.
The logical names identifying the linker options files should be defined in the process logical name table by means of suitable commands in the library startup file (§6), such as:
where LIB_LINK.OPT and LIB_LINK_ADAM.OPT are the linker options files in question (these file names are recommended for future use but existing files need not be changed).