1Perl 5 DynaLoader 2 3See DynaLoader.pm for detailed specification. 4 5This module is very similar to the other Perl 5 modules except that 6Configure selects which dl_*.xs file to use. 7 8After Configure has been run the Makefile.PL will generate a Makefile 9which will run xsubpp on a specific dl_*.xs file and write the output 10to DynaLoader.c 11 12After that the processing is the same as any other module. 13 14Note that, to be effective, the DynaLoader module must be _statically_ 15linked into perl! Configure should arrange this. 16 17This interface is based on the work and comments of (in no particular 18order): Larry Wall, Robert Sanders, Dean Roehrich, Jeff Okamoto, Anno 19Siegel, Thomas Neumann, Paul Marquess, Charles Bailey and others. 20 21The dl_*.xs files should either be named after the dynamic linking 22operating system interface used if that interface is available on more 23than one type of system, e.g.: 24 dlopen for dlopen()/dlsym() type functions (SunOS, BSD) 25 dld for the GNU dld library functions (linux, ?) 26or else the osname, e.g., hpux, next, vms etc. 27 28Both are determined by Configure and so only those specific names that 29Configure knows/uses will work. 30 31If porting the DynaLoader to a platform that has a core dynamic linking 32interface similar to an existing generic type, e.g., dlopen or dld, 33please try to port the corresponding dl_*.xs file (using #ifdef's if 34required). 35 36Otherwise, or if that proves too messy, create a new dl_*.xs file named 37after your osname. Configure will give preference to a dl_$osname.xs 38file if one exists. 39 40The file dl_dlopen.xs is a reference implementation by Paul Marquess 41which is a good place to start if porting from scratch. For more complex 42platforms take a look at dl_dld.xs. The dlutils.c file holds some 43common definitions that are #included into the dl_*.xs files. 44 45After the initial implementation of a new DynaLoader dl_*.xs file you 46may need to edit or create ext/MODULE/MODULE.bs files (library bootstrap 47files) to reflect the needs of your platform and linking software. 48 49Refer to DynaLoader.pm, lib/ExtUtils/MakeMaker.pm and any existing 50ext/MODULE/MODULE.bs files for more information. 51 52Tim Bunce. 53August 1994 54