summaryrefslogtreecommitdiff
path: root/ext/DynaLoader/README
blob: 19dd8e72f6bee06aa72032121659ffc5aa0ca235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Perl 5 DynaLoader

See DynaLoader.doc for detailed specification.

This module is very similar to the other Perl 5 modules except that
Configure selects which dl_*.xs file to use.

After Configure has been run the Makefile.SH will generate a Makefile
which will run xsubpp on a specific dl_*.xs file and write the output
to DynaLoader.c

After that the processing is the same as any other module.

Note that, to be effective, the DynaLoader module must be _statically_
linked into perl! Configure should arrange this.

This interface is based on the work and comments of (in no particular
order): Larry Wall, Robert Sanders, Dean Roehrich, Jeff Okamoto, Anno
Siegel, Thomas Neumann, Paul Marquess, Charles Bailey and others.

The dl_*.xs files should either be named after the dynamic linking
operating system interface used if that interface is available on more
than one type of system, e.g.:
	dlopen  for dlopen()/dlsym() type functions (SunOS, BSD)
	dld     for the GNU dld library functions (linux, ?)
or else the osname, e.g., hpux, next, vms etc.

Both are determined by Configure and so only those specific names that
Configure knows/uses will work.

If porting the DynaLoader to a platform that has a core dynamic linking
interface similar to an existing generic type, e.g., dlopen or dld,
please try to port the corresponding dl_*.xs file (using #ifdef's if
required).

Otherwise, or if that proves too messy, create a new dl_*.xs file named
after your osname. Configure will give preference to a dl_$osname.xs
file if one exists.

The file dl_dlopen.xs is a reference implementation by Paul Marquess
which is a good place to start if porting from scratch. For more complex
platforms take a look at dl_dld.xs. The dlutils.c file holds some
common definitions that are #included into the dl_*.xs files.

After the initial implementation of a new DynaLoader dl_*.xs file
you may need to edit or create ext/MODULE/MODULE.bs files to reflect
the needs of your platform and linking software.

Refer to DynaLoader.doc, ext/utils/mkbootstrap and any existing
ext/MODULE/MODULE.bs files for more information.

Tim Bunce.
August 1994