The following imake macros are used to build dynamic applications:
DynamicUserTarget(prog, objs, staticLibs, dynamicLibs, dlDeps, options) DynamicSupTarget(prog, objs, staticLibs, dynamicLibs, dlDeps, options) DynamicCXXUserTarget(prog, objs, staticLibs, dynamicLibs, dlDeps, options) DynamicCXXSupTarget(prog, objs, staticLibs, dynamicLibs, dlDeps, options)
For details of the functions that each macro performs, refer to "imake Build Rules".
The prog argument is the name of the resulting process. Other arguments are similar to those in the DynamicLibraryTarget() macro. For the options argument, the following options are particularly useful:
-soname=<name>
Within a DynamicLibraryTarget() rule, this option sets the internal soname of the library. If a library is used as a dependency in a rule that builds a dynamic executable and has a soname defined, the executable records the soname instead of the dynamicLibs argument.
-rpath <dir>
This option defines the runpath directory that is added to the library search path.
The following example builds a dynamic application called dyn_app from the binary object files a.o and b.o. The process is statically linked with the static ChorusOS operating system library. When this application is started, the runtime linker loads the dynamic library libdyn.so. In the target file system, this library can be located in the /libraries directory because this directory will be added to the search path of the runtime linker.
DynamicUserTarget( dyn_app, a.o b.o, , libdyn.so, , -rpath /libraries)