Next: File names, Previous: Building standalone executables, Up: Building programs
To build a library you proceed more or less the same way as with standalone executables. There are two different functions depending on whether you need to build static or shared libraries.
This function builds a library file up from the object files listed in lisp-files. Each of the arguments to lisp-file must name a single object file produced with
compile-file
.library-name is the physical pathname corresponding to the library. The value of library-name must follow some system-specific conventions. To make your program portable, library-name should be built using the output of
compile-file-pathname
.prologue-code and epilogue-code are strings with C code to be executed before and after initializing the library, respectively. For dynamically linked libraries you can also provide a list of strings in ld-flags. These strings are additional parameters for the linker and their purpose is to link C/C++ extensions into the library.
init-name gives the initialization function of the library a user-specified name. Thus a the generated library may be used and/or linked to a C application.