UNIX Standards
Informix 4GL Informix SQL UNIX Naming Standards
UNIX Online UNIX Shell Scripts Store Report Layout
Informix Error Handling Distributed Print UNIX Directory Structures

UNIX Libraries

Contents
The following topics are discussed in this document:
Architecture/ Common Business Service Libraries

Go to

Top of this page

Architecture/Common Business Service Libraries

Subsystem Shared/Archive Libraries

Contents of Section Definition: Shared Libraries
Benefits: Shared Libraries
Naming Standards/File Locations
Globals Files/Libraries
Requirements for make Files
Global Files/Libraries
Definition: Shared Libraries Shared libraries for Architecture functions and Common Business Service functions contain object code that may be shared by many applications across subsystems. These libraries allow 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.
Benefits: Shared Libraries
  • Reduced Size of Executable. All applications that call the shared Architecture and Common Business Service library functions "point" to the shared libraries at compile time. The code is not included in the application executable. When the application is executed, the functions are brought into memory from the appropriate shared library. This feature results in the executable code being smaller than if the functions were physically included in the executable.
  • Recompiles Not Required. Making changes to the library functions does not require recompiling the application executable files.
Naming Standards/File Locations The convention for naming shared libraries is libxx.sl where xx is variable. The following table explains naming standards and file locations applicable to Architecture an Common Business Service function libraries:

Type of LibraryNameLocation
Architecturelibaa.sl/usr/aa/lib
Common Business Servicelibsh.sl/usr/sh/lib
Globals Files/Libraries Libraries for Architecture functions and Common Business Service functions each have one main globals file. As other global files are required by individual functions, those global files are included.

The main globals file contains variables that are required for all applications. All functions within each library should access local function variables if possible. All the necessary variable information is passed to and from the function through parameters.

Example: The APPL_LOG record is an example of a global variable in the Architecture shared library.

Requirements for make Files The following table explains how to code application make files (*.mak) to take advantage of the functions contained in the Architecture and Common Business shared libraries:
This code element...should read like this
CCFLAGS variableCCFLAGS=-s -Wl,+s, -L,/usr/sh/lib, -L,/usr/aa/lib
LIBAA variableLIBAA=-laa
LIBSH variableLIBSH=-lsh
compile line${CC} {CCFLAGS} -o $@ ${OBJS} ${LIBSH} ${LIBAA}
Note: The statements above use the letter el (l), not the number one (1).
Creating/Updating Library Functions The UNIX Application Architecture team is responsible for creating and updating functions in the Architecture and the Common Business Function shared libraries. Contact an Application Support representative to add or update a function contained in these libraries.
Subsystem Shared/Archive Libraries

Go to

Top of this page

Architecture/Common Business Service Libraries

Subsystem Shared/Archive Libraries
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 LibraryNameLocation
Sharedlibxx.sl, where xx is the subsystem code/usr/xx/lib
Archivelibxx.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 variableCCFLAGS=-s -Wl,+s, -L,/usr/sh/lib, -L,/usr/aa/lib, -L,/usr/xx/lib
LIBXX variableLIBXX=-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 variableLIBAXX=/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
  1. Copy the file /usr/aa/pr/bin/generic_lib.mak to your subsystem src directory.
  2. Rename the file /usr/xx/ad/src/libxx.mak, where xx is the subsystem code.
  3. Make the appropriate changes to the file to create your archive library.


Go to top of this page.
IS Home Page
Last updated: 3/5/97 9:59 AM
Webmaster: Lallie Heard, Ext. 17536
© Copyright 1997 The Home Depot Inc.