Contents of Section |
Definition: Subsystem Shared Libraries
Dynamic Function Calls within an Application
Benefits; Subsystem Shared Libraries
Definition: Subsystem Archive Library
Benefits: Subsystem Archive Library
Naming Standards/File Locations
Globals Files/Libraries
Requirements for make Files: Subsystem Shared Libraries
Requirements for make Files: Subsystem Archive Libraries
Creating/Updating Library Functions
|
Definition: Subsystem Shared Libraries |
A subsystem shared library contains object code that may be shared
by applications only within the subsystem. A subsystem shared library
allows functions and objects to be contained in binary files that are separate
from the application binary file. References to these functions and objects
are resolved at run time.
Each subsystem may have only one shared library.
|
Dynamic Function Calls within an Application |
If a function is called dynamically within an application (see the function
call_by_name() in the Common Business Services document),
the function must exist in the subsystem shared library.
Example: An application is developed to process sales data. The
sales data is needed by many functional areas labor,
sales posting, special services.
To process this data, the Architecture transaction driver
is used to call the application logic modules (ALMs) for
each functional area that processes the data. Because it is
not possible to know all of the ALMs that will be required in
the future if business needs change, the function names
are called dynamically.
When a new function is needed, the function name is
added to a table that contains the function names; the
function code is added to the library. When the transaction
driver reads the table, the function name is retrieved from
the library and executed dynamically. Each subsystem has
only one subsystem shared library, even if the subsystem
has more than one application that uses dynamically
accessed functions.
|
Benefits; Subsystem Shared Libraries |
- Dynamic Function Calls. Functions can be placed in a
subsystem's shared library and called dynamically from driver applications.
- Recompiles Not Required. Making changes to the library
functions does not require recompiling the application executable files.
|
Definition: Subsystem Archive Libraries |
A subsystem archive library contains object code that may be shared
by many applications within only one subsystem.
The object code contains program functions that are "hard linked" into the executable files
at compile time.
In contrast to the functions contained in shared libraries, when
the executable files that call functions in an archive library are compiled, all
of the called functions in an archive library are copied into the file
containing the object code and physically exist within it.
A subsystem may contain one subsystem shared library OR one
subsystem archive library; it may not contain both. |
Benefits: Subsystem Archive Libraries |
- "Master" Copy of Shared Functions. The archive library contains the "master" copy of shared functions for a subsystem. Code does not
have to be duplicated in each application.
- Recompiles Required. Application executable files must be
recompiled when changes are made to functions in the library. Because
functions are pulled into the code only at compile time, the "old" function is
not replaced with the "new" function until the code is recompiled.
|
Naming Standards/File Locations |
The following table outlines naming standards and file locations applicable to shared and archive subsystem libraries:
Type of Subsystem Library | Name | Location |
Shared | libxx.sl, where xx is the subsystem code | /usr/xx/lib |
Archive | libxx.a, where xx is the subsystem code | /usr/xx/lib |
|
Globals Files/Libraries |
Subsystem shared and archive libraries may have as many globals files
as are required by the subsystem.
|
Requirements for make Files: Subsystem Shared Libraries |
The following table explains how to code application
make files (*.mak) to take advantage of the functions contained in the subsystem shared libraries:
This code element... | should read like this |
CCFLAGS variable | CCFLAGS=-s -Wl,+s, -L,/usr/sh/lib, -L,/usr/aa/lib, -L,/usr/xx/lib |
LIBXX variable | LIBXX=-lxx |
compile line | ${CC} {CCFLAGS} -o $@ ${OBJS} ${LIBSH} ${LIBAA} ${LIBXX} |
Note: The statements above use the letter el (l), not the number one (1).
Substitute the subsystem code wherever xx appears. |
|
Requirements for make Files: Subsystem Archive Libraries |
The following table explains how to code application
make files (*.mak) to take advantage of the functions contained in the subsystem archive libraries:
This code element... | should read like this |
LIBAXX variable | LIBAXX=/usr/xx/lib/libxx.a |
compile line | ${CC} {CCFLAGS} -o $@ ${OBJS} ${LIBSH} ${LIBAA} ${LIBAxx} |
Note: The statements above use the letter el (l), not the number one (1).
Substitute the subsystem code wherever xx appears. |
|
Creating/Updating Library Functions |
Development teams create subsystem shared and archive libraries.
To create a shared or archive library for a subsystem
- Copy the file
/usr/aa/pr/bin/generic_lib.mak to your subsystem
src directory.
- Rename the file
/usr/xx/ad/src/libxx.mak, where xx is the
subsystem code.
- Make the appropriate changes to the file to create your
archive library.
|